XBee Firmware Library  1.6.0
Functions | Variables
zigbee_zcl.c File Reference

Functions

int _zcl_discover_attributes (zcl_command_t *cmd)
 
zigbee_zcl_debug int _zcl_encode_array_value (uint8_t FAR *buffer, int16_t bufsize, const zcl_array_t FAR *array)
 
zigbee_zcl_debug int _zcl_encode_struct_value (uint8_t FAR *buffer, int16_t bufsize, const zcl_struct_t FAR *zcl_struct)
 
int _zcl_read_attributes (zcl_command_t *cmd)
 
int _zcl_write_attributes (zcl_command_t *cmd)
 
const zcl_attribute_base_t FAR * zcl_attribute_get_next (const zcl_attribute_base_t FAR *entry)
 Return a pointer to the next attribute entry from an attribute table. More...
 
int zcl_build_header (zcl_header_response_t *rsp, zcl_command_t *cmd)
 Support function to fill in a ZCL response header. More...
 
int zcl_check_minmax (const zcl_attribute_base_t FAR *entry, const uint8_t FAR *buffer_le)
 Checks whether a new value from a Write Attributes command is within the limits specified for a given attribute. More...
 
int zcl_command_build (zcl_command_t *cmd, const wpan_envelope_t FAR *envelope, zcl_attribute_tree_t FAR *tree)
 Parse a ZCL request and store in a zcl_command_t structure with fields in fixed locations (therefore easier to use than the variable-length frame header). More...
 
void zcl_command_dump (const zcl_command_t *cmd)
 Debugging routine that dumps contents of a parsed ZCL command structure to STDOUT. More...
 
uint32_t zcl_convert_24bit (const void FAR *value_le, bool_t extend_sign)
 Convert a 24-bit (3-byte) little-endian value to a 32-bit value in host byte order. More...
 
int zcl_decode_attribute (const zcl_attribute_base_t FAR *entry, zcl_attribute_write_rec_t *rec)
 Decode attribute value from a Write Attribute Request or Read Attribute Response record and optionally write to entry. More...
 
int zcl_default_response (zcl_command_t *request, uint8_t status)
 Send a Default Response (#ZCL_CMD_DEFAULT_RESP) to a given command. More...
 
int zcl_encode_attribute_value (uint8_t FAR *buffer, int16_t bufsize, const zcl_attribute_base_t FAR *entry)
 Format a ZCL attribute's value for a Read Attributes Response or a Write Attributes Request. More...
 
void zcl_envelope_payload_dump (const wpan_envelope_t *envelope)
 Debugging routine that parses an envelope payload as a ZCL command and dumps a parsed copy to STDOUT. More...
 
const zcl_attribute_base_t FAR * zcl_find_attribute (const zcl_attribute_base_t FAR *entry, uint16_t search_id)
 Search the attribute table starting at entry, for attribute ID search_id. More...
 
int zcl_general_command (const wpan_envelope_t FAR *envelope, void FAR *context)
 Handler for ZCL General Commands. More...
 
int zcl_invalid_cluster (const wpan_envelope_t FAR *envelope, wpan_ep_state_t FAR *ep_state)
 Called if a request comes in for an invalid endpoint/cluster combination. More...
 
int zcl_invalid_command (const wpan_envelope_t FAR *envelope)
 Called if a request comes in for an invalid command on a valid endpoint/cluster combination. More...
 
int zcl_parse_attribute_record (const zcl_attribute_base_t FAR *entry, zcl_attribute_write_rec_t *write_rec)
 Parse an attribute record from a Write Attributes Request or a Read Attributes Response and possibly store the new attribute value. More...
 
int zcl_send_response (zcl_command_t *request, const void FAR *response, uint16_t length)
 Send a response to a ZCL command. More...
 
const char * zcl_status_text (uint_fast8_t status)
 Converts a ZCL status byte (one of the ZCL_STATUS_* macros) into a string. More...
 

Variables

const zcl_attribute_tree_t FAR zcl_attributes_none [1]
 

Detailed Description

Process General Commands for ZigBee Cluster Library and provide support functions to other layers of the stack.

Note
For performance, on a low-resource, single-threaded system, the zcl_command_t object should be a global instead of building it on the stack of zcl_general_command and then passing a pointer around to the other functions.