Revision 747
Commited new wireless version.
trunk/code/lib/src/libwireless/xbee.c | ||
---|---|---|
206 | 206 |
**/ |
207 | 207 |
int xbee_lib_init() |
208 | 208 |
{ |
209 |
WL_DEBUG_PRINT("in xbee_init\n"); |
|
209 | 210 |
#ifdef ROBOT |
210 | 211 |
|
211 | 212 |
//enable the receiving interrupt |
... | ... | |
267 | 268 |
} |
268 | 269 |
#endif |
269 | 270 |
|
271 |
WL_DEBUG_PRINT("Entering command mode.\n"); |
|
270 | 272 |
|
271 | 273 |
if (xbee_enter_command_mode() != 0) { |
272 | 274 |
return -1; |
273 | 275 |
} |
274 | 276 |
|
277 |
WL_DEBUG_PRINT("Entered command mode.\n"); |
|
278 |
|
|
275 | 279 |
if (xbee_enter_api_mode() != 0) { |
276 | 280 |
return -1; |
277 | 281 |
} |
278 | 282 |
|
283 |
WL_DEBUG_PRINT("Entered api mode.\n"); |
|
284 |
|
|
279 | 285 |
if (xbee_exit_command_mode() != 0) { |
280 | 286 |
return -1; |
281 | 287 |
} |
282 | 288 |
|
289 |
WL_DEBUG_PRINT("Left command mode.\n"); |
|
290 |
|
|
283 | 291 |
if (xbee_send_read_at_command("MY")) { |
284 | 292 |
return -1; |
285 | 293 |
} |
294 |
WL_DEBUG_PRINT("Getting ATMY address.\n"); |
|
286 | 295 |
|
287 | 296 |
#ifndef ROBOT |
288 | 297 |
int i; |
... | ... | |
305 | 314 |
xbee_get_packet(NULL); |
306 | 315 |
} |
307 | 316 |
#endif |
317 |
WL_DEBUG_PRINT("Got ATMY address.\n"); |
|
308 | 318 |
|
309 | 319 |
#ifndef ROBOT |
310 | 320 |
if (i == XBEE_GET_PACKET_TIMEOUT) { // We timed-out. |
Also available in: Unified diff