* @since_tizen 3.0
*/
typedef struct {
- char *attribute_id; /**< Attribute ID */
+ unsigned char *attribute_id; /**< Attribute ID */
int attribute_id_len; /**< Attribute ID length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlReadAttributesRequest_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *write_records; /**< Write records */
+ unsigned char *write_records; /**< Write records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlWriteAttributesRequest_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *write_records; /**< Write records */
+ unsigned char *write_records; /**< Write records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlWriteAttributesUndividedRequest_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *write_records; /**< Write records */
+ unsigned char *write_records; /**< Write records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlWriteAttributesNoResponse_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *write_records; /**< Write records */
+ unsigned char *write_records; /**< Write records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlWriteAttributesStructed_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *read_records; /**< Read records */
+ unsigned char *read_records; /**< Read records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlReadAttributesStructed_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *read_records; /**< Read records */
+ unsigned char *read_records; /**< Read records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlConfigureReportingReq_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- char *read_records; /**< Read records */
+ unsigned char *read_records; /**< Read records */
int records_len; /**< Records length */
- short node_id; /**< Node ID */
- char cluster_id; /**< Cluster ID */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char src_ep; /**< Source endpoint */
- char dest_ep; /**< Destination endpoint */
+ unsigned short node_id; /**< Node ID */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char dest_ep; /**< Destination endpoint */
} ZigbeeZclGlobalControlReadConfigureReporting_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- short node_id; /**< Node ID */
- char dest_ep; /**< Destination endpoint */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char cluster_id; /**< Cluster ID */
- char start_attribute; /**< Start attribute */
- char max; /**< Maximum */
+ unsigned short node_id; /**< Node ID */
+ unsigned char dest_ep; /**< Destination endpoint */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char start_attribute; /**< Start attribute */
+ unsigned char max_attribute_count; /**< Maximum */
} ZigbeeZclGlobalControlDiscoverAttributes_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- short node_id; /**< Node ID */
- char dest_ep; /**< Destination endpoint */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char cluster_id; /**< Cluster ID */
- char start_attribute; /**< Start attribute */
- char max; /**< Maximum */
+ unsigned short node_id; /**< Node ID */
+ unsigned char dest_ep; /**< Destination endpoint */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char start_attribute; /**< Start attribute */
+ unsigned char max_attribute_count; /**< Maximum */
} ZigbeeZclGlobalControlDiscoverAttributesExtended_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- short node_id; /**< Node ID */
- char dest_ep; /**< Destination endpoint */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char cluster_id; /**< Cluster ID */
- char start_attribute; /**< Start attribute */
- char max; /**< Maximum */
+ unsigned short node_id; /**< Node ID */
+ unsigned char dest_ep; /**< Destination endpoint */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char start_command; /**< Start attribute */
+ unsigned char max_command_count; /**< Maximum */
} ZigbeeZclGlobalControlDiscoverCommandsReceived_t;
/**
* @since_tizen 3.0
*/
typedef struct {
- short node_id; /**< Node ID */
- char dest_ep; /**< Destination endpoint */
- char zcl_frame_ctrl; /**< ZCL frame control */
- char cluster_id; /**< Cluster ID */
- char start_attribute; /**< Start attribute */
- char max; /**< Maximum */
+ unsigned short node_id; /**< Node ID */
+ unsigned char dest_ep; /**< Destination endpoint */
+ unsigned char zcl_frame_ctrl; /**< ZCL frame control */
+ unsigned char cluster_id; /**< Cluster ID */
+ unsigned char start_command; /**< Start attribute */
+ unsigned char max_command_count; /**< Maximum */
} ZigbeeZclGlobalControlDiscoverCommandsGenerated_t;
+/* -----------------------------------------------------------------------------
+ * For Notifications
+ * ---------------------------------------------------------------------------*/
+
+/**
+ * @brief Definition for ZCL Global control read attributes response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char *values; /**< Attribute values */
+ unsigned short attribute_id; /**< Attribute ID */
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned char status; /**< Status */
+ unsigned char type; /**< Type */
+ unsigned short record_length; /**< Length of record */
+ int is_string; /**< Is this attribute string ? */
+} ZigbeeZclGlobalControlReadAttributesResp_t;
+
+/**
+ * @brief Definition for ZCL Global control write attributes response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char *values; /**< Attribute values */
+ unsigned short *attribute_list; /**< Attribute list */
+ unsigned short cluster_id; /**< Cluster ID */
+ int record_length; /**< Length of record */
+} ZigbeeZclGlobalControlWriteAttributesResp_t;
+
+/**
+ * @brief Definition for ZCL Global control configure reporting response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned char *status_list; /**< Status list */
+ unsigned short *attribute_list; /**< Attribute list */
+ unsigned char *dir_list; /**< Direction list */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned short cluster_id; /**< Cluster ID */
+ int record_length; /**< Length of record */
+} ZigbeeZclGlobalControlConfigReportResp_t;
+
+/**
+ * @brief Definition for ZCL Global control discover attribute response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char *type_list; /**< Type list */
+ unsigned short *attribute_list; /**< Attribute list */
+ unsigned short cluster_id; /**< Cluster ID */
+ int record_length; /**< Length of record */
+ int discovery_completed; /**< Discovery completed */
+} ZigbeeZclGlobalControlDiscoverAttributeResp_t;
+
+/**
+ * @brief Definition for ZCL Global control write attribute structured response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned char *status_list; /**< Status list */
+ unsigned short *attribute_list; /**< Attribute list */
+ unsigned char *indicator_list; /**< Indicator list */
+ unsigned short **index_list; /**< Index list */
+ unsigned short cluster_id; /**< Cluster ID */
+ int record_length; /**< Length of record */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+} ZigbeeZclGlobalControlWriteAttributeStructuredResp_t;
+
+/**
+ * @brief Definition for ZCL Global control discover received commands response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned char *command_list; /**< Command list */
+ unsigned short list_count; /**< Length of record */
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char discovery_completed; /**< Discovery completed */
+} ZigbeeZclGlobalControlDiscoverCommandsReceivedResp_t;
+
+/**
+ * @brief Definition for ZCL Global control discover generated commands response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned char *command_list; /**< Command list */
+ unsigned short list_count; /**< Length of record */
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char discovery_completed; /**< Discovery completed */
+} ZigbeeZclGlobalControlDiscoverCommandsGeneratedResp_t;
+
+/**
+ * @brief Definition for ZCL Global control discover extended attributes response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short *attribute_list; /**< Attribute list */
+ unsigned char *attribute_type_list; /**< Attribute type list */
+ unsigned char *access_list; /**< Access list */
+ unsigned short list_count; /**< Length of record */
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char discovery_completed; /**< Discovery completed */
+} ZigbeeZclGlobalControlDiscoverAttributesExtendedResp_t;
+
+/**
+ * @brief Definition for ZCL Global control default response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+ unsigned char command_id; /**< Command ID */
+ unsigned char status; /**< Status */
+} ZigbeeZclGlobalControlDefaultResp_t;
+
+/**
+ * @brief Definition for ZCL Global control discover extended attributes response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short *attribute_list; /**< Attribute list */
+ unsigned char *data_type_list; /**< Attribute type list */
+ unsigned char **values; /**< Values list */
+ unsigned char *values_count; /**< Count for each value list */
+ unsigned short list_count; /**< Length of record */
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned short node_id; /**< Node ID */
+ unsigned char src_ep; /**< Source endpoint */
+} ZigbeeZclGlobalControlReportAttributeHandlerResp_t;
+
+/**
+ * @brief Definition for ZCL Global control read configure reporting entry structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned char status; /**< status */
+ unsigned char dir; /**< direction */
+ unsigned short attribute_id; /**< attribute identifier */
+ unsigned char data_type; /**< attribute data type */
+ unsigned short min_interval; /**< minimum reporting interval */
+ unsigned short max_interval; /**< maximum reporting interval */
+ unsigned char *change; /**< reportable change */
+ unsigned char change_count; /**< The number of change list */
+ unsigned short timeout; /**< timeout period */
+} ZigbeeZclGlobalControlReadConfigureReportingEntry_t;
+
+/**
+ * @brief Definition for ZCL Global control read configure reporting response structure.
+ * @since_tizen 3.0
+ */
+typedef struct {
+ unsigned short cluster_id; /**< Cluster ID */
+ unsigned short node_id; /**< Node ID */
+ unsigned short record_count; /**< The number of record */
+ unsigned char src_ep; /**< Source endpoint */
+ ZigbeeZclGlobalControlReadConfigureReportingEntry_t *entry_list; /**< Entry */
+} ZigbeeZclGlobalControlReadConfigureReportingResp_t;
+
#endif /* __ZIGBEE_ZCL_GLOBAL_CONTROL_TYPE_H__ */
<node>
<interface name='org.tizen.zigbee.zcl_global_control'>
<method name='read_attributes_req'>
- <arg type='ay' name='attributeId' direction='in'/>
+ <arg type='a(y)' name='attributeId' direction='in'/>
<arg type='i' name='attributeIdsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='write_attributes_req'>
- <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='a(y)' name='writeAttribute' direction='in'/>
<arg type='i' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='write_attributes_undivided_req'>
- <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='a(y)' name='writeAttribute' direction='in'/>
<arg type='i' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='write_attributes_no_resp'>
- <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='a(y)' name='writeAttribute' direction='in'/>
<arg type='i' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='write_attributes_structured'>
- <arg type='ay' name='writeAttribute' direction='in'/>
+ <arg type='a(y)' name='writeAttribute' direction='in'/>
<arg type='q' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='read_attributes_structured'>
- <arg type='ay' name='ReadAttribute' direction='in'/>
+ <arg type='a(y)' name='ReadAttribute' direction='in'/>
<arg type='q' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='configure_reporting_req'>
- <arg type='ay' name='ReadAttribute' direction='in'/>
+ <arg type='a(y)' name='ReadAttribute' direction='in'/>
<arg type='q' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='read_configure_reporting'>
- <arg type='ay' name='ReadAttribute' direction='in'/>
+ <arg type='a(y)' name='ReadAttribute' direction='in'/>
<arg type='q' name='recordsLen' direction='in'/>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='y' name='zcl_frame_ctrl' direction='in'/>
<arg type='y' name='src_ep' direction='in'/>
<arg type='y' name='dest_ep' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='discover_attributes'>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='q' name='startAttr' direction='in'/>
<arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='discover_attributes_extended'>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='q' name='startAttr' direction='in'/>
<arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='discover_commands_received'>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='q' name='startAttr' direction='in'/>
<arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<method name='discover_commands_generated'>
<arg type='q' name='nodeId' direction='in'/>
<arg type='q' name='clusterId' direction='in'/>
<arg type='q' name='startAttr' direction='in'/>
<arg type='y' name='max' direction='in'/>
+ <arg type='i' name='result' direction='out'/>
</method>
<signal name='read_attributes_rsp'>
<arg type='q' name='nodeId'/>
- <arg type='y' name='endpoint'/>
- <arg type='ay' name='value'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='a(y)' name='value'/>
<arg type='q' name='attribute_id'/>
<arg type='q' name='clusterId'/>
<arg type='y' name='status'/>
</signal>
<signal name='write_attributes_rsp'>
<arg type='q' name='nodeId'/>
- <arg type='y' name='endpoint'/>
- <arg type='ay' name='value'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='a(y)' name='value'/>
<arg type='aq' name='attribute_id'/>
<arg type='q' name='clusterId'/>
<arg type='i' name='record_len'/>
</signal>
<signal name='configure_reporting_rsp'>
- <arg type='ay' name='status'/>
+ <arg type='a(y)' name='status'/>
<arg type='aq' name='attribute_id'/>
- <arg type='ay' name='dir'/>
+ <arg type='a(y)' name='dir'/>
<arg type='q' name='clusterId'/>
<arg type='i' name='record_len'/>
<arg type='q' name='nodeId'/>
</signal>
<signal name='discover_attribute_rsp'>
<arg type='q' name='nodeId'/>
- <arg type='y' name='endpoint'/>
- <arg type='ay' name='type'/>
+ <arg type='y' name='src_ep'/>
+ <arg type='a(y)' name='type'/>
<arg type='aq' name='attribute_id'/>
<arg type='q' name='clusterId'/>
<arg type='i' name='record_len'/>
<arg type='i' name='discoveryComplete'/>
</signal>
<signal name='write_attribute_structured_rsp'>
- <arg type='ay' name='type'/>
+ <arg type='a(y)' name='status'/>
<arg type='aq' name='attribute_id'/>
- <arg type='ay' name='indicator'/>
+ <arg type='a(y)' name='indicator'/>
<arg type='aq' name='index'/>
<arg type='q' name='clusterId'/>
<arg type='i' name='record_len'/>
<arg type='y' name='src_ep'/>
</signal>
<signal name='discover_commands_received_rsp'>
- <arg type='ay' name='type'/>
+ <arg type='a(y)' name='commands'/>
<arg type='q' name='clusterId'/>
<arg type='q' name='commandLen'/>
<arg type='q' name='nodeId'/>
- <arg type='y' name='srcep'/>
+ <arg type='y' name='src_ep'/>
<arg type='y' name='discoveryComplete'/>
</signal>
<signal name='discover_commands_generated_rsp'>
- <arg type='ay' name='type'/>
+ <arg type='a(y)' name='commands'/>
<arg type='q' name='clusterId'/>
<arg type='q' name='commandLen'/>
<arg type='q' name='nodeId'/>
- <arg type='y' name='srcep'/>
+ <arg type='y' name='src_ep'/>
<arg type='y' name='discoveryComplete'/>
</signal>
<signal name='discover_attributes_extended_rsp'>
<arg type='aq' name='attrId'/>
- <arg type='ay' name='attrtype'/>
- <arg type='ay' name='access'/>
+ <arg type='a(y)' name='attrtype'/>
+ <arg type='a(y)' name='access'/>
<arg type='q' name='clusterId'/>
- <arg type='q' name='commandLen'/>
+ <arg type='q' name='attrCount'/>
<arg type='q' name='nodeId'/>
- <arg type='y' name='srcep'/>
+ <arg type='y' name='src_ep'/>
<arg type='y' name='discoveryComplete'/>
</signal>
<signal name='zcl_global_default_response'>
<arg type='y' name='src_ep'/>
<arg type='q' name='cluster_id'/>
<arg type='aq' name='attribute_id'/>
- <arg type='ay' name='dataType'/>
- <arg type='ay' name='value'/>
+ <arg type='a(y)' name='dataType'/>
+ <arg type='a(y)' name='value'/>
<arg type='i' name='recordLength'/>
</signal>
<signal name='read_configure_reporting_rsp'>
#include <zblib_driver_zcl_global_control.h>
+static void *_service_interface_ref_zigbee_zcl_global_control(ZigBeeServiceInterface *service_interface)
+{
+ ZigbeeObjectSkeleton *zigbee_object = NULL;
+ ZigbeeCustomData_t *custom_data = NULL;
+ ZigbeeZcl_global_control *global_control_object = NULL;
+
+ custom_data = (ZigbeeCustomData_t *)zblib_service_interface_ref_user_data(service_interface);
+ if (NULL == custom_data) {
+ Z_LOGE("D-BUS service interface custom_data is NULL!");
+ return NULL;
+ }
+
+ /* Get zigbee object */
+ zigbee_object = g_hash_table_lookup(custom_data->objects, ZIGBEE_SERVICE_PATH);
+ if (NULL == zigbee_object) {
+ Z_LOGW("Cannot find ZigBee D-BUS interface object!", zigbee_object);
+ return NULL;
+ }
+
+ global_control_object = zigbee_object_get_zcl_global_control(ZIGBEE_OBJECT(zigbee_object));
+ return global_control_object;
+}
+
static void on_zclglobal_control_read_attributes_req_resp(ZigBeeServiceInterface *service_interface,
guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
{
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_read_attributes_req(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_read_attributes_req(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlReadAttributesRequest_t));
+ req.attribute_id = g_try_malloc0_n(attribute_ids_length, sizeof(unsigned char));
+ if (NULL == req.attribute_id) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(attribute_id, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.attribute_id[i])) {
+ g_variant_get(attribute_id, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.attribute_id[i]))) {
i++;
if (i >= attribute_ids_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_write_attributes_req(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_write_attributes_req(ZigbeeZcl_global_control *zclglobal_control_object,
gshort node_id,
gshort cluster_id,
gchar zcl_frame_ctrl,
+ gchar src_ep,
gchar dest_ep,
gpointer user_data)
{
gboolean ret;
- memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlReadAttributesRequest_t));
+ Z_LOGI("DBus Service interface: [%p]", service_interface);
+
+ memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlWriteAttributesRequest_t));
+
+ req.write_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.write_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
+ Z_LOGI("DBus Service interface: [%p]", service_interface);
/* Update request structure */
- g_variant_get(write_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+ g_variant_get(write_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.write_records[i]))) {
i++;
if (i >= records_length)
break;
req.node_id = node_id;
req.cluster_id = cluster_id;
req.zcl_frame_ctrl = zcl_frame_ctrl;
+ req.src_ep = src_ep;
req.dest_ep = dest_ep;
/* Allocate response callback data */
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_write_attributes_undivided_req(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_write_attributes_undivided_req(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlWriteAttributesUndividedRequest_t));
+ req.write_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.write_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(write_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+ g_variant_get(write_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.write_records[i]))) {
i++;
if (i >= records_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_write_attributes_no_resp(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_write_attributes_no_resp(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlWriteAttributesNoResponse_t));
+ req.write_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.write_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(write_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+ g_variant_get(write_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.write_records[i]))) {
i++;
if (i >= records_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_write_attributes_structured(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_write_attributes_structured(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlWriteAttributesStructed_t));
+ req.write_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.write_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(write_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+ g_variant_get(write_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.write_records[i]))) {
i++;
if (i >= records_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_read_attributes_structured(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_read_attributes_structured(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlReadAttributesStructed_t));
+ req.read_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.read_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(read_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.read_records[i])) {
+ g_variant_get(read_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.read_records[i]))) {
i++;
if (i >= records_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_configure_reporting_req(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_configure_reporting_req(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlConfigureReportingReq_t));
+ req.read_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.read_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(read_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.read_records[i])) {
+ g_variant_get(read_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.read_records[i]))) {
i++;
if (i >= records_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_read_configure_reporting(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_read_configure_reporting(ZigbeeZcl_global_control *zclglobal_control_object,
memset(&req, 0x0, sizeof(ZigbeeZclGlobalControlReadConfigureReporting_t));
+ req.read_records = g_try_malloc0_n(records_length, sizeof(unsigned char));
+ if (NULL == req.read_records) {
+ Z_LOGE("Failed to allocation !");
+
+ /* Send failure response */
+ ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+ return TRUE;
+ }
+
/* Update request structure */
- g_variant_get(read_attribute, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.read_records[i])) {
+ g_variant_get(read_attribute, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.read_records[i]))) {
i++;
if (i >= records_length)
break;
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_discover_attributes(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_discover_attributes(ZigbeeZcl_global_control *zclglobal_control_object,
gchar zcl_frame_ctrl,
gshort cluster_id,
gshort start_attr,
- gchar max,
+ gchar max_attribute_count,
gpointer user_data)
{
ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
req.zcl_frame_ctrl = zcl_frame_ctrl;
req.cluster_id = cluster_id;
req.start_attribute = start_attr;
- req.max = max;
+ req.max_attribute_count = max_attribute_count;
/* Allocate response callback data */
resp_cb_data =
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_discover_attributes_extended(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_discover_attributes_extended(ZigbeeZcl_global_control *zclglobal_control_object,
gchar zcl_frame_ctrl,
gshort cluster_id,
gshort start_attr,
- gchar max,
+ gchar max_attribute_count,
gpointer user_data)
{
ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
req.zcl_frame_ctrl = zcl_frame_ctrl;
req.cluster_id = cluster_id;
req.start_attribute = start_attr;
- req.max = max;
+ req.max_attribute_count = max_attribute_count;
/* Allocate response callback data */
resp_cb_data =
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_discover_commands_received(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);;
}
static gboolean on_zclglobal_control_discover_commands_received(ZigbeeZcl_global_control *zclglobal_control_object,
gchar dest_ep,
gchar zcl_frame_ctrl,
gshort cluster_id,
- gshort start_attr,
- gchar max,
+ gshort start_command,
+ gchar max_command_count,
gpointer user_data)
{
ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
req.dest_ep = dest_ep;
req.zcl_frame_ctrl = zcl_frame_ctrl;
req.cluster_id = cluster_id;
- req.start_attribute = start_attr;
- req.max = max;
+ req.start_command = start_command;
+ req.max_command_count = max_command_count;
/* Allocate response callback data */
resp_cb_data =
ZigbeeServiceInterfaceRespCbData_t *cb_data =
(ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
- NOT_USED(cb_data);
+ ZigbeeZcl_global_control *global_control_object;
+ GDBusMethodInvocation *invocation;
+
+ ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
+
NOT_USED(service_interface);
NOT_USED(request_id);
- NOT_USED(resp_data);
- NOT_USED(resp_data_len);
+
+ if (NULL == resp_data || 0 == resp_data_len) {
+ Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
+ g_free(cb_data);
+ return;
+ }
+
+ global_control_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
+ zblib_check_null_free_and_ret("global_control_object", global_control_object, cb_data);
+
+ invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ zigbee_zcl_global_control_complete_discover_commands_generated(global_control_object,
+ invocation, payload->result);
+
+ g_free(cb_data);
}
static gboolean on_zclglobal_control_discover_commands_generated(ZigbeeZcl_global_control *zclglobal_control_object,
gchar dest_ep,
gchar zcl_frame_ctrl,
gshort cluster_id,
- gshort start_attr,
- gchar max,
+ gshort start_command,
+ gchar max_command_count,
gpointer user_data)
{
ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
req.dest_ep = dest_ep;
req.zcl_frame_ctrl = zcl_frame_ctrl;
req.cluster_id = cluster_id;
- req.start_attribute = start_attr;
- req.max = max;
+ req.start_command = start_command;
+ req.max_command_count = max_command_count;
/* Allocate response callback data */
resp_cb_data =
void zigbee_service_dbus_interface_zcl_global_control_notification(ZigBeeServiceInterface *service_interface,
guint noti_id, gpointer noti_data, guint noti_data_len, gpointer noti_cb_data)
{
- if (NULL == service_interface) {
- Z_LOGE("service_interface is NULL");
+ ZigbeeZcl_global_control *global_control_object = NULL;
+
+ zblib_check_null_ret("service_interface", service_interface);
+
+ if (NULL == noti_data || 0 == noti_data_len) {
+ Z_LOGE("noti_data is NULL");
return;
}
- NOT_USED(noti_id);
- NOT_USED(noti_data);
- NOT_USED(noti_data_len);
+ global_control_object = _service_interface_ref_zigbee_zcl_global_control(service_interface);
+ zblib_check_null_ret("global_control_object", global_control_object);
+
NOT_USED(noti_cb_data);
+
+ switch(noti_id) {
+ case ZBLIB_ZCL_GLOBAL_NOTI_READ_ATTR_RSP: {
+ ZigbeeZclGlobalControlReadAttributesResp_t *attr_t =
+ (ZigbeeZclGlobalControlReadAttributesResp_t*)noti_data;
+
+ GVariant *v_values = NULL;
+ v_values = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->values, attr_t->record_length, TRUE, NULL, NULL);
+ if (NULL == v_values) {
+ Z_LOGE("Failed to create variant!");
+ } else {
+ Z_LOGD("Read attributes resp");
+ zigbee_zcl_global_control_emit_read_attributes_rsp(global_control_object,
+ attr_t->node_id, attr_t->src_ep, v_values, attr_t->attribute_id,
+ attr_t->cluster_id, attr_t->status, attr_t->type,
+ attr_t->record_length, attr_t->is_string);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_WRITE_ATTR_RSP: {
+ ZigbeeZclGlobalControlWriteAttributesResp_t *attr_t =
+ (ZigbeeZclGlobalControlWriteAttributesResp_t*)noti_data;
+
+ GVariant *v_values = NULL;
+ GVariant *v_attrs = NULL;
+ v_values = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->values, attr_t->record_length, TRUE, NULL, NULL);
+ v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ attr_t->attribute_list, (sizeof(gushort) * attr_t->record_length),
+ TRUE, NULL, NULL);
+ if (NULL == v_values || NULL == v_attrs) {
+ Z_LOGE("Failed to create variant!");
+ if (v_values)
+ g_variant_unref(v_values);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ } else {
+ Z_LOGD("Write attributes resp");
+ zigbee_zcl_global_control_emit_write_attributes_rsp(global_control_object,
+ attr_t->node_id, attr_t->src_ep, v_values, v_attrs,
+ attr_t->cluster_id, attr_t->record_length);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_CONFIG_REPORT_RSP: {
+ ZigbeeZclGlobalControlConfigReportResp_t *attr_t =
+ (ZigbeeZclGlobalControlConfigReportResp_t*)noti_data;
+
+ GVariant *v_status = NULL;
+ GVariant *v_attrs = NULL;
+ GVariant *v_dirs = NULL;
+ v_status = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->status_list, attr_t->record_length, TRUE, NULL, NULL);
+ v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ attr_t->attribute_list, (sizeof(gushort) * attr_t->record_length),
+ TRUE, NULL, NULL);
+ v_dirs = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->dir_list, attr_t->record_length, TRUE, NULL, NULL);
+ if (NULL == v_status || NULL == v_attrs || NULL == v_dirs) {
+ Z_LOGE("Failed to create variant!");
+ if (v_status)
+ g_variant_unref(v_status);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_dirs)
+ g_variant_unref(v_dirs);
+ } else {
+ Z_LOGD("Configure reporting resp");
+ zigbee_zcl_global_control_emit_configure_reporting_rsp(global_control_object,
+ v_status, v_attrs, v_dirs, attr_t->cluster_id,
+ attr_t->record_length, attr_t->node_id, attr_t->src_ep);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_ATTR_RSP: {
+ ZigbeeZclGlobalControlDiscoverAttributeResp_t *attr_t =
+ (ZigbeeZclGlobalControlDiscoverAttributeResp_t*)noti_data;
+
+ GVariant *v_types = NULL;
+ GVariant *v_attrs = NULL;
+ v_types = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->type_list, attr_t->record_length, TRUE, NULL, NULL);
+ v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ attr_t->attribute_list, (sizeof(gushort) * attr_t->record_length),
+ TRUE, NULL, NULL);
+ if (NULL == v_types || NULL == v_attrs) {
+ Z_LOGE("Failed to create variant!");
+ if (v_types)
+ g_variant_unref(v_types);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ } else {
+ Z_LOGD("Discover attribute resp");
+ zigbee_zcl_global_control_emit_discover_attribute_rsp(global_control_object,
+ attr_t->node_id, attr_t->src_ep, v_types, v_attrs,
+ attr_t->cluster_id, attr_t->record_length, attr_t->discovery_completed);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_WRITE_ATTR_STRUCTURED_RSP: {
+ ZigbeeZclGlobalControlWriteAttributeStructuredResp_t *attr_t =
+ (ZigbeeZclGlobalControlWriteAttributeStructuredResp_t*)noti_data;
+
+ GVariant *v_status = NULL;
+ GVariant *v_attrs = NULL;
+ GVariant *v_indicator = NULL;
+ GVariantBuilder *index_builder = NULL;
+ GVariant *v_index = NULL;
+ int i = 0, j = 0;
+
+ v_status = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->status_list, attr_t->record_length, TRUE, NULL, NULL);
+ v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ attr_t->attribute_list, (sizeof(gushort) * attr_t->record_length),
+ TRUE, NULL, NULL);
+ v_indicator = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->indicator_list, attr_t->record_length, TRUE, NULL, NULL);
+
+ if (NULL == v_status || NULL == v_attrs || NULL == v_indicator) {
+ Z_LOGE("Failed to create variant!");
+ if (v_status)
+ g_variant_unref(v_status);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_indicator)
+ g_variant_unref(v_indicator);
+ break;
+ }
+
+ index_builder = g_variant_builder_new (G_VARIANT_TYPE ("aq"));
+ if (NULL == index_builder) {
+ Z_LOGE("Failed to create variant builder!");
+ g_variant_unref(v_status);
+ g_variant_unref(v_attrs);
+ g_variant_unref(v_indicator);
+ break;
+ }
+ for(i = 0; i < attr_t->record_length; i++) {
+ for(j = 0; j < attr_t->indicator_list[i]; j++) {
+ g_variant_builder_add (index_builder, "q", attr_t->index_list[i][j]);
+ }
+ }
+ v_index = g_variant_builder_end (index_builder);
+ g_variant_builder_unref(index_builder);
+ if (NULL == index_builder) {
+ Z_LOGE("Failed to create variant!");
+ g_variant_unref(v_status);
+ g_variant_unref(v_attrs);
+ g_variant_unref(v_indicator);
+ break;
+ }
+
+ Z_LOGD("Write attribute structured resp");
+ zigbee_zcl_global_control_emit_write_attribute_structured_rsp(
+ global_control_object,
+ v_status, v_attrs, v_indicator, v_index,
+ attr_t->cluster_id, attr_t->record_length,
+ attr_t->node_id, attr_t->src_ep);
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_CMDS_RECEIVED_RSP: {
+ ZigbeeZclGlobalControlDiscoverCommandsReceivedResp_t *attr_t =
+ (ZigbeeZclGlobalControlDiscoverCommandsReceivedResp_t*)noti_data;
+
+ GVariant *v_commands = NULL;
+ v_commands = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->command_list, attr_t->list_count, TRUE, NULL, NULL);
+ if (NULL == v_commands) {
+ Z_LOGE("Failed to create variant!");
+ } else {
+ Z_LOGD("Discover commands received resp");
+ zigbee_zcl_global_control_emit_discover_commands_received_rsp(
+ global_control_object,
+ v_commands, attr_t->list_count, attr_t->cluster_id,
+ attr_t->node_id, attr_t->src_ep, attr_t->discovery_completed);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_CMDS_GENERATED_RSP: {
+ ZigbeeZclGlobalControlDiscoverCommandsGeneratedResp_t *attr_t =
+ (ZigbeeZclGlobalControlDiscoverCommandsGeneratedResp_t*)noti_data;
+
+ GVariant *v_commands = NULL;
+ v_commands = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->command_list, attr_t->list_count, TRUE, NULL, NULL);
+ if (NULL == v_commands) {
+ Z_LOGE("Failed to create variant!");
+ } else {
+ Z_LOGD("Discover commands generated resp");
+ zigbee_zcl_global_control_emit_discover_commands_generated_rsp(
+ global_control_object,
+ v_commands, attr_t->list_count, attr_t->cluster_id,
+ attr_t->node_id, attr_t->src_ep, attr_t->discovery_completed);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_ATTR_EXT_RSP: {
+ ZigbeeZclGlobalControlDiscoverAttributesExtendedResp_t *attr_t =
+ (ZigbeeZclGlobalControlDiscoverAttributesExtendedResp_t*)noti_data;
+
+ GVariant *v_attrs = NULL;
+ GVariant *v_attrs_type = NULL;
+ GVariant *v_access = NULL;
+ v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ attr_t->attribute_list, (sizeof(gushort) * attr_t->list_count),
+ TRUE, NULL, NULL);
+ v_attrs_type = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->attribute_type_list, attr_t->list_count, TRUE, NULL, NULL);
+ v_access = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->access_list, attr_t->list_count, TRUE, NULL, NULL);
+ if (NULL == v_attrs_type || NULL == v_attrs || NULL == v_access) {
+ Z_LOGE("Failed to create variant!");
+ if (v_attrs_type)
+ g_variant_unref(v_attrs_type);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_access)
+ g_variant_unref(v_access);
+ } else {
+ Z_LOGD("Discover attributes extended resp");
+ zigbee_zcl_global_control_emit_discover_attributes_extended_rsp(
+ global_control_object,
+ v_attrs, v_attrs_type, v_access,
+ attr_t->list_count, attr_t->cluster_id,
+ attr_t->node_id, attr_t->src_ep, attr_t->discovery_completed);
+ }
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_DEFAULT_RSP: {
+ ZigbeeZclGlobalControlDefaultResp_t *attr_t =
+ (ZigbeeZclGlobalControlDefaultResp_t*)noti_data;
+
+ Z_LOGD("Global default resp");
+ zigbee_zcl_global_control_emit_zcl_global_default_response(
+ global_control_object,
+ attr_t->cluster_id, attr_t->node_id, attr_t->src_ep,
+ attr_t->command_id, attr_t->status);
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_REPORT_ATTR_HANDLER_RSP: {
+ ZigbeeZclGlobalControlReportAttributeHandlerResp_t *attr_t =
+ (ZigbeeZclGlobalControlReportAttributeHandlerResp_t*)noti_data;
+
+ GVariant *v_attrs = NULL;
+ GVariant *v_data_type = NULL;
+ GVariant *v_values = NULL;
+ GVariantBuilder *values_builder = NULL;
+ int i = 0, j = 0;
+
+ v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ attr_t->attribute_list, (sizeof(gushort) * attr_t->list_count),
+ TRUE, NULL, NULL);
+ v_data_type = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ attr_t->data_type_list, attr_t->list_count, TRUE, NULL, NULL);
+ if (NULL == v_data_type || NULL == v_attrs) {
+ Z_LOGE("Failed to create variant!");
+ if (v_data_type)
+ g_variant_unref(v_data_type);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ break;
+ }
+
+ values_builder = g_variant_builder_new (G_VARIANT_TYPE ("a(y)"));
+ if (NULL == values_builder) {
+ Z_LOGE("Failed to create variant builder!");
+ g_variant_unref(v_data_type);
+ g_variant_unref(v_attrs);
+ break;
+ }
+ for(i = 0; i < attr_t->list_count; i++) {
+ for(j = 0; j < attr_t->values_count[i]; j++) {
+ g_variant_builder_add (values_builder, "(y)", attr_t->values[i][j]);
+ }
+ }
+ v_values = g_variant_builder_end (values_builder);
+ g_variant_builder_unref(values_builder);
+ if (NULL == values_builder) {
+ Z_LOGE("Failed to create variant!");
+ g_variant_unref(v_data_type);
+ g_variant_unref(v_attrs);
+ break;
+ }
+
+ Z_LOGD("Report attributes handler resp");
+ zigbee_zcl_global_control_emit_report_attr_handler_rsp(
+ global_control_object,
+ attr_t->node_id, attr_t->src_ep, attr_t->cluster_id,
+ v_attrs, v_data_type, v_values,
+ attr_t->list_count);
+ break;
+ }
+ case ZBLIB_ZCL_GLOBAL_NOTI_READ_CONFIG_REPORT_RSP: {
+ ZigbeeZclGlobalControlReadConfigureReportingResp_t *resp_t =
+ (ZigbeeZclGlobalControlReadConfigureReportingResp_t *)noti_data;
+ int i = 0;
+ int v = 0;
+
+ GVariant *v_entries = NULL;
+ GVariantBuilder *entry_builder =
+ g_variant_builder_new (G_VARIANT_TYPE ("a(yyqyqqayq)"));
+ if (NULL == entry_builder) {
+ Z_LOGE("Failed to create variant builder!");
+ break;
+ }
+
+ for(i = 0; i < resp_t->record_count ; i++) {
+ GVariantBuilder *change_builder =
+ g_variant_builder_new (G_VARIANT_TYPE ("ay"));
+ if (NULL == change_builder) {
+ Z_LOGE("Failed to create variant builder!");
+ g_variant_builder_unref(entry_builder);
+ break;
+ }
+
+ for (v = 0; v < resp_t->entry_list[i].change_count; v++) {
+ g_variant_builder_add (change_builder, "y",
+ resp_t->entry_list[i].change[v]);
+ }
+
+ g_variant_builder_add (entry_builder, "(yyqyqqayq)",
+ resp_t->entry_list[i].status,
+ resp_t->entry_list[i].dir,
+ resp_t->entry_list[i].attribute_id,
+ resp_t->entry_list[i].data_type,
+ resp_t->entry_list[i].min_interval,
+ resp_t->entry_list[i].max_interval,
+ change_builder,
+ resp_t->entry_list[i].change_count,
+ resp_t->entry_list[i].timeout);
+
+ g_variant_builder_unref(change_builder);
+ }
+ v_entries = g_variant_builder_end(entry_builder);
+ g_variant_builder_unref(entry_builder);
+
+ Z_LOGD("Read configure reporting resp");
+ zigbee_zcl_global_control_emit_read_configure_reporting_rsp(
+ global_control_object, resp_t->cluster_id, resp_t->node_id,
+ resp_t->record_count, resp_t->src_ep, v_entries);
+ break;
+ }
+ default:
+ Z_LOGE("Unexpected notification [%x]", noti_id);
+ break;
+ }
+
+ /* ZigbeeZcl_global_control should be dereferenced */
+ g_object_unref(global_control_object);
}
gboolean zigbee_service_dbus_interface_zcl_global_control_init(ZigBeeServiceInterface *service_interface,