return service;
}
-static void on_service_enable_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;
-
- ZigbeeService *service_object;
- GDBusMethodInvocation *invocation;
- ZigbeeServiceServiceState_t *payload =
- (ZigbeeServiceServiceState_t*)resp_data;
-
- NOT_USED(service_interface);
- NOT_USED(request_id);
-
- if (NULL == resp_data || 0 == resp_data_len) {
- Z_LOGE("resp_data is null");
- return;
- }
-
- service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
-
- invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
-
- zigbee_service_complete_enable(service_object, invocation,
- payload->result, payload->enabled);
-
- g_free(cb_data);
-}
-
-static gboolean on_service_enable(ZigbeeService *service_object,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
- ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
-
- gboolean ret;
-
- Z_LOGE("KSR");
-
- /* Allocate response callback data */
- resp_cb_data =
- zigbee_service_dbus_interface_create_resp_cb_data(service_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_SERVICE,
- ZBLIB_SERVICE_OPS_ENABLE,
- NULL, 0,
- on_service_enable_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_service_disable_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;
-
- ZigbeeService *service_object;
- GDBusMethodInvocation *invocation;
- ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
-
- NOT_USED(service_interface);
- NOT_USED(request_id);
-
- if (NULL == resp_data || 0 == resp_data_len) {
- Z_LOGE("resp_data is null");
- return;
- }
-
- service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
-
- invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
-
- zigbee_service_complete_disable(service_object, invocation, payload->result);
-
- g_free(cb_data);
-}
-
-static gboolean on_service_disable(ZigbeeService *service_object,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
- ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
-
- gboolean ret;
-
- /* Allocate response callback data */
- resp_cb_data =
- zigbee_service_dbus_interface_create_resp_cb_data(service_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_SERVICE,
- ZBLIB_SERVICE_OPS_DISABLE,
- NULL, 0,
- on_service_disable_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_service_zb_hw_reset_resp(ZigBeeServiceInterface *service_interface,
guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
{
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_zb_hw_reset(service_object, invocation, payload->result);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_form_network(service_object, invocation, payload->result);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_coex_start(service_object, invocation, payload->result);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_coex_stop(service_object, invocation, payload->result);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_leave_network(service_object, invocation, payload->result);
ZigbeeService *service_object;
GDBusMethodInvocation *invocation;
- ZigbeeServiceGetNetworkInfo_t *payload =
- (ZigbeeServiceGetNetworkInfo_t*)resp_data;
+ ZigbeeServiceGetNetworkInfoResp_t *payload =
+ (ZigbeeServiceGetNetworkInfoResp_t*)resp_data;
- GVariant *v_eui64;
+ GVariant *v_eui64 = NULL;
NOT_USED(service_interface);
NOT_USED(request_id);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
payload->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_permit_join(service_object, invocation, payload->result);
if (NULL == resp_data || 0 == resp_data_len) {
Z_LOGE("resp_data is null");
+ g_free(cb_data);
return;
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_leave_request(service_object, invocation, payload->result);
memset(&req, 0x0, sizeof(ZigbeeServiceLeaveRequest_t));
/* Update request structure */
- g_variant_get(eui64, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.eui64[i])) {
+ g_variant_get(eui64, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
i++;
if (i >= ZIGBEE_EUI64_SIZE)
break;
req.remove_child = remove_child;
req.rejoin = rejoin;
+ Z_LOGD("IEEE Address = %X:%X:%X:%X:%X:%X:%X:%X",
+ req.eui64[0], req.eui64[1], req.eui64[2], req.eui64[3],
+ req.eui64[4], req.eui64[5], req.eui64[6], req.eui64[7]);
+ Z_LOGD("remove_child [%d]", remove_child);
+ Z_LOGD("rejoin [%d]", rejoin);
+
/* Allocate response callback data */
resp_cb_data =
zigbee_service_dbus_interface_create_resp_cb_data(service_object,
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
- /* To-To : zigbee_service_complete_get_device_list */
- //zigbee_service_complete_get_device_list(service_object, invocation, resp_data);
+ /* TODO : zigbee_service_complete_get_device_list */
+ /* zigbee_service_complete_get_device_list(service_object, invocation, resp_data); */
g_free(cb_data);
}
ZigbeeService *service_object;
GDBusMethodInvocation *invocation;
+ ZigbeeServiceGetMacResp_t *payload =
+ (ZigbeeServiceGetMacResp_t*)resp_data;
+
+ GVariant *v_eui64 = NULL;
- NOT_USED(cb_data);
NOT_USED(service_interface);
NOT_USED(request_id);
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ payload->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
- /* Todo : plugin must load resp_data as char pointer */
- //zigbee_service_complete_get_mac(service_object, invocation, resp_data);
+ zigbee_service_complete_get_mac(service_object, invocation, payload->result,
+ v_eui64);
g_free(cb_data);
-
}
static gboolean on_service_get_mac(ZigbeeService *service_object,
ZigbeeService *service_object;
GDBusMethodInvocation *invocation;
+ ZigbeeServiceGetDeviceInfoResp_t *payload =
+ (ZigbeeServiceGetDeviceInfoResp_t*)resp_data;
+
+ GVariant *variant = NULL;
+ GVariantBuilder* builder = NULL;
+ int i = 0;
+ int index = 0;
- NOT_USED(cb_data);
NOT_USED(service_interface);
NOT_USED(request_id);
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ builder = g_variant_builder_new(G_VARIANT_TYPE("a(qyayyay)"));
+ for (index = 0; index < payload->count; index++) {
+ ZigbeeServiceGetDeviceInfoDetailResp_t *device = &(payload->list[index]);
+ GVariantBuilder* mac_builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
+ GVariantBuilder* endpoint_builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
- /* To-Do : zigbee_service_complete_get_device_list */
- //zigbee_service_complete_get_device_info(service_object, invocation, resp_data);
+ for (i = 0; i < ZIGBEE_EUI64_SIZE; i++)
+ g_variant_builder_add(mac_builder, "y", device->eui64[i]);
+ for (i = 0; i < device->endpoint_count; i++)
+ g_variant_builder_add(endpoint_builder, "y", device->endpoints[i]);
+
+ g_variant_builder_add(builder, "(qyayyay)",
+ device->node_id, device->node_type,
+ mac_builder, device->endpoint_count, endpoint_builder);
+
+ g_variant_builder_unref(mac_builder);
+ g_variant_builder_unref(endpoint_builder);
+ }
+
+ variant = g_variant_builder_end(builder);
+ zigbee_service_complete_get_device_info(service_object, invocation,
+ payload->result, variant);
g_free(cb_data);
}
ZigbeeService *service_object;
GDBusMethodInvocation *invocation;
+ ZigbeeServiceGetEndpointListResp_t *payload =
+ (ZigbeeServiceGetEndpointListResp_t*)resp_data;
+ GVariant *v_endpoints = NULL;
- NOT_USED(cb_data);
NOT_USED(service_interface);
NOT_USED(request_id);
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
- /* To fix : end-points must be changed gchar* -> GVariant ay */
- //zigbee_service_complete_get_endpoint_list(service_object, invocation, resp_data);
+ v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ payload->endpoints, payload->endpoint_count, TRUE, NULL, NULL);
+
+ zigbee_service_complete_get_endpoint_list(service_object, invocation,
+ payload->result, v_endpoints);
g_free(cb_data);
}
memset(&req, 0x0, sizeof(ZigbeeServiceGetEndpointList_t));
/* Update request structure */
- g_variant_get(eui64, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.eui64[i])) {
+ g_variant_get(eui64, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
i++;
if (i >= ZIGBEE_EUI64_SIZE)
break;
ZigbeeService *service_object;
GDBusMethodInvocation *invocation;
+ ZigbeeServiceGetClusterListResp_t *payload =
+ (ZigbeeServiceGetClusterListResp_t*)resp_data;
+ GVariant *v_in_clusters = NULL;
+ GVariant *v_out_clusters = NULL;
- NOT_USED(cb_data);
NOT_USED(service_interface);
NOT_USED(request_id);
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
+
+ v_in_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ payload->in_clusters, (payload->in_cluster_count * sizeof(unsigned short)),
+ TRUE, NULL, NULL);
+ v_out_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
+ payload->out_clusters, (payload->out_cluster_count * sizeof(unsigned short)),
+ TRUE, NULL, NULL);
- /* To-Do : zigbee_service_complete_get_cluster_list */
- //zigbee_service_complete_get_cluster_list(service_object, invocation, resp_data);
+ zigbee_service_complete_get_cluster_list(service_object, invocation,
+ payload->result, v_in_clusters, v_out_clusters);
g_free(cb_data);
}
memset(&req, 0x0, sizeof(ZigbeeServiceGetClusterList_t));
/* Update request structure */
- g_variant_get(eui64, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.eui64[i])) {
+ g_variant_get(eui64, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
i++;
if (i >= ZIGBEE_EUI64_SIZE)
break;
ZigbeeService *service_object;
GDBusMethodInvocation *invocation;
- ZigbeeServiceServiceNodeType_t *payload =
- (ZigbeeServiceServiceNodeType_t *)resp_data;
+ ZigbeeServiceServiceNodeTypeResp_t *payload =
+ (ZigbeeServiceServiceNodeTypeResp_t *)resp_data;
- NOT_USED(cb_data);
NOT_USED(service_interface);
NOT_USED(request_id);
}
service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
- zblib_check_null_ret("service_object", service_object);
+ zblib_check_null_free_and_ret("service_object", service_object, cb_data);
invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
- zblib_check_null_ret("invocation", invocation);
+ zblib_check_null_free_and_ret("invocation", invocation, cb_data);
zigbee_service_complete_get_node_type(service_object, invocation,
payload->result, payload->node_type);
memset(&req, 0x0, sizeof(ZigbeeServiceGetNodeType_t));
/* Update request structure */
- g_variant_get(eui64, "ay", &iter);
- while (g_variant_iter_loop(iter, "y", req.eui64[i])) {
+ g_variant_get(eui64, "a(y)", &iter);
+ while (g_variant_iter_loop(iter, "(y)", req.eui64[i])) {
i++;
if (i >= ZIGBEE_EUI64_SIZE)
break;
return TRUE;
}
+static gboolean on_service_check_privilege(ZigbeeService *service_object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ NOT_USED(user_data);
+
+ zigbee_service_complete_check_privilege(service_object, invocation);
+
+ return TRUE;
+}
+
void zigbee_service_dbus_interface_service_notification(ZigBeeServiceInterface *service_interface,
guint noti_id, gpointer noti_data, guint noti_data_len, gpointer noti_cb_data)
{
NOT_USED(noti_cb_data);
- switch(noti_id) {
+ switch (noti_id) {
case ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE: {
- ZigbeeServiceServiceFormNetworkDone_t *panid_t =
+ ZigbeeServiceServiceFormNetworkDone_t *panid_t =
(ZigbeeServiceServiceFormNetworkDone_t*)noti_data;
Z_LOGD("form_network_done : [0x%X]", panid_t->pan_id);
-
+
zigbee_service_emit_form_network_done(service_object, panid_t->pan_id);
}
break;
case ZBLIB_SERVICE_NOTI_CHILD_JOINED: {
- zigbee_service_emit_child_joined(service_object, (GVariant *)noti_data);
+ ZigbeeServiceServiceChildJoined_t *child_t =
+ (ZigbeeServiceServiceChildJoined_t*)noti_data;
+
+ GVariant *v_eui64 = NULL;
+ GVariant *v_endpoints = NULL;
+
+ v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
+ v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ child_t->endpoints, child_t->endpoint_count, TRUE, NULL, NULL);
+ if (NULL == v_eui64 || NULL == v_endpoints) {
+ Z_LOGE("Failed to create variant!");
+ if (v_eui64)
+ g_object_unref(v_eui64);
+ if (v_endpoints)
+ g_object_unref(v_endpoints);
+ } else {
+ zigbee_service_emit_child_joined(service_object,
+ v_eui64, child_t->endpoint_count, v_endpoints, child_t->node_id);
+ }
}
break;
case ZBLIB_SERVICE_NOTI_CHILD_REJOINED: {
- ZigbeeServiceServiceChildRejoined_t ieee_addr_t;
- memcpy(&ieee_addr_t, noti_data, noti_data_len);
- zigbee_service_emit_child_rejoined(service_object, ieee_addr_t.eui64);
+ ZigbeeServiceServiceChildRejoined_t *child_t =
+ (ZigbeeServiceServiceChildRejoined_t*)noti_data;
+
+ GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
+ if (NULL == v_eui64)
+ Z_LOGE("Failed to create variant!");
+ else
+ zigbee_service_emit_child_rejoined(service_object, v_eui64);
}
break;
case ZBLIB_SERVICE_NOTI_CHILD_LEFT: {
- ZigbeeServiceServiceChildLeft_t child_left_t;
- memcpy(&child_left_t, noti_data, noti_data_len);
- zigbee_service_emit_child_left(service_object, child_left_t.eui64, child_left_t.status);
+ ZigbeeServiceServiceChildLeft_t *child_left_t =
+ (ZigbeeServiceServiceChildLeft_t*)noti_data;
+
+ GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
+ child_left_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
+ if (NULL == v_eui64)
+ Z_LOGE("Failed to create variant!");
+ else {
+ zigbee_service_emit_child_left(service_object,
+ v_eui64, child_left_t->status);
+ }
}
break;
case ZBLIB_SERVICE_NOTI_LEAVE_NETWORK_DONE: {
* Register signal handlers for 'service' interface
*/
g_signal_connect(service_object,
- "handle-enable",
- G_CALLBACK(on_service_enable), service_interface);
-
- g_signal_connect(service_object,
- "handle-disable",
- G_CALLBACK(on_service_disable), service_interface);
-
- g_signal_connect(service_object,
"handle-zb-hw-reset",
G_CALLBACK(on_service_zb_hw_reset), service_interface);
"handle-get-node-type",
G_CALLBACK(on_service_get_node_type), service_interface);
+ g_signal_connect(service_object,
+ "handle-check-privilege",
+ G_CALLBACK(on_service_check_privilege), service_interface);
+
return TRUE;
}