Skip to content

Commit

Permalink
Small fix conditional simulation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Dec 15, 2024
1 parent 32c3684 commit c2f9fcb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,13 +1005,14 @@ def connect_to_hardware(self, canline=0):
# Can
ecuname = self.ecuname.encode('ascii', errors='ignore')
if self.ecu_protocol == 'CAN':
if len(self.ecu_send_id) == 8:
short_addr = elm.get_can_addr_ext(self.ecu_send_id)
else:
short_addr = elm.get_can_addr(self.ecu_send_id)
if short_addr is None:
print(_("Cannot retrieve functionnal address of ECU") + " %s @ %s" % (self.ecuname, self.ecu_send_id))
return False
if not options.simulation_mode:
if len(self.ecu_send_id) == 8:
short_addr = elm.get_can_addr_ext(self.ecu_send_id)
else:
short_addr = elm.get_can_addr(self.ecu_send_id)
if short_addr is None:
print(_("Cannot retrieve functionnal address of ECU") + " %s @ %s" % (self.ecuname, self.ecu_send_id))
return False
ecu_conf = {'idTx': self.ecu_send_id, 'idRx': self.ecu_recv_id, 'ecuname': str(ecuname)}

if not options.simulation_mode:
Expand Down

0 comments on commit c2f9fcb

Please sign in to comment.