Digi XBee(R) ANSI C Host Library
|
Files | |
file | zcl_identify.h |
Header for implementation of the ZigBee Identify Cluster (ZCL Spec section 3.5). | |
file | zcl_identify.c |
Server code to implement the ZigBee Identify Cluster (ZCL Spec section 3.5). | |
Macros | |
#define | ZCL_IDENTIFY_ATTR_IDENTIFY_TIME 0x0000 |
3.5.2.2, IdentifyTime Attribute | |
#define | ZCL_IDENTIFY_CMD_IDENTIFY 0x00 |
3.5.2.3.1, Identify Command | |
#define | ZCL_IDENTIFY_CMD_QUERY 0x01 |
3.5.2.3.2, Identify Query Command | |
#define | ZCL_IDENTIFY_CMD_QUERY_RESPONSE 0x00 |
3.5.2.4.1, Identify Query Response Command | |
#define | ZCL_CLUST_ENTRY_IDENTIFY_SERVER |
Macro to add an Identify Server cluster to an endpoint's cluster table. More... | |
Functions | |
int | zcl_identify_command (const wpan_envelope_t FAR *envelope, void FAR *context) |
Handler for ZCL Identify Server Commands (Identify, IdentifyQuery). More... | |
uint16_t | zcl_identify_isactive (void) |
Used by main program to see if a device is in "Identification mode". More... | |
int | _zcl_identify_time_set (const zcl_attribute_full_t FAR *attribute, zcl_attribute_write_rec_t *rec) |
Function registered to ZCL_IDENTIFY_ATTR_IDENTIFY_TIME attribute of Identify Cluster. More... | |
uint_fast8_t | _zcl_identify_time_get (const zcl_attribute_full_t FAR *attribute) |
Function registered to ZCL_IDENTIFY_ATTR_IDENTIFY_TIME attribute of Identify Cluster and called to refresh the IdentifyTime attribute. More... | |
Variables | |
const zcl_attribute_tree_t | zcl_identify_attribute_tree [] |
uint16_t | zcl_identify_time = 0 |
Private variable for tracking amount of "Identification mode" time left. | |
uint32_t | zcl_identify_end = 0 |
Private variable for tracking value of xbee_seconds_timer() that "Idenfication mode" should end. More... | |
struct { | |
zcl_attribute_full_t identify_time | |
uint16_t end_of_list | |
} | zcl_identify_attr |
Standard attribute list for the Identify Server Cluster. More... | |
const zcl_attribute_tree_t | zcl_identify_attribute_tree [] |
#define ZCL_CLUST_ENTRY_IDENTIFY_SERVER |
Macro to add an Identify Server cluster to an endpoint's cluster table.
uint_fast8_t _zcl_identify_time_get | ( | const zcl_attribute_full_t FAR * | attribute | ) |
Function registered to ZCL_IDENTIFY_ATTR_IDENTIFY_TIME attribute of Identify Cluster and called to refresh the IdentifyTime attribute.
See zcl_attribute_update_fn() for calling convention.
References _zcl_identify_time_set(), XBEE_UNUSED_PARAMETER, ZCL_ATTRIB_FLAG_FULL, ZCL_ATTRIBUTE_END_OF_LIST, zcl_identify_attr, ZCL_IDENTIFY_ATTR_IDENTIFY_TIME, zcl_identify_isactive(), and zcl_identify_time.
Referenced by _zcl_identify_time_set(), and zcl_identify_command().
int _zcl_identify_time_set | ( | const zcl_attribute_full_t FAR * | attribute, |
zcl_attribute_write_rec_t * | rec | ||
) |
Function registered to ZCL_IDENTIFY_ATTR_IDENTIFY_TIME attribute of Identify Cluster.
Responsible for updating the IdentifyTime attribute, and also for determining when identify mode should end.
[in] | attribute | ignored; assumed to point to zcl_identify_time |
[in,out] | rec | value from write request or NULL to update the time when identify mode should end (used by the Identify cluster command). |
See zcl_attribute_write_fn() for calling convention.
References _zcl_identify_time_get(), FAR, zcl_attribute_write_rec_t::flags, ZCL_ATTR_WRITE_FLAG_ASSIGN, zcl_decode_attribute(), zcl_identify_end, and zcl_identify_time.
Referenced by _zcl_identify_time_get(), zcl_identify_command(), and zcl_identify_isactive().
int zcl_identify_command | ( | const wpan_envelope_t FAR * | envelope, |
void FAR * | context | ||
) |
Handler for ZCL Identify Server Commands (Identify, IdentifyQuery).
Used in the #ZCL_CLUST_IDENTIFY cluster entry for an endpoint.
[in] | envelope | envelope from received message |
[in] | context | pointer to attribute list for cluster (typically passed in via endpoint dispatcher) |
0 | command was processed, including sending a possible Identify Query Response |
!0 | error sending response or processing command |
References _zcl_identify_time_get(), _zcl_identify_time_set(), zcl_command_t::command, zcl_command_t::frame_control, hex_dump(), HEX_DUMP_FLAG_TAB, htole16, le16toh, zcl_command_t::length, zcl_build_header(), ZCL_CMD_MATCH, zcl_command_build(), zcl_default_response(), zcl_general_command(), ZCL_IDENTIFY_CMD_IDENTIFY, ZCL_IDENTIFY_CMD_QUERY, ZCL_IDENTIFY_CMD_QUERY_RESPONSE, zcl_identify_time, zcl_command_t::zcl_payload, and zcl_send_response().
uint16_t zcl_identify_isactive | ( | void | ) |
Used by main program to see if a device is in "Identification mode".
>0 | Number of seconds of "Identification mode" left. |
0 | Device is not in "Identification mode". |
References _zcl_identify_time_set(), FAR, zcl_identify_end, and zcl_identify_time.
Referenced by _zcl_identify_time_get().
const { ... } zcl_identify_attr |
Standard attribute list for the Identify Server Cluster.
Referenced by _zcl_identify_time_get().
const zcl_attribute_tree_t zcl_identify_attribute_tree[] |
uint32_t zcl_identify_end = 0 |
Private variable for tracking value of xbee_seconds_timer() that "Idenfication mode" should end.
Referenced by _zcl_identify_time_set(), and zcl_identify_isactive().