From f35eb90b4a216450d1a7507f88af4eca577df01e Mon Sep 17 00:00:00 2001 From: Nishant Chaprana Date: Tue, 8 Sep 2015 18:19:03 +0530 Subject: [PATCH] [Fix] EthernetCableState not implemented on net.netconfig.network Description: This patch fixes the dbus error "EthernetCableState not implemented on net.netconfig.network" Change-Id: I74eaf1f14685c17be0f771bfd64de51258324bf4 Signed-off-by: Nishant Chaprana --- include/neterror.h | 1 + packaging/net-config.spec | 2 +- src/neterror.c | 7 +++++++ src/network-state.c | 24 +++++++++++++++--------- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/include/neterror.h b/include/neterror.h index 7a957f6..177a2ce 100644 --- a/include/neterror.h +++ b/include/neterror.h @@ -64,6 +64,7 @@ void netconfig_error_fail_req_sim_auth(GDBusMethodInvocation *context); void netconfig_error_fail_req_sim_auth_wrong_param(GDBusMethodInvocation *context); void netconfig_error_fail_get_sim_auth_wrong_data(GDBusMethodInvocation *context); void netconfig_error_fail_get_sim_auth_delay(GDBusMethodInvocation *context); +void netconfig_error_fail_ethernet_cable_state(GDBusMethodInvocation *context); void netconfig_error_dbus_method_return(GDBusMethodInvocation *context, netconfig_error_e error, const gchar *message); void netconfig_error_init(void); diff --git a/packaging/net-config.spec b/packaging/net-config.spec index 6c03bbe..8ae9230 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.34 +Version: 1.1.35 Release: 2 Group: System/Network License: Apache-2.0 diff --git a/src/neterror.c b/src/neterror.c index 461394d..49ea946 100644 --- a/src/neterror.c +++ b/src/neterror.c @@ -136,6 +136,13 @@ void netconfig_error_fail_save_congifuration(GDBusMethodInvocation *context) NETCONFIG_ERROR_INTERFACE".FailSaveConfiguration"); } +void netconfig_error_fail_ethernet_cable_state(GDBusMethodInvocation *context) +{ + g_dbus_method_invocation_return_error(context, netconfig_error_quark(), + NETCONFIG_ERROR_INTERNAL, + NETCONFIG_ERROR_INTERFACE".FailGetEthernetCableState"); +} + void netconfig_error_dbus_method_return(GDBusMethodInvocation *context, netconfig_error_e error, const gchar *message) { gchar *msg = NULL; diff --git a/src/network-state.c b/src/network-state.c index c973f02..bb1fc8c 100755 --- a/src/network-state.c +++ b/src/network-state.c @@ -1006,18 +1006,22 @@ static gboolean handle_check_profile_privilege(Network *object, return TRUE; } -gboolean netconfig_iface_network_state_ethernet_cable_state(gint32 *state) +gboolean handle_ethernet_cable_state(Network *object, + GDBusMethodInvocation *context) { - int ret = 0; + int ret = 0; + int state = 0; - ret = netconfig_get_ethernet_cable_state(state); - if(ret != 0) { - DBG("Failed to get ethernet cable state"); - return FALSE; - } + ret = netconfig_get_ethernet_cable_state(&state); + if(ret != 0) { + DBG("Failed to get ethernet cable state"); + netconfig_error_fail_ethernet_cable_state(context); + return FALSE; + } - DBG("Successfully get ethernet cable state[%d]", state); - return TRUE; + DBG("Successfully get ethernet cable state[%d]", state); + network_complete_ethernet_cable_state(object, context, state); + return TRUE; } void netconfig_network_state_create_and_init(void) @@ -1044,6 +1048,8 @@ void netconfig_network_state_create_and_init(void) G_CALLBACK(handle_check_profile_privilege), NULL); g_signal_connect(netconfigstate, "handle-remove-route", G_CALLBACK(handle_remove_route), NULL); + g_signal_connect(netconfigstate, "handle-ethernet-cable-state", + G_CALLBACK(handle_ethernet_cable_state), NULL); if (!g_dbus_interface_skeleton_export(interface, connection, NETCONFIG_NETWORK_STATE_PATH, NULL)) { -- 2.34.1