Skip to content

Commit 237f89f

Browse files
author
Brendan Whitfield
committed
enable ECU tagging for the transmission
1 parent 7261a35 commit 237f89f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

obd/protocols/protocol.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class Protocol(object):
127127

128128
# the TX_IDs of known ECUs
129129
TX_ID_ENGINE = None
130+
TX_ID_TRANSMISSION = None
130131

131132

132133
def __init__(self, lines_0100):
@@ -253,12 +254,16 @@ def populate_ecu_map(self, messages):
253254

254255
# if any tx_ids are exact matches to the expected values, record them
255256
for m in messages:
257+
if m.tx_id is None:
258+
logger.debug("parse_frame failed to extract TX_ID")
259+
continue
260+
256261
if m.tx_id == self.TX_ID_ENGINE:
257262
self.ecu_map[m.tx_id] = ECU.ENGINE
258263
found_engine = True
264+
elif m.tx_id == self.TX_ID_TRANSMISSION:
265+
self.ecu_map[m.tx_id] = ECU.TRANSMISSION
259266
# TODO: program more of these when we figure out their constants
260-
# elif m.tx_id == self.TX_ID_TRANSMISSION:
261-
# self.ecu_map[m.tx_id] = ECU.TRANSMISSION
262267

263268
if not found_engine:
264269
# last resort solution, choose ECU with the most bits set

0 commit comments

Comments
 (0)