Digi XBee(R) ANSI C Host Library
|
This structure and the attendant functions provide a useful layer for Rabbit applications who wish to use a simplified interface to the XBee API. More...
#include "xbee/sxa.h"
Public Member Functions | |
_SXA_CACHED_STRING (command_char, 1) | |
_SXA_CACHED_BIN (ext_pan_id, 8) | |
_SXA_CACHED_BIN (link_key, 16) | |
_SXA_CACHED_BIN (network_key, 16) | |
Data Fields | |
struct sxa_node_t FAR * | next |
Next in linked list (or NULL) | |
struct sxa_node_t FAR * | next_local |
Next in linked list of local devices (or NULL) | |
int16_t | index |
Index (order of discovery: 0, 1, 2...) | |
xbee_dev_t * | xbee |
Local device through which discovered. | |
uint32_t | stamp |
Time stamp of last received message from xbee_seconds_timer(). More... | |
uint32_t | caps |
Capabilites bitmask (ZB_CAP_*) | |
xbee_node_id_t | id |
Instance of basic node addressing and identification info. | |
wpan_address_t FAR * | addr_ptr |
Either NULL (for local device) or points to next field. More... | |
wpan_address_t | address |
IEEE and network addresses (for remote devices, else N/A) | |
uint16_t | nqueued |
Cached register value handling: number of entries in .queued Range [0.._SXA_MAX_QUEUED]. More... | |
const struct _xbee_reg_descr_t FAR *FAR * | queued |
Cached register value handling: list of queued updates. More... | |
uint16_t | q_index |
Cached register value handling: current update (index into .queued) If >= .nqueued, then no current update is being processed, so scan list for next update (if any). More... | |
xbee_atcmd_reg_t | misc_reg [2] |
Cached register value handling: Single entry command list for single register (miscellaneous) updates. More... | |
const sxa_cached_group_t FAR * | groups |
const sxa_cached_group_t FAR * | doing_group |
sxa_cache_flags_t | node_id_cf |
Cache flags for node_id group. | |
sxa_cache_flags_t | io_config_cf |
Cache flags for I/O configuration group. | |
xbee_io_t | io |
I/O shadow state and configuration. More... | |
sxa_cache_flags_t | device_info_cf |
Cache flags for device info group. | |
uint8_t | ao |
Value of XBee module's AO (API options) register. More... | |
uint16_t | hardware_version |
Value of XBee module's HV register. | |
uint32_t | firmware_version |
Value of XBee module's VR register (4-bytes on some devices) | |
uint32_t | dd |
Value of XBee module's DD register (device type) | |
sxa_cache_flags_t | dhdl_cf |
Cache flags for DH/DL (destination address) group. | |
addr64 | dest_addr |
Value of DH and DL registers, combined into a single logical field. More... | |
sxa_cached_uint8_t | aggregation |
sxa_cached_uint8_t | assoc_led |
sxa_cached_uint8_t | beacon_response |
sxa_cached_uint8_t | broadcast_hops |
sxa_cached_uint8_t | cca_threshold |
sxa_cached_uint8_t | channel |
sxa_cached_uint16_t | cluster_id |
sxa_cached_uint16_t | command_timeout |
sxa_cached_uint8_t | coord_assoc |
sxa_cached_uint8_t | coord_enable |
sxa_cached_uint8_t | delay_slots |
sxa_cached_uint8_t | dest_endpoint |
sxa_cached_uint8_t | device_options |
sxa_cached_uint16_t | discover_timeout |
sxa_cached_uint8_t | encrypt_enable |
sxa_cached_uint8_t | encrypt_options |
sxa_cached_uint8_t | end_assoc |
sxa_cached_uint16_t | flow_threshold |
sxa_cached_uint16_t | guard_times |
sxa_cached_uint8_t | hop_sequence |
sxa_cached_addr64 | io_address |
sxa_cached_uint8_t | io_enable |
sxa_cached_uint16_t | initial_pan_id |
sxa_cached_uint8_t | join_time |
sxa_cached_uint8_t | join_notification |
sxa_cached_uint8_t | join_verification |
sxa_cached_uint8_t | mac_mode |
sxa_cached_uint8_t | mac_retries |
sxa_cached_uint8_t | max_hops |
sxa_cached_uint8_t | mesh_retries |
sxa_cached_uint8_t | multi_transmit |
sxa_cached_uint8_t | net_delay_slots |
sxa_cached_uint16_t | network_watchdog |
sxa_cached_uint8_t | packet_timeout |
sxa_cached_uint16_t | pan_id |
sxa_cached_uint16_t | polling_rate |
sxa_cached_uint8_t | power_level |
sxa_cached_uint8_t | power_mode |
sxa_cached_uint8_t | rssi_timer |
sxa_cached_uint16_t | scan_channels |
sxa_cached_uint8_t | scan_duration |
sxa_cached_uint8_t | serial_parity |
sxa_cached_uint32_t | serial_rate |
sxa_cached_uint16_t | sleep_count |
sxa_cached_uint16_t | sleep_disassoc |
sxa_cached_uint8_t | sleep_mode |
sxa_cached_uint8_t | sleep_options |
sxa_cached_uint16_t | sleep_period |
sxa_cached_uint8_t | sleep_sample_rate |
sxa_cached_uint16_t | sleep_time |
sxa_cached_uint16_t | sleep_wake |
sxa_cached_uint8_t | source_endpoint |
sxa_cached_uint8_t | stack_profile |
sxa_cached_uint8_t | stop_bits |
sxa_cached_uint16_t | supply_threshold |
sxa_cached_uint8_t | xbee_retries |
sxa_cached_uint16_t | wake_host_delay |
sxa_cached_uint8_t | zigbee_enable |
sxa_cached_uint8_t | association |
sxa_cached_uint16_t | children |
sxa_cached_uint8_t | max_payload |
sxa_cached_uint16_t | config_code |
sxa_cached_uint8_t | verify_cert |
sxa_cached_uint16_t | supply_voltage |
sxa_cached_uint8_t | temperature |
sxa_cached_uint8_t | duty_cycle |
sxa_cached_uint8_t | rssi |
sxa_cached_uint8_t | tx_power |
sxa_cached_uint8_t | sleep_status |
sxa_cached_uint16_t | sleep_time_op |
sxa_cached_uint16_t | wake_time |
sxa_cached_uint32_t | ack_failures |
sxa_cached_uint32_t | cca_failures |
sxa_cached_uint32_t | good_packets |
sxa_cached_uint32_t | missed_syncs |
sxa_cached_uint32_t | missed_sync_msg |
sxa_cached_uint32_t | rf_errors |
sxa_cached_uint32_t | tx_errors |
This structure and the attendant functions provide a useful layer for Rabbit applications who wish to use a simplified interface to the XBee API.
The Simplified XBee API (SXA) has the following facilities:
The first three items are device-independent. Data streams requires Rabbit-compatible CPUs on both ends.
It is assumed that XBee modules are used. This library depends on proprietary XBee functions, so interoperability with other manufacturers' devices is not expected. In fact, since SXA currently supports only ATND node discovery (DDO) and not ZDO discovery, only XBee devices will show up in the node list. For upward compatibility, code can call sxa_is_digi() to determine whether the node is a 'Digi' (i.e. XBee) device, and thus supports remote AT commands. The .caps field has additional information about node capabilities.
Node discovery is the most important service. Each node is added to a linked list which is dynamically allocated. The application deals with pointers to individual table elements, as returned by table searching API functions. Each new node (identified uniquely by IEEE 64-bit address) has a table entry allocated. The entry is never freed so that applications do not have to be concerned with dangling pointers. The assumption is that the total set of XBee nodes ever discovered (in one power cycle) is bounded to a reasonably small number (maybe in the low hundreds).
Each table entry contains basic addressing data for the node, some of which may be dynamically updated. The IEEE address is guaranteed to be constant. The table entry contains pointers (initially set NULL) which may be set to point to other dynamically allocated information such as I/O configuration. Some of the additional information is used to maintain "cached" settings of remote node configuration, which is necessary to avoid redundant radio traffic. Other information is used to record updated state on the remote device, and to implement scheduling for remote commands.
wpan_address_t FAR* addr_ptr |
Either NULL (for local device) or points to next field.
This is for convenience with functions which take NULL address to indicate the local device.
Referenced by _sxa_disc_handle_frame_0x95().
uint8_t ao |
Value of XBee module's AO (API options) register.
Also sets value 0xFF if the AO command is not supported (fails to read).
addr64 dest_addr |
Value of DH and DL registers, combined into a single logical field.
You always want both, so there is a command list to get them.
xbee_io_t io |
I/O shadow state and configuration.
This contains a CLC which is used for the other queries as well.
xbee_atcmd_reg_t misc_reg[2] |
Cached register value handling: Single entry command list for single register (miscellaneous) updates.
2 elements used because 2nd must terminate the list.
uint16_t nqueued |
Cached register value handling: number of entries in .queued Range [0.._SXA_MAX_QUEUED].
Requests in excess of the maximum will not be queued and the application will need to try again later.
uint16_t q_index |
Cached register value handling: current update (index into .queued) If >= .nqueued, then no current update is being processed, so scan list for next update (if any).
const struct _xbee_reg_descr_t FAR* FAR* queued |
Cached register value handling: list of queued updates.
This may be NULL if there are no outstanding updates. The list is allocated only when being used.
uint32_t stamp |
Time stamp of last received message from xbee_seconds_timer().