Revision 1437 trunk/code/projects/test/xbee.c
| xbee.c (revision 1437) | ||
|---|---|---|
| 88 | 88 |
static int xbee_enter_command_mode(void); |
| 89 | 89 |
static int xbee_exit_command_mode(void); |
| 90 | 90 |
static int xbee_enter_api_mode(void); |
| 91 |
static int xbee_exit_api_mode(void); |
|
| 91 | 92 |
static int xbee_wait_for_string(char* s, int len); |
| 92 | 93 |
static int xbee_wait_for_ok(void); |
| 93 | 94 |
|
| ... | ... | |
| 349 | 350 |
free(xbee_listen_thread); |
| 350 | 351 |
lockf(xbee_stream, F_ULOCK, 0); |
| 351 | 352 |
close(xbee_stream); |
| 353 |
#else |
|
| 354 |
xbee_exit_api_mode(); |
|
| 352 | 355 |
#endif |
| 353 | 356 |
} |
| 354 | 357 |
|
| ... | ... | |
| 456 | 459 |
} |
| 457 | 460 |
|
| 458 | 461 |
/** |
| 462 |
* Exit API mode. |
|
| 463 |
**/ |
|
| 464 |
static int xbee_exit_api_mode() |
|
| 465 |
{
|
|
| 466 |
if (xbee_send_modify_at_command("AP","0") != 0) {
|
|
| 467 |
return -1; |
|
| 468 |
} |
|
| 469 |
|
|
| 470 |
return 0; |
|
| 471 |
} |
|
| 472 |
|
|
| 473 |
/** |
|
| 459 | 474 |
* Wait until the string "OK\r" is received from the XBee. |
| 460 | 475 |
**/ |
| 461 | 476 |
static int xbee_wait_for_ok() |
Also available in: Unified diff