Modified way of update rssi value
[platform/core/connectivity/net-config.git] / src / neterror.c
old mode 100644 (file)
new mode 100755 (executable)
index 461394d..0e3113d
@@ -21,6 +21,7 @@
 
 #include "netdbus.h"
 #include "neterror.h"
+#include "log.h"
 
 #define NETCONFIG_ERROR_INTERFACE NETCONFIG_SERVICE ".Error"
 #define CONNMAN_AGENT_ERROR_INTERFACE "net.connman.Agent.Error"
@@ -47,6 +48,7 @@ GQuark netconfig_connman_agent_error_quark(void)
 
 void netconfig_error_no_profile(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_NO_PROFILE,
                        NETCONFIG_ERROR_INTERFACE ".NoProfile");
@@ -54,6 +56,7 @@ void netconfig_error_no_profile(GDBusMethodInvocation *context)
 
 void netconfig_error_inprogress(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_INPROGRESS,
                        NETCONFIG_ERROR_INTERFACE ".InProgress");
@@ -61,6 +64,7 @@ void netconfig_error_inprogress(GDBusMethodInvocation *context)
 
 void netconfig_error_already_exists(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_ALREADYEXISTS,
                        NETCONFIG_ERROR_INTERFACE ".AlreadyExists");
@@ -68,6 +72,7 @@ void netconfig_error_already_exists(GDBusMethodInvocation *context)
 
 void netconfig_error_invalid_parameter(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_INVALID_PARAMETER,
                        NETCONFIG_ERROR_INTERFACE ".InvalidParameter");
@@ -75,6 +80,7 @@ void netconfig_error_invalid_parameter(GDBusMethodInvocation *context)
 
 void netconfig_error_permission_denied(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_PERMISSION_DENIED,
                        NETCONFIG_ERROR_INTERFACE ".PermissionDenied");
@@ -82,6 +88,7 @@ void netconfig_error_permission_denied(GDBusMethodInvocation *context)
 
 void netconfig_error_wifi_driver_failed(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_WIFI_DRIVER_FAILURE,
                        NETCONFIG_ERROR_INTERFACE ".WifiDriverFailed");
@@ -89,6 +96,7 @@ void netconfig_error_wifi_driver_failed(GDBusMethodInvocation *context)
 
 void netconfig_error_wifi_direct_failed(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_WIFI_DRIVER_FAILURE,
                        NETCONFIG_ERROR_INTERFACE ".WifiDirectFailed");
@@ -96,6 +104,7 @@ void netconfig_error_wifi_direct_failed(GDBusMethodInvocation *context)
 
 void netconfig_error_fail_get_imsi(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_FAILED_GET_IMSI,
                        NETCONFIG_ERROR_INTERFACE".FailGetSimImsi");
@@ -103,6 +112,7 @@ void netconfig_error_fail_get_imsi(GDBusMethodInvocation *context)
 
 void netconfig_error_fail_req_sim_auth(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH,
                        NETCONFIG_ERROR_INTERFACE".FailReqSimAuth");
@@ -110,6 +120,7 @@ void netconfig_error_fail_req_sim_auth(GDBusMethodInvocation *context)
 
 void netconfig_error_fail_req_sim_auth_wrong_param(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM,
                        NETCONFIG_ERROR_INTERFACE".FailReqSimAuthWrongParam");
@@ -117,6 +128,7 @@ void netconfig_error_fail_req_sim_auth_wrong_param(GDBusMethodInvocation *contex
 
 void netconfig_error_fail_get_sim_auth_wrong_data(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_FAILED_GET_SIM_AUTH_WRONG_DATA,
                        NETCONFIG_ERROR_INTERFACE".FailGetSimAuthWrongData");
@@ -124,6 +136,7 @@ void netconfig_error_fail_get_sim_auth_wrong_data(GDBusMethodInvocation *context
 
 void netconfig_error_fail_get_sim_auth_delay(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_FAILED_GET_SIM_AUTH_DELAY,
                        NETCONFIG_ERROR_INTERFACE".FailGetSimAuthDelay");
@@ -131,17 +144,28 @@ void netconfig_error_fail_get_sim_auth_delay(GDBusMethodInvocation *context)
 
 void netconfig_error_fail_save_congifuration(GDBusMethodInvocation *context)
 {
+       ERR("dbus method return error");
        g_dbus_method_invocation_return_error(context, netconfig_error_quark(),
                        NETCONFIG_ERROR_INTERNAL,
                        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");
+}
+
+#include <glib/gprintf.h>
 void netconfig_error_dbus_method_return(GDBusMethodInvocation *context, netconfig_error_e error, const gchar *message)
 {
        gchar *msg = NULL;
 
+       ERR("dbus method return error");
+
        msg = g_strdup_printf("%s.%s", NETCONFIG_ERROR_INTERFACE, message);
-       g_dbus_method_invocation_return_error_literal(context, netconfig_error_quark(), error, msg);
+       g_dbus_method_invocation_return_error(context, netconfig_error_quark(), error, "%s", msg);
 
        g_free(msg);
 }