rtpavlovsk21 / python-xbee

Automatically exported from code.google.com/p/python-xbee
MIT License
0 stars 0 forks source link

zigbee response parsing enhancement #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem: 
sending command ND and IS using the lowercase command (eg: bee.at('nd')) does 
not trigger the command response parsing in zigbee.py because it only looks for 
the capitalised version (bee.at('ND')).

Solution:
Replace line 175
if packet_info['id'] in ('at_response','remote_at_response') and 
packet_info['command'] == b'IS' and packet_info['status'] == b'\x00':
with
if packet_info['id'] in ('at_response','remote_at_response') and 
(packet_info['command'] == b'IS' or packet_info['command'] == b'is') and 
packet_info['status'] == b'\x00':

and 

Replace line 185
if packet_info['id'] == 'at_response' and packet_info['command'] == b'ND' and 
packet_info['status'] == b'\x00':
with
if packet_info['id'] == 'at_response' and (packet_info['command'] == b'ND' or 
packet_info['command'] == b'nd')  and packet_info['status'] == b'\x00':

Original issue reported on code.google.com by charlesf...@gmail.com on 11 Jun 2012 at 3:50

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 938d5f985fa5.

Original comment by pmalms...@gmail.com on 13 Jun 2012 at 7:34

GoogleCodeExporter commented 9 years ago
Hi charlesfracchia,

Thanks for your suggestion! As you can see, I have committed a change to fix 
the problem. Let me know what you think.

Regards,
~Paul Malmsten

Original comment by pmalms...@gmail.com on 14 Jun 2012 at 8:30