XBee Firmware Library  1.6.0
Functions
xbee_atmode.c File Reference

Functions

XBEE_BEGIN_DECLS int xbee_atmode_enter (xbee_dev_t *xbee)
 Attempt to enter AT command mode (delay 1 second, send +++, delay 1 second). More...
 
int xbee_atmode_exit (xbee_dev_t *xbee)
 Leave AT command mode and return to idle mode. More...
 
int xbee_atmode_read_response (xbee_dev_t *xbee, char FAR *response, int resp_size, int FAR *bytesread)
 Non-blocking function reads response to request sent with xbee_atmode_send_request to an XBee device in AT Command Mode. More...
 
int xbee_atmode_send_request (xbee_dev_t *xbee, const char FAR *command)
 Send an AT request and wait for a response. More...
 
int xbee_atmode_tick (xbee_dev_t *xbee)
 Advance the XBee device state machine when entering or exiting AT Command Mode or waiting for a response to a command. More...
 

Detailed Description

Code for working with XBee modules in AT command mode instead of API mode.

For DigiMesh 900 modules, this is necessary when doing firmware updates (even when module is using API-mode firmware).

Note that this mode is not very robust. Once it AT mode, the XBee will return to idle mode after some amount of time (value of CT register * 100ms). If our calculation of that idle time doesn't match the XBee module's, our state machine won't match the actual state. It may be possible to add some extra time on either end of that timeout to be certain, and it's always possible re-enter command mode just to send the command to exit (ATCN) and be sure we're out of it.