Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
XBeeAPI Class Reference
#include <XBeeAPI.h>
Public Member Functions | |
| XBeeAPI (PinName tx, PinName rx, int BaudRate, SmartLab_XBeeAPI::APIMode mode) | |
| Constructor for XBeeAPI. | |
| void | SetVerifyChecksum (bool status) |
| Whether or not checksum verification is enabled. | |
| void | Send (const RequestBase &request) |
| Send request out thtough Tx as API frame. | |
| void | Start (PacketListener *packetListener) |
| Start to receive API packets. | |
Detailed Description
XBeeAPI class.
The main interface of SmartLabXBeeAPI to send and receive API frames
Example:
#include "XBeeAPI.h" XBeeAPI xbee(p9,p10,9600,API_ESCAPED); class MyListener : public PacketListener { public : virtual void onATCommandReceived(const ATCommandResponse &response) { //do something... } }; MyListener myListener; int main() { xbee.SetVerifyChecksum(false); xbee.Start(&myListener); OptionsBase op = TransmitOptions::DEFAULT; XBeeTx16Request Tx16Request(0x89, 0, op , "Hello World!"); xbee.Send(Tx16Request); }
Definition at line 65 of file XBeeAPI.h.
Constructor & Destructor Documentation
| XBeeAPI | ( | PinName | tx, |
| PinName | rx, | ||
| int | BaudRate, | ||
| SmartLab_XBeeAPI::APIMode | mode | ||
| ) |
Constructor for XBeeAPI.
- Parameters:
-
tx PinName of serial transmit rx PinName of serial receive BaudRate baud rate of serial interface mode normal or escaped operation (API_NORMAL, API_ESCAPED)
Definition at line 3 of file XBeeAPI.cpp.
Member Function Documentation
| void Send | ( | const RequestBase & | request ) |
Send request out thtough Tx as API frame.
- Parameters:
-
request the base class for all request type
Definition at line 128 of file XBeeAPI.cpp.
| void SetVerifyChecksum | ( | bool | status ) |
Whether or not checksum verification is enabled.
- Parameters:
-
status true enable checksum (slow but safe), false disable checksum (fast but unsafe)
Definition at line 123 of file XBeeAPI.cpp.
| void Start | ( | PacketListener * | packetListener ) |
Start to receive API packets.
- Parameters:
-
packetListener an abstract class to receive call back when API frames are ready, there is a default implement called "PacketListener.h", in order to receive certain packet just override the corresponding virtual method.
Definition at line 156 of file XBeeAPI.cpp.
Generated on Tue Jul 12 2022 14:26:52 by
1.7.2