File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
scapy/contrib/automotive/bmw
test/contrib/automotive/bmw Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,12 @@ class HSFZ(Packet):
70
70
71
71
def _hasaddrs (self ):
72
72
# type: () -> bool
73
- # Address present in diagnostic_req_res, acknowledge_transfer and
74
- # two byte length alive_check frames.
73
+ # Address present in diagnostic_req_res, acknowledge_transfer,
74
+ # two byte length alive_check and incorrect_tester_address frames.
75
75
return self .control == 0x01 or \
76
76
self .control == 0x02 or \
77
- (self .control == 0x12 and self .length == 2 )
77
+ (self .control == 0x12 and self .length == 2 ) or \
78
+ self .control == 0x40
78
79
79
80
def _hasidstring (self ):
80
81
# type: () -> bool
Original file line number Diff line number Diff line change @@ -124,6 +124,14 @@ assert pkt.source == 0x00
124
124
assert pkt.target == 0xf4
125
125
126
126
127
+ = Dissect incorrect tester address
128
+ pkt = HSFZ(bytes.fromhex("000000020040fff4"))
129
+ assert pkt.length == 2
130
+ assert pkt.control == 0x40
131
+ assert pkt.source == 0xff
132
+ assert pkt.target == 0xf4
133
+
134
+
127
135
= Test HSFZSocket
128
136
129
137
server_up = threading.Event()
You can’t perform that action at this time.
0 commit comments