Project

General

Profile

Revision 1587

wireless: core send function and ack function done

View differences:

xbee.c
59 59
#include <string.h>
60 60

  
61 61

  
62
/**@addtogroup xbee
63
 * @{ **/
64
 
65
/**@defgroup xbee_const xbee constants 
66
 * @{ **/
67
 
68
// TODO: move constants to xbee.h so they can be used publicly
69

  
70
/**@brief The port to use the XBee from on the computer. **/
71
#ifndef ROBOT
72
#define XBEE_PORT_DEFAULT "/dev/ttyUSB1"
73
#endif
74
 
75
/**@name xbee options
76
 * @{ **/
77
 
78
/**@brief Unset PAN, uses XBee default **/
79
#define XBEE_PAN_DEFAULT 0xFFFF
80
/**@brief Unset channel, uses XBee default **/
81
#define XBEE_CHANNEL_DEFAULT 0
82
/**@brief Broadcast to all robots in the PAN **/
83
#define XBEE_BROADCAST 0xFFFF
84
/**@brief No special options **/
85
#define XBEE_OPTIONS_NONE 0x00
86
/**@brief Do not receive a TX_STATUS message from this packet **/
87
#define XBEE_OPTIONS_DISABLE_RESPONSE 0x01
88
/**@brief Send the packet to all PANS **/
89
#define XBEE_OPTIONS_BROADCAST_ALL_PANS 0x04
90
/**@brief A transmit status packet **/
91
#define XBEE_TX_STATUS 0x89
92
/**@brief A packet received from another XBee **/
93
#define XBEE_RX 0x81
94

  
95
/**@}
96
 * @name xbee frame types
97
 * @{ **/
98

  
99
// TODO: add comments for all of these definitions
100
#define XBEE_FRAME_START 0x7E
101
#define XBEE_GET_PACKET_TIMEOUT 1000
102

  
103
/*Frame Types*/
104
#define XBEE_FRAME_STATUS 0x8A
105
#define XBEE_FRAME_AT_COMMAND 0x08
106
#define XBEE_FRAME_AT_COMMAND_RESPONSE 0x88
107
#define XBEE_FRAME_TX_REQUEST_64 0x00
108
#define XBEE_FRAME_TX_REQUEST_16 0x01
109
#define XBEE_FRAME_TX_STATUS XBEE_TX_STATUS
110
#define XBEE_FRAME_RX_64 0x80
111
#define XBEE_FRAME_RX_16 XBEE_RX
112

  
113
/** @} **/
114

  
115

  
116
// TODO: is this a good size?
117
/*Buffer sizes*/
118
#define XBEE_BUFFER_SIZE	128
119
#define PACKET_BUFFER_SIZE	108
120

  
121
/**@} **/ // end const group
122

  
123 62
/*Internal Function Prototypes*/
124 63

  
125 64
// TODO: convert all int references to int16_t syntax (see stdint.h)
......
183 122
static volatile unsigned int xbee_address = 0;
184 123

  
185 124

  
125
/**@addtogroup xbee
126
 * @{ **/
127

  
128

  
186 129
/*Function Implementations*/
187 130

  
188 131
#ifdef ROBOT

Also available in: Unified diff