Digi XBee(R) ANSI C Host Library
Files | Macros | Functions | Variables

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 []
 

Detailed Description

Macro Definition Documentation

#define ZCL_CLUST_ENTRY_IDENTIFY_SERVER
Value:
{ ZCL_CLUST_IDENTIFY, \
zcl_identify_attribute_tree, \
#define WPAN_CLUST_FLAG_SERVER
alias name for input cluster (uses ZCL terminology)
Definition: aps.h:234
int zcl_identify_command(const wpan_envelope_t FAR *envelope, void FAR *context)
Handler for ZCL Identify Server Commands (Identify, IdentifyQuery).
Definition: zcl_identify.c:181

Macro to add an Identify Server cluster to an endpoint's cluster table.

Function Documentation

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.

Parameters
[in]attributeignored; assumed to point to zcl_identify_time
[in,out]recvalue 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.

Parameters
[in]envelopeenvelope from received message
[in]contextpointer to attribute list for cluster (typically passed in via endpoint dispatcher)
Return values
0command was processed, including sending a possible Identify Query Response
!0error 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".

Return values
>0Number of seconds of "Identification mode" left.
0Device is not in "Identification mode".

References _zcl_identify_time_set(), FAR, zcl_identify_end, and zcl_identify_time.

Referenced by _zcl_identify_time_get().

Variable Documentation

const { ... } zcl_identify_attr
Initial value:
=
{
ZCL_TYPE_UNSIGNED_16BIT,
{ 0 }, { 0 },
}
#define ZCL_IDENTIFY_ATTR_IDENTIFY_TIME
3.5.2.2, IdentifyTime Attribute
Definition: zcl_identify.h:34
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.
Definition: zcl_identify.c:104
#define ZCL_ATTRIB_FLAG_FULL
If set, this is part of a zcl_attribute_full_t structure.
Definition: zcl.h:759
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 re...
Definition: zcl_identify.c:134
uint16_t zcl_identify_time
Private variable for tracking amount of "Identification mode" time left.
Definition: zcl_identify.c:53
#define ZCL_ATTRIBUTE_END_OF_LIST
Attribute ID for end of list marker.
Definition: zcl.h:851

Standard attribute list for the Identify Server Cluster.

Referenced by _zcl_identify_time_get().

const zcl_attribute_tree_t zcl_identify_attribute_tree[]
Initial value:
=
{ { ZCL_MFG_NONE, &zcl_identify_attr.identify_time.base, NULL } }
const struct @30 zcl_identify_attr
Standard attribute list for the Identify Server Cluster.
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().