Zigbee Protocol Controller 1.6.0
|
Go to the source code of this file.
Classes | |
struct | node_config_report_data_t |
the data structure representing all data required to handle a "Configure Reports - Node" event, represented by ATTR_MGMT_EVT_INIT_NODE More... | |
struct | endpoint_config_report_data_t |
the data structure representing all data required to handle a "Configure Reports - Endpoint" event, represented by ATTR_MGMT_EVT_INIT_ENDPOINT More... | |
struct | zigpc_attr_mgmt_read_data_t |
the structure used to initialize attribute data. In order to populate initial values of all attributes, it is necessary to request attributes after a delay. This structure holds all information related to this operation. More... | |
struct | zigpc_attr_mgmt_write_data_t |
the structure used to send a write attribute command. Contains all the information from MQTT and expected to be parsed into a valid ZCL frame. More... | |
struct | attribute_report_t |
the structure used to represent a report record used by the ZCL application framework when sending attribute/report information More... | |
struct | zigpc_attrmgmt_on_frame_receive_t |
the structure used to represent the data received on a report for a changed attribute More... | |
Enumerations | |
enum | attr_mgmt_evt { ZIGPC_ATTR_MGMT_EVT_INIT_NODE = 0 , ZIGPC_ATTR_MGMT_EVT_INIT_ENDPOINT , ZIGPC_ATTR_MGMT_EVT_ATTR_UPDATE , ZIGPC_ATTR_MGMT_EVT_CONFIGURE_RESPONSE , ZIGPC_ATTR_MGMT_EVT_READ_ATTRIBUTES_COMMAND } |
the enum representing the events handled by the attribute management Contiki process. Entries outside of this data structure are not valid More... | |
Functions | |
sl_status_t | zigpc_attrmgmt_process_send_event (const enum attr_mgmt_evt event, const void *data, size_t data_size) |
Send an event and associated data to the attribute management Contiki process. Based on the data and data_size passed in, memory will be dynamically allocated in the heap and sent in order to be processed. More... | |
size_t | zigpc_attrmgmt_get_records_to_send_in_message (size_t start_index, size_t count, size_t limit) |
Determine the number of records to send per ZCL message. More... | |
sl_status_t | zigpc_attrmgmt_configure_reports_for_endpoint (const zigbee_eui64_t eui64, const zigbee_endpoint_t endpoint) |
zigpc_attrmgmt_configure_reports_for_endpoint - API for sending a ZCL command to the zigpc_gateway to configure reports for a single endpoint. This is an internal API, expected to be abstracted away. More... | |
sl_status_t | node_send_report_config_cmd (const zigbee_node_t node) |
node_send_report_config_cmd - API for sending a ZCL command to the zigpc_gateway to configure reports for a node. This is an internal API, expected to be abstracted away. More... | |
sl_status_t | zigpc_attribute_management_read_cluster_attributes (const zigbee_eui64_t eui64, zigbee_endpoint_id_t endpoint_id, zcl_cluster_id_t cluster_id) |
Request to send a Read Attribute commands to the associated device, endpoint, and cluster combination. More... | |
void | zigpc_attrmgmt_send_delayed_read_command_callback (void *read_data) |
Callback invoked by zigpc_attrmgmt_send_delayed_read_command after delay of ZIGPC_ATTR_MGMT_DELAY_READ_ATTRIBUTES. This handler will call zigpc_attribute_management_read_cluster_attributes afterwards. More... | |
sl_status_t | zigpc_attrmgmt_send_read_attributes_command (const zigbee_eui64_t eui64, zigbee_endpoint_id_t endpoint_id, zcl_cluster_id_t cluster_id) |
Send a ZCL Global Read Attribute Command to the associated device, endpoint, and cluster combination. More... | |
sl_status_t | zigpc_attrmgmt_receive_attribute_frame (const zigbee_eui64_t eui64, zigbee_endpoint_id_t endpoint_id, zcl_cluster_id_t cluster_id, bool is_read_response, const zcl_frame_t *frame) |
Process Attribute update response frames received from the a Device. This function is capable of processing the following Response record lists: More... | |
sl_status_t | zigpc_attrmgmt_receive_configure_response_frame (const zigbee_eui64_t eui64, zigbee_endpoint_id_t endpoint_id, zcl_cluster_id_t cluster_id, const zcl_frame_t *frame) |
zigpc_attrmgmt_receive_configure_response_frame Process a configure attribute response frame Accepts a ZCL frame for the response to a configure reports command. On a failed configure, adds the given EUI64, endpoint and cluster combination to the poll lis More... | |
sl_status_t | attr_mgmt_gateway_init_observer (void) |
attr_mgmt_gateway_init_observer - the function that initiates all observers from the zigpc_gateway. Required to process a ReadAttribute Reponse, an Attribute Report or other data received asynchronously from the Zigbee network. More... | |
sl_status_t | zigpc_attrmgmt_publish_reported (const zigbee_eui64_uint_t eui64, const zigbee_endpoint_id_t endpoint_id, const zcl_cluster_id_t cluster_id, const zcl_attribute_id_t attr_id, const uint8_t *attr_value) |
Publish Reported Attribute Values. More... | |
size_t | zigpc_attrmgmt_get_poll_list_current_size () |
zigpc_attrmgmt_get_poll_list_size More... | |
size_t | zigpc_attrmgmt_get_poll_list_max_size () |
zigpc_attrmgmt_get_poll_list_Max_size More... | |
sl_status_t | zigpc_attrmgmt_send_poll_attributes () |
zigpc_attrmgmt_send_poll_attributes More... | |
sl_status_t | zigpc_attrmgmt_add_poll_entry (const zigbee_eui64_t eui64, zigbee_endpoint_id_t endpoint_id, zcl_cluster_id_t cluster_id) |
zigpc_attrmgmt_add_poll_entry More... | |
sl_status_t | zigpc_attrmgmt_remove_poll_entry (const zigbee_eui64_t eui64, zigbee_endpoint_id_t endpoint_id, zcl_cluster_id_t cluster_id) |
void | zigpc_attrmgmt_empty_poll_list () |
zigpc_attrmgmt_empty_poll_list More... | |
Variables | |
static const unsigned int | ZIGPC_ATTR_MGMT_DELAY_READ_ATTRIBUTES = CLOCK_SECOND * 5 |
static const unsigned int | ZIGPC_ATTRMGMT_READ_RECORDS_LIMIT_PER_MESSAGE = 25 |
Limit of Read Attribute Records to send per ZCL Message. More... | |
static const unsigned int | ZIGPC_ATTRMGMT_REPORT_RECORDS_LIMIT_PER_MESSAGE = 5 |
Limit of Configure Reporting Records to send per ZCL Message. More... | |
static const uint16_t | ZIGPC_ATTRMGMT_REPORT_INTERVAL_MIN_DEFAULT = 1000 |
Default Configure Reporting Record Minimum Interval (Seconds). More... | |
static const uint16_t | ZIGPC_ATTRMGMT_REPORT_INTERVAL_MAX_DEFAULT = 10000 |
Default Configure Reporting Record Maximum Interval (Seconds). More... | |
static const uint32_t | ZIGPC_ATTRMGMT_REPORT_CHANGE_DEFAULT = 0x0001 |
Default Configure Reporting Record Reportable Change to allow any change to be reported. More... | |
static const uint32_t | ZIGPC_ATTRMGMT_DEFAULT_POLL_SIZE = 256 |
Default poll list size. The maximum number of clusters that can be stoed in the poll list. More... | |
enum attr_mgmt_evt |
the enum representing the events handled by the attribute management Contiki process. Entries outside of this data structure are not valid
attr_mgmt_evt
sl_status_t attr_mgmt_gateway_init_observer | ( | void | ) |
attr_mgmt_gateway_init_observer - the function that initiates all observers from the zigpc_gateway. Required to process a ReadAttribute Reponse, an Attribute Report or other data received asynchronously from the Zigbee network.
sl_status_t node_send_report_config_cmd | ( | const zigbee_node_t | node | ) |
node_send_report_config_cmd - API for sending a ZCL command to the zigpc_gateway to configure reports for a node. This is an internal API, expected to be abstracted away.
node | - the node, whose endpoints should be configured for reports |
sl_status_t zigpc_attribute_management_read_cluster_attributes | ( | const zigbee_eui64_t | eui64, |
zigbee_endpoint_id_t | endpoint_id, | ||
zcl_cluster_id_t | cluster_id | ||
) |
Request to send a Read Attribute commands to the associated device, endpoint, and cluster combination.
eui64 | Device identifier. |
endpoint_id | Device endpoint identifier. |
cluster_id | Cluster identifer to read attributes from. |
sl_status_t zigpc_attrmgmt_add_poll_entry | ( | const zigbee_eui64_t | eui64, |
zigbee_endpoint_id_t | endpoint_id, | ||
zcl_cluster_id_t | cluster_id | ||
) |
zigpc_attrmgmt_add_poll_entry
Add a new entry to be polled by ReadAttribute commands Will be put at the end of the list
eui64 | - the eui64 of the node |
endpoint_id | - the endpoint specified |
cluster_id | - the cluster specified |
sl_status_t zigpc_attrmgmt_configure_reports_for_endpoint | ( | const zigbee_eui64_t | eui64, |
const zigbee_endpoint_t | endpoint | ||
) |
zigpc_attrmgmt_configure_reports_for_endpoint - API for sending a ZCL command to the zigpc_gateway to configure reports for a single endpoint. This is an internal API, expected to be abstracted away.
eui64 | - the eui64, whose endpoints should be configured for reports |
endpoint | - the endpoint, expected to give reports |
void zigpc_attrmgmt_empty_poll_list | ( | ) |
zigpc_attrmgmt_empty_poll_list
Empty the polling list
size_t zigpc_attrmgmt_get_poll_list_current_size | ( | ) |
zigpc_attrmgmt_get_poll_list_size
Get the size of the current list we are polling with ReadAttributes
size_t zigpc_attrmgmt_get_poll_list_max_size | ( | ) |
zigpc_attrmgmt_get_poll_list_Max_size
Get the maximum size of the polling list
size_t zigpc_attrmgmt_get_records_to_send_in_message | ( | size_t | start_index, |
size_t | count, | ||
size_t | limit | ||
) |
Determine the number of records to send per ZCL message.
start_index | Starting index of record to send. |
count | Total number of records in list. |
limit | Maximum number of records to send in each message. |
sl_status_t zigpc_attrmgmt_process_send_event | ( | const enum attr_mgmt_evt | event, |
const void * | data, | ||
size_t | data_size | ||
) |
Send an event and associated data to the attribute management Contiki process. Based on the data and data_size passed in, memory will be dynamically allocated in the heap and sent in order to be processed.
NOTE: The attribute management process will free the memory allocated for data in the process loop.
event | Event type to send |
data | Pointer to data to be sent with the above event. |
data_size | Size of the data passed in. |
sl_status_t zigpc_attrmgmt_publish_reported | ( | const zigbee_eui64_uint_t | eui64, |
const zigbee_endpoint_id_t | endpoint_id, | ||
const zcl_cluster_id_t | cluster_id, | ||
const zcl_attribute_id_t | attr_id, | ||
const uint8_t * | attr_value | ||
) |
Publish Reported Attribute Values.
Update the attribute value for a node, ep, cluster combination. This function will call the uic_dotdot_mqtt publish APIs in order to format and publish the reported attribute value.
sl_status_t zigpc_attrmgmt_receive_attribute_frame | ( | const zigbee_eui64_t | eui64, |
zigbee_endpoint_id_t | endpoint_id, | ||
zcl_cluster_id_t | cluster_id, | ||
bool | is_read_response, | ||
const zcl_frame_t * | frame | ||
) |
Process Attribute update response frames received from the a Device. This function is capable of processing the following Response record lists:
eui64 | Device identifier. |
endpoint_id | Device endpoint identifier. |
cluster_id | Cluster identifer to read attributes from. |
is_read_response | If the passed frame is a ReadAttributeResponse |
frame | ZCL Frame containing read attribute records. |
sl_status_t zigpc_attrmgmt_receive_configure_response_frame | ( | const zigbee_eui64_t | eui64, |
zigbee_endpoint_id_t | endpoint_id, | ||
zcl_cluster_id_t | cluster_id, | ||
const zcl_frame_t * | frame | ||
) |
zigpc_attrmgmt_receive_configure_response_frame Process a configure attribute response frame Accepts a ZCL frame for the response to a configure reports command. On a failed configure, adds the given EUI64, endpoint and cluster combination to the poll lis
eui64 | Device identifier. |
endpoint_id | Device endpoint identifier |
cluster_id | Cluster identifer of the source from |
frame | ZCL Frame containing configure report response |
sl_status_t zigpc_attrmgmt_remove_poll_entry | ( | const zigbee_eui64_t | eui64, |
zigbee_endpoint_id_t | endpoint_id, | ||
zcl_cluster_id_t | cluster_id | ||
) |
@briefzigpc_attrmgmt_remove_poll_entry
Remove a eui64, endpoint and cluster combination from the poll list
eui64 | - the eui64 of the node |
endpoint_id | - the endpoint specified |
cluster_id | - the cluster specified |
void zigpc_attrmgmt_send_delayed_read_command_callback | ( | void * | read_data | ) |
Callback invoked by zigpc_attrmgmt_send_delayed_read_command after delay of ZIGPC_ATTR_MGMT_DELAY_READ_ATTRIBUTES. This handler will call zigpc_attribute_management_read_cluster_attributes afterwards.
read_data | Pointer to zigpc_attr_mgmt_read_data_t |
sl_status_t zigpc_attrmgmt_send_poll_attributes | ( | ) |
zigpc_attrmgmt_send_poll_attributes
Send a ReadAttribute command to the next entry in the polling list
sl_status_t zigpc_attrmgmt_send_read_attributes_command | ( | const zigbee_eui64_t | eui64, |
zigbee_endpoint_id_t | endpoint_id, | ||
zcl_cluster_id_t | cluster_id | ||
) |
Send a ZCL Global Read Attribute Command to the associated device, endpoint, and cluster combination.
eui64 | Device identifier. |
endpoint_id | Device endpoint identifier. |
cluster_id | Cluster identifer to read attributes from. |
|
static |
|
static |
Default poll list size. The maximum number of clusters that can be stoed in the poll list.
|
static |
Limit of Read Attribute Records to send per ZCL Message.
Due to the ZCL messages only having a maximum payload of 70-80 bytes (depending on added manfacuturer-specific header information), and since each attribute record is 2-bytes, the maximum number of attribute read records to set per ZCL message should be limited. The current limit is chosen arbitrarily to allow the attribute read records to reliabily sent to the device.
|
static |
Default Configure Reporting Record Reportable Change to allow any change to be reported.
NOTE: This value is chosen arbitrarily and will likely be configurable in the future.
|
static |
Default Configure Reporting Record Maximum Interval (Seconds).
NOTE: This value is chosen arbitrarily and will likely be configurable in the future.
|
static |
Default Configure Reporting Record Minimum Interval (Seconds).
NOTE: This value is chosen arbitrarily and will likely be configurable in the future.
|
static |
Limit of Configure Reporting Records to send per ZCL Message.
Due to the ZCL messages only having a maximum payload of 70-80 bytes (depending on added manfacuturer-specific header information), and since each attribute record is 8-bytes, the maximum number of attribute report records to set per ZCL message should be limited. The current limit is chosen arbitrarily to allow the configure report records to reliabily sent to the device.