File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,6 +188,25 @@ def test_lowercase_nd_at_response_parameter_parsed(self):
188188
189189 self .assertEqual (info , expected_info )
190190
191+ def test_split_route_information (self ):
192+ data = b'\x8d \x12 \x27 \x9c \x93 \x81 \x7f \x00 \x00 \x00 \x00 \x13 \xa2 \x00 \x40 \x52 \xaa \xaa \x00 \x13 \xa2 \x00 \x40 \x52 \xdd \xdd \x00 \x13 \xa2 \x00 \x40 \x52 \xbb \xbb \x00 \x13 \xa2 \x00 \x40 \x52 \xcc \xcc '
193+ info = self .zigbee ._split_response (data )
194+ expected_info = {
195+ 'id' : 'route_information' ,
196+ 'source_event' : b'\x12 ' ,
197+ 'info_length' : b'\x27 ' ,
198+ 'timestamp' : b'\x9c \x93 \x81 \x7f ' ,
199+ 'ack_timeout_count' : b'\x00 ' ,
200+ 'tx_blocked_count' : b'\x00 ' ,
201+ 'reserved' : b'\x00 ' ,
202+ 'dest_addr' : b'\x00 \x13 \xa2 \x00 \x40 \x52 \xaa \xaa ' ,
203+ 'source_addr' : b'\x00 \x13 \xa2 \x00 \x40 \x52 \xdd \xdd ' ,
204+ 'responder_addr' : b'\x00 \x13 \xa2 \x00 \x40 \x52 \xbb \xbb ' ,
205+ 'receiver_addr' : b'\x00 \x13 \xa2 \x00 \x40 \x52 \xcc \xcc ' ,
206+ }
207+
208+ self .assertEqual (info , expected_info )
209+
191210class TestParseZigBeeIOData (unittest .TestCase ):
192211 """
193212 Test parsing ZigBee specific IO data
Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ class ZigBee(XBeeBase):
126126 {'name' :'status' ,
127127 'structure' :
128128 [{'name' :'status' , 'len' :1 }]},
129+ b"\x8d " :
130+ {'name' :'route_information' ,
131+ 'structure' :
132+ [ {'name' :'source_event' , 'len' :1 },
133+ {'name' :'info_length' , 'len' :1 },
134+ {'name' :'timestamp' , 'len' :4 },
135+ {'name' :'ack_timeout_count' ,'len' :1 },
136+ {'name' :'tx_blocked_count' ,'len' :1 },
137+ {'name' :'reserved' , 'len' :1 },
138+ {'name' :'dest_addr' , 'len' :8 },
139+ {'name' :'source_addr' , 'len' :8 },
140+ {'name' :'responder_addr' , 'len' :8 },
141+ {'name' :'receiver_addr' , 'len' :8 }
142+ ]},
129143 b"\x88 " :
130144 {'name' :'at_response' ,
131145 'structure' :
You can’t perform that action at this time.
0 commit comments