Add support for variable UDS RX offsets (#631)
parent
0ae2be95a1
commit
3bb0408ee6
|
@ -486,13 +486,14 @@ class IsoTpMessage():
|
||||||
|
|
||||||
FUNCTIONAL_ADDRS = [0x7DF, 0x18DB33F1]
|
FUNCTIONAL_ADDRS = [0x7DF, 0x18DB33F1]
|
||||||
|
|
||||||
def get_rx_addr_for_tx_addr(tx_addr):
|
def get_rx_addr_for_tx_addr(tx_addr, rx_offset=0x8):
|
||||||
if tx_addr in FUNCTIONAL_ADDRS:
|
if tx_addr in FUNCTIONAL_ADDRS:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if tx_addr < 0xFFF8:
|
if tx_addr < 0xFFF8:
|
||||||
# standard 11 bit response addr (add 8)
|
# pseudo-standard 11 bit response addr (add 8) works for most manufacturers
|
||||||
return tx_addr + 8
|
# allow override; some manufacturers use other offsets for non-OBD2 access
|
||||||
|
return tx_addr + rx_offset
|
||||||
|
|
||||||
if tx_addr > 0x10000000 and tx_addr < 0xFFFFFFFF:
|
if tx_addr > 0x10000000 and tx_addr < 0xFFFFFFFF:
|
||||||
# standard 29 bit response addr (flip last two bytes)
|
# standard 29 bit response addr (flip last two bytes)
|
||||||
|
|
Loading…
Reference in New Issue