XBee Firmware Library  1.6.0
Data Structures | Typedefs | Enumerations | Functions | Variables
atcmd.h File Reference

Data Structures

union  xbee_at_cmd
 
struct  xbee_atcmd_reg_t
 Entry for table of XBee registers to query at startup. More...
 
struct  xbee_cmd_request
 
struct  xbee_cmd_response
 
struct  xbee_command_list_context_t
 Context data passed to command list processor. More...
 
union  xbee_frame_at_response
 Useful typedef for casting either a local or remote response frame. More...
 
union  xbee_header_at_request
 Useful typedef to create either a local or remote request frame. More...
 

Typedefs

typedef union xbee_at_cmd xbee_at_cmd_t
 
typedef struct xbee_atcmd_reg_t xbee_atcmd_reg_t
 Entry for table of XBee registers to query at startup. More...
 
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 struct xbee_cmd_request xbee_cmd_request_t
 
typedef struct xbee_cmd_response xbee_cmd_response_t
 
typedef struct xbee_command_list_context_t xbee_command_list_context_t
 Context data passed to command list processor. 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...
 
typedef union xbee_frame_at_response xbee_frame_at_response_t
 Useful typedef for casting either a local or remote response frame. More...
 
typedef PACKED_STRUCT xbee_frame_local_at_resp
 Response to an AT Command sent to the local serially-connected XBee. More...
 
typedef PACKED_STRUCT xbee_frame_remote_at_resp
 Response to an AT Command sent to a remote XBee. More...
 
typedef union xbee_header_at_request xbee_header_at_request_t
 Useful typedef to create either a local or remote request frame. More...
 
typedef PACKED_STRUCT xbee_header_local_at_req
 Header for AT Commands sent to the local (serially-attached) XBee. More...
 
typedef PACKED_STRUCT xbee_header_local_at_resp
 
typedef PACKED_STRUCT xbee_header_remote_at_req
 Header to AT Commands sent to a remote XBee on the network. More...
 
typedef PACKED_STRUCT xbee_header_remote_at_resp
 

Enumerations

enum  xbee_at_resp_status {
  XBEE_AT_RESP_STATUS_MASK = 0x0F, XBEE_AT_RESP_SUCCESS = 0, XBEE_AT_RESP_ERROR = 1, XBEE_AT_RESP_BAD_COMMAND = 2,
  XBEE_AT_RESP_BAD_PARAMETER = 3, XBEE_AT_RESP_TX_FAIL = 4, XBEE_AT_RESP_ATND_RSSI_INVALID = 0x40
}
 
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_BE, XBEE_CLT_SET,
  XBEE_CLT_SET_STR, XBEE_CLT_SET_BE, XBEE_CLT_SET_8, XBEE_CLT_LAST
}
 

Functions

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)
 
int _xbee_cmd_modem_status (xbee_dev_t *xbee, const void FAR *payload, uint16_t length, void FAR *context)
 
int _xbee_cmd_release_request (xbee_cmd_request_t FAR *request)
 
int xbee_cmd_clear_flags (int16_t handle, uint16_t flags)
 Clear the flags for a given AT Command request. More...
 
int16_t xbee_cmd_create (xbee_dev_t *xbee, const char FAR command[3])
 Allocate an AT Command request. 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_init_device (xbee_dev_t *xbee)
 Initialize the AT Command layer for an XBee device. More...
 
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_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...
 
int xbee_cmd_release_handle (int16_t handle)
 Release an entry from the request table by marking it as available. More...
 
int xbee_cmd_send (int16_t handle)
 Send an AT Command to a local or remote XBee device. 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_command (int16_t handle, const char FAR command[3])
 Change the command associated with a 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_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_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. 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_tick (void)
 This function should be called periodically (at least every few seconds) to expire old entries from the AT Command Request table. 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

xbee_at_cmd_t command
 two-character AT Command More...
 
uint8_t frame_id
 1 to 255, or 0 to suppress the Transmit Status response More...
 
addr64 ieee_address
 64-bit IEEE address (big-endian) of target More...
 
uint16_t network_address_be
 16-bit network address (big-endian) of target More...
 
uint8_t options
 Options byte (see XBEE_REMOTE_AT_OPT_* macros) More...
 
uint8_t status
 
uint8_t value [1]
 First byte of multi-byte value. More...
 
FAR xbee_cmd_request_t xbee_cmd_request_table [XBEE_CMD_REQUEST_TABLESIZE]
 Table used to keep track of outstanding requests. More...
 
 xbee_frame_local_at_resp_t
 
 xbee_frame_remote_at_resp_t
 
 xbee_header_local_at_req_t
 
 xbee_header_local_at_resp_t
 
 xbee_header_remote_at_req_t
 
 xbee_header_remote_at_resp_t
 

Detailed Description

Sending AT command requests and processing the responses.