A library with drivers for different peripherals on the LPC4088 QuickStart Board or related add-on boards.
Dependents: LPC4088test LPC4088test_ledonly LPC4088test_deleteall LPC4088_RAMtest ... more
XBee Class Reference
Interface to Digi International's XBee module. More...
#include <XBee.h>
Public Types | |
enum | XBeeError |
Error codes returned from public methods. More... | |
enum | CallbackType { CbDeviceUp = 0, CbDeviceDown, CbNodeFound, CbTxStat, CbDataAvailable } |
Callback function/method types. More... | |
enum | XBeeType |
Xbee types. More... | |
enum | XBeeTxStatus |
Transmit status. More... | |
Public Member Functions | |
XBee (PinName tx, PinName rx, PinName reset, PinName sleep) | |
Create an interface to an XBee module. | |
XBeeError | init (XBeeType type, const char *panId) |
Initialize the XBee module and configure it to be of a specific type. | |
void | registerCallback (void(*fptr)(void), CallbackType type) |
Register a callback function. | |
template<typename T > | |
void | registerCallback (T *tptr, void(T::*mptr)(void), CallbackType type) |
Register a callback method. | |
void | process () |
Call this method repeatedly to process incoming data. | |
XBeeError | getRemoteAddress (uint32_t *addrHi, uint32_t *addrLo) |
Get address of remote node. | |
XBeeError | getRssi (uint8_t *rssi) |
Get signal strength indicator value (RSSI). | |
XBeeError | getTxStatus (uint8_t *frameId, XBeeTxStatus *status) |
Get the transmit status. | |
XBeeError | getData (char **data, uint8_t *len) |
Get received data. | |
XBeeError | send (uint32_t addrHi, uint32_t addrLo, char *data, uint8_t len, uint8_t *frameId) |
Send data to a node with specified address. | |
XBeeError | discoverNodes () |
Send a Node Discover request. | |
XBeeError | enterSleep () |
Request the module to enter sleep mode. | |
XBeeError | exitSleep () |
Request the module to exit sleep mode. |
Detailed Description
Interface to Digi International's XBee module.
The XBee S1 module has been used during testing of this interface.
Definition at line 30 of file XBee.h.
Member Enumeration Documentation
enum CallbackType |
enum XBeeTxStatus |
Constructor & Destructor Documentation
XBee | ( | PinName | tx, |
PinName | rx, | ||
PinName | reset, | ||
PinName | sleep | ||
) |
Member Function Documentation
XBee::XBeeError discoverNodes | ( | ) |
XBee::XBeeError enterSleep | ( | ) |
XBee::XBeeError exitSleep | ( | ) |
XBee::XBeeError getData | ( | char ** | data, |
uint8_t * | len | ||
) |
XBee::XBeeError getRemoteAddress | ( | uint32_t * | addrHi, |
uint32_t * | addrLo | ||
) |
Get address of remote node.
This method will only return valid data when called in the context of the CbDataAvailable and CbNodeFound callbacks
- Parameters:
-
addrHi Top 32 bits of address will be written to this argument addrLo Bottom 32 bits of address will be written to this argument
XBee::XBeeError getRssi | ( | uint8_t * | rssi ) |
XBee::XBeeError getTxStatus | ( | uint8_t * | frameId, |
XBeeTxStatus * | status | ||
) |
XBee::XBeeError init | ( | XBeeType | type, |
const char * | panId | ||
) |
Initialize the XBee module and configure it to be of a specific type.
Note: This implementation will always configure the XBee module to work in API mode.
void process | ( | ) |
void registerCallback | ( | void(*)(void) | fptr, |
CallbackType | type | ||
) |
void registerCallback | ( | T * | tptr, |
void(T::*)(void) | mptr, | ||
CallbackType | type | ||
) |
XBee::XBeeError send | ( | uint32_t | addrHi, |
uint32_t | addrLo, | ||
char * | data, | ||
uint8_t | len, | ||
uint8_t * | frameId | ||
) |
Send data to a node with specified address.
It is also possible to broadcast a message using broadcast address (XBEE_ADDRHI_BROADCAST, XBEE_ADDRLO_BROADCAST).
- Parameters:
-
addrHi Top 32 bits of address addrLo Bottom 32 bits of address data buffer containing data to send len number of bytes to send frameId the ID of the frame will be written to this argument. The ID can then be used to match this request with the status returned in the CbTxStat callback.
Generated on Fri Jul 15 2022 02:16:08 by 1.7.2