@@ -59,23 +59,31 @@ class HSFZ(Packet):
59
59
IntField ('length' , None ),
60
60
ShortEnumField ('control' , 1 , control_words ),
61
61
ConditionalField (
62
- XByteField ('source' , 0 ), lambda p : p ._hasaddrs ()),
62
+ XByteField ('source' , 0 ), lambda p : p ._has_srctgt_addrs ()),
63
63
ConditionalField (
64
- XByteField ('target' , 0 ), lambda p : p ._hasaddrs ()),
64
+ XByteField ('target' , 0 ), lambda p : p ._has_srctgt_addrs ()),
65
+ ConditionalField (
66
+ XByteField ('expected' , 0 ), lambda p : p ._has_exprecv_addrs ()),
67
+ ConditionalField (
68
+ XByteField ('received' , 0 ), lambda p : p ._has_exprecv_addrs ()),
65
69
ConditionalField (
66
70
StrFixedLenField ("identification_string" ,
67
71
None , None , lambda p : p .length ),
68
72
lambda p : p ._hasidstring ())
69
73
]
70
74
71
- def _hasaddrs (self ):
75
+ def _has_srctgt_addrs (self ):
72
76
# type: () -> bool
73
77
# Address present in diagnostic_req_res, acknowledge_transfer,
74
- # two byte length alive_check and incorrect_tester_address frames.
78
+ # and two byte length alive_check frames.
75
79
return self .control == 0x01 or \
76
80
self .control == 0x02 or \
77
- (self .control == 0x12 and self .length == 2 ) or \
78
- self .control == 0x40
81
+ (self .control == 0x12 and self .length == 2 )
82
+
83
+ def _has_exprecv_addrs (self ):
84
+ # type: () -> bool
85
+ # Address present in incorrect_tester_address frames.
86
+ return self .control == 0x40
79
87
80
88
def _hasidstring (self ):
81
89
# type: () -> bool
0 commit comments