XBee Firmware Library
1.6.0
|
Files | |
file | atcmd.h |
file | xbee_atcmd.c |
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 | |
uint8_t | _xbee_cmd_encode_param (void FAR *buffer, uint32_t value) |
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) |
_xbee_atcmd_debug int | _xbee_cmd_issue_list (xbee_dev_t *xbee, xbee_command_list_context_t FAR *clc, const xbee_cmd_response_t FAR *response) |
_xbee_atcmd_debug int | _xbee_cmd_list_callback (const xbee_cmd_response_t FAR *response) |
int | _xbee_cmd_modem_status (xbee_dev_t *xbee, const void FAR *payload, uint16_t length, void FAR *context) |
_xbee_atcmd_debug void | _xbee_cmd_query_handle_ai (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base) |
_xbee_atcmd_debug void | _xbee_cmd_query_handle_end (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base) |
_xbee_atcmd_debug void | _xbee_cmd_query_handle_eo (const xbee_cmd_response_t FAR *response, const struct xbee_atcmd_reg_t FAR *reg, void FAR *base) |
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 | |
const xbee_atcmd_reg_t | _xbee_atcmd_query_regs [] |
xbee_command_list_context_t | _xbee_atcmd_query_regs_head |
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... | |
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 | |
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.
typedef union xbee_at_cmd xbee_at_cmd_t |
Datatype used for passing and storing XBee AT Commands. Allows printing (e.g., printf( "%.2s", foo.str)), easy copying (bar.w = foo.w) and easy comparison (bar.w == foo.w).
typedef struct xbee_atcmd_reg_t xbee_atcmd_reg_t |
Entry for table of XBee registers to query at startup.
Use #_XBEE_ATCMD_REG() to populate _xbee_atcmd_query_regs[].
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.
[in] | response | response received for AT Command |
XBEE_ATCMD_DONE | done with the request handle |
XBEE_ATCMD_REUSE | more responses are expected, or the request handle will be reused |
typedef struct xbee_cmd_request xbee_cmd_request_t |
This structure is used to keep track of outstanding local and remote AT requests.
typedef struct xbee_cmd_response xbee_cmd_response_t |
Structure used to pass AT Command responses to registered callback handlers. This is used for both local and remote command responses.
typedef struct xbee_command_list_context_t xbee_command_list_context_t |
Context data passed to command list processor.
This struct (or another struct with this as its first member) must be used as the context for the command list processor.
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.
[in] | response | response 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] | reg | Table element for this command. Usually, the callback will dereference reg->context to find any required auxiliary data for processing this command. |
[in,out] | base | Base address of structure to populate with response value (typical use). |
typedef union xbee_frame_at_response xbee_frame_at_response_t |
Useful typedef for casting either a local or remote response frame.
Response to an AT Command sent to the local serially-connected XBee.
Response to an AT Command sent to a remote XBee.
typedef union xbee_header_at_request xbee_header_at_request_t |
Useful typedef to create either a local or remote request frame.
enum xbee_at_resp_status |
Possible values of status
byte in xbee_header_local_at_resp_t and xbee_frame_local_at_resp_t.
Status codes for xbee_cmd_list_status()
We force these to be -Exxx codes (or 0).
Enumerator | |
---|---|
XBEE_COMMAND_LIST_RUNNING | |
XBEE_COMMAND_LIST_DONE | |
XBEE_COMMAND_LIST_TIMEOUT | |
XBEE_COMMAND_LIST_ERROR |
Enumerator | |
---|---|
XBEE_CLT_NONE |
No default action. Often used for callbacks. |
XBEE_CLT_COPY |
Copy response data byte-for-byte to base struct. |
XBEE_CLT_COPY_BE |
Data must be 1,2 or 4 bytes, assumed unsigned. Copy response, changing expected big-endian to host byte order, and store in base struct. |
XBEE_CLT_SET |
with binary data copied byte-for-byte. Use data in base struct as parameter for command, |
XBEE_CLT_SET_STR |
with null-terminated string data copied byte-for-byte. Use data in base struct as parameter for command, |
XBEE_CLT_SET_BE |
Data must be 1,2 or 4 bytes, assumed unsigned. Use data in base struct as parameter for command, changing host byte order to big-endian. |
XBEE_CLT_SET_8 |
field of the xbee_atcmd_reg_t entry. No response. Set value to immediate 8-bit constant in .bytes |
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). |
_xbee_atcmd_debug int _xbee_cmd_handle_response | ( | xbee_dev_t * | xbee, |
const void FAR * | rawframe, | ||
uint16_t | length, | ||
void FAR * | context | ||
) |
_xbee_atcmd_debug xbee_cmd_request_t FAR * _xbee_cmd_handle_to_address | ( | int16_t | handle | ) |
_xbee_atcmd_debug int _xbee_cmd_issue_list | ( | xbee_dev_t * | xbee, |
xbee_command_list_context_t FAR * | clc, | ||
const xbee_cmd_response_t FAR * | response | ||
) |
_xbee_atcmd_debug int _xbee_cmd_list_callback | ( | const xbee_cmd_response_t FAR * | response | ) |
_xbee_atcmd_debug int _xbee_cmd_modem_status | ( | xbee_dev_t * | xbee, |
const void FAR * | payload, | ||
uint16_t | length, | ||
void FAR * | context | ||
) |
_xbee_atcmd_debug void _xbee_cmd_query_handle_ai | ( | const xbee_cmd_response_t FAR * | response, |
const struct xbee_atcmd_reg_t FAR * | reg, | ||
void FAR * | base | ||
) |
_xbee_atcmd_debug void _xbee_cmd_query_handle_end | ( | const xbee_cmd_response_t FAR * | response, |
const struct xbee_atcmd_reg_t FAR * | reg, | ||
void FAR * | base | ||
) |
_xbee_atcmd_debug void _xbee_cmd_query_handle_eo | ( | const xbee_cmd_response_t FAR * | response, |
const struct xbee_atcmd_reg_t FAR * | reg, | ||
void FAR * | base | ||
) |
_xbee_atcmd_debug int _xbee_cmd_release_request | ( | xbee_cmd_request_t FAR * | request | ) |
Clear the flags for a given AT Command request.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | flags | One or more of the following:
|
0 | flags cleared |
-EINVAL | handle is not valid |
_xbee_atcmd_debug int16_t xbee_cmd_create | ( | xbee_dev_t * | xbee, |
const char FAR | command[3] | ||
) |
Allocate an AT Command request.
[in] | xbee | XBee 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] | command | Two-letter AT Command to send (e.g., "VR", "NI", etc.). |
>0 | a "handle" to a request that can be built up and sent to a local (serially-attached) or remote XBee module. |
-ENOSPC | the AT command table is full (increase the compile-time macro XBEE_CMD_REQUEST_TABLESIZE) |
-EINVAL | an invalid parameter was passed to the function |
_xbee_atcmd_debug 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.
[in] | xbee | XBee device to use as the target. |
[in] | command | Two-letter AT Command to send (e.g., "ID", "CH", etc.). |
[in] | data | Optional big-endian (MSB-first) value to assign to command. Use NULL if command doesn't take a parameter. |
[in] | length | Number of bytes in data; ignored if data is NULL. |
0 | command sent |
-EINVAL | an invalid parameter was passed to the function |
-EBUSY | transmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal). |
_xbee_atcmd_debug 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.
[in] | xbee | XBee 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. |
0 | the XBee device was successfully configured to send and receive AT commands |
-EINVAL | an invalid parameter was passed to the function |
_xbee_atcmd_debug 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.
[in,out] | xbee | Device to execute commands |
[out] | clc | List head to set up. This must be static since callback functions access it asynchronously. |
[in] | list | First 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] | base | Base address of a structure to fill in with command results or as a source of values to set. |
[in] | address | Remote address, or NULL if local device. |
0 | started sending commands from the list |
-ENOSPC | the AT command table is full (increase the compile-time macro XBEE_CMD_REQUEST_TABLESIZE) |
-EINVAL | an invalid parameter was passed to the function |
enum xbee_command_list_status() xbee_cmd_list_status | ( | xbee_command_list_context_t FAR * | clc | ) |
Determine status of command list execution.
[in] | clc | List head passed to xbee_cmd_list_execute(). |
XBEE_COMMAND_LIST_RUNNING | currently executing commands |
XBEE_COMMAND_LIST_DONE | successfully completed |
XBEE_COMMAND_LIST_TIMEOUT | timed out |
XBEE_COMMAND_LIST_ERROR | completed with error(s) |
_xbee_atcmd_debug 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.
[in,out] | xbee | XBee device to query. |
[in] | refresh | if non-zero, just refresh the volatile values (e.g., network settings, as opposed to device serial number) |
0 | Started querying device. |
-EBUSY | Transmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal). |
_xbee_atcmd_debug int xbee_cmd_query_status | ( | xbee_dev_t * | xbee | ) |
Check the status of querying an XBee device, as initiated by xbee_cmd_query_device().
[in] | xbee | device to check |
0 | query completed |
-EINVAL | xbee is NULL |
-EBUSY | query underway |
-ETIMEDOUT | query timed out |
-EIO | halted, but query may not have completed (unexpected response) |
_xbee_atcmd_debug int xbee_cmd_release_handle | ( | int16_t | handle | ) |
Release an entry from the request table by marking it as available.
[in] | handle | handle to the request (as returned by xbee_cmd_create) |
0 | request freed |
-EINVAL | handle is not valid |
_xbee_atcmd_debug int xbee_cmd_send | ( | int16_t | handle | ) |
Send an AT Command to a local or remote XBee device.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
0 | frame sent |
-EINVAL | handle is not valid |
-EBUSY | transmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal). |
_xbee_atcmd_debug 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.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | callback | Callback 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). |
[in] | context | Context (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. |
0 | callback set |
-EINVAL | handle is not valid |
_xbee_atcmd_debug int xbee_cmd_set_command | ( | int16_t | handle, |
const char FAR | command[3] | ||
) |
Change the command associated with a request.
[in] | handle | handle to the request, as returned by xbee_cmd_create() |
[in] | command | two-letter AT Command to send (e.g., "VR", "NI", etc.) |
0 | command changed |
-EINVAL | handle is not valid |
Set the flags for a given AT Command request.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | flags | One or more of the following:
|
0 | flags set |
-EINVAL | handle is not valid |
Set the parameter (up to 32-bits) for a given AT Command request.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | value | Value 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(). |
0 | parameter set |
-EINVAL | handle is not valid |
_xbee_atcmd_debug 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.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | data | Pointer to bytes (MSB-first) to copy into request. |
[in] | length | Number of bytes to copy. 0 < length <= #XBEE_CMD_MAX_PARAM_LENGTH |
0 | parameter set |
-EINVAL | handle or length is not valid |
-EMSGSIZE | length is greater than #XBEE_CMD_MAX_PARAM_LENGTH |
_xbee_atcmd_debug 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).
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | str | String to use as the parameter. Must be less than #XBEE_CMD_MAX_PARAM_LENGTH characters long. |
0 | parameter set |
-EINVAL | handle is not valid |
-EMSGSIZE | str is more than #XBEE_CMD_MAX_PARAM_LENGTH characters. |
_xbee_atcmd_debug 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.
[in] | handle | Handle to the request, as returned by xbee_cmd_create(). |
[in] | ieee | Pointer to 64-bit IEEE hardware address of target, or NULL to switch back to the local XBee device.
|
[in] | network | 16-bit network address of target.
|
0 | target set |
-EINVAL | handle is not valid |
-ENOSYS | function not implemented (XBEE_CMD_DISABLE_REMOTE defined) |
_xbee_atcmd_debug 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.
[in] | xbee | XBee device to use as the target. |
[in] | command | Two-letter AT Command to send (e.g., "ID", "CH", etc.). |
[in] | value | Value to use as the parameter to the AT Command. |
0 | command sent |
-EINVAL | an invalid parameter was passed to the function |
-EBUSY | transmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal). |
_xbee_atcmd_debug 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.
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.
[in] | xbee | device to identify |
[in] | identify | TRUE if XBee should be in identify mode |
const xbee_atcmd_reg_t _xbee_atcmd_query_regs[] |
xbee_command_list_context_t _xbee_atcmd_query_regs_head |
uint8_t command |
two-character AT Command
Command from original request.
uint8_t frame_id |
1 to 255, or 0 to suppress the Transmit Status response
ID from request, used to match response to request.
addr64 ieee_address |
64-bit IEEE address (big-endian) of target
64-bit IEEE address (big-endian) of source.
64-bit IEEE address (big-endian) of responder.
uint16_t network_address_be |
16-bit network address (big-endian) of target
16-bit network address (big-endian) of source.
16-bit network address (big-endian) of responder.
uint8_t options |
Options byte (see XBEE_REMOTE_AT_OPT_* macros)
combination of XBEE_TX_OPT_* macros
bitfield, see XBEE_RX_OPT_xxx macros
uint8_t status |
See enum xbee_at_resp_status. Note that DigiMesh uses the upper nibble for additional flags – use XBEE_AT_RESP_STATUS() macro when comparing this field to the xbee_at_resp_status enum.
uint8_t value |
First byte of multi-byte value.
variable length, only if ZCL_STATUS_SUCCESS
FAR xbee_cmd_request_t xbee_cmd_request_table[XBEE_CMD_REQUEST_TABLESIZE] |
Table used to keep track of outstanding requests.
FAR xbee_cmd_request_t xbee_cmd_request_table[XBEE_CMD_REQUEST_TABLESIZE] |
Table used to keep track of outstanding requests.
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 |