[Fix] EthernetCableState not implemented on net.netconfig.network 65/47765/1 accepted/tizen/mobile/20150909.055314 accepted/tizen/tv/20150909.055335 accepted/tizen/wearable/20150909.055413 submit/tizen/20150909.044126
authorNishant Chaprana <n.chaprana@samsung.com>
Tue, 8 Sep 2015 12:49:03 +0000 (18:19 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Tue, 8 Sep 2015 12:49:03 +0000 (18:19 +0530)
Description: This patch fixes the dbus error
"EthernetCableState not implemented on net.netconfig.network"

Change-Id: I74eaf1f14685c17be0f771bfd64de51258324bf4
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
include/neterror.h
packaging/net-config.spec
src/neterror.c
src/network-state.c

index 7a957f65bbd86d23213df91924b249c34b3ee663..177a2cee9ac5c755213ad343d6f1ff19321839be 100644 (file)
@@ -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);
index 6c03bbe8cda4298691347ee3bf816f839af47ad4..8ae923092537ac066a07eda13bf89a5b8ea37995 100755 (executable)
@@ -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
index 461394d32062c28448293bf06fa40ccb96f07296..49ea9465695e301b06fd54d03e7afe1384376241 100644 (file)
@@ -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;
index c973f02953676769bea737bc3937a81190edc402..bb1fc8cf194b7a5f48373a57615a3e6cde405664 100755 (executable)
@@ -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)) {