API for communicating with XBee devices.
Dependencies: CircularBuffer FixedLengthList
Dependents: XBeeApiTest XBeeApiSimpleATCmdsExample XBeeApiBroadcastExample XBeeApiBroadcastExampleRTOS ... more
Overview
XBeeApi is intended to be a library for providing a high-level API interface to the XBee - for example getChannel()
and setChannel(2)
methods rather than needing to send( "ATCH" )
and send( "ATCH 2" )
- and then de-code the responses.
See the notebook page here for a description of how the API works & some details on the various classes.
Features:
- Support for transmission & reception of data packets
- Support for reading & changing settings
- Support for "Remote AT" interface to access settings & I/O channels on remote XBees
- XBeeApi should work if you're using mbed-rtos, though it is not currently threadsafe. Take a look at the XBeeApiBroadcastExampleRTOS example if you're including mbed-rtos.
Example Programs
There are also example programs available:
Transmit
Import programXBeeApiSimpleBroadcastExample
Simple example of how to use XBeeApi - set up the XBee, configure P2P networking then transmit a frame.
Import programXBeeApiBroadcastExample
Example for XBeeAPI; a little more involved than XBeeApiSimpleBroadcastExample with report on failure to set up the XBee and on the transmit status of the message.
Import programXBeeApiBroadcastExampleRTOS
Example of using the XBeeApi library to broadcast a message, based on XBeeApiBroadcastExample. This example shows how to use the library when using mbed-rtos. Before compiling you must open "XbeeApi\Config\XBeeApiCfg.hpp" and change the '#if 0' to '#if 1' on the line above the comment reading "Use RTOS features to make XBeeApi threadsafe"
Settings/Status
Import programXBeeApiSimpleATCmdsExample
Simple example of using XBeeApi to send AT-style commands to the XBee
Import programXBeeApiRemoteATCmdsExample
Example of using the XBeeApi library to send AT commands to remote XBee devices in order to read/write settings
Receive
Import programXBeeApiSimpleReceiveExample
Simple example of using XBeeApi to receive data packets via wireless
Import programXBeeApiReceiveCallbackExample
Example of using the XBeeApi library to receive a message via a callback method
Import programXBeeApiReceiveCallbackExampleRTOS
Example of using the XBeeApi library to receive a message via a callback method. This example shows how to use the library when using mbed-rtos. See the comment at the top of main.cpp
Remote I/O
Import programXBeeApiRemoteIOExample
Example of using the XBeeApi library to read inputs on a remote XBee
If you have 2 mbed connected XBees available then you can use XBeeApiSimpleReceiveExample and XBeeApiSimpleBroadcastExample as a pair.
Note that this is still a work in progress! XBeeApiTodoList tracks some of the functionality still to be added.
History
Add support for setting up encrypted communications; Re-jig XBeeApiCmdAt virtual functions to make inheritance by XBeeDeviceRemoteAt cleaner.
2014-08-08, by johnb [Fri, 08 Aug 2014 11:59:52 +0000] rev 56
Add support for setting up encrypted communications; Re-jig XBeeApiCmdAt virtual functions to make inheritance by XBeeDeviceRemoteAt cleaner.
Add support for "Restore Defaults" AT command.; Support in XbeeDeviceRemoteAt for re-association with a different XBee.
2014-08-02, by johnb [Sat, 02 Aug 2014 16:41:14 +0000] rev 55
Add support for "Restore Defaults" AT command.; Support in XbeeDeviceRemoteAt for re-association with a different XBee.
Add missing return assignment in XBeeDeviceRemoteAt::decodeCallback(); Ensure that serial number is initialised to a "safe" value when using 16-bit addressing with XBeeDeviceRemoteAt.
2014-07-28, by johnb [Mon, 28 Jul 2014 14:13:20 +0000] rev 54
Add missing return assignment in XBeeDeviceRemoteAt::decodeCallback(); Ensure that serial number is initialised to a "safe" value when using 16-bit addressing with XBeeDeviceRemoteAt.
Comments & clean-up
2014-07-28, by johnb [Mon, 28 Jul 2014 13:27:58 +0000] rev 53
Comments & clean-up
Add initial support for decoding IO frames.
2014-07-28, by johnb [Mon, 28 Jul 2014 12:48:33 +0000] rev 52
Add initial support for decoding IO frames.
Additional infrastructure for AT & remote AT commands.
2014-07-28, by johnb [Mon, 28 Jul 2014 10:24:16 +0000] rev 51
Additional infrastructure for AT & remote AT commands.
Add support for Remote AT commands
2014-07-13, by johnb [Sun, 13 Jul 2014 15:47:40 +0000] rev 50
Add support for Remote AT commands
Add sanity check to RX'd message length
2014-07-07, by johnb [Mon, 07 Jul 2014 19:14:46 +0000] rev 49
Add sanity check to RX'd message length
Add checksum verification on the received frames and the ability to turn it on/off.
2014-07-07, by johnb [Mon, 07 Jul 2014 19:03:09 +0000] rev 48
Add checksum verification on the received frames and the ability to turn it on/off.
Re-jig XBeeApiTxFrame to allow getDataPtr to be a const method again.
2014-07-06, by johnb [Sun, 06 Jul 2014 22:10:28 +0000] rev 47
Re-jig XBeeApiTxFrame to allow getDataPtr to be a const method again.