From: saerome.kim Date: Mon, 23 Jan 2017 12:10:15 +0000 (+0900) Subject: Restore GDBus API from async to sync. X-Git-Tag: submit/tizen/20170512.045637~45 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fzigbee-manager.git;a=commitdiff_plain;h=4314e8cbc0c9d7cf0d0e8e24165882f0b963eabe Restore GDBus API from async to sync. - add result parameters to let app know the result of its calling Change-Id: I2768c25620db74fae8d45174e3e267fcd68e3bd3 Signed-off-by: saerome.kim Signed-off-by: Jiwan Kim --- diff --git a/common/include/zigbee_service_type.h b/common/include/zigbee_service_type.h index 9f5c395..4de51df 100644 --- a/common/include/zigbee_service_type.h +++ b/common/include/zigbee_service_type.h @@ -79,11 +79,22 @@ typedef struct { /* -------------------------------------------------------------------------------------- * For Responses * -------------------------------------------------------------------------------------*/ + + /** + * @brief Definition for service 'enabled' response. + * @since_tizen 4.0 + */ +typedef struct { + int result; /**< Result */ + char enabled; /**< Enabled / Disabled result */ +} ZigbeeServiceServiceState_t; + /** * @brief Definition for get network info structure. * @since_tizen 3.0 */ typedef struct { + int result; /**< Result */ char eui64[ZIGBEE_EUI64_SIZE]; /**< EUI64 (an IEEE address) */ short node_id; /**< Node ID (an Network address) */ short pan_id; /**< PAN ID (an Network address) */ @@ -91,17 +102,18 @@ typedef struct { char radio_tx_power; /**< Power (dBm) */ } ZigbeeServiceGetNetworkInfo_t; -/* -------------------------------------------------------------------------------------- - * For Notifications - * -------------------------------------------------------------------------------------*/ - /** - * @brief Definition for service 'enabled' response. + * @brief Definition for service 'get_node_type' response. * @since_tizen 4.0 */ typedef struct { - char enabled; /**< Enabled / Disabled result */ -} ZigbeeServiceServiceState_t; + int result; /**< Result */ + char node_type; /**< Node Type */ +} ZigbeeServiceServiceNodeType_t; + +/* -------------------------------------------------------------------------------------- + * For Notifications + * -------------------------------------------------------------------------------------*/ /** * @brief Definition for service 'form_network_done' response. @@ -112,7 +124,7 @@ typedef struct { } ZigbeeServiceServiceFormNetworkDone_t; /** - * @brief Definition for service 'child_rejoind' response. + * @brief Definition for service 'child_rejoined' response. * @since_tizen 4.0 */ typedef struct { @@ -120,7 +132,7 @@ typedef struct { } ZigbeeServiceServiceChildRejoined_t; /** - * @brief Definition for service 'child_reft' response. + * @brief Definition for service 'child_left' response. * @since_tizen 4.0 */ typedef struct { @@ -136,14 +148,5 @@ typedef struct { short pan_id; /**< PAN ID */ } ZigbeeServiceServiceLeaveNetworkDone_t; -/** - * @brief Definition for service 'get_node_type' response. - * @since_tizen 4.0 - */ -typedef struct { - char node_type; /**< Node Type */ -} ZigbeeServiceServiceNodeType_t; - - #endif /* __ZIGBEE_SERVICE_TYPE_H__ */ diff --git a/common/include/zigbee_types.h b/common/include/zigbee_types.h index 4b35d5e..0b96d42 100644 --- a/common/include/zigbee_types.h +++ b/common/include/zigbee_types.h @@ -74,4 +74,16 @@ */ #define ZIGBEE_ZDO_BIND_ADDRESS_MAX_LEN 8 + /* -------------------------------------------------------------------------------------- + * For Responses + * -------------------------------------------------------------------------------------*/ + + /** + * @brief Definition for general response. + * @since_tizen 4.0 + */ +typedef struct { + int result; /**< Result */ +} ZigbeeGeneralResp_t; + #endif /* __ZIGBEE_TYPES_H__ */ diff --git a/zigbee-daemon/zigbee-interface/introspection/custom.xml b/zigbee-daemon/zigbee-interface/introspection/custom.xml index c1d05d8..8b62eec 100644 --- a/zigbee-daemon/zigbee-interface/introspection/custom.xml +++ b/zigbee-daemon/zigbee-interface/introspection/custom.xml @@ -10,6 +10,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/zigbee-daemon/zigbee-interface/introspection/mfglib-control.xml b/zigbee-daemon/zigbee-interface/introspection/mfglib-control.xml index cb83fca..ace61fd 100644 --- a/zigbee-daemon/zigbee-interface/introspection/mfglib-control.xml +++ b/zigbee-daemon/zigbee-interface/introspection/mfglib-control.xml @@ -3,63 +3,80 @@ + + + + + + + + + + + + + + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/service.xml b/zigbee-daemon/zigbee-interface/introspection/service.xml index 1928756..f5cd66c 100644 --- a/zigbee-daemon/zigbee-interface/introspection/service.xml +++ b/zigbee-daemon/zigbee-interface/introspection/service.xml @@ -2,21 +2,29 @@ + + + + + + + + @@ -26,32 +34,40 @@ + + + + + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-alarm.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-alarm.xml index e29159d..49be1bd 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-alarm.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-alarm.xml @@ -11,24 +11,29 @@ + + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-basic.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-basic.xml index cb185bb..a6a6094 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-basic.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-basic.xml @@ -3,6 +3,7 @@ + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-color-control.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-color-control.xml index 62781e5..2380044 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-color-control.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-color-control.xml @@ -6,12 +6,14 @@ + + @@ -19,18 +21,21 @@ + + + @@ -38,6 +43,7 @@ + @@ -45,6 +51,7 @@ + @@ -52,12 +59,14 @@ + + @@ -65,12 +74,14 @@ + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-door-lock.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-door-lock.xml index 38199e6..7e0b71a 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-door-lock.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-door-lock.xml @@ -19,10 +19,12 @@ + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-fan-control.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-fan-control.xml index 7834e54..e03a66c 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-fan-control.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-fan-control.xml @@ -3,18 +3,22 @@ + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-group.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-group.xml index 789bc41..bba87d5 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-group.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-group.xml @@ -5,33 +5,39 @@ + + + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-level-control.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-level-control.xml index 5682fa1..933c58b 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-level-control.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-level-control.xml @@ -5,12 +5,14 @@ + + @@ -18,18 +20,21 @@ + + + @@ -37,10 +42,12 @@ + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-on-off.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-on-off.xml index 1da1c80..b4d595c 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-on-off.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-on-off.xml @@ -4,10 +4,12 @@ + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-poll-control.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-poll-control.xml index 810dc6c..700dc9e 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-poll-control.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-poll-control.xml @@ -5,20 +5,24 @@ + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-scene.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-scene.xml index ad8e02c..2ecbf98 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-scene.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-scene.xml @@ -9,40 +9,47 @@ + + + + + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zcl-thermostat.xml b/zigbee-daemon/zigbee-interface/introspection/zcl-thermostat.xml index 955cf69..2fe6f12 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zcl-thermostat.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zcl-thermostat.xml @@ -3,12 +3,14 @@ + + @@ -18,16 +20,19 @@ + + + diff --git a/zigbee-daemon/zigbee-interface/introspection/zdo-bind.xml b/zigbee-daemon/zigbee-interface/introspection/zdo-bind.xml index 69bb961..0dd47b0 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zdo-bind.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zdo-bind.xml @@ -9,6 +9,7 @@ + @@ -19,6 +20,7 @@ + diff --git a/zigbee-daemon/zigbee-interface/introspection/zdo-dev-control.xml b/zigbee-daemon/zigbee-interface/introspection/zdo-dev-control.xml index 3082c9b..0eb9959 100644 --- a/zigbee-daemon/zigbee-interface/introspection/zdo-dev-control.xml +++ b/zigbee-daemon/zigbee-interface/introspection/zdo-dev-control.xml @@ -4,6 +4,7 @@ + @@ -12,55 +13,69 @@ + + + + + + + + + + + + + + @@ -68,6 +83,7 @@ + @@ -75,6 +91,7 @@ + diff --git a/zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_service.c b/zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_service.c index 879ba23..cd83955 100644 --- a/zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_service.c +++ b/zigbee-daemon/zigbee-interface/src/zigbee_service_dbus_interface_service.c @@ -22,7 +22,7 @@ static void *_service_interface_ref_zigbee_service(ZigBeeServiceInterface *service_interface) { - ZigbeeObjectSkeleton *zigbee_object; + ZigbeeObjectSkeleton *zigbee_object = NULL; ZigbeeCustomData_t *custom_data = NULL; ZigbeeService *service = NULL; @@ -34,7 +34,7 @@ static void *_service_interface_ref_zigbee_service(ZigBeeServiceInterface *servi /* Get zigbee object */ zigbee_object = g_hash_table_lookup(custom_data->objects, ZIGBEE_SERVICE_PATH); - if (zigbee_object) { + if (NULL == zigbee_object) { Z_LOGW("Cannot find ZigBee D-BUS interface object!", zigbee_object); return NULL; } @@ -51,11 +51,16 @@ static void on_service_enable_resp(ZigBeeServiceInterface *service_interface, ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeServiceServiceState_t *payload = + (ZigbeeServiceServiceState_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -63,7 +68,8 @@ static void on_service_enable_resp(ZigBeeServiceInterface *service_interface, invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_enable(service_object, invocation, TRUE); + zigbee_service_complete_enable(service_object, invocation, + payload->result, payload->enabled); g_free(cb_data); } @@ -121,11 +127,15 @@ static void on_service_disable_resp(ZigBeeServiceInterface *service_interface, ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -133,7 +143,7 @@ static void on_service_disable_resp(ZigBeeServiceInterface *service_interface, invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_disable(service_object, invocation); + zigbee_service_complete_disable(service_object, invocation, payload->result); g_free(cb_data); } @@ -189,11 +199,15 @@ static void on_service_zb_hw_reset_resp(ZigBeeServiceInterface *service_interfac ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -201,7 +215,7 @@ static void on_service_zb_hw_reset_resp(ZigBeeServiceInterface *service_interfac invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_zb_hw_reset(service_object, invocation); + zigbee_service_complete_zb_hw_reset(service_object, invocation, payload->result); g_free(cb_data); } @@ -257,11 +271,15 @@ static void on_service_form_network_resp(ZigBeeServiceInterface *service_interfa ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -269,7 +287,7 @@ static void on_service_form_network_resp(ZigBeeServiceInterface *service_interfa invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_form_network(service_object, invocation); + zigbee_service_complete_form_network(service_object, invocation, payload->result); g_free(cb_data); } @@ -325,11 +343,15 @@ static void on_service_coex_start_resp(ZigBeeServiceInterface *service_interface ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -337,7 +359,7 @@ static void on_service_coex_start_resp(ZigBeeServiceInterface *service_interface invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_coex_start(service_object, invocation); + zigbee_service_complete_coex_start(service_object, invocation, payload->result); g_free(cb_data); } @@ -400,11 +422,15 @@ static void on_service_coex_stop_resp(ZigBeeServiceInterface *service_interface, ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -412,7 +438,7 @@ static void on_service_coex_stop_resp(ZigBeeServiceInterface *service_interface, invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_coex_stop(service_object, invocation); + zigbee_service_complete_coex_stop(service_object, invocation, payload->result); g_free(cb_data); } @@ -468,11 +494,15 @@ static void on_service_leave_network_resp(ZigBeeServiceInterface *service_interf ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -480,7 +510,7 @@ static void on_service_leave_network_resp(ZigBeeServiceInterface *service_interf invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_leave_network(service_object, invocation); + zigbee_service_complete_leave_network(service_object, invocation, payload->result); g_free(cb_data); } @@ -537,12 +567,16 @@ static void on_service_get_network_info_resp(ZigBeeServiceInterface *service_int ZigbeeService *service_object; GDBusMethodInvocation *invocation; - ZigbeeServiceGetNetworkInfo_t payload; + ZigbeeServiceGetNetworkInfo_t *payload = + (ZigbeeServiceGetNetworkInfo_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -550,10 +584,9 @@ static void on_service_get_network_info_resp(ZigBeeServiceInterface *service_int invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - memcpy(&payload, resp_data, resp_data_len); zigbee_service_complete_get_network_info(service_object, invocation, - payload.eui64, payload.node_id, payload.pan_id, payload.channel, - payload.radio_tx_power); + payload->result, payload->eui64, payload->node_id, + payload->pan_id, payload->channel, payload->radio_tx_power); g_free(cb_data); } @@ -609,11 +642,15 @@ static void on_service_permit_join_resp(ZigBeeServiceInterface *service_interfac ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -621,7 +658,7 @@ static void on_service_permit_join_resp(ZigBeeServiceInterface *service_interfac invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_permit_join(service_object, invocation); + zigbee_service_complete_permit_join(service_object, invocation, payload->result); g_free(cb_data); } @@ -686,11 +723,15 @@ static void on_service_leave_request_resp(ZigBeeServiceInterface *service_interf ZigbeeService *service_object; GDBusMethodInvocation *invocation; + ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data; NOT_USED(service_interface); NOT_USED(request_id); - NOT_USED(resp_data); - NOT_USED(resp_data_len); + + if (NULL == resp_data || 0 == resp_data_len) { + Z_LOGE("resp_data is null"); + return; + } service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data); zblib_check_null_ret("service_object", service_object); @@ -698,7 +739,7 @@ static void on_service_leave_request_resp(ZigBeeServiceInterface *service_interf invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_leave_request(service_object, invocation); + zigbee_service_complete_leave_request(service_object, invocation, payload->result); g_free(cb_data); } @@ -789,7 +830,8 @@ static void on_service_get_device_list_resp(ZigBeeServiceInterface *service_inte invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_get_device_list(service_object, invocation, resp_data); + /* To-To : zigbee_service_complete_get_device_list */ + //zigbee_service_complete_get_device_list(service_object, invocation, resp_data); g_free(cb_data); } @@ -863,7 +905,7 @@ static void on_service_get_mac_resp(ZigBeeServiceInterface *service_interface, zblib_check_null_ret("invocation", invocation); /* 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, resp_data); g_free(cb_data); @@ -937,7 +979,8 @@ static void on_service_get_device_info_resp(ZigBeeServiceInterface *service_inte invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_get_device_info(service_object, invocation, resp_data); + /* To-Do : zigbee_service_complete_get_device_list */ + //zigbee_service_complete_get_device_info(service_object, invocation, resp_data); g_free(cb_data); } @@ -1011,7 +1054,7 @@ static void on_service_get_endpoint_list_resp(ZigBeeServiceInterface *service_in zblib_check_null_ret("invocation", invocation); /* To fix : end-points must be changed gchar* -> GVariant ay */ - zigbee_service_complete_get_endpoint_list(service_object, invocation, resp_data); + //zigbee_service_complete_get_endpoint_list(service_object, invocation, resp_data); g_free(cb_data); } @@ -1099,7 +1142,8 @@ static void on_service_get_cluster_list_resp(ZigBeeServiceInterface *service_int invocation = zigbee_service_dbus_interface_ref_invocation(cb_data); zblib_check_null_ret("invocation", invocation); - zigbee_service_complete_get_cluster_list(service_object, invocation, resp_data); + /* To-Do : zigbee_service_complete_get_cluster_list */ + //zigbee_service_complete_get_cluster_list(service_object, invocation, resp_data); g_free(cb_data); } @@ -1172,7 +1216,8 @@ static void on_service_get_node_type_resp(ZigBeeServiceInterface *service_interf ZigbeeService *service_object; GDBusMethodInvocation *invocation; - ZigbeeServiceServiceNodeType_t payload; + ZigbeeServiceServiceNodeType_t *payload = + (ZigbeeServiceServiceNodeType_t *)resp_data; NOT_USED(cb_data); NOT_USED(service_interface); @@ -1184,15 +1229,14 @@ static void on_service_get_node_type_resp(ZigBeeServiceInterface *service_interf return; } - memcpy(&payload, resp_data, resp_data_len); - 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_get_node_type(service_object, invocation, payload.node_type); + zigbee_service_complete_get_node_type(service_object, invocation, + payload->result, payload->node_type); g_free(cb_data); } @@ -1274,9 +1318,12 @@ void zigbee_service_dbus_interface_service_notification(ZigBeeServiceInterface * switch(noti_id) { case ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE: { - ZigbeeServiceServiceFormNetworkDone_t panid_t; - memcpy(&panid_t, noti_data, noti_data_len); - zigbee_service_emit_form_network_done(service_object, panid_t.pan_id); + 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: { diff --git a/zigbee-daemon/zigbee-lib/include/zblib_driver_service.h b/zigbee-daemon/zigbee-lib/include/zblib_driver_service.h index f9d632e..d5af5ef 100644 --- a/zigbee-daemon/zigbee-lib/include/zblib_driver_service.h +++ b/zigbee-daemon/zigbee-lib/include/zblib_driver_service.h @@ -61,7 +61,7 @@ typedef enum { /**< ZigBee 'service' notification IDs */ typedef enum { - ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE, /**< Form network done */ + ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE = 1, /**< Form network done */ ZBLIB_SERVICE_NOTI_CHILD_JOINED, /**< Child is joined */ ZBLIB_SERVICE_NOTI_CHILD_REJOINED, /**< Child is rejoined */ ZBLIB_SERVICE_NOTI_CHILD_LEFT, /**< Child left */