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);
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;
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)
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)) {