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.

Changes

RevisionDateWhoCommit message
56:7fe74b03e6b1 2014-08-08 johnb Add support for setting up encrypted communications; Re-jig XBeeApiCmdAt virtual functions to make inheritance by XBeeDeviceRemoteAt cleaner. default tip
55:610aa4a2ed3b 2014-08-02 johnb Add support for "Restore Defaults" AT command.; Support in XbeeDeviceRemoteAt for re-association with a different XBee.
54:9f5b7652943e 2014-07-28 johnb Add missing return assignment in XBeeDeviceRemoteAt::decodeCallback(); Ensure that serial number is initialised to a "safe" value when using 16-bit addressing with XBeeDeviceRemoteAt.
53:7b65422d7a32 2014-07-28 johnb Comments & clean-up
52:0950b05d5270 2014-07-28 johnb Add initial support for decoding IO frames.
51:a7d0d2ef9261 2014-07-28 johnb Additional infrastructure for AT & remote AT commands.
50:f76b7e7959a2 2014-07-13 johnb Add support for Remote AT commands
49:37bba77ee73f 2014-07-07 johnb Add sanity check to RX'd message length
48:48397bedf95d 2014-07-07 johnb Add checksum verification on the received frames and the ability to turn it on/off.
47:5d3608835668 2014-07-06 johnb Re-jig XBeeApiTxFrame to allow getDataPtr to be a const method again.
46:a1abbc66f157 2014-07-06 johnb Merge back in branch which was accidentally created.
45:dde04adb8791 2014-07-06 johnb Re-add changes which where committed in http://mbed.org/users/johnb/code/XBeeApi/rev/291aee9eb900 - unsure as to why they don't still seem to be present.
44:85a66d56e176 2014-07-06 johnb Expand argument list on XBeeApiTxFrame constructor
43:975a28e01dac 2014-07-06 johnb Update logic of return for setupDispatchTask() to be in line with other methods
42:81c789ba4c08 2014-07-06 johnb Changes to support working with mbed-rtos; Use a dispatcher thread to deal with data received from the serial port rather than doing it in the interrupt. Not only is this poor practice, it seems that when using mbed-rtos there's less interrupt stack
41:07cb97b44e81 2014-07-05 johnb Change from Serial to RawSerial so that the library is RTOS friendly.
40:b96e8cad93d3 2014-07-05 johnb Fix comma/semi-colon typo in serial interface setup
39:35ab09bff018 2014-06-27 johnb Fix issue with mis-matching virtual function declaration breaking TX
38:291aee9eb900 2014-04-02 johnb Sync from https://github.com/bright-tools/xbeeapi/commit/10fb465f9b314dcf88e007bd3f33af856ab70c8f
37:653e048c0fcd 2014-03-31 johnb Fix method prototype
36:cc7e8d1e35dd 2014-03-28 johnb Add missing cast & fix issue with endianism during copy
35:0f8910a023a3 2014-03-28 johnb Fix issue with condition in error checking
34:2535760d53a6 2014-03-25 johnb Comment update
33:eccf4725930c 2014-03-25 johnb New constructor to allow Serial object to be passed rather than instantiated by the XBeeDevice
32:af4e495afd62 2014-02-07 johnb Add methods to access more XBee parameters.
31:c144106e55b5 2014-02-06 johnb Add method to set XBee's source address; Macro-ise XBeeApiCmdAt's method generation; Fix bug with timeout on XBeeApiCmdAtBlocking's get/set methods
30:9532b01a1ae1 2014-02-06 johnb Tidy up
29:c6d037cceb02 2014-02-06 johnb Infrastructure for supporting different XBee models; Change XBeeApiCmdAt constructor to allown an XBeeDevice to be passed
28:e22f61badee3 2014-02-06 johnb Doxygen xbeeapi.hpp
27:6356ef5fe39b 2014-02-05 johnb RX message decoding
26:f5df80e990f4 2014-02-05 johnb Doc updates for XBeeApiCmdAt and XBeeApiCmdAtBlocking
25:db6874b7ac4b 2014-02-05 johnb Add XBeeApiCmdAtSet to replace various classes in XBeeApiCmdAt
24:2cd1094c4fd7 2014-02-05 johnb Remove various classes from XBeeApiCmdAt and extend XBeeApiFrame to allow initialisation of the members so that this class can perform the same task as was previously occupying >3 classes.
23:0e92813b5a50 2014-02-05 johnb Add xbeeapi.hpp general header; RX support infrastructure
22:2e5aff1149a2 2014-02-05 johnb Infrastructure for RX'd messages
21:09ddf12a65ed 2014-02-05 johnb Make decodeCallback() protected, as per parent class
20:3fa7a0daf1c7 2014-02-05 johnb Doc update
19:85e5bad7f5a9 2014-02-05 johnb Add XBeeApiTxFrameEx::getMostRecentStatus() and supporting.
18:e19505ed8fcb 2014-02-05 johnb Remove debug option
17:023e5355d4c5 2014-02-05 johnb Class documentation
16:8095c43a2a6e 2014-02-04 johnb Flesh out XBeeApiTXFrame and add XBeeApiTxFrameEx
15:ff9f12e38f44 2014-02-03 johnb Add TX callback to XBeeApiTxFrame
14:edec6cd78ffb 2014-02-03 johnb Fix problems with blocking API
13:302e7c1ea0b3 2014-02-03 johnb Add implementation for xbeeSetNetworkTypeP2P() and the AT cmds to support it.
12:58319a467943 2014-02-01 johnb Add XBeeApiAddrType_t
11:bfcf1356027b 2014-01-31 johnb Switch to using macros to implement the access functions in XBeeApiCmdAtBlocking.; Implement XBeeApiCmdAtBlocking::setChannel()
10:0d084d0253a7 2014-01-31 johnb Update getDataPtr() to support fragmented buffers
9:ba90e9efd68b 2014-01-31 johnb Initial work on TX of data packets
8:1b48b619d7f6 2014-01-31 johnb Work-in-progress commit. Add blocking version of XBeeApiCmdAt
7:2f1e157cdd1c 2014-01-30 johnb Tidy up & overhaul to receive routine to be more robust
6:3cb62daace78 2014-01-29 johnb Document API
5:b40a6fd3a334 2014-01-29 johnb Documentation update
4:e5e152b3930f 2014-01-27 johnb Initial interface for XBeeApi library
3:c3d96b94041a 2014-01-27 johnb Documentation & misc changes
2:7196461129e9 2014-01-19 johnb Work-in-progress commit: At the point where messages can be received and decoded - can request the channel and then change it using high-level API commands.
1:1f3ffa394a1e 2014-01-18 johnb Work-in-progress commit : Can get XBee into AT command mode, configure API mode 2, exit command code and successfully perform API command.
0:9f44c388ca00 2014-01-18 johnb Baseline point - initial comms with XBee established.