#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"
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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");
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);
}