DEBUG_SIGNAL(sender, object_path, interface, signal, parameters);
#endif /* TIZEN_DEBUG_DBUS_VALUE */
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
if (!g_strcmp0(signal,"InterfaceAdded")) {
WDP_LOGD("InterfaceAdded");
if(!event || !event->edata)
return;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
wfd_oem_group_data_s *group = (wfd_oem_group_data_s *)event->edata;
#if defined (TIZEN_DEBUG_DBUS_VALUE)
CHECK_KEY_VALUE(key, value);
wfd_oem_dev_data_s *edata = NULL;
static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
wfd_oem_event_s event;
static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
__WDP_LOG_FUNC_ENTER__;
wfd_oem_event_s event;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
const char *pin = NULL;
char *loc = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
const char *pin = NULL;
char *loc = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
wfd_oem_dev_data_s *edata = NULL;
static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
wfd_oem_dev_data_s *edata = NULL;
static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
wfd_oem_dev_data_s *edata = NULL;
static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
wfd_oem_dev_data_s *edata = NULL;
static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
int prov_status = 0;
char *loc = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.edata_type = WFD_OEM_EDATA_TYPE_DEVICE;
wfd_oem_event_s event;
wfd_oem_conn_data_s *edata = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_conn_data_s*)calloc(1, sizeof(wfd_oem_conn_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
int dev_pwd_id = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_dev_data_s *) g_try_malloc0(sizeof(wfd_oem_dev_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
wfd_oem_event_s event;
wfd_oem_invite_data_s *edata = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
edata = (wfd_oem_invite_data_s *) g_try_malloc0(sizeof(wfd_oem_invite_data_s));
if (!edata) {
WDP_LOGF("Failed to allocate memory for event. [%s]",
__WDP_LOG_FUNC_ENTER__;
wfd_oem_event_s event;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.event_id = WFD_OEM_EVENT_GROUP_DESTROYED;
GVariantIter *iter = NULL;
wfd_oem_event_s event;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.event_id = WFD_OEM_EVENT_SERV_DISC_RESP;
wfd_oem_event_s event;
const char *name = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.event_id = WFD_OEM_EVENT_WPS_FAIL;
__WDP_LOG_FUNC_ENTER__;
wfd_oem_event_s event;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.event_id = WFD_OEM_EVENT_WPS_FAIL;
DEBUG_SIGNAL(sender, object_path, interface, signal, parameters);
#endif /* TIZEN_DEBUG_DBUS_VALUE */
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
if(!g_strcmp0(signal,"PeerJoined")){
wfd_oem_event_s event;
static char interface_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
const char *path = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
pd_data = (ws_dbus_plugin_data_s *)g_pd;
g_variant_get(value, "(o)", &path);
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
static char interface_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
GError *error = NULL;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (conn == NULL) {
{
GDBusConnection *g_dbus = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
return -1;
}
- if(g_pd != NULL) {
- g_dbus_connection_signal_unsubscribe(g_dbus, g_pd->supp_sub_id);
- g_dbus_connection_signal_unsubscribe(g_dbus, g_pd->p2pdevice_sub_id);
- g_dbus_connection_signal_unsubscribe(g_dbus, g_pd->group_sub_id);
- }
+
+ g_dbus_connection_signal_unsubscribe(g_dbus, g_pd->supp_sub_id);
+ g_dbus_connection_signal_unsubscribe(g_dbus, g_pd->p2pdevice_sub_id);
+ g_dbus_connection_signal_unsubscribe(g_dbus, g_pd->group_sub_id);
+
g_pd->group_iface_sub_id = 0;
g_pd->p2pdevice_sub_id = 0;
g_pd->group_sub_id = 0;
int i = 0;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
for(i = 0; i < WS_DEVTYPE_LEN; i++)
WDP_LOGD("device type[%02x]", primary_device_type[i]);
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
int res = 0;
int retry_count = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
res = __ws_p2p_supplicant_start();
if (res < 0) {
res = __ws_p2p_supplicant_stop();
__WDP_LOG_FUNC_ENTER__;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
if (!g_pd->activated) {
WDP_LOGE("Wi-Fi Direct is not activated");
return -1;
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
char n_pin[9] = {0,};
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
ws_dbus_plugin_data_s * pd_data;
const char *path = NULL;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return;
+ }
+
pd_data = (ws_dbus_plugin_data_s *) g_pd;
g_variant_get(value, "(o)", &path);
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
res = dbus_method_call(¶ms, SUPPLICANT_P2PDEVICE, NULL, NULL);
if (res < 0) {
- WDP_LOGE("Failed to send command to wpa_supplicant");
- __WDP_LOG_FUNC_EXIT__;
- return -1;
+ WDP_LOGE("Failed to send command to wpa_supplicant");
+ __WDP_LOG_FUNC_EXIT__;
+ return -1;
} else {
_ws_flush();
WDP_LOGD("Succeeded to remove group");
int ws_invite(unsigned char *peer_addr, wfd_oem_invite_param_s *param)
{
__WDP_LOG_FUNC_ENTER__;
- GDBusConnection *g_dbus = NULL;
- GVariantBuilder *builder = NULL;
- GVariant *value = NULL;
- dbus_method_param_s params;
- static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
- int res = 0;
+ GDBusConnection *g_dbus = NULL;
+ GVariantBuilder *builder = NULL;
+ GVariant *value = NULL;
+ dbus_method_param_s params;
+ static char peer_path[DBUS_OBJECT_PATH_MAX] = {'\0',};
+ int res = 0;
- if (!peer_addr || !param) {
- WDP_LOGE("Invalid parameter");
- return -1;
- }
- g_dbus = g_pd->g_dbus;
- if (!g_dbus) {
- WDP_LOGE("DBus connection is NULL");
- return -1;
- }
- memset(¶ms, 0x0, sizeof(dbus_method_param_s));
+ if (!peer_addr || !param) {
+ WDP_LOGE("Invalid parameter");
+ return -1;
+ }
- dbus_set_method_param(¶ms, "Invite", g_pd->group_iface_path, g_dbus);
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
- g_snprintf(peer_path, DBUS_OBJECT_PATH_MAX, "%s/Peers/"
- COMPACT_MACSTR, g_pd->iface_path, MAC2STR(peer_addr));
- WDP_LOGE("get peer path [%s]", peer_path);
+ g_dbus = g_pd->g_dbus;
+ if (!g_dbus) {
+ WDP_LOGE("DBus connection is NULL");
+ return -1;
+ }
+ memset(¶ms, 0x0, sizeof(dbus_method_param_s));
- builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}") );
- g_variant_builder_add (builder, "{sv}", "peer", g_variant_new_object_path(peer_path));
- value = g_variant_new ("(a{sv})", builder);
- g_variant_builder_unref (builder);
+ dbus_set_method_param(¶ms, "Invite", g_pd->group_iface_path, g_dbus);
+
+ g_snprintf(peer_path, DBUS_OBJECT_PATH_MAX, "%s/Peers/"
+ COMPACT_MACSTR, g_pd->iface_path, MAC2STR(peer_addr));
+ WDP_LOGE("get peer path [%s]", peer_path);
+
+ builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}") );
+ g_variant_builder_add (builder, "{sv}", "peer", g_variant_new_object_path(peer_path));
+ value = g_variant_new ("(a{sv})", builder);
+ g_variant_builder_unref (builder);
#if defined (TIZEN_DEBUG_DBUS_VALUE)
- WDP_LOGD("params [%s]", g_variant_print(value, TRUE));
+ WDP_LOGD("params [%s]", g_variant_print(value, TRUE));
#endif /* TIZEN_DEBUG_DBUS_VALUE */
- params.params = value;
+ params.params = value;
- res = dbus_method_call(¶ms, SUPPLICANT_P2PDEVICE, NULL, NULL);
- if (res < 0)
- WDP_LOGE("Failed to send command to wpa_supplicant");
- else
- WDP_LOGD("Succeeded to invite peer[" MACSTR "]", MAC2STR(peer_addr));
+ res = dbus_method_call(¶ms, SUPPLICANT_P2PDEVICE, NULL, NULL);
+ if (res < 0)
+ WDP_LOGE("Failed to send command to wpa_supplicant");
+ else
+ WDP_LOGD("Succeeded to invite peer[" MACSTR "]", MAC2STR(peer_addr));
- __WDP_LOG_FUNC_EXIT__;
- return 0;
+ __WDP_LOG_FUNC_EXIT__;
+ return 0;
}
// Only group owner can use this command
int i = 0;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
WDP_LOGE("Invalid parameter");
return -1;
}
+
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
wfd_oem_persistent_group_s *wfd_persistent_groups = NULL;
int i, cnt = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
int i, cnt = 0;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
int i = 0;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");
dbus_method_param_s params;
int res = 0;
+ if(!g_pd) {
+ WDP_LOGE("ws_dbus_plugin_data_s is not created yet");
+ return -1;
+ }
+
g_dbus = g_pd->g_dbus;
if (!g_dbus) {
WDP_LOGE("DBus connection is NULL");