return &g_client_info;
}
+static int __net_wifidirect_gerror_to_enum(GError* error)
+{
+ int ret = WIFI_DIRECT_ERROR_NONE;
+ if(error == NULL) {
+ WDC_LOGI("GError is NULL!!");
+ return ret;
+ }
+
+ WDC_LOGE("wifi_direct_dbus_method_call_sync() failed. error [%d: %s]",
+ error->code, error->message);
+
+ if(NULL == strstr(error->message, "net.wifidirect.Error")) {
+ if (NULL != strstr(error->message, ".PermissionDenied"))
+ ret = WIFI_DIRECT_ERROR_PERMISSION_DENIED;
+ else
+ ret = WIFI_DIRECT_ERROR_OPERATION_FAILED;
+ } else {
+ if (NULL != strstr(error->message, "InvalidParameter"))
+ ret = WIFI_DIRECT_ERROR_INVALID_PARAMETER;
+ else if (NULL != strstr(error->message, "NotPermitted"))
+ ret = WIFI_DIRECT_ERROR_NOT_PERMITTED;
+ else if (NULL != strstr(error->message, "OperationFailed"))
+ ret = WIFI_DIRECT_ERROR_OPERATION_FAILED;
+ else if (NULL != strstr(error->message, "TooManyClient"))
+ ret = WIFI_DIRECT_ERROR_TOO_MANY_CLIENT;
+ else
+ ret = WIFI_DIRECT_ERROR_OPERATION_FAILED;
+ }
+ g_error_free(error);
+ return ret;
+}
+
/* Manage */
void wifi_direct_process_manage_activation(GDBusConnection *connection,
const gchar *object_path, GVariant *parameters)
CHECK_FEATURE_SUPPORTED(WIFIDIRECT_FEATURE);
+ GError* error = NULL;
+ GVariant *reply = NULL;
bool wifi_direct_enable;
+ int state = 0;
int res = 0;
if (g_client_info.is_registered == TRUE) {
return WIFI_DIRECT_ERROR_OPERATION_FAILED;
}
+ reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
+ "GetState", NULL, &error);
+
+ res = __net_wifidirect_gerror_to_enum(error);
+ if(res != WIFI_DIRECT_ERROR_NONE) {
+ return res;
+ }
+
+ g_variant_get(reply, "(ii)", &res, &state);
+ WDC_LOGD("State = [%d]", state);
+
g_client_info.is_registered = TRUE;
/* Initialize callbacks */
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"Activate", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"Deactivate", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"StartDiscovery", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"StartDiscovery", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"StopDiscovery", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"GetDiscoveredPeers", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret!= WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(iaa{sv})", &ret, &iter_peers);
params = g_variant_new("(s)", mac_address);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"Connect", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
params = g_variant_new("(s)", mac_address);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"CancelConnection", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
params = g_variant_new("(s)", mac_address);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"RejectConnection", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"DisconnectAll", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
params = g_variant_new("(s)", mac_address);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"Disconnect", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
params = g_variant_new("(s)", mac_address);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"AcceptConnection", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"GetConnectedPeers", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(iaa{sv})", &ret, &iter_peers);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_GROUP_INTERFACE,
"CreateGroup", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_GROUP_INTERFACE,
"DestroyGroup", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
GError* error = NULL;
GVariant *reply = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
bool val;
if (g_client_info.is_registered == false) {
"IsGroupOwner",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
+
WDC_LOGD("%s() SUCCESS", __func__);
g_variant_get(reply, "(b)", &val);
*owner = val;
GError* error = NULL;
GVariant *reply = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
bool val;
if (g_client_info.is_registered == false) {
"IsAutoGroup",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
+
WDC_LOGD("%s() SUCCESS", __func__);
g_variant_get(reply, "(b)", &val);
*autonomous_group = val;
"SetGoIntent",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"GetGoIntent",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"SetMaxClient",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"GetMaxClient",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"GetOperatingChannel",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"ActivatePushButton",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- WDC_LOGD("%s() SUCCESS", __func__);
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"SetWpsPin",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"GetWpsPin",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", &ret, &str);
"GetSupportedWpsMode",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &mode);
"GetSupportedWpsMode",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &wps_mode);
"GetLocalWpsMode",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &mode);
"SetReqWpsMode",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"GetReqWpsMode",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &mode);
"GetDeviceName",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", &ret, &str);
"GetDeviceName",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", &ret, &str);
"SetDeviceName",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"GetInterfaceName",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", ret ,&get_str);
"GetIPAddress",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", ret ,&str);
"GetSubnetMask",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", ret ,&get_str);
"GetGateway",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", ret ,&get_str);
"GetMacAddress",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(i&s)", &ret, &str);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"GetState", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
GError* error = NULL;
GVariant *reply = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
if (g_client_info.is_registered == false) {
WDC_LOGE("Client is NOT registered");
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"IsDiscoverable", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(b)", discoverable);
GError* error = NULL;
GVariant *reply = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
if (g_client_info.is_registered == false) {
WDC_LOGE("Client is NOT registered");
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"IsListeningOnly", NULL, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(b)", listen_only);
"SetAutoConnectionMode",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"IsAutoConnectionMode",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ib)", &ret, &val);
GError* error = NULL;
GVariant *reply = NULL;
GVariant *params = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
if (g_client_info.is_registered == false) {
WDC_LOGE("Client is NOT registered");
"SetPersistentGroupEnabled",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
}
- WDC_LOGD("%s() SUCCESS", __func__);
- g_variant_unref(reply);
+ WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
return WIFI_DIRECT_ERROR_NONE;
GError* error = NULL;
GVariant *reply = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
bool val;
if (g_client_info.is_registered == false) {
"IsPersistentGroupEnabled",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
+
WDC_LOGD("%s() SUCCESS", __func__);
g_variant_get(reply, "(b)", &val);
*enabled = val;
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_GROUP_INTERFACE,
"GetPersistentGroups", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(iaa{sv})", &ret, &iter_groups);
GError* error = NULL;
GVariant *reply = NULL;
GVariant *params = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
if (g_client_info.is_registered == false) {
WDC_LOGE("Client is NOT registered");
"RemovePersistentGroup",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
}
- WDC_LOGD("%s() SUCCESS", __func__);
- g_variant_unref(reply);
+ WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
return WIFI_DIRECT_ERROR_NONE;
"StartDiscovery",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"StopDiscovery",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"Register",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, service_id);
"Deregister",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
params = g_variant_new("(s)", mac_address);
reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
"GetPeerInfo", params, &error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ia{sv})", &ret, &iter_peer);
GError* error = NULL;
GVariant *reply = NULL;
GVariant *params = NULL;
+ int ret = WIFI_DIRECT_ERROR_NONE;
if (g_client_info.is_registered == false) {
WDC_LOGE("Client is NOT registered.");
"SetPassphrase",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
}
- WDC_LOGD("%s() SUCCESS", __func__);
- g_variant_unref(reply);
+ WDC_LOGD("%s() SUCCESS", __func__);
__WDC_LOG_FUNC_END__;
return WIFI_DIRECT_ERROR_NONE;
"GetPassphrase",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
+
WDC_LOGD("%s() SUCCESS", __func__);
g_variant_get(reply, "(i&s)", &ret, &val);
*passphrase = g_strdup(val);
"SetAutoConnectionPeer",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"Init",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"Deinit",
NULL,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"SetConfig",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"SetAvailiability",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
- }
- g_variant_get(reply, "(i)", &ret);
- g_variant_unref(reply);
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret == WIFI_DIRECT_ERROR_NONE) {
+ g_variant_get(reply, "(i)", &ret);
+ g_variant_unref(reply);
+ }
WDC_LOGD("%s() return : [%d]", __func__, ret);
__WDC_LOG_FUNC_END__;
"GetPeerType",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"GetPeerAvailability",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"GetPeerHdcp",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"GetPeerPort",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);
"GetPeerThroughput",
params,
&error);
- if (error != NULL) {
- WDC_LOGE("wifi_direct_dbus_method_call_sync() failed."
- "error [%d: %s]", error->code, error->message);
- g_error_free(error);
- __WDC_LOG_FUNC_END__;
- return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+
+ ret = __net_wifidirect_gerror_to_enum(error);
+ if(ret != WIFI_DIRECT_ERROR_NONE) {
+ return ret;
}
g_variant_get(reply, "(ii)", &ret, &val);