Skip to content

Commit

Permalink
Remove subFunction field from TesterPreset packets.
Browse files Browse the repository at this point in the history
Per spec TP doesn't have a subFunction and field observations
indicate sending an extra 0x00 does not always elicit the desired response.
  • Loading branch information
Kurt Snieckus committed May 15, 2023
1 parent 0d2e799 commit bcc3e8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scapy/contrib/automotive/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ def answers(self, other):
class UDS_TP(Packet):
name = 'TesterPresent'
fields_desc = [
ByteField('subFunction', 0)
# Per spec TP doesn't have a subFunction and field
# observations indicate sending an extra 0x00 does
# not always elicit the desired response.
# ByteField('subFunction', 0)
]


Expand Down Expand Up @@ -1387,7 +1390,7 @@ def answers(self, other):


class UDS_TesterPresentSender(PeriodicSenderThread):
def __init__(self, sock, pkt=UDS() / UDS_TP(subFunction=0x80), interval=2):
def __init__(self, sock, pkt=UDS() / UDS_TP(), interval=2):
""" Thread to send TesterPresent messages packets periodically
Args:
Expand Down

0 comments on commit bcc3e8f

Please sign in to comment.