Skip to content

Commit d0b1354

Browse files
committed
Agreed-upon feedback updates.
1 parent aeed81d commit d0b1354

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

lib/rex/post/hwbridge/extensions/automotive/uds_errors.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ module UDSErrors
5656
0x78 => "RCRRP",
5757
0x7E => "SFNSIAS",
5858
0x7F => "SNSIAS",
59-
0x81 => "RTH",
60-
0x82 => "RTL",
59+
0x81 => "RPMTH",
60+
0x82 => "RPMTL",
6161
0x83 => "EIR",
6262
0x84 => "EINR",
6363
0x85 => "ERTTL",

lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def cmd_isotpsend(*args)
219219
bytes = data.scan(/../) # Break up data string into 2 char (byte) chunks
220220
if bytes.size > 8
221221
print_error("Data section can only contain a max of 8 bytes (for now)")
222-
return result
222+
return
223223
end
224224
opt = {}
225225
opt['TIMEOUT'] = timeout unless timeout.nil?
@@ -281,7 +281,15 @@ def cmd_testerpresent(*args)
281281
end
282282
return
283283
end
284-
unless stop
284+
if stop
285+
if self.tpjobs[stopid]
286+
self.tpjobs[stopid].kill
287+
self.tpjobs[stopid] = nil
288+
print_status("Stopped TesterPresent #{stopid}")
289+
else
290+
print_error("TesterPresent #{stopid} was not running")
291+
end
292+
else
285293
jid = self.tpjob_id
286294
print_status("Starting TesterPresent sender (#{self.tpjob_id})")
287295
self.tpjob_id += 1
@@ -300,14 +308,6 @@ def cmd_testerpresent(*args)
300308
self.tpjobs[myjid] = nil
301309
print_status("TesterPreset #{myjid} has stopped (#{::Thread.current[:args].inspect})")
302310
end
303-
else
304-
if self.tpjobs[stopid]
305-
self.tpjobs[stopid].kill
306-
self.tpjobs[stopid] = nil
307-
print_status("Stopped TesterPresent #{stopid}")
308-
else
309-
print_error("TesterPresent #{stopid} was not running")
310-
end
311311
end
312312
end
313313

lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ def cmd_status(*args)
219219
print_status("Device: #{status['device_name']}") if status.key? 'device_name'
220220
print_status("FW Version: #{status['fw_version']}") if status.key? 'fw_version'
221221
print_status("HW Version: #{status['hw_version']}") if status.key? 'hw_version'
222-
print_status("Uptime: #{stats["uptime"]} seconds") if stats.key? "uptime"
223-
print_status("Packets Sent: #{stats["packet_stats"]}") if stats.key? "packet_stats"
224-
print_status("Last packet Sent: #{Time.at(stats["last_request"])}") if stats.key? "last_request"
225-
print_status("Voltage: #{stats["voltage"]}") if stats.key? "voltage" and not stats["voltage"] == "not supported"
222+
print_status("Uptime: #{stats['uptime']} seconds") if stats.key? 'uptime'
223+
print_status("Packets Sent: #{stats['packet_stats']}") if stats.key? 'packet_stats'
224+
print_status("Last packet Sent: #{Time.at(stats['last_request'])}") if stats.key? 'last_request'
225+
print_status("Voltage: #{stats['voltage']}") if stats.key? 'voltage' and not stats['voltage'] == 'not supported'
226226
end
227227

228228
def cmd_specialty_help

lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def cmd_recv(*args)
290290
arg['blocksize'] = blocksize unless blocksize == -1
291291
arg['timeout'] = timeout unless timeout == -1
292292
r = client.rftransceiver.rfrecv(idx, arg)
293-
if r.key?('data') && r.has_key?('timestamp')
293+
if r.key?('data') && r.key?('timestamp')
294294
print_line(" #{r['timestamp']}: #{r['data'].inspect}")
295295
else
296296
print_line("Error")

0 commit comments

Comments
 (0)