Xbee API Mode
Lightfoot
Posts: 228
I am attempting to use the API mode so I can transmit data to particular XBEES (a total of six on the network). The object I think makes you build a packet before you send it (hard to tell just by looking at the code). I for now just want to transmit and receive single bytes. In the future I will want packets of multiple bytes. Can you post examples of how to properly send API data and retrieve it at the other end? I set the 16 bit source addresses from 1 to 6, 0 is the transmitter unit. I tried this code, but I think you have to build a packet, as the object probably does not do this automatically:
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Transmitter: XB.API_Tx(1,5) 'Transmit 5 to XBEE address 1. 'Receiver: repeat outa[noparse][[/noparse]8..15] := XB.API_Rx 'Set LEDs to received data.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Comments
Another strategy is to transmit to every unit and include a unique identifier code in your transmitted data that indicates the intended recipient. This strategy was useful for me using SX chips amd XBee and allowed me to avoid API mode and having to build out whole packets (which might be your problem).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Talbot
New Market, MD, USA