Digi XBee(R) ANSI C Host Library
Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
AT Commands

This layer wraps the AT request/response frames to provide an easy method
for querying/setting registers on, and sending AT commands to the XBee.
More...

Files

file  atcmd.h
 Sending AT command requests and processing the responses.
 
file  reg_descr.h
 Header for XBee register descriptors.
 
file  scan.h
 Structures for the ATAS (Active Scan) API responses.
 
file  xbee_atcmd.c
 Code related to sending AT command requests and processing the responses.
 
file  xbee_scan.c
 Code related to ATAS (Active Scan) responses.
 

Data Structures

union  xbee_at_cmd_t
 Datatype used for passing and storing XBee AT Commands. More...
 
struct  xbee_cmd_response_t
 Structure used to pass AT Command responses to registered callback handlers. More...
 
struct  xbee_cmd_request_t
 This structure is used to keep track of outstanding local and remote AT requests. More...
 
struct  xbee_header_local_at_req_t
 Header for AT Commands sent to the local (serially-attached) XBee. More...
 
struct  xbee_header_remote_at_req_t
 Header to AT Commands sent to a remote XBee on the network. More...
 
union  xbee_header_at_request_t
 Useful typedef to create either a local or remote request frame. More...
 
struct  xbee_header_local_at_resp_t
 XBEE_FRAME_LOCAL_AT_RESPONSE (0x88) More...
 
struct  xbee_header_remote_at_resp_t
 XBEE_FRAME_REMOTE_AT_RESPONSE (0x97) More...
 
struct  xbee_frame_local_at_resp_t
 Response to an AT Command sent to the local serially-connected XBee. More...
 
struct  xbee_frame_remote_at_resp_t
 Response to an AT Command sent to a remote XBee. More...
 
union  xbee_frame_at_response_t
 Useful typedef for casting either a local or remote response frame. More...
 
struct  xbee_command_list_context_t
 Context data passed to command list processor. More...
 
struct  xbee_atcmd_reg_t
 Entry for table of XBee registers to query at startup. More...
 
struct  _xbee_reg_descr_t
 
struct  xbee_scan_zigbee_response_t
 
union  xbee_scan_response_t
 

Macros

#define XBEE_CMD_REQUEST_TABLESIZE   2
 Maximum number of outstanding requests. More...
 
#define XBEE_CMD_MAX_PARAM_LENGTH   64
 Maximum number of bytes in the parameter sent to a command. More...
 
#define XBEE_CMD_REMOTE_TIMEOUT   180
 Timeout (in seconds) to wait for a response to a remote command. More...
 
#define XBEE_CMD_LOCAL_TIMEOUT   2
 Timeout (in seconds) to wait for a response to a local command.
 
#define XBEE_CMD_ATEO_INSECURE_JOIN   (1<<0)
 
#define XBEE_CMD_ATEO_USE_TRUST_CENTER   (1<<1)
 
#define XBEE_CMD_ATEO_USE_HASH_LINK_KEY   (1<<2)
 
#define XBEE_CMD_ATEO_USE_AUTHENTICATION   (1<<3)
 
#define XBEE_AT_RESP_STATUS(var)   ((var) & XBEE_AT_RESP_STATUS_MASK)
 Macro for checking the status byte of an AT response. More...
 
#define XBEE_ATCMD_REG(c1, c2, type, obj, field)
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_CB(c1, c2, cb, flags)   { { { c1, c2 } }, flags, XBEE_CLT_NONE, cb, 0, 0 }
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_MOVE_THEN_CB(c1, c2, type, obj, field, cb, flags)
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_SET_8(c1, c2, value)   { { { c1, c2 } }, 0, XBEE_CLT_SET_8, NULL, value, 0 }
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_END   { { { '\0', '\0' } } }
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_END_CMD(c1, c2)   { { { c1, c2 } }, 0, XBEE_CLT_LAST, NULL, 0, 0 }
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_END_CB(cb, flags)   { { { '\0', '\0' } }, flags, XBEE_CLT_NONE, cb, 0, 0 }
 Macro used in creating command list tables. More...
 
#define XBEE_ATCMD_REG_VALID(ptr)   (ptr->command.w != 0)
 Macro used in create command list tables. More...
 
#define xbee_cmd_list_status(clc)   ((clc)->status)
 
#define XBEE_CMD_REQUEST_EMPTY(index)   (xbee_cmd_request_table[index].device == NULL)
 Is entry index available (unused)?
 
#define XBEE_CMD_REQUEST_HANDLE(index)   ((index << 8) || xbee_cmd_request_table[index].sequence)
 Return the handle for entry index (combination of index and .sequence member of entry). More...
 
#define XBEE_FRAME_HANDLE_LOCAL_AT
 
#define XBEE_FRAME_HANDLE_REMOTE_AT   { XBEE_FRAME_REMOTE_AT_RESPONSE, 0, _xbee_cmd_handle_response, NULL }
 
#define XBEE_SCAN_TYPE_ZIGBEE   0x01
 
#define _xbee_atcmd_debug
 
#define XBEE_ATCMD_REG_REFRESH_IDX   7
 Offset into _xbee_atcmd_query_regs to use when refreshing the xbee_dev_t/ wpan_dev_t structure. More...
 

Typedefs

typedef int(* xbee_cmd_callback_fn) (const xbee_cmd_response_t FAR *response)
 Callback registered to an AT Command with xbee_cmd_set_callback(). More...
 
typedef void(* xbee_command_list_fn) (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)
 Callback registered for individual command list commands. More...
 

Enumerations

enum  xbee_at_resp_status {
  XBEE_AT_RESP_STATUS_MASK = 0x0F, XBEE_AT_RESP_SUCCESS = 0x00, XBEE_AT_RESP_ERROR = 0x01, XBEE_AT_RESP_BAD_COMMAND = 0x02,
  XBEE_AT_RESP_BAD_PARAMETER = 0x03, XBEE_AT_RESP_TX_FAIL = 0x04, XBEE_AT_RESP_NO_SESSION = 0x0B, XBEE_AT_RESP_ENCRYPTION_ERR = 0x0C,
  XBEE_AT_RESP_TO_BIT_NOT_SET = 0x0D, XBEE_AT_RESP_ATND_RSSI_INVALID = 0x40
}
 Possible values of status byte in xbee_header_local_at_resp_t and xbee_frame_local_at_resp_t. More...
 
enum  xbee_command_list_status { XBEE_COMMAND_LIST_RUNNING = -EBUSY, XBEE_COMMAND_LIST_DONE = 0, XBEE_COMMAND_LIST_TIMEOUT = -ETIMEDOUT, XBEE_COMMAND_LIST_ERROR = -EIO }
 Status codes for xbee_cmd_list_status() More...
 
enum  xbee_command_list_type {
  XBEE_CLT_NONE, XBEE_CLT_COPY, XBEE_CLT_COPY_PAD_LEFT, XBEE_CLT_COPY_BE,
  XBEE_CLT_SET, XBEE_CLT_SET_STR, XBEE_CLT_SET_BE, XBEE_CLT_SET_8,
  XBEE_CLT_LAST
}
 
enum  _xbee_rci_type_t {
  XBEE_RCI_TYPE_UINT32, XBEE_RCI_TYPE_HEX32, XBEE_RCI_TYPE_STRING, XBEE_RCI_TYPE_BIN,
  XBEE_RCI_TYPE_ADDR64
}
 iDigi RCI type names used by do_command type=zigbee. More...
 

Functions

int xbee_cmd_list_execute (xbee_dev_t *xbee, xbee_command_list_context_t FAR *clc, const xbee_atcmd_reg_t FAR *list, void FAR *base, const wpan_address_t FAR *address)
 Execute a list of AT commands. More...
 
enum xbee_command_list_status() xbee_cmd_list_status (xbee_command_list_context_t FAR *clc)
 Determine status of command list execution. More...
 
int xbee_cmd_tick (void)
 This function should be called periodically (at least every few seconds) to expire old entries from the AT Command Request table. More...
 
xbee_cmd_request_t FAR_xbee_cmd_handle_to_address (int16_t handle)
 
int xbee_cmd_init_device (xbee_dev_t *xbee)
 Initialize the AT Command layer for an XBee device. More...
 
int xbee_cmd_query_device (xbee_dev_t *xbee, uint_fast8_t refresh)
 Learn about the underlying device by sending a series of commands and storing the results in the xbee_dev_t. More...
 
int xbee_cmd_query_status (xbee_dev_t *xbee)
 Check the status of querying an XBee device, as initiated by xbee_cmd_query_device(). More...
 
int16_t xbee_cmd_create (xbee_dev_t *xbee, const char FAR command[3])
 Allocate an AT Command request. More...
 
int _xbee_cmd_release_request (xbee_cmd_request_t FAR *request)
 Release an entry from the request table by marking it as available. More...
 
int xbee_cmd_release_handle (int16_t handle)
 Release an entry from the request table by marking it as available. More...
 
int xbee_cmd_set_command (int16_t handle, const char FAR command[3])
 Change the command associated with a request. More...
 
int xbee_cmd_set_callback (int16_t handle, xbee_cmd_callback_fn callback, void FAR *context)
 Associate a callback with a given AT Command request. More...
 
int xbee_cmd_set_target (int16_t handle, const addr64 FAR *ieee, uint16_t network_address)
 Associate a remote XBee device with a given AT Command request. More...
 
int xbee_cmd_set_flags (int16_t handle, uint16_t flags)
 Set the flags for a given AT Command request. More...
 
int xbee_cmd_clear_flags (int16_t handle, uint16_t flags)
 Clear the flags for a given AT Command request. More...
 
int xbee_cmd_set_param (int16_t handle, uint32_t value)
 Set the parameter (up to 32-bits) for a given AT Command request. More...
 
int xbee_cmd_set_param_bytes (int16_t handle, const void FAR *data, uint8_t length)
 Set the parameter for a given AT Command request to a sequence of bytes. More...
 
int xbee_cmd_set_param_str (int16_t handle, const char FAR *str)
 Set a string parameter for a given AT Command request (e.g., the "NI" node identifier command). More...
 
int xbee_cmd_send (int16_t handle)
 Send an AT Command to a local or remote XBee device. More...
 
int xbee_cmd_simple (xbee_dev_t *xbee, const char FAR command[3], uint32_t value)
 Simple interface for sending a command with a parameter to the local XBee without checking for a response. More...
 
int xbee_cmd_execute (xbee_dev_t *xbee, const char FAR command[3], const void FAR *data, uint8_t length)
 Simple interface for sending a command with an optional parameter to the local XBee without checking for a response. More...
 
int _xbee_cmd_handle_response (xbee_dev_t *xbee, const void FAR *rawframe, uint16_t length, void FAR *context)
 Callback handler registered for frame types XBEE_FRAME_LOCAL_AT_RESPONSE (0x88) and XBEE_FRAME_REMOTE_AT_RESPONSE (0x97). More...
 
int _xbee_cmd_modem_status (xbee_dev_t *xbee, const void FAR *payload, uint16_t length, void FAR *context)
 Receive modem status frames and update our network address (and payload size) on state changes. More...
 
int xbee_scan_dump_response (xbee_dev_t *xbee, const void FAR *raw, uint16_t length, void FAR *context)
 
int _xbee_cmd_issue_list (xbee_dev_t *xbee, xbee_command_list_context_t FAR *clc, const xbee_cmd_response_t FAR *response)
 
int _xbee_cmd_list_callback (const xbee_cmd_response_t FAR *response)
 
void _xbee_cmd_query_handle_eo (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)
 
void _xbee_cmd_query_handle_ai (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)
 
void _xbee_cmd_query_handle_end (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)
 
uint8_t _xbee_cmd_encode_param (void FAR *buffer, uint32_t value)
 Store an unsigned integer in 1, 2 or 4 bytes as a parameter to an AT command. More...
 
void xbee_identify (xbee_dev_t *xbee, bool_t identify)
 Programs with the ZCL Identify Server Cluster can call this function in their main loop to have the XBee module's association LED flash fast (100ms cycle) when in Identify Mode. More...
 

Variables

FAR xbee_cmd_request_t xbee_cmd_request_table [XBEE_CMD_REQUEST_TABLESIZE]
 Table used to keep track of outstanding requests.
 
const char * _xbee_rci_types []
 Table to map _xbee_rci_type_t to RCI type string.
 
const FAR _xbee_reg_descr_t _xbee_reg_table []
 
FAR xbee_cmd_request_t xbee_cmd_request_table [XBEE_CMD_REQUEST_TABLESIZE]
 Table used to keep track of outstanding requests.
 
const xbee_atcmd_reg_t _xbee_atcmd_query_regs []
 
xbee_command_list_context_t _xbee_atcmd_query_regs_head
 

Return values for xbee_cmd_callback_fn() functions.

#define XBEE_ATCMD_DONE   0
 Returned by an xbee_cmd_callback_fn() if the handle can be released.
 
#define XBEE_ATCMD_REUSE   1
 Returned by an xbee_cmd_callback_fn() if more reponses are expected, or it has re-used the command handle. More...
 

XBEE_REMOTE_AT_OPT_*

Values for .options member of xbee_header_remote_at_req_t.

#define XBEE_REMOTE_AT_OPT_QUEUE   (0)
 Queue changes until ATAC command or another request with XBEE_REMOTE_AT_OPT_IMMEDIATE set. More...
 
#define XBEE_REMOTE_AT_OPT_IMMEDIATE   (1<<1)
 Apply changes immediately, don't wait for ATAC command.
 
#define XBEE_REMOTE_AT_OPT_SECURE   (1<<4)
 Send securely (requires Secure Session to target).
 

Detailed Description

This layer wraps the AT request/response frames to provide an easy method
for querying/setting registers on, and sending AT commands to the XBee.

Macro Definition Documentation

#define XBEE_AT_RESP_STATUS (   var)    ((var) & XBEE_AT_RESP_STATUS_MASK)

Macro for checking the status byte of an AT response.

If this library is compiled without DigiMesh support, we can use a simpler test.

Referenced by _sxa_disc_atnd_response(), _sxa_io_process_response(), and xbee_disc_atnd_response_handler().

#define XBEE_ATCMD_REG (   c1,
  c2,
  type,
  obj,
  field 
)
Value:
{ { { c1, c2 } }, 0, type, NULL, \
(uint8_t) sizeof((*(obj *)NULL).field), \
(uint8_t) offsetof( obj, field) }
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39

Macro used in creating command list tables.

This macro does not set a callback.

Parameters
[in]c1first character of AT command
[in]c2second character of AT command
[in]typeone of xbee_command_list_type enumerated values: XBEE_CLT_NONE - no action except to issue the command. 'obj' and 'field' parameters are ignored. XBEE_CLT_COPY - copy response data directly, followed by 0x00 to fill the target element XBEE_CLT_COPY_PAD_LEFT - copy response data directly, padding to the left with 0x00 to fill target element XBEE_CLT_COPY_BE - copy numeric data to host byte order XBEE_CLT_SET - set command parameter directly XBEE_CLT_SET_STR - set command parameter as null- terminated string. XBEE_CLT_SET_BE - set numeric command parameter
[in]objtypedef name of object at base address
[in]fieldfield in obj in which to store result
Note
The 'type' parameter allows for either setting the data in the base structure as the command parameter (XBEE_CLT_SET*) or the converse, which is copying the command result back to the base structure (XBEE_CLT_COPY*).
Returns
xbee_atcmd_reg_t record for constructing command list tables
See also
XBEE_ATCMD_REG_CB, XBEE_ATCMD_REG_SET_8
#define XBEE_ATCMD_REG_CB (   c1,
  c2,
  cb,
  flags 
)    { { { c1, c2 } }, flags, XBEE_CLT_NONE, cb, 0, 0 }

Macro used in creating command list tables.

Parameters
[in]c1first character of AT command
[in]c2second character of AT command
[in]cbcallback function (prototype xbee_command_list_fn)
[in]flags8-bit flags for callback (arbitrary).
Returns
xbee_atcmd_reg_t record for constructing command list tables
See also
XBEE_ATCMD_REG
#define XBEE_ATCMD_REG_END   { { { '\0', '\0' } } }

Macro used in creating command list tables.

Used to terminate table, with no special final callback. This must be the last entry if used, or XBEE_ATCMD_REG_END_CB must be used.

#define XBEE_ATCMD_REG_END_CB (   cb,
  flags 
)    { { { '\0', '\0' } }, flags, XBEE_CLT_NONE, cb, 0, 0 }

Macro used in creating command list tables.

Used to terminate table, with a final callback. This must be the last entry if used, or XBEE_ATCMD_REG_END must be used.

Parameters
[in]cbcallback function (prototype xbee_command_list_fn).
Note
The 'response' parameter to the callback will be the final command response received.
Parameters
[in]flags8-bit flags for callback (arbitrary).
#define XBEE_ATCMD_REG_END_CMD (   c1,
  c2 
)    { { { c1, c2 } }, 0, XBEE_CLT_LAST, NULL, 0, 0 }

Macro used in creating command list tables.

Used to terminate table, with a command (usually ND or WR). This must be the last entry if used.

Referenced by _sxa_io_process_response().

#define XBEE_ATCMD_REG_MOVE_THEN_CB (   c1,
  c2,
  type,
  obj,
  field,
  cb,
  flags 
)
Value:
{ { { c1, c2 } }, flags, type, cb, \
(uint8_t) sizeof((*(obj *)NULL).field), \
(uint8_t) offsetof( obj, field) }
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39

Macro used in creating command list tables.

This is a combination of XBEE_ATCMD_REG (moving data automatically) and XBEE_ATCMD_REG_CB (calling a callback function). The callback function is invoked after the data move.

Parameters
[in]c1first character of AT command
[in]c2second character of AT command
[in]typeone of xbee_command_list_type enumerated values: XBEE_CLT_NONE - no action except to issue the command. 'obj' and 'field' parameters are ignored. XBEE_CLT_COPY - copy response data directly, followed by 0x00 to fill the target element XBEE_CLT_COPY_PAD_LEFT - copy response data directly, padding to the left with 0x00 to fill target element XBEE_CLT_COPY_BE - copy numeric data to host byte order XBEE_CLT_SET - set command parameter directly XBEE_CLT_SET_STR - set command parameter as null- terminated string. XBEE_CLT_SET_BE - set numeric command parameter
[in]objtypedef name of object at base address
[in]fieldfield in obj in which to store result
[in]cbcallback function (prototype xbee_command_list_fn)
[in]flags8-bit flags for callback (arbitrary).
Returns
xbee_atcmd_reg_t record for constructing command list tables
See also
XBEE_ATCMD_REG, XBEE_ATCMD_REG_CB
#define XBEE_ATCMD_REG_REFRESH_IDX   7

Offset into _xbee_atcmd_query_regs to use when refreshing the xbee_dev_t/ wpan_dev_t structure.

Referenced by xbee_cmd_query_device().

#define XBEE_ATCMD_REG_SET_8 (   c1,
  c2,
  value 
)    { { { c1, c2 } }, 0, XBEE_CLT_SET_8, NULL, value, 0 }

Macro used in creating command list tables.

This macro does not set a callback.

Parameters
[in]c1first character of AT command
[in]c2second character of AT command
[in]valueunsigned 8-bit value (compile-time constant) to set.
Returns
xbee_atcmd_reg_t record for constructing command list tables
See also
XBEE_ATCMD_REG

Referenced by _sxa_io_process_response().

#define XBEE_ATCMD_REG_VALID (   ptr)    (ptr->command.w != 0)

Macro used in create command list tables.

Used to identify the last entry in the table (inserted with XBEE_ATCMD_REG_END_CB()).

Referenced by _xbee_cmd_list_callback().

#define XBEE_ATCMD_REUSE   1

Returned by an xbee_cmd_callback_fn() if more reponses are expected, or it has re-used the command handle.

Referenced by _xbee_cmd_handle_response(), _xbee_cmd_list_callback(), and xbee_cmd_tick().

#define XBEE_CMD_MAX_PARAM_LENGTH   64

Maximum number of bytes in the parameter sent to a command.

Platforms can override this when limiting to AT commands with shorter parameters (e.g., 16 bytes when not using the certificate parameters).

Referenced by xbee_cmd_set_param_bytes(), and xbee_cmd_set_param_str().

#define XBEE_CMD_REMOTE_TIMEOUT   180

Timeout (in seconds) to wait for a response to a remote command.

Set to a high value to allow for a sleeping end device.

Referenced by xbee_cmd_send().

#define XBEE_CMD_REQUEST_HANDLE (   index)    ((index << 8) || xbee_cmd_request_table[index].sequence)

Return the handle for entry index (combination of index and .sequence member of entry).

#define XBEE_CMD_REQUEST_TABLESIZE   2

Maximum number of outstanding requests.

Two should be sufficient in most (all?) cases. One might even be enough if space is tight.

Referenced by _xbee_cmd_handle_response(), _xbee_cmd_handle_to_address(), xbee_cmd_create(), and xbee_cmd_tick().

#define XBEE_FRAME_HANDLE_LOCAL_AT
Value:
Current modem status (see xbee_frame_modem_status_t).
Definition: device.h:84
int _xbee_cmd_modem_status(xbee_dev_t *xbee, const void FAR *payload, uint16_t length, void FAR *context)
Receive modem status frames and update our network address (and payload size) on state changes...
Definition: xbee_atcmd.c:1704
Response from local device to AT Command (see xbee_atcmd.c, xbee_cmd_response_t). ...
Definition: device.h:80
int _xbee_cmd_handle_response(xbee_dev_t *xbee, const void FAR *rawframe, uint16_t length, void FAR *context)
Callback handler registered for frame types XBEE_FRAME_LOCAL_AT_RESPONSE (0x88) and XBEE_FRAME_REMOTE...
Definition: xbee_atcmd.c:1507
#define XBEE_REMOTE_AT_OPT_QUEUE   (0)

Queue changes until ATAC command or another request with XBEE_REMOTE_AT_OPT_IMMEDIATE set.

Referenced by xbee_cmd_send().

Typedef Documentation

typedef int(* xbee_cmd_callback_fn) (const xbee_cmd_response_t FAR *response)

Callback registered to an AT Command with xbee_cmd_set_callback().

It should not modify the contents of the xbee_cmd_response_t structure passed to it. It should return either XBEE_ATCMD_DONE or XBEE_ATCMD_REUSE.

View the help on xbee_cmd_response_t for details on the members of that structure.

Parameters
[in]responseresponse received for AT Command
Return values
XBEE_ATCMD_DONEdone with the request handle
XBEE_ATCMD_REUSEmore responses are expected, or the request handle will be reused
See also
xbee_cmd_set_callback(), xbee_cmd_response_t
typedef void(* xbee_command_list_fn) (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base)

Callback registered for individual command list commands.

Parameters
[in]responseresponse received for AT Command. From this, the context field points to the start of the entire set of commands in the list being processed.
[in]regTable element for this command. Usually, the callback will dereference reg->context to find any required auxiliary data for processing this command.
[in,out]baseBase address of structure to populate with response value (typical use).
Note
This callback is called for a command response, and is intended to be used for manipulating the raw response data into something suitable for the application. There is no corresponding callback for a request (i.e. called before setting parameter data); the application is expected to perform setting parameter manipulation before invoking xbee_cmd_list_execute().

Enumeration Type Documentation

iDigi RCI type names used by do_command type=zigbee.

This table is used so as to avoid having XBEE_RCI_TYPE_STRING pointers in the register descriptor table.

Possible values of status byte in xbee_header_local_at_resp_t and xbee_frame_local_at_resp_t.

Enumerator
XBEE_AT_RESP_STATUS_MASK 

Mask to ignore extra bits used in the status response.

XBEE_AT_RESP_SUCCESS 

Success.

XBEE_AT_RESP_ERROR 

Error.

XBEE_AT_RESP_BAD_COMMAND 

Bad Command.

XBEE_AT_RESP_BAD_PARAMETER 

Bad Parameter.

XBEE_AT_RESP_TX_FAIL 

Transmit failed.

XBEE_AT_RESP_NO_SESSION 

No Session.

XBEE_AT_RESP_ENCRYPTION_ERR 

Encryption Error.

XBEE_AT_RESP_TO_BIT_NOT_SET 

ATTO bit not set.

XBEE_AT_RESP_ATND_RSSI_INVALID 

The RSSI field of the ATND response is not valid [DigiMesh].

Status codes for xbee_cmd_list_status()

We force these to be -Exxx codes (or 0).

Enumerator
XBEE_CLT_NONE 

No default action. Often used for callbacks.

XBEE_CLT_COPY 

Copy response data byte-for-byte to base struct, starting at offset 0 and setting remaining bytes to 0x00.

XBEE_CLT_COPY_PAD_LEFT 

Copy response data byte-for-byte to base struct,.

padding with 0x00 bytes before the copied data, to have last copied byte in last position of base struct. (see ATSH/ATSL).

XBEE_CLT_COPY_BE 

Copy response, changing expected big-endian to host byte order, and store in base struct.

Data must be 1, 2 or 4 bytes, assumed unsigned.

XBEE_CLT_SET 

Use data in base struct as parameter for command, with binary data copied byte-for-byte.

XBEE_CLT_SET_STR 

Use data in base struct as parameter for command, with null-terminated string data copied byte-for-byte.

XBEE_CLT_SET_BE 

Use data in base struct as parameter for command, changing host byte order to big-endian.

Data must be 1,2 or 4 bytes, assumed unsigned.

XBEE_CLT_SET_8 

Set value to immediate 8-bit constant in .bytes field of the xbee_atcmd_reg_t entry.

No response.

XBEE_CLT_LAST 

Last command, any response is discarded, no further command list entries are processed.

This is useful if ND is the last command, since the command list will terminate, but discovered nodes will be handled subsequently (asynchronously).

Function Documentation

uint8_t _xbee_cmd_encode_param ( void FAR buffer,
uint32_t  value 
)

Store an unsigned integer in 1, 2 or 4 bytes as a parameter to an AT command.

Parameters
[in]bufferbuffer to store value
[in]valuevalue to store
Returns
Number of bytes required (1, 2 or 4) to hold value.

References FAR, htobe16, and htobe32.

Referenced by xbee_cmd_set_param(), xbee_cmd_set_target(), and xbee_cmd_simple().

int _xbee_cmd_handle_response ( xbee_dev_t xbee,
const void FAR rawframe,
uint16_t  length,
void FAR context 
)
xbee_cmd_request_t FAR * _xbee_cmd_handle_to_address ( int16_t  handle)

Convert a handle (16-bit int) to a pointer into the command request table. Ensures that the handle is valid (correct index and sequence bytes).

Parameters
[in]handleHandle returned from xbee_cmd_create().
Returns
Pointer into the request table or NULL if handle is invalid.
See also
xbee_cmd_create()

References FAR, xbee_cmd_request_table, and XBEE_CMD_REQUEST_TABLESIZE.

Referenced by xbee_cmd_clear_flags(), xbee_cmd_release_handle(), xbee_cmd_send(), xbee_cmd_set_callback(), xbee_cmd_set_command(), xbee_cmd_set_flags(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_target(), and xbee_cmd_tick().

int _xbee_cmd_issue_list ( xbee_dev_t xbee,
xbee_command_list_context_t FAR clc,
const xbee_cmd_response_t FAR response 
)
int _xbee_cmd_list_callback ( const xbee_cmd_response_t FAR response)

Callback used by xbee_cmd_query_device (and possibly other functions) to learn about the attached XBee device (hardware/firmware version, address, etc.)

View function help for xbee_cmd_set_callback() for details on xbee_cmd_response_t structure.

This callback should only be called by xbee_cmd_handle_response(). ***

References _xbee_cmd_issue_list(), FAR, PRIsFAR, PRIX32, XBEE_AT_RESP_SUCCESS, XBEE_ATCMD_DONE, XBEE_ATCMD_REG_VALID, XBEE_ATCMD_REUSE, XBEE_CLT_COPY, XBEE_CLT_COPY_BE, XBEE_CLT_COPY_PAD_LEFT, XBEE_CLT_LAST, xbee_cmd_release_handle(), XBEE_CMD_RESP_FLAG_TIMEOUT, XBEE_CMD_RESP_MASK_STATUS, and xbee_cmd_send().

Referenced by xbee_cmd_list_execute().

int _xbee_cmd_modem_status ( xbee_dev_t xbee,
const void FAR payload,
uint16_t  length,
void FAR context 
)

Receive modem status frames and update our network address (and payload size) on state changes.

See also
xbee_frame_handler_fn()

References EINVAL, FAR, xbee_dev_t::flags, xbee_cmd_query_device(), XBEE_MODEM_STATUS_COORD_START, XBEE_MODEM_STATUS_JOINED, XBEE_MODEM_STATUS_KEY_ESTABLISHED, and XBEE_UNUSED_PARAMETER.

int _xbee_cmd_release_request ( xbee_cmd_request_t FAR request)

Release an entry from the request table by marking it as available.

For internal driver use only – userspace code should use xbee_cmd_release_handle() instead.

Parameters
[in]requestAddress of the table entry.
Return values
0request freed
-EINVALaddress (request) is not valid
See also
xbee_cmd_create(), xbee_cmd_release_handle()
Todo:
add bounds checking on request to make sure it's in the table?

References EINVAL.

Referenced by _xbee_cmd_handle_response(), xbee_cmd_release_handle(), xbee_cmd_send(), and xbee_cmd_tick().

int xbee_cmd_clear_flags ( int16_t  handle,
uint16_t  flags 
)

Clear the flags for a given AT Command request.

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]flagsOne or more of the following:
  • XBEE_CMD_FLAG_QUEUE_CHANGE don't apply changes until ATAC or another command without this flag is sent
Return values
0flags cleared
-EINVALhandle is not valid
See also
xbee_cmd_set_flags

References _xbee_cmd_handle_to_address(), EINVAL, FAR, and XBEE_CMD_FLAG_USER_MASK.

int16_t xbee_cmd_create ( xbee_dev_t xbee,
const char FAR  command[3] 
)

Allocate an AT Command request.

Parameters
[in]xbeeXBee device to use as the target (local) or to send through (remote). This function will automatically call xbee_cmd_init() if it hasn't already been called for this device.
[in]commandTwo-letter AT Command to send (e.g., "VR", "NI", etc.).
Return values
>0a "handle" to a request that can be built up and sent to a local (serially-attached) or remote XBee module.
-ENOSPCthe AT command table is full (increase the compile-time macro XBEE_CMD_REQUEST_TABLESIZE)
-EINVALan invalid parameter was passed to the function
See also
xbee_cmd_init_device(), xbee_cmd_query_device(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_send()

References EINVAL, ENOSPC, FAR, xbee_dev_t::flags, xbee_cmd_init_device(), xbee_cmd_request_table, XBEE_CMD_REQUEST_TABLESIZE, xbee_cmd_tick(), XBEE_DEV_FLAG_CMD_INIT, and XBEE_SET_TIMEOUT_SEC.

Referenced by _xbee_cmd_issue_list(), xbee_io_configure(), xbee_io_set_digital_output(), and xbee_io_set_options().

int xbee_cmd_execute ( xbee_dev_t xbee,
const char FAR  command[3],
const void FAR data,
uint8_t  length 
)

Simple interface for sending a command with an optional parameter to the local XBee without checking for a response.

For an asynchronous method of sending AT commands and getting the response, see xbee_cmd_create, the xbee_cmd_set_* functions and xbee_cmd_send.

Parameters
[in]xbeeXBee device to use as the target.
[in]commandTwo-letter AT Command to send (e.g., "ID", "CH", etc.).
[in]dataOptional big-endian (MSB-first) value to assign to command. Use NULL if command doesn't take a parameter.
[in]lengthNumber of bytes in data; ignored if data is NULL.
Return values
0command sent
-EINVALan invalid parameter was passed to the function
-EBUSYtransmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal).
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_simple()

References XBEE_FRAME_LOCAL_AT_CMD, xbee_frame_write(), and xbee_next_frame_id().

Referenced by xbee_disc_discover_nodes().

int xbee_cmd_init_device ( xbee_dev_t xbee)

Initialize the AT Command layer for an XBee device.

You need to call this function before any of the other xbee_cmd_* functions.

Parameters
[in]xbeeXBee device on which to enable the AT Command layer. This function will automatically call xbee_cmd_query_device if it hasn't already been called for this device.
Return values
0the XBee device was successfully configured to send and receive AT commands
-EINVALan invalid parameter was passed to the function
See also
xbee_cmd_query_device(), xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_send()

References addr64_format(), ADDR64_STRING_LENGTH, wpan_dev_t::address, CAST_FAR_TO_NEAR, EINVAL, FAR, xbee_dev_t::firmware_version, xbee_dev_t::flags, xbee_dev_t::hardware_version, PRIsFAR, PRIu32, PRIx16, PRIx32, xbee_dev_t::wpan_dev, WPAN_DEV_IS_JOINED, WPAN_FLAG_AUTHENTICATED, WPAN_FLAG_AUTHENTICATION_ENABLED, WPAN_FLAG_JOINED, WPAN_NET_ADDR_UNDEFINED, XBEE_AT_RESP_SUCCESS, xbee_cmd_query_device(), XBEE_CMD_RESP_FLAG_TIMEOUT, XBEE_CMD_RESP_MASK_STATUS, XBEE_DEV_FLAG_CMD_INIT, XBEE_DEV_FLAG_QUERY_BEGIN, XBEE_DEV_FLAG_QUERY_DONE, XBEE_DEV_FLAG_QUERY_ERROR, XBEE_DEV_FLAG_QUERY_INPROGRESS, XBEE_DEV_FLAG_QUERY_REFRESH, and XBEE_UNUSED_PARAMETER.

Referenced by _sxa_io_process_response(), and xbee_cmd_create().

int xbee_cmd_list_execute ( xbee_dev_t xbee,
xbee_command_list_context_t FAR clc,
const xbee_atcmd_reg_t FAR list,
void FAR base,
const wpan_address_t FAR address 
)

Execute a list of AT commands.

Parameters
[in,out]xbeeDevice to execute commands
[out]clcList head to set up. This must be static since callback functions access it asynchronously.
[in]listFirst entry of list of commands to execute. The list must be terminated by either XBEE_ATCMD_REG_END or XBEE_ATCMD_REG_END_CB. List entries are created using XBEE_ATCMD_REG macros etc.
[in]baseBase address of a structure to fill in with command results or as a source of values to set.
[in]addressRemote address, or NULL if local device.
Return values
0started sending commands from the list
-ENOSPCthe AT command table is full (increase the compile-time macro XBEE_CMD_REQUEST_TABLESIZE)
-EINVALan invalid parameter was passed to the function
See also
xbee_cmd_list_status()

References _xbee_cmd_issue_list(), _xbee_cmd_list_callback(), xbee_cmd_send(), xbee_cmd_set_callback(), and xbee_cmd_set_target().

Referenced by _sxa_io_process_response(), and xbee_cmd_query_device().

enum xbee_command_list_status() xbee_cmd_list_status ( xbee_command_list_context_t FAR clc)

Determine status of command list execution.

Parameters
[in]clcList head passed to xbee_cmd_list_execute().
Return values
XBEE_COMMAND_LIST_RUNNINGcurrently executing commands
XBEE_COMMAND_LIST_DONEsuccessfully completed
XBEE_COMMAND_LIST_TIMEOUTtimed out
XBEE_COMMAND_LIST_ERRORcompleted with error(s)
See also
xbee_cmd_list_execute()

Referenced by xbee_cmd_query_status(), and xbee_io_query_status().

int xbee_cmd_query_device ( xbee_dev_t xbee,
uint_fast8_t  refresh 
)

Learn about the underlying device by sending a series of commands and storing the results in the xbee_dev_t.

This function will likely get called by the XBee stack at some point in the startup/initialization phase.

Use xbee_cmd_query_status() to check on the progress of querying the device.

Parameters
[in,out]xbeeXBee device to query.
[in]refreshif non-zero, just refresh the volatile values (e.g., network settings, as opposed to device serial number)
Return values
0Started querying device.
-EBUSYTransmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal).
See also
xbee_cmd_init_device(), xbee_cmd_query_status()

References EINVAL, xbee_dev_t::flags, XBEE_ATCMD_REG_REFRESH_IDX, xbee_cmd_list_execute(), XBEE_DEV_FLAG_QUERY_BEGIN, XBEE_DEV_FLAG_QUERY_DONE, XBEE_DEV_FLAG_QUERY_ERROR, XBEE_DEV_FLAG_QUERY_INPROGRESS, and XBEE_DEV_FLAG_QUERY_REFRESH.

Referenced by _xbee_cmd_modem_status(), xbee_cmd_init_device(), and xbee_cmd_tick().

int xbee_cmd_query_status ( xbee_dev_t xbee)

Check the status of querying an XBee device, as initiated by xbee_cmd_query_device().

Parameters
[in]xbeedevice to check
Return values
0query completed
-EINVALxbee is NULL
-EBUSYquery underway
-ETIMEDOUTquery timed out
-EIOhalted, but query may not have completed (unexpected response)

References EINVAL, xbee_cmd_list_status(), and xbee_cmd_tick().

Referenced by _sxa_io_process_response().

int xbee_cmd_release_handle ( int16_t  handle)

Release an entry from the request table by marking it as available.

Parameters
[in]handlehandle to the request (as returned by xbee_cmd_create)
Return values
0request freed
-EINVALhandle is not valid
See also
xbee_cmd_create(), xbee_cmd_release_handle()

References _xbee_cmd_handle_to_address(), and _xbee_cmd_release_request().

Referenced by _xbee_cmd_list_callback().

int xbee_cmd_send ( int16_t  handle)
int xbee_cmd_set_callback ( int16_t  handle,
xbee_cmd_callback_fn  callback,
void FAR context 
)

Associate a callback with a given AT Command request.

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]callbackCallback function to receive the AT Command response. This function should take a single parameter (pointer to an xbee_cmd_response_t) and return either XBEE_ATCMD_DONE (if done with the request handle) or XBEE_ATCMD_REUSE (if more responses are expected, or the request handle is going to be reused).
1 int atcmd_callback( const xbee_cmd_response_t FAR *response)
[in]contextContext (or "userdata") value to pass to the callback along with the AT Command response when it arrives. Should be set to NULL if not used.
Return values
0callback set
-EINVALhandle is not valid
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_send()

References _xbee_cmd_handle_to_address(), EINVAL, and FAR.

Referenced by xbee_cmd_list_execute().

int xbee_cmd_set_command ( int16_t  handle,
const char FAR  command[3] 
)

Change the command associated with a request.

Parameters
[in]handlehandle to the request, as returned by xbee_cmd_create()
[in]commandtwo-letter AT Command to send (e.g., "VR", "NI", etc.)
Return values
0command changed
-EINVALhandle is not valid
See also
xbee_cmd_create(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_send()

References _xbee_cmd_handle_to_address(), EINVAL, and FAR.

Referenced by _xbee_cmd_issue_list().

int xbee_cmd_set_flags ( int16_t  handle,
uint16_t  flags 
)

Set the flags for a given AT Command request.

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]flagsOne or more of the following:
  • XBEE_CMD_FLAG_QUEUE_CHANGE don't apply changes until ATAC or another command without this flag is sent
Return values
0flags set
-EINVALhandle is not valid
See also
xbee_cmd_clear_flags

References _xbee_cmd_handle_to_address(), EINVAL, FAR, and XBEE_CMD_FLAG_USER_MASK.

int xbee_cmd_set_param ( int16_t  handle,
uint32_t  value 
)

Set the parameter (up to 32-bits) for a given AT Command request.

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]valueValue to use as the parameter to the AT Command. For negative values, or values > 0xFFFFFFFF, use xbee_cmd_set_param_bytes(). For string parameters (e.g., for the "NI" command), use xbee_cmd_set_param_str().
Return values
0parameter set
-EINVALhandle is not valid
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_send()

References _xbee_cmd_encode_param(), _xbee_cmd_handle_to_address(), EINVAL, and FAR.

Referenced by _xbee_cmd_issue_list(), xbee_io_configure(), xbee_io_set_digital_output(), and xbee_io_set_options().

int xbee_cmd_set_param_bytes ( int16_t  handle,
const void FAR data,
uint8_t  length 
)

Set the parameter for a given AT Command request to a sequence of bytes.

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]dataPointer to bytes (MSB-first) to copy into request.
[in]lengthNumber of bytes to copy. 0 < length <= XBEE_CMD_MAX_PARAM_LENGTH
Return values
0parameter set
-EINVALhandle or length is not valid
-EMSGSIZElength is greater than XBEE_CMD_MAX_PARAM_LENGTH
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_str(), xbee_cmd_send()

References _xbee_cmd_handle_to_address(), EINVAL, EMSGSIZE, FAR, and XBEE_CMD_MAX_PARAM_LENGTH.

Referenced by _xbee_cmd_issue_list(), and xbee_cmd_set_param_str().

int xbee_cmd_set_param_str ( int16_t  handle,
const char FAR str 
)

Set a string parameter for a given AT Command request (e.g., the "NI" node identifier command).

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]strString to use as the parameter. Must be less than XBEE_CMD_MAX_PARAM_LENGTH characters long.
Return values
0parameter set
-EINVALhandle is not valid
-EMSGSIZEstr is more than XBEE_CMD_MAX_PARAM_LENGTH characters.
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_send()

References EMSGSIZE, XBEE_CMD_MAX_PARAM_LENGTH, and xbee_cmd_set_param_bytes().

Referenced by _xbee_cmd_issue_list().

int xbee_cmd_set_target ( int16_t  handle,
const addr64 FAR ieee,
uint16_t  network_address 
)

Associate a remote XBee device with a given AT Command request.

By default, xbee_cmd_create() configures the request as a local AT Command for the serially-attached XBee module. Use this function to send the command to a remote device.

Parameters
[in]handleHandle to the request, as returned by xbee_cmd_create().
[in]ieeePointer to 64-bit IEEE hardware address of target, or NULL to switch back to the local XBee device.
[in]network_address16-bit network address of target.
Return values
0target set
-EINVALhandle is not valid
-ENOSYSfunction not implemented (XBEE_CMD_DISABLE_REMOTE defined)
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_send()

References _xbee_cmd_encode_param(), _xbee_cmd_handle_to_address(), EINVAL, ENOSYS, FAR, and XBEE_CMD_FLAG_REMOTE.

Referenced by xbee_cmd_list_execute(), xbee_io_configure(), xbee_io_set_digital_output(), and xbee_io_set_options().

int xbee_cmd_simple ( xbee_dev_t xbee,
const char FAR  command[3],
uint32_t  value 
)

Simple interface for sending a command with a parameter to the local XBee without checking for a response.

Parameters
[in]xbeeXBee device to use as the target.
[in]commandTwo-letter AT Command to send (e.g., "ID", "CH", etc.).
[in]valueValue to use as the parameter to the AT Command.
Return values
0command sent
-EINVALan invalid parameter was passed to the function
-EBUSYtransmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal).
See also
xbee_cmd_create(), xbee_cmd_set_command(), xbee_cmd_set_callback(), xbee_cmd_set_target(), xbee_cmd_set_param(), xbee_cmd_set_param_bytes(), xbee_cmd_set_param_str(), xbee_cmd_execute()

References _xbee_cmd_encode_param(), PRIu32, PRIx32, XBEE_FRAME_LOCAL_AT_CMD, and xbee_frame_write().

Referenced by xbee_identify().

int xbee_cmd_tick ( void  )
void xbee_identify ( xbee_dev_t xbee,
bool_t  identify 
)

Programs with the ZCL Identify Server Cluster can call this function in their main loop to have the XBee module's association LED flash fast (100ms cycle) when in Identify Mode.

Parameters
[in]xbeedevice to identify
[in]identifyTRUE if XBee should be in identify mode
See also
xbee_zcl_identify, zcl_identify_isactive, ZCL_CLUST_ENTRY_IDENTIFY_SERVER

References xbee_cmd_simple().

Variable Documentation

const xbee_atcmd_reg_t _xbee_atcmd_query_regs[]
Initial value:
= {
XBEE_ATCMD_REG( 'H', 'V', XBEE_CLT_COPY_BE, xbee_dev_t, hardware_version),
XBEE_ATCMD_REG( 'H', 'S', XBEE_CLT_COPY_BE, xbee_dev_t, hardware_series),
XBEE_ATCMD_REG( 'V', 'R', XBEE_CLT_COPY_BE, xbee_dev_t, firmware_version),
XBEE_ATCMD_REG( 'S', 'H', XBEE_CLT_COPY_PAD_LEFT, xbee_dev_t, wpan_dev.address.ieee.l[0]),
XBEE_ATCMD_REG( 'S', 'L', XBEE_CLT_COPY_PAD_LEFT, xbee_dev_t, wpan_dev.address.ieee.l[1]),
XBEE_ATCMD_REG_CB( 'E', 'O', _xbee_cmd_query_handle_eo, 0),
XBEE_ATCMD_REG_CB( 'A', 'I', _xbee_cmd_query_handle_ai, 0),
XBEE_ATCMD_REG( 'N', 'P', XBEE_CLT_COPY_BE, xbee_dev_t, wpan_dev.payload),
XBEE_ATCMD_REG( 'M', 'Y', XBEE_CLT_COPY_BE, xbee_dev_t, wpan_dev.address.network),
}
Copy response data byte-for-byte to base struct,.
Definition: atcmd.h:465
Copy response, changing expected big-endian to host byte order, and store in base struct...
Definition: atcmd.h:469
#define XBEE_ATCMD_REG(c1, c2, type, obj, field)
Macro used in creating command list tables.
Definition: atcmd.h:540
Definition: device.h:361
#define XBEE_ATCMD_REG_CB(c1, c2, cb, flags)
Macro used in creating command list tables.
Definition: atcmd.h:557

List of XBee registers to query at startup; used to learn about the attached XBee module.