cthuun / python-xbee

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

Add automatic parsing of Node Discover at_response packet 'parameter' field #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Jim suggests:

I like to use the ND (Node Discover) command to see what nodes have been 
discovered by my coordinator and are on the network. When I issue the command, 
the API returns a standard AT response frame with some of the fields parsed, 
but not all of them. Here is what the raw output looks like:

{'status': '\x00', 'frame_id': 'A', 'parameter': 
'v\x1a\x00\x13\xa2\x00@oG\xe4ENDPOINT-1\x00\xff\xfe\x01\x00\xc1\x05\x10\x1e', 
'command': 'ND', 'id': 'at_response'}

I was wondering if it might be possible to get the 'parameter' field parsed 
into a dictionary in the same way as the I/O fields we've been working with 
lately. From the documentation, here are what the fields would be for 
'parameter', using my example above:

MY – 1 byte                          \x76\x1a
SH – 4 bytes                         \x00\x13\xa2\x00
SL  -- 4 bytes                       \x40\x6f\x47\xe4
NI – Variable                        ENDPOINT-1\x00 (null terminated, I 
assume… the document doesn't say)
Parent Network Address – 2 bytes     \xff\xfe
Device Type – 1 byte                 \x01     (00 = Coordinator, 01 = Router, 
02 = Endpoint)
Status  -- 1 byte                    \x00
Profile_ID  -- 2 bytes               \xc1\x05
Manufacturer  -- 2 bytes             \x10\x1e

Original issue reported on code.google.com by pmalms...@gmail.com on 28 Oct 2011 at 2:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed as of revision 1ed1d07d4be7.

Original comment by pmalms...@gmail.com on 21 Dec 2011 at 8:29