Home/Support/Support Forum/How do you access different frame fields of data sent to XBee Socket on Gateway
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

How do you access different frame fields of data sent to XBee Socket on Gateway

0 votes
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,
asked Oct 20, 2017 in 3rd Party Python and API development in other Languages by ganondalf New to the Community (0 points)

Please log in or register to answer this question.

...