63 #define _SXA_CACHED_PREFIX_SIZE (sizeof(sxa_cache_flags_t)) 103 typedef XBEE_PACKED(,
116 #define _SXA_CACHED_STRING(name, len) \ 117 XBEE_PACKED(, { sxa_cache_flags_t flags; uint8_t value[len+1]; }) name 124 #define _SXA_CACHED_BIN(name, len) \ 125 XBEE_PACKED(, { sxa_cache_flags_t flags; uint8_t value[len]; }) name 189 #define ZB_CAP_ADV_ADDR 0x00000001 192 #define ZB_CAP_ZDO 0x00000002 196 #define ZB_CAP_REMOTE_DDO 0x00000004 199 #define ZB_CAP_GW_FW 0x00000008 202 #define ZB_CAP_REMOTE_FW 0x00000010 205 #define ZB_CAP_ZIGBEE 0x00000020 208 #define ZB_CAP_ZBPRO 0x00000040 211 #define ZB_CAP_DIGIMESH 0x00000080 214 #define ZB_CAP_CHILDREN 0x00000100 217 #define ZB_CAP_SE 0x00000200 292 #ifndef _SXA_MAX_QUEUED 293 #define _SXA_MAX_QUEUED 100 340 #define XBEE_ATAO_NOT_SUPPORTED 0xFF 349 #define MS_MOD_UNSPEC 0x00000000 // Unspecified 350 #define MS_MOD_SERIES1 0x00010000 // 802.15.4 or ZigBee (Freescale) 351 #define MS_MOD_ZNET25 0x00020000 // ZNet 2.5 (Ember) 352 #define MS_MOD_ZB 0x00030000 // ZB/SE (Ember) 353 #define MS_MOD_XBEE900 0x00040000 // XBee DigiMesh 900 354 #define MS_MOD_XBEE24 0x00050000 // XBee DigiMesh 2.4 355 #define MS_MOD_XBEE868 0x00060000 // XBee 868 356 #define MS_MOD_XBEE900DP 0x00070000 // XBee DP 900 357 #define MS_MOD_ZB_S2C 0x000a0000 // ZB/SE on S2C (Ember EM357) 359 #define MS_MOD_MIN MS_MOD_SERIES1 360 #define MS_MOD_MAX MS_MOD_ZB_S2C 487 void _sxa_update_io_config_group(
490 void _sxa_process_version_info(
500 extern int sxa_table_count;
508 void sxa_node_table_dump(
void);
510 #define sxa_list_head() sxa_table 512 #define sxa_list_count() sxa_table_count 513 int (sxa_list_count)(void);
514 #define sxa_xbee(s) ((s)->xbee) 516 #define sxa_wpan_address(s) ((s)->addr_ptr) 519 int sxa_get_digital_input(
const sxa_node_t FAR *sxa, uint_fast8_t index);
520 int sxa_get_digital_output(
const sxa_node_t FAR *sxa, uint_fast8_t index);
562 #define XBEE_FRAME_HANDLE_ND_RESPONSE \ 563 { XBEE_FRAME_LOCAL_AT_RESPONSE, 0, _sxa_disc_atnd_response, NULL }, \ 564 { XBEE_FRAME_NODE_ID, 0, _sxa_disc_handle_frame_0x95, NULL } 566 #define XBEE_DISC_CLIENT_CLUST_ENTRY \ 567 { DIGI_CLUST_NODEID_MESSAGE, _sxa_disc_cluster_handler, NULL, \ 568 WPAN_CLUST_FLAG_INPUT | WPAN_CLUST_FLAG_NOT_ZCL } 576 const void FAR *raw,
int length);
577 int _sxa_io_response_handler(
xbee_dev_t *xbee,
const void FAR *raw,
581 int _sxa_remote_is_cmd_response_handler(
xbee_dev_t *xbee,
const void FAR *raw,
583 int _sxa_local_is_cmd_response_handler(
xbee_dev_t *xbee,
const void FAR *raw,
612 #define XBEE_FRAME_HANDLE_IS_RESPONSE \ 613 { XBEE_FRAME_REMOTE_AT_RESPONSE, 0, _sxa_remote_is_cmd_response_handler, NULL }, \ 614 { XBEE_FRAME_LOCAL_AT_RESPONSE, 0, _sxa_local_is_cmd_response_handler, NULL }, \ 615 { XBEE_FRAME_IO_RESPONSE, 0, _sxa_io_response_handler, NULL } 617 #define XBEE_IO_CLIENT_CLUST_ENTRY \ 618 {DIGI_CLUST_IODATA, _sxa_io_cluster_handler, NULL, \ 619 WPAN_CLUST_FLAG_INPUT | WPAN_CLUST_FLAG_NOT_ZCL} int _sxa_io_process_response(const addr64 FAR *ieee_be, const void FAR *raw, int length)
Function shared by multiple functions that process I/O sample messages (0x92 frames and ATIS response...
Definition: xbee_sxa.c:652
unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
uint8_t ao
Value of XBee module's AO (API options) register.
Definition: sxa.h:339
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).
Definition: sxa.h:303
uint32_t caps
Capabilites bitmask (ZB_CAP_*)
Definition: sxa.h:278
int _sxa_disc_atnd_response(xbee_dev_t *xbee, const void FAR *raw, uint16_t length, void FAR *context)
Frame handler for processing AT Command Response frames.
Definition: xbee_sxa.c:366
const xbee_atcmd_reg_t FAR * get_list
If not NULL, is a command list used to update all cached values in the group.
Definition: sxa.h:166
Dest addr: DH,DL.
Definition: sxa.h:475
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
addr64 dest_addr
Value of DH and DL registers, combined into a single logical field.
Definition: sxa.h:367
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
Entry for table of XBee registers to query at startup.
Definition: atcmd.h:493
sxa_cache_flags_t device_info_cf
Cache flags for device info group.
Definition: sxa.h:336
xbee_node_id_t id
Instance of basic node addressing and identification info.
Definition: sxa.h:279
xbee_dev_t * xbee
Local device through which discovered.
Definition: sxa.h:275
Device information: HV, VR and DD.
Definition: sxa.h:472
Note that Node Discovery isn't supported on XBee Smart Energy firmware.
#define _SXA_CACHED_STRING(name, len)
Cached string register value.
Definition: sxa.h:116
xbee_io_t io
I/O shadow state and configuration.
Definition: sxa.h:332
#define _SXA_CACHED_BIN(name, len)
Cached binary register value.
Definition: sxa.h:124
uint32_t stamp
Time stamp of last received message from xbee_seconds_timer().
Definition: sxa.h:276
uint8_t sxa_cache_flags_t
Definition: sxa.h:39
wpan_address_t address
IEEE and network addresses (for remote devices, else N/A)
Definition: sxa.h:286
struct @9 sxa_cached_addr64
Cached extended address register value.
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
This structure and the attendant functions provide a useful layer for Rabbit applications who wish to...
Definition: sxa.h:267
int _sxa_disc_handle_frame_0x95(xbee_dev_t *xbee, const void FAR *raw, uint16_t length, void FAR *context)
Frame handler for processing Node Identification Indicator (0x95) frames.
Definition: xbee_sxa.c:400
Miscellaneous stuff (one of the sxa_cached_* sub-structures) - these have their own individual cache ...
Definition: sxa.h:482
Cached register group value.
Definition: sxa.h:158
uint32_t firmware_version
Value of XBee module's VR register (4-bytes on some devices)
Definition: sxa.h:344
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
void(* sxa_cache_upd_fn)(struct sxa_node_t FAR *sxa, const struct sxa_cached_group_t FAR *cgroup)
Function registered for cache group update post-processing.
Definition: sxa.h:139
int _sxa_disc_cluster_handler(const wpan_envelope_t FAR *envelope, void FAR *context)
Cluster handler for "Digi Node Identification" cluster.
Definition: xbee_sxa.c:621
Single structure to hold an 802.15.4 device's 64-bit IEEE/MAC address and 16-bit network address...
Definition: types.h:98
struct sxa_node_t FAR * next
Next in linked list (or NULL)
Definition: sxa.h:269
Definition: reg_descr.h:50
struct sxa_node_t FAR * next_local
Next in linked list of local devices (or NULL)
Definition: sxa.h:271
int _sxa_disc_process_node_data(xbee_dev_t *xbee, const void FAR *raw, int length)
Function shared by multiple functions that process Node Identification Messages (0x95 frames and ATND...
Definition: xbee_sxa.c:311
sxa_cache_flags_t dhdl_cf
Cache flags for DH/DL (destination address) group.
Definition: sxa.h:364
uint32_t dd
Value of XBee module's DD register (device type)
Definition: sxa.h:346
uint16_t nqueued
Cached register value handling: number of entries in .queued Range [0.._SXA_MAX_QUEUED].
Definition: sxa.h:291
struct @5 sxa_cached_t
Cached generic register value (no data)
Structure used to pass AT Command responses to registered callback handlers.
Definition: atcmd.h:74
struct @7 sxa_cached_uint16_t
Cached uint16_t register value.
parsed Node ID in host-byte-order and fixed length fields
Definition: discovery.h:126
struct @8 sxa_cached_uint32_t
Cached uint32_t register value.
Sending AT command requests and processing the responses.
short int16_t
16-bit signed integer
Definition: platform_config.h:40
wpan_address_t FAR * addr_ptr
Either NULL (for local device) or points to next field.
Definition: sxa.h:284
Typedef used to hold a 64-bit IEEE address, represented as 8 bytes, 4 16-bit values or 2 32-bit value...
Definition: types.h:34
xbee_io_type
Configuration type for XBee built-in I/Os.
Definition: io.h:128
sxa_cache_flags_t io_config_cf
Cache flags for I/O configuration group.
Definition: sxa.h:329
int16_t index
Index (order of discovery: 0, 1, 2...)
Definition: sxa.h:274
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
struct @6 sxa_cached_uint8_t
Cached uint8_t register value.
sxa_cache_flags_t node_id_cf
Cache flags for node_id group.
Definition: sxa.h:326
Header for XBee register descriptors.
I/O configuration: ATD0 etc., in .io field.
Definition: sxa.h:470
Information on each endpoint on this device.
Definition: aps.h:252
uint16_t flags_offs
Offset (within sxa_node_t) of cache group status flags (_SXA_CACHED_OK etc.) This field is zero to in...
Definition: sxa.h:164
uint16_t id
Arbitrary numeric ID of this group (see SXA_CACHED_NODE_ID etc.)
Definition: sxa.h:161
The "envelope" is used to gather all necessary information about a given frame on the network...
Definition: aps.h:40
xbee_io_digital_output_state
Digital output state for XBee built-in I/Os configured as outputs.
Definition: io.h:163
Dummy for when no caching required.
Definition: sxa.h:465
Got .id.node_id (normally obtained by initial discovery, however app can explicitly refresh if desire...
Definition: sxa.h:468
sxa_cache_upd_fn get_fn
If not NULL, is a function to call (after get_list, if any) in order to perform any necessary post pr...
Definition: sxa.h:169