root / trunk / code / lib / include / libwireless / xbee.h @ 18
History | View | Annotate | Download (1.58 KB)
1 |
/**
|
---|---|
2 |
* @file xbee.h
|
3 |
* @brief Contains definitions for using the XBee
|
4 |
*
|
5 |
* Contains definitions for interfacing with the
|
6 |
* XBee module, from either a robot or a computer.
|
7 |
* To use a robot, define ROBOT in wl_defs.h, and
|
8 |
* to use a computer, don't define ROBOT.
|
9 |
*
|
10 |
* @author Brian Coltin, Colony Project, CMU Robotics Club
|
11 |
**/
|
12 |
|
13 |
/**
|
14 |
* @defgroup xbee XBee
|
15 |
* @brief Interface with the XBee module
|
16 |
*
|
17 |
* Interface with the XBee module.
|
18 |
*
|
19 |
* @{
|
20 |
**/
|
21 |
|
22 |
/*Definitions*/
|
23 |
/**@brief Do not change the PAN **/
|
24 |
#define XBEE_PAN_DEFAULT 0xFFFF |
25 |
/**@brief Broadcast to all robots in the PAN **/
|
26 |
#define XBEE_BROADCAST 0xFFFF |
27 |
/**@brief No special options **/
|
28 |
#define XBEE_OPTIONS_NONE 0x00 |
29 |
/**@brief Do not receive a TX_STATUS message from this packet **/
|
30 |
#define XBEE_OPTIONS_DISABLE_RESPONSE 0x01 |
31 |
/**@brief Send the packet to all PANS **/
|
32 |
#define XBEE_OPTIONS_BROADCAST_ALL_PANS 0x04 |
33 |
/**@brief A transmit status packet **/
|
34 |
#define XBEE_TX_STATUS 0x89 |
35 |
/**@brief A packet received from another XBee **/
|
36 |
#define XBEE_RX 0x81 |
37 |
|
38 |
/**@brief Initialize the XBee library **/
|
39 |
void xbee_lib_init(int pan_id); |
40 |
/**@brief Uninitialize the XBee library **/
|
41 |
void xbee_terminate(void); |
42 |
/**@brief Get a packet from the XBee **/
|
43 |
int xbee_get_packet(unsigned char* packet); |
44 |
/**@brief Send a packet to the XBee **/
|
45 |
void xbee_send_packet(char* packet, int len, int dest, |
46 |
char options, char frame); |
47 |
/**@brief Set the PAN ID for the XBee **/
|
48 |
void xbee_set_pan_id(int id); |
49 |
/**@brief Get the XBee's PAN ID **/
|
50 |
unsigned int xbee_get_pan_id(void); |
51 |
/**@brief Get the XBee's 16-bit address **/
|
52 |
unsigned int xbee_get_address(void); |
53 |
|
54 |
/**@}**/ //end defgroup |
55 |
|