Adding service interface layer logic for request processing
authorSuresh Kumar N <suresh.n@samsung.com>
Fri, 6 Jan 2017 13:23:05 +0000 (18:53 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Thu, 11 May 2017 09:10:25 +0000 (18:10 +0900)
Modules completed:
 - zcl_color
 - zcl_group
 - zcl_poll_control
 - zcl_scene
 - zclglobal_control
 - zclias_control
 - zclidentify_control
 - zdo_bind
 - zdodev_control

Change-Id: Ibe79794cb323d6397c1cd1de0ece51ebba583730
Signed-off-by: Suresh Kumar N <suresh.n@samsung.com>
Signed-off-by: Jiwan Kim <ji-wan.kim@samsung.com>
12 files changed:
common/include/zigbee_zcl_group_type.h
common/include/zigbee_zclidentify_control_type.h
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_thermostat.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zcl_color.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zcl_group.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zcl_poll_control.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zcl_scene.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zclglobal_control.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zclias_control.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zclidentify_control.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zdo_bind.c
zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_zdodev_control.c

index 9264a82..ea2397b 100644 (file)
@@ -39,6 +39,7 @@ typedef struct {
 typedef struct {
        short node_id; /**< Node ID */
        char dest_ep; /**< Destination endpoint */
+       short group_id; /**< Group ID */
 } ZigbeeZclGroupViewGroup_t;
 
 /**
index e289af2..d334c59 100644 (file)
@@ -37,6 +37,7 @@ typedef struct {
  */
 typedef struct {
        short node_id; /**< Node ID */
+       char dest_ep; /**< Destination endpoint */
 } ZigbeeZclidentifyControlQuery_t;
 
 #endif /* __ZIGBEE_ZCLIDENTIFY_CONTROL_TYPE_H__ */
index b512169..d616c3c 100644 (file)
@@ -216,6 +216,8 @@ static gboolean on_thermostat_set_weekly_schedule(ZigbeeThermostat *thermostat_o
        req.no_of_transitions = no_of_transitions;
        req.num_of_days = no_of_days;
        req.mode = mode;
+
+       i = 0;
        g_variant_get(payload, "ay", &iter);
        while (g_variant_iter_loop(iter, "y", req.payload[i])) {
                i++;
index 60b5e61..303d9a5 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zcl_color.h>
+
+static void on_zcl_color_move_to_hue_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_to_hue(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gchar endpoint,
-       gchar move_mode,
-       gchar rate,
+       gchar hue,
+       gchar direction,
+       gshort transition_time,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveToHue_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(move_mode);
-       NOT_USED(rate);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveToHue_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.hue = hue;
+       req.direction = direction;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_TO_HUE,
+               &req, sizeof(req),
+               on_zcl_color_move_to_hue_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_hue_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_hue(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gchar endpoint,
-       gchar hue,
-       gchar direction,
+       gchar move_mode,
+       gchar rate,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveHue_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(hue);
-       NOT_USED(direction);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveHue_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.move_mode = move_mode;
+       req.rate = rate;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_HUE,
+               &req, sizeof(req),
+               on_zcl_color_move_hue_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_step_hue_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_step_hue(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -80,24 +183,67 @@ static gboolean on_zcl_color_step_hue(ZigbeeZcl_color *zcl_color_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorStepHue_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(step_mode);
-       NOT_USED(step_size);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorStepHue_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.step_mode = step_mode;
+       req.step_size = step_size;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_STEP_HUE,
+               &req, sizeof(req),
+               on_zcl_color_step_hue_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_to_saturation_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_to_saturation(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -107,23 +253,66 @@ static gboolean on_zcl_color_move_to_saturation(ZigbeeZcl_color *zcl_color_objec
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveToSaturation_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(saturation);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveToSaturation_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.saturation = saturation;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_TO_STAURATION,
+               &req, sizeof(req),
+               on_zcl_color_move_to_saturation_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_saturation_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_saturation(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -133,23 +322,66 @@ static gboolean on_zcl_color_move_saturation(ZigbeeZcl_color *zcl_color_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveSaturation_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(move_mode);
-       NOT_USED(rate);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveSaturation_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.move_mode = move_mode;
+       req.rate = rate;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_STAURATION,
+               &req, sizeof(req),
+               on_zcl_color_move_saturation_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_step_saturation_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_step_saturation(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -160,24 +392,67 @@ static gboolean on_zcl_color_step_saturation(ZigbeeZcl_color *zcl_color_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorStepSaturation_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(step_mode);
-       NOT_USED(step_size);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorStepSaturation_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.step_mode = step_mode;
+       req.step_size = step_size;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_STEP_STAURATION,
+               &req, sizeof(req),
+               on_zcl_color_step_saturation_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_to_hue_and_saturation_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_to_hue_and_saturation(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -188,24 +463,67 @@ static gboolean on_zcl_color_move_to_hue_and_saturation(ZigbeeZcl_color *zcl_col
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveToHueAndSaturation_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(hue);
-       NOT_USED(saturation);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveToHueAndSaturation_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.hue = hue;
+       req.saturation = saturation;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_TO_HUE_AND_SATURATION,
+               &req, sizeof(req),
+               on_zcl_color_move_to_hue_and_saturation_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_to_color_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_to_color(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -216,24 +534,67 @@ static gboolean on_zcl_color_move_to_color(ZigbeeZcl_color *zcl_color_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveToColor_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(start_x);
-       NOT_USED(start_y);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveToColor_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.color_x = start_x;
+       req.color_y = start_y;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_TO_COLOR,
+               &req, sizeof(req),
+               on_zcl_color_move_to_color_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_color_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_color(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -243,23 +604,66 @@ static gboolean on_zcl_color_move_color(ZigbeeZcl_color *zcl_color_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveColor_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(rate_x);
-       NOT_USED(rate_y);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveColor_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.rate_x = rate_x;
+       req.rate_y = rate_y;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_COLOR,
+               &req, sizeof(req),
+               on_zcl_color_move_color_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_step_color_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_step_color(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -270,24 +674,67 @@ static gboolean on_zcl_color_step_color(ZigbeeZcl_color *zcl_color_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorStepColor_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(rate_x);
-       NOT_USED(rate_y);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorStepColor_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.rate_x = rate_x;
+       req.rate_y = rate_y;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_STEP_COLOR,
+               &req, sizeof(req),
+               on_zcl_color_step_color_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_color_move_color_temperature_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_color_move_color_temperature(ZigbeeZcl_color *zcl_color_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -297,19 +744,49 @@ static gboolean on_zcl_color_move_color_temperature(ZigbeeZcl_color *zcl_color_o
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclColorMoveColorTemperature_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_color_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
-       NOT_USED(color_temperature);
-       NOT_USED(transition_time);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclColorMoveColorTemperature_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = endpoint;
+       req.color_temperature = color_temperature;
+       req.transition_time = transition_time;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_color_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_COLOR,
+               ZBLIB_ZCL_COLOR_OPS_MOVE_COLOR_TEMPERATURE,
+               &req, sizeof(req),
+               on_zcl_color_move_color_temperature_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index 749d20e..6c3b36f 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zcl_group.h>
+
+static void on_zcl_group_add_group_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_group_add_group(ZigbeeZcl_group *zcl_group_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        GVariant *group_name,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclGroupAddGroup_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_group_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(group_name);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclGroupAddGroup_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       g_variant_get(group_name, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.group_name[i])) {
+               i++;
+               if (i >= ZIGBEE_ZCL_GROUP_NAME_MAX_LEN + 1)
+                       break;
+       }
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_group_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_GROUP,
+               ZBLIB_ZCL_GROUP_OPS_ADD_GROUP,
+               &req, sizeof(req),
+               on_zcl_group_add_group_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_group_view_group_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_group_view_group(ZigbeeZcl_group *zcl_group_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclGroupViewGroup_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_group_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclGroupViewGroup_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_group_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_GROUP,
+               ZBLIB_ZCL_GROUP_OPS_VIEW_GROUP,
+               &req, sizeof(req),
+               on_zcl_group_view_group_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_group_get_group_membership_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_group_get_group_membership(ZigbeeZcl_group *zcl_group_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gchar group_count,
        GVariant *group_list,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclGroupGetGroupMembership_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
+
+       GVariantIter *iter = NULL;
+       gint i = 0;
+
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclGroupGetGroupMembership_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_count = group_count;
+       req.group_list = g_malloc0(sizeof(gshort) * group_count);
+       g_variant_get(group_list, "aq", &iter);
+       while (g_variant_iter_loop(iter, "q", req.group_list[i])) {
+               i++;
+               if (i >= group_count)
+                       break;
+       }
 
-       NOT_USED(zcl_group_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_count);
-       NOT_USED(group_list);
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_group_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_GROUP,
+               ZBLIB_ZCL_GROUP_OPS_GET_GROUP_MEMBERSHIP,
+               &req, sizeof(req),
+               on_zcl_group_get_group_membership_resp, resp_cb_data);
+
+       /* Free resource */
+       g_free(req.group_list);
+
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_group_remove_group_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_group_remove_group(ZigbeeZcl_group *zcl_group_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclGroupRemoveGroup_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_group_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclGroupRemoveGroup_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_group_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_GROUP,
+               ZBLIB_ZCL_GROUP_OPS_REMOVE_GROUP,
+               &req, sizeof(req),
+               on_zcl_group_remove_group_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_group_remove_all_group_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_group_remove_all_group(ZigbeeZcl_group *zcl_group_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclGroupRemoveAllGroup_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_group_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclGroupRemoveAllGroup_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_group_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_GROUP,
+               ZBLIB_ZCL_GROUP_OPS_REMOVE_ALL_GROUP,
+               &req, sizeof(req),
+               on_zcl_group_remove_all_group_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_group_add_group_if_identifying_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_group_add_group_if_identifying(ZigbeeZcl_group *zcl_group_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        GVariant *group_name,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclGroupAddGroupIfIdentifying_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_group_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(group_name);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclGroupAddGroupIfIdentifying_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       g_variant_get(group_name, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.group_name[i])) {
+               i++;
+               if (i >= ZIGBEE_ZCL_GROUP_NAME_MAX_LEN + 1)
+                       break;
+       }
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_group_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_GROUP,
+               ZBLIB_ZCL_GROUP_OPS_ADD_GROUP_IF_IDENTIFYING,
+               &req, sizeof(req),
+               on_zcl_group_add_group_if_identifying_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index c5ca814..85d618c 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zcl_poll_control.h>
+
+static void on_zcl_poll_control_check_in_response_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_poll_control_check_in_response(ZigbeeZcl_poll_control *zcl_poll_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gchar start_fast_polling,
        gshort fast_poll_timeout,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclPollControlCheckInResponse_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_poll_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(start_fast_polling);
-       NOT_USED(fast_poll_timeout);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclPollControlCheckInResponse_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.start_fast_polling = start_fast_polling;
+       req.fast_poll_timeout = fast_poll_timeout;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_poll_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_POLL_CONTROL,
+               ZBLIB_ZCL_POLL_CONTROL_OPS_CHECK_IN_RESPONSE,
+               &req, sizeof(req),
+               on_zcl_poll_control_check_in_response_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_poll_control_fast_poll_stop_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_poll_control_fast_poll_stop(ZigbeeZcl_poll_control *zcl_poll_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclPollControlFastPollStop_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_poll_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclPollControlFastPollStop_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_poll_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_POLL_CONTROL,
+               ZBLIB_ZCL_POLL_CONTROL_OPS_FAST_POLL_STOP,
+               &req, sizeof(req),
+               on_zcl_poll_control_fast_poll_stop_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_poll_control_set_long_poll_interval_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_poll_control_set_long_poll_interval(ZigbeeZcl_poll_control *zcl_poll_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        guint new_long_poll_interval,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclPollControlSetLongPollInterval_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_poll_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(new_long_poll_interval);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclPollControlSetLongPollInterval_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.new_long_poll_interval = new_long_poll_interval;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_poll_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_POLL_CONTROL,
+               ZBLIB_ZCL_POLL_CONTROL_OPS_SET_LONG_POLL_INTERVAL,
+               &req, sizeof(req),
+               on_zcl_poll_control_set_long_poll_interval_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_poll_control_set_short_poll_interval_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_poll_control_set_short_poll_interval(ZigbeeZcl_poll_control *zcl_poll_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        guint new_short_poll_interval,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclPollControlSetShortPollInterval_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_poll_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(new_short_poll_interval);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclPollControlSetShortPollInterval_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.new_short_poll_interval = new_short_poll_interval;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_poll_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_POLL_CONTROL,
+               ZBLIB_ZCL_POLL_CONTROL_OPS_SET_SHORT_POLL_INTERVAL,
+               &req, sizeof(req),
+               on_zcl_poll_control_set_short_poll_interval_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index 6c242de..1c42d98 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zcl_scene.h>
+
+static void on_zcl_scene_add_scene_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_add_scene(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gchar scene_id,
        gshort transition_time,
@@ -31,175 +46,483 @@ static gboolean on_zcl_scene_add_scene(ZigbeeZcl_scene *zcl_scene_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneAddScene_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
+
+       GVariantIter *iter = NULL;
+       gint i = 0;
+
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneAddScene_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       req.scene_id = scene_id;
+       req.transition_time = transition_time;
+       g_variant_get(scene_name, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.scene_name[i])) {
+               i++;
+               if (i >= ZIGBEE_ZCL_GROUP_NAME_MAX_LEN + 1)
+                       break;
+       }
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(scene_id);
-       NOT_USED(transition_time);
-       NOT_USED(ext_length);
-       NOT_USED(scene_name);
-       NOT_USED(ext_field_set);
+       i = 0;
+       req.ext_field_set_len = ext_length;
+       req.ext_field_set = g_malloc0(ext_length);
+       g_variant_get(ext_field_set, "aq", &iter);
+       while (g_variant_iter_loop(iter, "q", req.ext_field_set[i])) {
+               i++;
+               if (i >= ext_length)
+                       break;
+       }
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_ADD_SCENE,
+               &req, sizeof(req),
+               on_zcl_scene_add_scene_resp, resp_cb_data);
+
+       /* Free resource */
+       g_free(req.ext_field_set);
+
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_scene_view_scene_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_view_scene(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gchar scene_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneViewScene_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(scene_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneViewScene_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       req.scene_id = scene_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_VIEW_SCENE,
+               &req, sizeof(req),
+               on_zcl_scene_view_scene_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_scene_remove_scene_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_remove_scene(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gchar scene_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneRemoveScene_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(scene_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneRemoveScene_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       req.scene_id = scene_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_REMOVE_SCENE,
+               &req, sizeof(req),
+               on_zcl_scene_remove_scene_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_scene_store_scene_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_store_scene(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gchar scene_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneStoreScene_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(scene_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneStoreScene_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       req.scene_id = scene_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_STORE_SCENE,
+               &req, sizeof(req),
+               on_zcl_scene_store_scene_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_scene_recall_scene_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_recall_scene(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gchar scene_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneRecallScene_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
-       NOT_USED(scene_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneRecallScene_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+       req.scene_id = scene_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_RECALL_SCENE,
+               &req, sizeof(req),
+               on_zcl_scene_recall_scene_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_scene_remove_all_scene_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_remove_all_scene(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneRemoveAllScene_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneRemoveAllScene_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_REMOVE_ALL_SCENE,
+               &req, sizeof(req),
+               on_zcl_scene_remove_all_scene_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zcl_scene_get_scene_membership_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zcl_scene_get_scene_membership(ZigbeeZcl_scene *zcl_scene_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort group_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclSceneGetSceneMembership_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zcl_scene_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(group_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclSceneGetSceneMembership_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.group_id = group_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zcl_scene_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCL_SCENE,
+               ZBLIB_ZCL_SCENE_OPS_GET_SCENE_MEMBERSHIP,
+               &req, sizeof(req),
+               on_zcl_scene_get_scene_membership_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index abf5905..29367db 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zclglobal_control.h>
+
+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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_read_attributes_req(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *attribute_id,
@@ -29,25 +44,76 @@ static gboolean on_zclglobal_control_read_attributes_req(ZigbeeZclglobal_control
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlReadAttributesRequest_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(attribute_id);
-       NOT_USED(attribute_ids_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlReadAttributesRequest_t));
+
+       /* Update request structure */
+       g_variant_get(attribute_id, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.attribute_id[i])) {
+               i++;
+               if (i >= attribute_ids_length)
+                       break;
+       }
+       req.attribute_id_len = attribute_ids_length;
+       req.node_id = node_id;
+       req.cluster_id = cluster_id;
+       req.zcl_frame_ctrl = zcl_frame_ctrl;
+       req.dest_ep = dest_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_READ_ATTRIBUTES_REQ,
+               &req, sizeof(req),
+               on_zclglobal_control_read_attributes_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_write_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_write_attributes_req(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *write_attribute,
@@ -59,25 +125,76 @@ static gboolean on_zclglobal_control_write_attributes_req(ZigbeeZclglobal_contro
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlWriteAttributesRequest_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(write_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlReadAttributesRequest_t));
+
+       /* Update request structure */
+       g_variant_get(write_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       req.node_id = node_id;
+       req.cluster_id = cluster_id;
+       req.zcl_frame_ctrl = zcl_frame_ctrl;
+       req.dest_ep = dest_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_WRITE_ATTRIBUTES_REQ,
+               &req, sizeof(req),
+               on_zclglobal_control_write_attributes_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_write_attributes_undivided_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_write_attributes_undivided_req(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *write_attribute,
@@ -90,26 +207,77 @@ static gboolean on_zclglobal_control_write_attributes_undivided_req(ZigbeeZclglo
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlWriteAttributesUndividedRequest_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(write_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(src_ep);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlWriteAttributesUndividedRequest_t));
+
+       /* Update request structure */
+       g_variant_get(write_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       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 */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_WRITE_ATTRIBUTES_UNDIVIDED_REQ,
+               &req, sizeof(req),
+               on_zclglobal_control_write_attributes_undivided_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_write_attributes_no_resp_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_write_attributes_no_resp(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *write_attribute,
@@ -122,26 +290,77 @@ static gboolean on_zclglobal_control_write_attributes_no_resp(ZigbeeZclglobal_co
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlWriteAttributesNoResponse_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(write_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(src_ep);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlWriteAttributesNoResponse_t));
+
+       /* Update request structure */
+       g_variant_get(write_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       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 */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_WRITE_ATTRIBUTES_NO_RESP,
+               &req, sizeof(req),
+               on_zclglobal_control_write_attributes_no_resp_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_write_attributes_structured_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_write_attributes_structured(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *write_attribute,
@@ -154,26 +373,77 @@ static gboolean on_zclglobal_control_write_attributes_structured(ZigbeeZclglobal
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlWriteAttributesStructed_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(write_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(src_ep);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlWriteAttributesStructed_t));
+
+       /* Update request structure */
+       g_variant_get(write_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.write_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       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 */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_WRITE_ATTRIBUTES_STRUCTURED,
+               &req, sizeof(req),
+               on_zclglobal_control_write_attributes_structured_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_read_attributes_structured_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_read_attributes_structured(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *read_attribute,
@@ -186,26 +456,77 @@ static gboolean on_zclglobal_control_read_attributes_structured(ZigbeeZclglobal_
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlReadAttributesStructed_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(read_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(src_ep);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlReadAttributesStructed_t));
+
+       /* Update request structure */
+       g_variant_get(read_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.read_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       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 */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_READ_ATTRIBUTES_STRUCTURED,
+               &req, sizeof(req),
+               on_zclglobal_control_read_attributes_structured_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_configure_reporting_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_configure_reporting_req(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *read_attribute,
@@ -218,26 +539,77 @@ static gboolean on_zclglobal_control_configure_reporting_req(ZigbeeZclglobal_con
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlConfigureReportingReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(read_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(src_ep);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlConfigureReportingReq_t));
+
+       /* Update request structure */
+       g_variant_get(read_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.read_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       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 */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_CONFIGURE_REPORTING_REQ,
+               &req, sizeof(req),
+               on_zclglobal_control_configure_reporting_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_read_configure_reporting_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_read_configure_reporting(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *read_attribute,
@@ -250,26 +622,77 @@ static gboolean on_zclglobal_control_read_configure_reporting(ZigbeeZclglobal_co
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlReadConfigureReporting_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(read_attribute);
-       NOT_USED(records_length);
-       NOT_USED(node_id);
-       NOT_USED(cluster_id);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(src_ep);
-       NOT_USED(dest_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlReadConfigureReporting_t));
+
+       /* Update request structure */
+       g_variant_get(read_attribute, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.read_records[i])) {
+               i++;
+               if (i >= records_length)
+                       break;
+       }
+       req.records_len = records_length;
+       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 */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_READ_CONFIGURE_REPORTING,
+               &req, sizeof(req),
+               on_zclglobal_control_read_configure_reporting_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_discover_attributes_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_discover_attributes(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -281,25 +704,68 @@ static gboolean on_zclglobal_control_discover_attributes(ZigbeeZclglobal_control
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlDiscoverAttributes_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dest_ep);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(cluster_id);
-       NOT_USED(start_attr);
-       NOT_USED(max);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlDiscoverAttributes_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       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;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_DISCOVER_ATTRIBUTES,
+               &req, sizeof(req),
+               on_zclglobal_control_discover_attributes_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_discover_attributes_extended_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_discover_attributes_extended(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -311,25 +777,68 @@ static gboolean on_zclglobal_control_discover_attributes_extended(ZigbeeZclgloba
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlDiscoverAttributesExtended_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dest_ep);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(cluster_id);
-       NOT_USED(start_attr);
-       NOT_USED(max);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlDiscoverAttributesExtended_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       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;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_DISCOVER_ATTRIBUTES_EXTENDED,
+               &req, sizeof(req),
+               on_zclglobal_control_discover_attributes_extended_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_discover_commands_received_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_discover_commands_received(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -341,25 +850,68 @@ static gboolean on_zclglobal_control_discover_commands_received(ZigbeeZclglobal_
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlDiscoverCommandsReceived_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dest_ep);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(cluster_id);
-       NOT_USED(start_attr);
-       NOT_USED(max);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlDiscoverCommandsReceived_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       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;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_DISCOVER_COMMANDS_RECEIVED,
+               &req, sizeof(req),
+               on_zclglobal_control_discover_commands_received_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclglobal_control_discover_commands_generated_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclglobal_control_discover_commands_generated(ZigbeeZclglobal_control *zclglobal_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -371,21 +923,51 @@ static gboolean on_zclglobal_control_discover_commands_generated(ZigbeeZclglobal
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclglobalControlDiscoverCommandsGenerated_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclglobal_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dest_ep);
-       NOT_USED(zcl_frame_ctrl);
-       NOT_USED(cluster_id);
-       NOT_USED(start_attr);
-       NOT_USED(max);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclglobalControlDiscoverCommandsGenerated_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       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;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclglobal_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLGLOBAL_CONTROL,
+               ZBLIB_ZCLGLOBAL_CONTROL_OPS_DISCOVER_COMMANDS_GENERATED,
+               &req, sizeof(req),
+               on_zclglobal_control_discover_commands_generated_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index 918ac81..9653ebb 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zclias_control.h>
+
+static void on_zclias_control_enroll_response_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclias_control_enroll_response(ZigbeeZclias_control *zclias_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gchar enroll_code,
        gchar zone_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZcliasControlEnrolResponse_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclias_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(enroll_code);
-       NOT_USED(zone_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZcliasControlEnrolResponse_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.enroll_code = enroll_code;
+       req.zone_id = zone_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclias_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLIAS_CONTROL,
+               ZBLIB_ZCLIAS_CONTROL_OPS_ENROLL_RESPONSE,
+               &req, sizeof(req),
+               on_zclias_control_enroll_response_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index 1ca4dec..ac77b0b 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zclidentify_control.h>
+
+static void on_zclidentify_control_identify_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclidentify_control_identify(ZigbeeZclidentify_control *zclidentify_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
-       gchar dst_ep,
+       gchar dest_ep,
        gshort identifytime,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclidentifyControlIdentify_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclidentify_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(dst_ep);
-       NOT_USED(identifytime);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclidentifyControlIdentify_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+       req.identify_time = identifytime;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclidentify_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLIDENTIFY_CONTROL,
+               ZBLIB_ZCLIDENTIFY_CONTROL_OPS_IDENTIFY,
+               &req, sizeof(req),
+               on_zclidentify_control_identify_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zclidentify_control_query_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zclidentify_control_query(ZigbeeZclidentify_control *zclidentify_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
+       gchar dest_ep,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZclidentifyControlQuery_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zclidentify_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZclidentifyControlQuery_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.dest_ep = dest_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zclidentify_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZCLIDENTIFY_CONTROL,
+               ZBLIB_ZCLIDENTIFY_CONTROL_OPS_QUERY,
+               &req, sizeof(req),
+               on_zclidentify_control_query_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index aad1471..41eca1f 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zdo_bind.h>
+
+static void on_zdo_bind_bind_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdo_bind_bind_req(ZigbeeZdo_bind *zdo_bind_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -31,27 +46,83 @@ static gboolean on_zdo_bind_bind_req(ZigbeeZdo_bind *zdo_bind_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdoBindBindReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdo_bind_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(src_addr);
-       NOT_USED(src_ep);
-       NOT_USED(cluster_id);
-       NOT_USED(dst_addr);
-       NOT_USED(bind_type);
-       NOT_USED(group_addr);
-       NOT_USED(dst_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZdoBindBindReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       g_variant_get(src_addr, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.src_addr[i])) {
+               i++;
+               if (i >= ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1)
+                       break;
+       }
+       req.src_ep = src_ep;
+       req.cluster_id = cluster_id;
+       g_variant_get(dst_addr, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.dst_addr[i])) {
+               i++;
+               if (i >= ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1)
+                       break;
+       }
+       req.bind_type = bind_type;
+       req.group_addr = group_addr;
+       req.dst_ep = dst_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdo_bind_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDO_BIND,
+               ZBLIB_ZDO_BIND_OPS_BIND_REQ,
+               &req, sizeof(req),
+               on_zdo_bind_bind_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdo_bind_unbind_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdo_bind_unbind_req(ZigbeeZdo_bind *zdo_bind_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -65,23 +136,66 @@ static gboolean on_zdo_bind_unbind_req(ZigbeeZdo_bind *zdo_bind_object,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdoBindUnbindReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdo_bind_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(src_addr);
-       NOT_USED(src_ep);
-       NOT_USED(cluster_id);
-       NOT_USED(dst_addr);
-       NOT_USED(bind_type);
-       NOT_USED(group_addr);
-       NOT_USED(dst_ep);
+       GVariantIter *iter = NULL;
+       gint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZdoBindUnbindReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       g_variant_get(src_addr, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.src_addr[i])) {
+               i++;
+               if (i >= ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1)
+                       break;
+       }
+       req.src_ep = src_ep;
+       req.cluster_id = cluster_id;
+       g_variant_get(dst_addr, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.dst_addr[i])) {
+               i++;
+               if (i >= ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN + 1)
+                       break;
+       }
+       req.bind_type = bind_type;
+       req.group_addr = group_addr;
+       req.dst_ep = dst_ep;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdo_bind_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDO_BIND,
+               ZBLIB_ZDO_BIND_OPS_UNBIND_REQ,
+               &req, sizeof(req),
+               on_zdo_bind_unbind_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
index 7d8debb..09e9790 100644 (file)
 
 #include "zigbee_service_interface_common.h"
 
+#include <zblib_driver_zdodev_control.h>
+
+static void on_zdodev_control_nwk_addr_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_nwk_addr_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        GVariant *eui64,
@@ -26,22 +41,73 @@ static gboolean on_zdodev_control_nwk_addr_req(ZigbeeZdodev_control *zdodev_cont
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlNwkAddrReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(eui64);
-       NOT_USED(request_type);
-       NOT_USED(start_index);
+       GVariantIter *iter = NULL;
+       guint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlNwkAddrReq_t));
+
+       /* Update request structure */
+       g_variant_get(eui64, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.eui64[i])) {
+               i++;
+               if (i >= ZIGBEE_EUI64_SIZE)
+                       break;
+       }
+       req.request_type = request_type;
+       req.start_index = start_index;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_NWK_ADDR_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_nwk_addr_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_matched_descriptor_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_matched_descriptor_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -53,145 +119,468 @@ static gboolean on_zdodev_control_matched_descriptor_req(ZigbeeZdodev_control *z
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlMatchedDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
+
+       GVariantIter *iter = NULL;
+       guint i = 0;
+
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlMatchedDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.profile_id = profile_id;
+       req.num_in_cl = num_in_cl;
+       req.in_cl = g_malloc0(sizeof(num_in_cl));
+       g_variant_get(in_cl, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.in_cl[i])) {
+               i++;
+               if (i >= num_in_cl)
+                       break;
+       }
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(profile_id);
-       NOT_USED(num_in_cl);
-       NOT_USED(in_cl);
-       NOT_USED(num_out_cl);
-       NOT_USED(out_cl);
+       i = 0;
+       req.num_out_cl = num_out_cl;
+       req.out_cl = g_malloc0(sizeof(num_out_cl));
+       g_variant_get(out_cl, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.out_cl[i])) {
+               i++;
+               if (i >= num_out_cl)
+                       break;
+       }
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_MATCHED_DESCRIPTOR_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_matched_descriptor_req_resp, resp_cb_data);
+
+       /* Free resources */
+       g_free(req.in_cl);
+       g_free(req.out_cl);
+
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_ieee_addr_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_ieee_addr_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlIeeeAddrReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlIeeeAddrReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_IEEE_ADDR_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_ieee_addr_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_active_ep_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_active_ep_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlActiveEpReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlActiveEpReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_ACTIVE_EP_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_active_ep_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_node_desc_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_node_desc_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlNodeDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlNodeDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_NODE_DESC_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_node_desc_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_power_desc_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_power_desc_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlPowerDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlPowerDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_POWER_DESC_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_power_desc_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_complex_desc_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_complex_desc_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlComplexDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlComplexDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_COMPLEX_DESC_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_complex_desc_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_user_desc_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_user_desc_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlUserDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlUserDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_USER_DESC_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_user_desc_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_user_desc_set_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_user_desc_set_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -200,22 +589,73 @@ static gboolean on_zdodev_control_user_desc_set_req(ZigbeeZdodev_control *zdodev
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlUserDescriptorSetReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(length);
-       NOT_USED(user_desc);
+       GVariantIter *iter = NULL;
+       guint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlUserDescriptorSetReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.user_descriptor_len = length;
+       g_variant_get(user_desc, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.user_descriptor[i])) {
+               i++;
+               if (i >= ZIGBEE_ZDODEV_CONTROL_USER_DECRIPTOR_MAX_LEN)
+                       break;
+       }
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_USER_DESC_SET_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_user_desc_set_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_device_announce_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_device_announce(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -224,22 +664,73 @@ static gboolean on_zdodev_control_device_announce(ZigbeeZdodev_control *zdodev_c
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlDeviceAnnounce_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(mac_addr);
-       NOT_USED(capability);
+       GVariantIter *iter = NULL;
+       guint i = 0;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       gboolean ret;
+
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlDeviceAnnounce_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       g_variant_get(mac_addr, "ay", &iter);
+       while (g_variant_iter_loop(iter, "y", req.mac_addr[i])) {
+               i++;
+               if (i >= ZIGBEE_EUI64_SIZE)
+                       break;
+       }
+       req.capability = capability;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_DEVICE_ANNOUNCE,
+               &req, sizeof(req),
+               on_zdodev_control_device_announce_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_simple_desc_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_simple_desc_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -247,21 +738,64 @@ static gboolean on_zdodev_control_simple_desc_req(ZigbeeZdodev_control *zdodev_c
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlSimpleDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(endpoint);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlSimpleDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.endpoint = endpoint;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_SIMPLE_DESC_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_simple_desc_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_mgmt_lqi_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_mgmt_lqi_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -269,21 +803,64 @@ static gboolean on_zdodev_control_mgmt_lqi_req(ZigbeeZdodev_control *zdodev_cont
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlMgmtLqiReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(start_idx);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlMgmtLqiReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.start_index = start_idx;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_MGMT_LQI_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_mgmt_lqi_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_mgmt_rtg_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_mgmt_rtg_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -291,21 +868,64 @@ static gboolean on_zdodev_control_mgmt_rtg_req(ZigbeeZdodev_control *zdodev_cont
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlMgmtRtgReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(start_idx);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlMgmtRtgReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.start_index = start_idx;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_MGMT_RTG_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_mgmt_rtg_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_mgmt_bind_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_mgmt_bind_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -313,21 +933,64 @@ static gboolean on_zdodev_control_mgmt_bind_req(ZigbeeZdodev_control *zdodev_con
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlMgmtBindReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(start_idx);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlMgmtBindReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.start_index = start_idx;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_MGMT_BIND_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_mgmt_bind_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_mgmt_permit_join_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_mgmt_permit_join_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort addr16,
@@ -336,22 +999,65 @@ static gboolean on_zdodev_control_mgmt_permit_join_req(ZigbeeZdodev_control *zdo
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlMgmtPermitJoinReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(addr16);
-       NOT_USED(duration);
-       NOT_USED(tc_significance);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlMgmtPermitJoinReq_t));
+
+       /* Update request structure */
+       req.addr = addr16;
+       req.duration = duration;
+       req.tc_significance = tc_significance;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_MGMT_PERMIT_JOIN_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_mgmt_permit_join_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_nwk_update_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_nwk_update_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -362,24 +1068,67 @@ static gboolean on_zdodev_control_nwk_update_req(ZigbeeZdodev_control *zdodev_co
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlNwkUpdateReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(scan_channel);
-       NOT_USED(scan_duration);
-       NOT_USED(scan_count);
-       NOT_USED(nwk_update_id);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlNwkUpdateReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.scan_channel = scan_channel;
+       req.scan_duration = scan_duration;
+       req.scan_count = scan_count;
+       req.network_update_id = nwk_update_id;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_NWK_UPDATE_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_nwk_update_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }
 
+static void on_zdodev_control_nwk_disc_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);
+       NOT_USED(service_interface);
+       NOT_USED(request_id);
+       NOT_USED(resp_data);
+       NOT_USED(resp_data_len);
+}
+
 static gboolean on_zdodev_control_nwk_disc_req(ZigbeeZdodev_control *zdodev_control_object,
        GDBusMethodInvocation *invocation,
        gshort node_id,
@@ -390,20 +1139,50 @@ static gboolean on_zdodev_control_nwk_disc_req(ZigbeeZdodev_control *zdodev_cont
        gpointer user_data)
 {
        ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
+       ZigbeeZdodevControlNwkDescriptorReq_t req;
+       ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
 
-       NOT_USED(zdodev_control_object);
-       NOT_USED(invocation);
-       NOT_USED(service_interface);
-       NOT_USED(node_id);
-       NOT_USED(scan_channel);
-       NOT_USED(scan_duration);
-       NOT_USED(scan_count);
-       NOT_USED(start_index);
+       gboolean ret;
 
-       /*
-        * TODO -
-        * Create and send request for processing
-        */
+       memset(&req, 0x0, sizeof(ZigbeeZdodevControlNwkDescriptorReq_t));
+
+       /* Update request structure */
+       req.node_id = node_id;
+       req.scan_channel = scan_channel;
+       req.scan_duration = scan_duration;
+       req.scan_count = scan_count;
+       req.start_index = start_index;
+
+       /* Allocate response callback data */
+       resp_cb_data =
+               zigbee_service_dbus_interface_create_resp_cb_data(zdodev_control_object,
+                       invocation, NULL, 0);
+       if (NULL == resp_cb_data) {
+               Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
+
+       /* Dispatch request */
+       ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
+               ZBLIB_DRIVER_TYPE_ZDODEV_CONTROL,
+               ZBLIB_ZDODEV_CONTROL_OPS_NWK_DISC_REQ,
+               &req, sizeof(req),
+               on_zdodev_control_nwk_disc_req_resp, resp_cb_data);
+       if (FALSE == ret) {
+               Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
+
+               /* Free response callback data */
+               zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
+
+               /* Send failure response */
+               ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
+
+               return TRUE;
+       }
 
        return TRUE;
 }