Defines | |
#define | XBEE_PAN_DEFAULT 0xFFFF |
Do not change the PAN. | |
#define | XBEE_BROADCAST 0xFFFF |
Broadcast to all robots in the PAN. | |
#define | XBEE_OPTIONS_NONE 0x00 |
No special options. | |
#define | XBEE_OPTIONS_DISABLE_RESPONSE 0x01 |
Do not receive a TX_STATUS message from this packet. | |
#define | XBEE_OPTIONS_BROADCAST_ALL_PANS 0x04 |
Send the packet to all PANS. | |
#define | XBEE_TX_STATUS 0x89 |
A transmit status packet. | |
#define | XBEE_RX 0x81 |
A packet received from another XBee. | |
Functions | |
void | xbee_lib_init (int pan_id) |
Initialize the XBee library. | |
void | xbee_terminate (void) |
Uninitialize the XBee library. | |
int | xbee_get_packet (unsigned char *packet) |
Get a packet from the XBee. | |
void | xbee_send_packet (char *packet, int len, int dest, char options, char frame) |
Send a packet to the XBee. | |
void | xbee_set_pan_id (int id) |
Set the PAN ID for the XBee. | |
unsigned int | xbee_get_pan_id (void) |
Get the XBee's PAN ID. | |
unsigned int | xbee_get_address (void) |
Get the XBee's 16-bit address. |
Interface with the XBee module.
|
Get the XBee's 16-bit address. Get the 16-bit address of the XBee. This is used to specify who to send messages to and who messages are from.
|
|
Get a packet from the XBee.
Reads a packet received from the XBee. This function is non-blocking. The resulting packet is stored in dest. Only returns transmission response packets and received packets. The returned packet does not include header information or the checksum. This method also handles special packets dealt with by the XBee library, and so should be called frequently while the XBee is in use.
The first byte of the packet will be either XBEE_TX_STATUS or XBEE_RX to indicated a response to a sent message or a received message, respectively.
For a status response packet:
For a received packet:
|
|
Get the XBee's PAN ID. Get the PAN ID for the XBee.
|
|
Initialize the XBee library. Initializes the XBee library so that other functions may be used.
|
|
Send a packet to the XBee. Send the specified packet.
|
|
Set the PAN ID for the XBee. Sets the personal area network id.
|
|
Uninitialize the XBee library. Call when finished using the XBee library. This releases all sued resources. |