static ws_dbus_plugin_data_s *g_pd;
+#define G_PD_CALLBACK(user_data, event)\
+ do {\
+ if (g_pd->callback)\
+ g_pd->callback(user_data, event);\
+ } while(0)
+
static int is_peer_joined_notified = 0;
static int is_peer_disconnected_notified = 0;
memset(&event, 0x0, sizeof(wfd_oem_event_s));
event.event_id = WFD_OEM_EVENT_DEACTIVATED;
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
memset(g_pd->iface_path, 0x0, DBUS_OBJECT_PATH_MAX);
}
ws_get_advertise_service(peer_path, (GList **)&(event.asp_services));
#endif /* TIZEN_FEATURE_ASP */
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
#if defined(TIZEN_FEATURE_ASP)
if (event.asp_services != NULL) {
GList *l;
__ws_path_to_addr(peer_path, event.dev_addr, parameters);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
event.event_id = WFD_OEM_EVENT_DISCOVERY_FINISHED;
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
WDP_LOGE("No Properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
if (event.edata_type == WFD_OEM_EDATA_TYPE_ASP_PROV)
g_free(edata->session_information);
__ws_txt_to_mac(peer_dev, event.dev_addr);
WDP_LOGE("peer mac [" MACSTR "]", MAC2STR(event.dev_addr));
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
WDP_LOGE("No properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
WDP_LOGE("No properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(edata);
__WDP_LOG_FUNC_EXIT__;
WDP_LOGE("No properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
}
memcpy(&(event.dev_addr), edata->sa, OEM_MACADDR_LEN);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(event.edata);
__WDP_LOG_FUNC_EXIT__;
memset(g_pd->group_iface_path, 0x0, DBUS_OBJECT_PATH_MAX);
_ws_flush();
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
WDP_LOGE("No Properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
if (event.edata_type == WFD_OEM_EDATA_TYPE_NEW_SERVICE)
g_list_free((GList*) event.edata);
GLIST_ITER_END()
if (tmp != NULL && tmp->service_info != NULL)
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
else
WDP_LOGD("service info is not required, don't notify to user");
g_variant_iter_free(iter);
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
event.event_id = WFD_OEM_EVENT_GROUP_FORMATION_FAILURE;
event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
}
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
WDP_LOGE("No Properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
if (event.edata_type == WFD_OEM_EDATA_TYPE_ASP_PROV)
g_free(edata->session_information);
WDP_LOGE("No Properties");
}
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
g_free(edata);
__WDP_LOG_FUNC_EXIT__;
event.event_id = WFD_OEM_EVENT_STA_CONNECTED;
event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
event.event_id = WFD_OEM_EVENT_STA_DISCONNECTED;
event.edata_type = WFD_OEM_EDATA_TYPE_NONE;
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
__WDP_LOG_FUNC_EXIT__;
}
dbus_property_get_all(peer_path, g_pd->g_dbus, SUPPLICANT_P2P_PEER,
__ws_peer_property, event.edata);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
is_peer_joined_notified = 1;
g_free(edata);
__ws_path_to_addr(peer_path, event.dev_addr, parameters);
- g_pd->callback(g_pd->user_data, &event);
+ G_PD_CALLBACK(g_pd->user_data, &event);
is_peer_disconnected_notified = 1;
}
}