Greetings,
I am currently using a XBee Gateway - ZB Wi-Fi which is running a python script that listens on a socket for data sent to it from and XBee radio. My code is as follows:
xbee_socket = socket.socket(socket.AF_ZIGBEE, socket.SOCK_DGRAM, socket.XBS_PROT_TRANSPORT)
xbee_socket.bind(("", 0xe8, 0, 0))
while True:
rs, ws, es = select.select([xbee_socket], [], [], 2)
for r in rs:
# Receive from the socket
payload, source = xbee_socket.recvfrom(200)
print 'rf_data: ' + payload
src_addr_long = source[0]
print 'src_addr_long: ' + src_addr_long
What I would like to do is retrieve the frame type (e.g. 0x95 or node_id_indicator), parameter, and command fields. I am able to access the rf_data as well as the src_addr_long from the payload and source; however, I am uncertain in terms of gathering these other pieces of information. I am receiving the payload and source data but not the entire frame. So I cannot parse accordingly.
Thank you,