+ug-setting-wifidirect-efl (1.0.2) precise; urgency=low
+
+ * DLog macro is changed
+ * Git: rsa/apps/home/ug-wifi-direct
+ * Tag: libug-setting-wifidirect-efl_1.0.2
+
+ -- Gibyoung Kim <laskgb.kim@samsung.com> Tue, 18 Dec 2012 19:41:03 +0900
+
ug-setting-wifidirect-efl (1.0.1) precise; urgency=low
* Applied EFL code and winset changes
Name: libug-setting-wifidirect-efl
Summary: Wi-Fi Direct setting UI gadget
-Version: 1.0.1
+Version: 1.0.2
Release: 1
Group: TO_BE_FILLED
License: Samsung Proprietary License
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -DVITA_FEATURE")
+SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -DUSE_DLOG")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-
-#ifdef VITA_FEATURE
-#include <dlog.h>
-
-#define WIFI_DIRECT_APP_MID "wfd-app"
-
-#define WFD_APP_LOG_LOW LOG_VERBOSE
-#define WFD_APP_LOG_HIGH LOG_INFO
-#define WFD_APP_LOG_ERROR LOG_ERROR
-#define WFD_APP_LOG_WARN LOG_WARN
-#define WFD_APP_LOG_ASSERT LOG_FATAL
-#define WFD_APP_LOG_EXCEPTION LOG_FATAL
#define WFD_MAX_SIZE 128
#define WFD_MAC_ADDRESS_SIZE 18
-char *wfd_app_trim_path(const char *filewithpath);
-int wfd_app_gettid();
-
-#define WFD_APP_LOG(log_level, format, args...) \
- LOG(log_level, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] " format, wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), ##args)
-#define __WFD_APP_FUNC_ENTER__ LOG(LOG_VERBOSE, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] Enter: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
-#define __WFD_APP_FUNC_EXIT__ LOG(LOG_VERBOSE, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] Quit: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
-
-#else /** _DLOG_UTIL */
-
-#define WFD_APP_LOG(log_level, format, args...) printf("[%s:%04d,%d] " format, wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), ##args)
-#define __WFD_APP_FUNC_ENTER__ printf("[%s:%04d,%d] Entering: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
-#define __WFD_APP_FUNC_EXIT__ printf("[%s:%04d,%d] Quit: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
+#ifdef USE_DLOG
+#include <dlog.h>
-#endif /** _USE_DLOG_UTIL */
+#undef LOG_TAG
+#define LOG_TAG "WIFI_DIRECT_POPUP"
+#define WDPOP_LOGV(format, args...) LOGV(format, ##args)
+#define WDPOP_LOGD(format, args...) LOGD(format, ##args)
+#define WDPOP_LOGI(format, args...) LOGI(format, ##args)
+#define WDPOP_LOGW(format, args...) LOGW(format, ##args)
+#define WDPOP_LOGE(format, args...) LOGE(format, ##args)
+#define WDPOP_LOGF(format, args...) LOGF(format, ##args)
+#define __WDPOP_LOG_FUNC_ENTER__ LOGV("Enter")
+#define __WDPOP_LOG_FUNC_EXIT__ LOGV("Quit")
-#define assertm_if(expr, fmt, arg...) do { \
+#define assertm_if(expr, fmt, args...) do { \
if (expr) { \
- WFD_APP_LOG(WFD_APP_LOG_ASSERT, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \
+ WDPOP_LOGF(" ##(%s) -> assert!!## "fmt, #expr, ##args); \
exit(1); \
} \
} while (0)
+#else /** _DLOG_UTIL */
+#define WDPOP_LOGV(format, args...) \
+ printf("[V/WIFI_DIRECT_POPUP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDPOP_LOGD(format, args...) \
+ printf("[D/WIFI_DIRECT_POPUP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDPOP_LOGI(format, args...) \
+ printf("[I/WIFI_DIRECT_POPUP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDPOP_LOGW(format, args...) \
+ printf("[W/WIFI_DIRECT_POPUP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDPOP_LOGE(format, args...) \
+ printf("[E/WIFI_DIRECT_POPUP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDPOP_LOGF(format, args...) \
+ printf("[F/WIFI_DIRECT_POPUP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+
+#define __WDPOP_LOG_FUNC_ENTER__ \
+ printf("[V/WIFI_DIRECT_POPUP] %s: %s()(%4d)> Enter", __FILE__, __FUNCTION__, __LINE__)
+#define __WDPOP_LOG_FUNC_EXIT__ \
+ printf("[V/WIFI_DIRECT_POPUP] %s: %s()(%4d)> Exit", __FILE__, __FUNCTION__, __LINE__)
+
+#endif /** _DLOG_UTIL */
#endif /* __WFD_APP_UTIL_H__ */
*/
bool _wfd_connected_peer_cb(wifi_direct_connected_peer_info_s *peer, void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *) user_data;
if (NULL == ad || NULL == peer || NULL == peer->device_name || NULL == peer->mac_address) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return FALSE;
}
int peer_cnt = ad->raw_connected_peer_cnt;
- WFD_APP_LOG(WFD_APP_LOG_LOW, "%dth connected peer. [%s]\n", peer_cnt, peer->device_name);
+ WDPOP_LOGD( "%dth connected peer. [%s]\n", peer_cnt, peer->device_name);
strncpy(ad->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ad->raw_connected_peers[peer_cnt].ssid));
strncpy(ad->raw_connected_peers[peer_cnt].mac_address, peer->mac_address, WFD_MAC_ADDRESS_SIZE);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "\tSSID: [%s]\n", ad->raw_connected_peers[peer_cnt].ssid);
+ WDPOP_LOGD( "\tSSID: [%s]\n", ad->raw_connected_peers[peer_cnt].ssid);
ad->raw_connected_peer_cnt++;
free(peer->device_name);
free(peer->mac_address);
free(peer);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return TRUE;
}
*/
int _wfd_app_get_connected_peers(void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *) user_data;
if (NULL == ad) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return -1;
}
res = wifi_direct_foreach_connected_peers(_wfd_connected_peer_cb, (void *)ad);
if (res != WIFI_DIRECT_ERROR_NONE) {
ad->raw_connected_peer_cnt = 0;
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Get connected peer failed: %d\n", res);
+ WDPOP_LOGD( "Get connected peer failed: %d\n", res);
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return 0;
}
*/
void _del_wfd_notification()
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
/* delete the notification */
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_delete_all_by_type.(%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_delete_all_by_type.(%d)\n", noti_err);
return;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
void _add_wfd_peers_connected_notification(void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *) user_data;
if (NULL == ad || NULL == ad->noti) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return;
}
/* set the icon */
noti_err = notification_set_image(ad->noti, NOTIFICATION_IMAGE_TYPE_ICON, RESDIR"/images/A09_notification_icon.png");
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_image. (%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_image. (%d)\n", noti_err);
return;
}
snprintf(msg, WFD_MAX_SIZE, "Connected with %d devices via Wi-Fi Direct", ad->raw_connected_peer_cnt);
noti_err = notification_set_text(ad->noti, NOTIFICATION_TEXT_TYPE_TITLE, msg, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_text. (%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_text. (%d)\n", noti_err);
return;
}
noti_err = notification_set_text(ad->noti, NOTIFICATION_TEXT_TYPE_CONTENT,
"Tap to change settings", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_text. (%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_text. (%d)\n", noti_err);
return;
}
int res = NOTIFICATION_ERROR_NONE;
res = notification_set_execute_option(ad->noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, /*Button Text*/NULL, NULL, b);
if (res != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Failed to notification_set_execute_option. [%d]", res);
+ WDPOP_LOGD( "Failed to notification_set_execute_option. [%d]", res);
return;
}
/* set display application list */
noti_err = notification_set_display_applist(ad->noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_display_applist : %d\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_display_applist : %d\n", noti_err);
return;
}
/* notify the quick panel */
noti_err = notification_insert(ad->noti, NULL);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_insert.(%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_insert.(%d)\n", noti_err);
return;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
void _add_wfd_turn_off_notification(void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *) user_data;
if (NULL == ad || NULL == ad->noti) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return;
}
/* set the icon */
noti_err = notification_set_image(ad->noti, NOTIFICATION_IMAGE_TYPE_ICON, RESDIR"/images/A09_notification_icon.png");
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_image. (%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_image. (%d)\n", noti_err);
return;
}
noti_err = notification_set_text(ad->noti, NOTIFICATION_TEXT_TYPE_TITLE,
"Disable Wi-Fi Direct after use", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_text. (%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_text. (%d)\n", noti_err);
return;
}
noti_err = notification_set_text(ad->noti, NOTIFICATION_TEXT_TYPE_CONTENT,
"Disable Wi-Fi Direct after use to save battery", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_text. (%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_text. (%d)\n", noti_err);
return;
}
int res = NOTIFICATION_ERROR_NONE;
res = notification_set_execute_option(ad->noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, /*Button Text*/NULL, NULL, b);
if (res != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Failed to notification_set_execute_option. [%d]", res);
+ WDPOP_LOGD( "Failed to notification_set_execute_option. [%d]", res);
return;
}
/* set display application list */
noti_err = notification_set_display_applist(ad->noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_set_display_applist : %d\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_set_display_applist : %d\n", noti_err);
return;
}
/* notify the quick panel */
noti_err = notification_insert(ad->noti, NULL);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_insert.(%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_insert.(%d)\n", noti_err);
return;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
wfd_appdata_t *ad = (wfd_appdata_t *)user_data;
if (NULL == ad) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return ECORE_CALLBACK_CANCEL;
}
/* get transfer state */
if (vconf_get_int(VCONFKEY_WIFI_DIRECT_TRANSFER_STATE, &wfd_transfer_state) < 0) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Error reading vconf (%s)\n",
+ WDPOP_LOGD( "Error reading vconf (%s)\n",
VCONFKEY_WIFI_DIRECT_TRANSFER_STATE);
return ECORE_CALLBACK_CANCEL;
}
/* show tickernoti*/
if (wfd_transfer_state > VCONFKEY_WIFI_DIRECT_TRANSFER_START) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "No RX/TX packet, turn off WFD automatically.\n");
+ WDPOP_LOGD( "No RX/TX packet, turn off WFD automatically.\n");
_add_wfd_turn_off_notification(ad);
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Has RX/TX packet, restart.\n");
+ WDPOP_LOGD( "Has RX/TX packet, restart.\n");
ad->last_wfd_transmit_time = time(NULL);
return ECORE_CALLBACK_RENEW;
}
*/
void _cb_activation(int error_code, wifi_direct_device_state_e device_state, void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *)user_data;
switch (device_state) {
case WIFI_DIRECT_DEVICE_STATE_ACTIVATED:
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_DEVICE_STATE_ACTIVATED\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_DEVICE_STATE_ACTIVATED\n");
break;
case WIFI_DIRECT_DEVICE_STATE_DEACTIVATED:
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_DEVICE_STATE_DEACTIVATED\n");
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Termination process of wifi-direct popup begins...\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_DEVICE_STATE_DEACTIVATED\n");
+ WDPOP_LOGD( "Termination process of wifi-direct popup begins...\n");
/* when deactivated, stop the timer */
if (ad->transmit_timer) {
break;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
static wfd_device_info_t *_wfd_app_find_peer_by_mac_address(void *data, const char *mac_address)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *) data;
int i;
if (ad == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter(NULL)\n");
+ WDPOP_LOGD( "Incorrect parameter(NULL)\n");
return NULL;
}
- WFD_APP_LOG(WFD_APP_LOG_LOW, "find peer by MAC [%s] \n", mac_address);
+ WDPOP_LOGD( "find peer by MAC [%s] \n", mac_address);
for (i = 0; i < ad->discovered_peer_count; i++) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "check %dth peer\n", i);
+ WDPOP_LOGD( "check %dth peer\n", i);
if (!strncmp(mac_address, (const char *) ad->discovered_peers[i].mac_address, 18)) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "found peer. [%d]\n", i);
- __WFD_APP_FUNC_EXIT__;
+ WDPOP_LOGD( "found peer. [%d]\n", i);
+ __WDPOP_LOG_FUNC_EXIT__;
return &ad->discovered_peers[i];
}
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return NULL;
}
*/
bool _wfd_app_discoverd_peer_cb(wifi_direct_discovered_peer_info_s *peer, void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *) user_data;
if (NULL != peer->device_name) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "discovered peer ssid[%s]\n", peer->device_name);
+ WDPOP_LOGD( "discovered peer ssid[%s]\n", peer->device_name);
strncpy(ad->discovered_peers[ad->discovered_peer_count].ssid, peer->device_name, 32);
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "peer's device name is NULL\n");
+ WDPOP_LOGD( "peer's device name is NULL\n");
}
if (NULL != peer->mac_address) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "discovered peer mac[%s]\n", peer->mac_address);
+ WDPOP_LOGD( "discovered peer mac[%s]\n", peer->mac_address);
strncpy(ad->discovered_peers[ad->discovered_peer_count].mac_address, peer->mac_address, 18);
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "peer's mac is NULL\n");
+ WDPOP_LOGD( "peer's mac is NULL\n");
}
ad->discovered_peer_count++;
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return TRUE;
}
*/
void _cb_discover(int error_code, wifi_direct_discovery_state_e discovery_state, void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *)user_data;
int ret;
switch (discovery_state) {
case WIFI_DIRECT_DISCOVERY_STARTED:
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_DISCOVERY_STARTED\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_DISCOVERY_STARTED\n");
break;
case WIFI_DIRECT_ONLY_LISTEN_STARTED:
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_ONLY_LISTEN_STARTED\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_ONLY_LISTEN_STARTED\n");
break;
case WIFI_DIRECT_DISCOVERY_FINISHED:
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_DISCOVERY_FINISHED\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_DISCOVERY_FINISHED\n");
break;
case WIFI_DIRECT_DISCOVERY_FOUND:
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_DISCOVERY_FOUND\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_DISCOVERY_FOUND\n");
if (NULL != ad->discovered_peers) {
free(ad->discovered_peers);
ret = wifi_direct_foreach_discovered_peers(_wfd_app_discoverd_peer_cb, (void *) ad);
if (ret != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "get discovery result failed: %d\n", ret);
+ WDPOP_LOGD( "get discovery result failed: %d\n", ret);
}
break;
break;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
void _cb_connection(int error_code, wifi_direct_connection_state_e connection_state, const char *mac_address, void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = (wfd_appdata_t *)user_data;
int result = -1;
/* find the peer's name by the mac address */
if (NULL == mac_address) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "ERROR : mac address is NULL !!\n");
+ WDPOP_LOGE("ERROR : mac address is NULL !!\n");
return;
}
peer_info = _wfd_app_find_peer_by_mac_address(ad, mac_address);
if (NULL == peer_info) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "peer_info is NULL !!\n");
+ WDPOP_LOGD( "peer_info is NULL !!\n");
} else if (0 == strlen(peer_info->ssid)) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "SSID from connection is invalid !!\n");
+ WDPOP_LOGD( "SSID from connection is invalid !!\n");
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "SSID from connection is %s.\n", peer_info->ssid);
+ WDPOP_LOGD( "SSID from connection is %s.\n", peer_info->ssid);
strncpy(ad->peer_name, peer_info->ssid, strlen(peer_info->ssid));
}
switch (connection_state) {
case WIFI_DIRECT_CONNECTION_RSP:
{
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_CONNECTION_RSP\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_CONNECTION_RSP\n");
wfd_destroy_popup();
if (error_code == WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Link Complete!\n");
+ WDPOP_LOGD( "Link Complete!\n");
/* add connected notification */
_add_wfd_peers_connected_notification(ad);
wfd_tickernoti_popup(msg);
} else {
if (error_code == WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT) {
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"Error Code - WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT\n");
} else if (error_code == WIFI_DIRECT_ERROR_AUTH_FAILED) {
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"Error Code - WIFI_DIRECT_ERROR_AUTH_FAILED\n");
} else if (error_code == WIFI_DIRECT_ERROR_CONNECTION_FAILED) {
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"Error Code - WIFI_DIRECT_ERROR_CONNECTION_FAILED\n");
}
memcpy(ad->peer_mac, mac_address, sizeof(ad->peer_mac));
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"event ------------------ WIFI_DIRECT_CONNECTION_WPS_REQ\n");
result = wifi_direct_get_wps_type(&wps_mode);
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"wifi_direct_get_wps_type() result=[%d]\n", result);
if (wps_mode == WIFI_DIRECT_WPS_TYPE_PBC) {
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"wps_config is WIFI_DIRECT_WPS_TYPE_PBC. Ignore it..\n");
} else if (wps_mode == WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD) {
char *pin;
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD\n");
+ WDPOP_LOGD( "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD\n");
if (wifi_direct_generate_wps_pin() != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_generate_wps_pin() is failed\n");
+ WDPOP_LOGD( "wifi_direct_generate_wps_pin() is failed\n");
return;
}
if (wifi_direct_get_wps_pin(&pin) != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_generate_wps_pin() is failed\n");
+ WDPOP_LOGD( "wifi_direct_generate_wps_pin() is failed\n");
return;
}
free(pin);
pin = NULL;
- WFD_APP_LOG(WFD_APP_LOG_LOW, "pin=[%s]\n", ad->pin_number);
+ WDPOP_LOGD( "pin=[%s]\n", ad->pin_number);
wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_PIN, NULL);
} else if (wps_mode == WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY\n");
+ WDPOP_LOGD( "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY\n");
wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_KEYPAD, (void *) NULL);
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is unkown!\n");
+ WDPOP_LOGD( "wps_config is unkown!\n");
}
}
case WIFI_DIRECT_CONNECTION_REQ:
{
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_CONNECTION_REQ\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_CONNECTION_REQ\n");
wifi_direct_wps_type_e wps_mode;
bool auto_connection_mode;
result = wifi_direct_get_wps_type(&wps_mode);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_get_wps_type() result=[%d]\n", result);
+ WDPOP_LOGD( "wifi_direct_get_wps_type() result=[%d]\n", result);
result = wifi_direct_is_autoconnection_mode(&auto_connection_mode);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_is_autoconnection_mode() result=[%d]\n", result);
+ WDPOP_LOGD( "wifi_direct_is_autoconnection_mode() result=[%d]\n", result);
if (auto_connection_mode == TRUE) {
result = wifi_direct_accept_connection(ad->peer_mac);
printf("wifi_direct_accept_connection() result=[%d]\n", result);
} else {
if (wps_mode == WIFI_DIRECT_WPS_TYPE_PBC) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is WIFI_DIRECT_WPS_TYPE_PBC\n");
+ WDPOP_LOGD( "wps_config is WIFI_DIRECT_WPS_TYPE_PBC\n");
wfd_prepare_popup(WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ, NULL);
} else if (wps_mode == WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY\n");
+ WDPOP_LOGD( "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY\n");
wfd_prepare_popup(WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ, NULL);
} else if (wps_mode == WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD\n");
+ WDPOP_LOGD( "wps_config is WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD\n");
wfd_prepare_popup(WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ, (void *) NULL);
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wps_config is unkown!\n");
+ WDPOP_LOGD( "wps_config is unkown!\n");
}
}
}
case WIFI_DIRECT_DISCONNECTION_IND:
{
_del_wfd_notification();
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_DISCONNECTION_IND\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_DISCONNECTION_IND\n");
result = wifi_direct_set_autoconnection_mode(false);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_set_autoconnection_mode() result=[%d]\n", result);
+ WDPOP_LOGD( "wifi_direct_set_autoconnection_mode() result=[%d]\n", result);
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_DISCONNECTED, ad->peer_name);
wfd_destroy_popup();
result = wifi_direct_set_autoconnection_mode(false);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_set_autoconnection_mode() result=[%d]\n", result);
+ WDPOP_LOGD( "wifi_direct_set_autoconnection_mode() result=[%d]\n", result);
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_DISCONNECTED, ad->peer_name);
break;
case WIFI_DIRECT_CONNECTION_IN_PROGRESS:
{
- WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
/* tickernoti popup */
wfd_tickernoti_popup(_("IDS_WFD_POP_CONNECTING"));
}
/* if connected, start the transmit timer */
wifi_direct_get_state(&ad->wfd_status);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "status: %d", ad->wfd_status);
+ WDPOP_LOGD( "status: %d", ad->wfd_status);
if (ad->wfd_status < WIFI_DIRECT_STATE_CONNECTED) {
if (ad->transmit_timer) {
}
} else {
if (NULL == ad->transmit_timer) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "start the transmit timer\n");
+ WDPOP_LOGD( "start the transmit timer\n");
ad->last_wfd_transmit_time = time(NULL);
ad->transmit_timer = ecore_timer_add(5.0,
(Ecore_Task_Cb)_wfd_automatic_deactivated_for_connection_cb, ad);
}
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_flight_mode_changed(keynode_t *node, void *user_data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
int res = -1;
int flight_mode = 0;
wfd_appdata_t *ad = (wfd_appdata_t *)user_data;
if (NULL == ad) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "NULL parameters.\n");
+ WDPOP_LOGE("NULL parameters.\n");
return;
}
res = vconf_get_bool(VCONFKEY_SETAPPL_FLIGHT_MODE_BOOL, &flight_mode);
if (res != 0) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get flight state from vconf. [%d]\n", res);
+ WDPOP_LOGE("Failed to get flight state from vconf. [%d]\n", res);
return;
}
if (flight_mode == FALSE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Flight mode is off\n");
+ WDPOP_LOGD( "Flight mode is off\n");
return;
}
/* If flight mode is on, turn off WFD */
wifi_direct_get_state(&ad->wfd_status);
if (WIFI_DIRECT_STATE_DEACTIVATED == ad->wfd_status) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Wi-Fi Direct is deactivated.\n");
+ WDPOP_LOGD( "Wi-Fi Direct is deactivated.\n");
return;
}
if (WIFI_DIRECT_STATE_CONNECTED == ad->wfd_status) {
res = wifi_direct_disconnect_all();
if (res != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to send disconnection request to all. [%d]\n", res);
+ WDPOP_LOGE("Failed to send disconnection request to all. [%d]\n", res);
return;
}
}
res = wifi_direct_deactivate();
if (res != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to deactivate Wi-Fi Direct. error code = [%d]\n", res);
+ WDPOP_LOGE("Failed to deactivate Wi-Fi Direct. error code = [%d]\n", res);
return;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
int init_wfd_popup_client(wfd_appdata_t *ad)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
if (NULL == ad) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return FALSE;
}
ret = wifi_direct_initialize();
if (ret != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to initialize Wi-Fi Direct. error code = [%d]\n", ret);
+ WDPOP_LOGE("Failed to initialize Wi-Fi Direct. error code = [%d]\n", ret);
return FALSE;
}
ret = wifi_direct_set_device_state_changed_cb(_cb_activation, (void *)ad);
if (ret != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to register _cb_activation. error code = [%d]\n", ret);
+ WDPOP_LOGE("Failed to register _cb_activation. error code = [%d]\n", ret);
return FALSE;
}
ret = wifi_direct_set_discovery_state_changed_cb(_cb_discover, (void *)ad);
if (ret != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to register _cb_discover. error code = [%d]\n", ret);
+ WDPOP_LOGE("Failed to register _cb_discover. error code = [%d]\n", ret);
return FALSE;
}
ret = wifi_direct_set_connection_state_changed_cb(_cb_connection, (void *)ad);
if (ret != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to register _cb_connection. error code = [%d]\n", ret);
+ WDPOP_LOGE("Failed to register _cb_connection. error code = [%d]\n", ret);
return FALSE;
}
/* initialize notification */
ad->noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
if (NULL == ad->noti) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "notification_new failed.\n");
+ WDPOP_LOGD( "notification_new failed.\n");
return FALSE;
}
int result = -1;
result = vconf_notify_key_changed(VCONFKEY_SETAPPL_FLIGHT_MODE_BOOL, _wfd_flight_mode_changed, ad);
if (result == -1) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to register vconf callback for flight mode\n");
+ WDPOP_LOGE("Failed to register vconf callback for flight mode\n");
return FALSE;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
if (ret == WIFI_DIRECT_ERROR_NONE) {
return TRUE;
*/
int deinit_wfd_popup_client(wfd_appdata_t *ad)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
if (NULL == ad || NULL == ad->noti) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "NULL parameters.\n");
+ WDPOP_LOGD( "NULL parameters.\n");
return FALSE;
}
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
noti_err = notification_free(ad->noti);
if (noti_err != NOTIFICATION_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to notification_free.(%d)\n", noti_err);
+ WDPOP_LOGD( "Fail to notification_free.(%d)\n", noti_err);
ret = WIFI_DIRECT_ERROR_RESOURCE_BUSY;
}
int result = -1;
result = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wfd_flight_mode_changed);
if (result == -1) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to ignore vconf key callback for flight mode\n");
+ WDPOP_LOGE("Failed to ignore vconf key callback for flight mode\n");
}
if (ad->transmit_timer) {
ad->transmit_timer = NULL;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
if (ret == WIFI_DIRECT_ERROR_NONE) {
return TRUE;
static int _app_create(void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
if (data == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter\n");
+ WDPOP_LOGD( "Incorrect parameter\n");
return -1;
}
ad->popup_data = (wfd_popup_t *) malloc(sizeof(wfd_popup_t));
if (!ad->popup_data) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "malloc failed\n");
+ WDPOP_LOGE("malloc failed\n");
return -1;
}
r = appcore_set_i18n(PACKAGE, NULL);
if (r != 0) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "appcore_set_i18n error\n");
+ WDPOP_LOGD( "appcore_set_i18n error\n");
return -1;
}
if (init_wfd_popup_client(ad) == FALSE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "init_wfd_popup_client error\n");
+ WDPOP_LOGE("init_wfd_popup_client error\n");
wfd_prepare_popup(WFD_POP_FAIL_INIT, NULL);
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return 0;
}
static int _app_terminate(void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
if (data == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Incorrect parameter\n");
+ WDPOP_LOGE("Incorrect parameter\n");
return -1;
}
wfd_appdata_t *ad = (wfd_appdata_t *) data;
if (deinit_wfd_popup_client(ad) == FALSE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "deinit_wfd_popup_client error\n");
+ WDPOP_LOGE("deinit_wfd_popup_client error\n");
} else {
if (ad->popup) {
evas_object_del(ad->popup);
}
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return 0;
}
static int _app_pause(void *data)
{
- __WFD_APP_FUNC_ENTER__;
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_EXIT__;
return 0;
}
static int _app_resume(void *data)
{
- __WFD_APP_FUNC_ENTER__;
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_EXIT__;
return 0;
}
static int _app_reset(bundle *b, void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
if (b == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Bundle is NULL");
+ WDPOP_LOGD( "Bundle is NULL");
return -1;
}
noti_type = (char *)appsvc_get_data(b, NOTIFICATION_BUNDLE_PARAM);
if (noti_type == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Notification type is wrong.");
+ WDPOP_LOGD( "Notification type is wrong.");
return -1;
}
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Notification type is [%s]", noti_type);
+ WDPOP_LOGD( "Notification type is [%s]", noti_type);
if (strncmp(noti_type, NOTIFICATION_BUNDLE_VALUE, strlen(NOTIFICATION_BUNDLE_PARAM)) == 0) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Launch wifidirect-ugapp");
+ WDPOP_LOGD( "Launch wifidirect-ugapp");
service_h service;
service_create(&service);
service_set_operation(service, SERVICE_OPERATION_DEFAULT);
service_destroy(service);
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return 0;
}
*/
static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
int result = -1;
int resp = (int) data;
char msg[WFD_POP_STR_MAX_LEN] = {0};
- WFD_APP_LOG(WFD_APP_LOG_HIGH, "popup resp : %d\n", resp);
+ WDPOP_LOGI( "popup resp : %d\n", resp);
switch (resp) {
case /* MT */ WFD_POP_RESP_APRV_CONNECT_PBC_YES:
{
- WFD_APP_LOG(WFD_APP_LOG_HIGH,
+ WDPOP_LOGI(
"WFD_POP_RESP_APRV_CONNECT_PBC_YES\n");
wfd_destroy_popup();
result = wifi_direct_accept_connection(ad->peer_mac);
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"wifi_direct_accept_connection() result=[%d]\n",
result);
if (result == WIFI_DIRECT_ERROR_NONE) {
/* tickernoti popup */
wfd_tickernoti_popup(_("IDS_WFD_POP_CONNECTING"));
} else {
- WFD_APP_LOG(WFD_APP_LOG_ERROR,
+ WDPOP_LOGE(
"wifi_direct_accept_connection() FAILED!!\n");
evas_object_hide(ad->win);
{
char *pin = NULL;
- WFD_APP_LOG(WFD_APP_LOG_HIGH,
+ WDPOP_LOGI(
"WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK\n");
wfd_destroy_popup();
if (wifi_direct_generate_wps_pin() != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_generate_wps_pin() is failed\n");
+ WDPOP_LOGD( "wifi_direct_generate_wps_pin() is failed\n");
return;
}
if (wifi_direct_get_wps_pin(&pin) != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "wifi_direct_generate_wps_pin() is failed\n");
+ WDPOP_LOGD( "wifi_direct_generate_wps_pin() is failed\n");
return;
}
strncpy(ad->pin_number, pin, 64);
free(pin);
pin = NULL;
- WFD_APP_LOG(WFD_APP_LOG_LOW, "button ok: pin [%s]", ad->pin_number);
+ WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
result = wifi_direct_accept_connection(ad->peer_mac);
if (result == WIFI_DIRECT_ERROR_NONE) {
wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_PIN, NULL);
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"wifi_direct_accept_connection() failed. result=[%d]\n", result);
/* tickernoti popup */
wfd_tickernoti_popup(IDS_WFD_POP_CONNECT_FAILED);
case /* MO */ WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK:
{
- WFD_APP_LOG(WFD_APP_LOG_HIGH,
+ WDPOP_LOGI(
"WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK\n");
wfd_destroy_popup();
int len = strlen(ad->pin_number);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "button ok: pin [%s]", ad->pin_number);
+ WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
if (len > 7 && len < 64) {
int result = 0;
- WFD_APP_LOG(WFD_APP_LOG_LOW, "pin=[%s]\n", ad->pin_number);
+ WDPOP_LOGD( "pin=[%s]\n", ad->pin_number);
result = wifi_direct_set_wps_pin(ad->pin_number);
if (result != WIFI_DIRECT_ERROR_NONE) {
//result = wifi_direct_activate_pushbutton();
result = wifi_direct_accept_connection(ad->peer_mac);
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"wifi_direct_accept_connection(%s) result=[%d]\n",
ad->peer_mac, result);
if (result != WIFI_DIRECT_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR,
+ WDPOP_LOGE(
"wifi_direct_accept_connection() FAILED!!\n");
evas_object_hide(ad->win);
wfd_tickernoti_popup(msg);
}
} else {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Error, Incorrect PIN!!\n");
+ WDPOP_LOGE( "Error, Incorrect PIN!!\n");
/* tickernoti popup */
wfd_tickernoti_popup(_("IDS_WFD_POP_PIN_INVALID"));
case /* MT */ WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES:
{
- WFD_APP_LOG(WFD_APP_LOG_HIGH,
+ WDPOP_LOGI(
"WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES\n");
wfd_destroy_popup();
if (pb_timer) {
case /* MT */ WFD_POP_RESP_APRV_CONNECT_NO:
{
- WFD_APP_LOG(WFD_APP_LOG_HIGH,
+ WDPOP_LOGI(
"WFD_POP_RESP_APRV_CONNECT_NO: destroy_popup...\n");
wfd_destroy_popup();
}
result = wifi_direct_disconnect(ad->peer_mac);
- WFD_APP_LOG(WFD_APP_LOG_LOW,
+ WDPOP_LOGD(
"wifi_direct_disconnect[%s] result=[%d]\n",
ad->peer_mac, result);
}
default:
{
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Unknown respone\n");
+ WDPOP_LOGE( "Unknown respone\n");
evas_object_hide(ad->win);
}
break;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
*/
void wfd_destroy_popup()
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
if (ad == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "ad is NULL\n");
+ WDPOP_LOGE( "ad is NULL\n");
return;
}
evas_object_hide(ad->win);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return;
}
*/
static Evas_Object *wfd_draw_pop_type_a(Evas_Object * win, wfd_popup_t * pop)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
Evas_Object *popup;
popup = elm_popup_add(win);
evas_object_show(popup);
evas_object_show(win);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return popup;
}
*/
static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
Evas_Object *popup = NULL;
Evas_Object *btn = NULL;
evas_object_show(popup);
evas_object_show(win);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return popup;
}
*/
static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
Evas_Object *popup = NULL;
Evas_Object *btn1 = NULL, *btn2 = NULL;
evas_object_show(popup);
evas_object_show(win);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return popup;
}
*/
static void _smart_ime_cb(void *data, Evas_Object * obj, void *event_info)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
Ecore_IMF_Context *imf_context = NULL;
imf_context = (Ecore_IMF_Context *) ad->pin_entry;
if (NULL == imf_context) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Error!!! Ecore_IMF_Context is NULL!!");
+ WDPOP_LOGE( "Error!!! Ecore_IMF_Context is NULL!!");
return;
}
const char *txt = elm_entry_markup_to_utf8(elm_entry_entry_get((const Evas_Object *) imf_context));
if (NULL != txt) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "* text [%s], len=[%d]", txt, strlen(txt));
+ WDPOP_LOGD( "* text [%s], len=[%d]", txt, strlen(txt));
strncpy(ad->pin_number, txt, sizeof(ad->pin_number));
} else {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Err!");
+ WDPOP_LOGD( "Err!");
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
/**
wfd_wps_display_popup_t *wps_display_popup = (wfd_wps_display_popup_t *) data;
if (NULL == wps_display_popup) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Param is NULL.\n");
+ WDPOP_LOGE( "Param is NULL.\n");
return ECORE_CALLBACK_CANCEL;
}
value = elm_progressbar_value_get(progressbar);
if (value >= 1.0) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Progress end.\n");
+ WDPOP_LOGE( "Progress end.\n");
if (pb_timer) {
ecore_timer_del(pb_timer);
pb_timer = NULL;
step = wps_display_popup->step;
value = ((double)step) / WFD_POP_TIMER_120;
elm_progressbar_value_set(progressbar, value);
- WFD_APP_LOG(WFD_APP_LOG_LOW, "step: %d, value: %f\n", wps_display_popup->step, value);
+ WDPOP_LOGD( "step: %d, value: %f\n", wps_display_popup->step, value);
/* show the time label */
if (step < 60) {
*/
Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
Evas_Object *popup = NULL;
Evas_Object *label = NULL;
evas_object_show(popup);
evas_object_show(win);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return popup;
}
*/
Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
Evas_Object *conformant = NULL;
evas_object_show(win);
elm_object_focus_set(ad->pin_entry, EINA_TRUE);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return pinpopup;
}
*/
void wfd_prepare_popup(int type, void *userdata)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
wfd_popup_t *pop = ad->popup_data;
break;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
return;
}
*/
void wfd_tickernoti_popup(char *msg)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDPOP_LOG_FUNC_ENTER__;
int ret = -1;
bundle *b = NULL;
b = bundle_create();
if (!b) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "FAIL: bundle_create()\n");
+ WDPOP_LOGD( "FAIL: bundle_create()\n");
return;
}
/* tickernoti style */
ret = bundle_add(b, "0", "info");
if (ret) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to add tickernoti style\n");
+ WDPOP_LOGD( "Fail to add tickernoti style\n");
bundle_free(b);
return;
}
/* popup text */
ret = bundle_add(b, "1", msg);
if (ret) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to add popup text\n");
+ WDPOP_LOGD( "Fail to add popup text\n");
bundle_free(b);
return;
}
/* orientation of tickernoti */
ret = bundle_add(b, "2", "0");
if (ret) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to add orientation of tickernoti\n");
+ WDPOP_LOGD( "Fail to add orientation of tickernoti\n");
bundle_free(b);
return;
}
/* timeout(second) of tickernoti */
ret = bundle_add(b, "3", "3");
if (ret) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to add timeout of tickernoti\n");
+ WDPOP_LOGD( "Fail to add timeout of tickernoti\n");
bundle_free(b);
return;
}
/* launch tickernoti */
ret = syspopup_launch(TICKERNOTI_SYSPOPUP, b);
if (ret) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Fail to launch syspopup\n");
+ WDPOP_LOGD( "Fail to launch syspopup\n");
}
bundle_free(b);
- __WFD_APP_FUNC_EXIT__;
+ __WDPOP_LOG_FUNC_EXIT__;
}
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
+ADD_DEFINITIONS("-DUSE_DLOG")
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0)
#ifndef __WFD_UG_H__
#define __WFD_UG_H__
-#include <dlog.h>
#include <ui-gadget-module.h>
#include <tethering.h>
#include <wifi-direct.h>
#define PACKAGE "ug-setting-wifidirect-efl"
#define LOCALEDIR "/usr/ug/res/locale"
+#define VCONF_WFD_APNAME "db/setting/device_name"
+
+#ifdef USE_DLOG
+#include <dlog.h>
-#define DIRECT_TAG "wfd_ug"
-#define DBG(log_level, format, args...) \
- LOG(log_level, DIRECT_TAG, "[%s()][%d] " format, __FUNCTION__, __LINE__, ##args)
+#undef LOG_TAG
+#define LOG_TAG "UG_WIFI_DIRECT"
-#define __FUNC_ENTER__ DBG(LOG_VERBOSE, "+\n")
-#define __FUNC_EXIT__ DBG(LOG_VERBOSE, "-\n")
+#define WDUG_LOGV(format, args...) LOGV(format, ##args)
+#define WDUG_LOGD(format, args...) LOGD(format, ##args)
+#define WDUG_LOGI(format, args...) LOGI(format, ##args)
+#define WDUG_LOGW(format, args...) LOGW(format, ##args)
+#define WDUG_LOGE(format, args...) LOGE(format, ##args)
+#define WDUG_LOGF(format, args...) LOGF(format, ##args)
-#define VCONF_WFD_APNAME "db/setting/device_name"
+#define __WDUG_LOG_FUNC_ENTER__ LOGV("Enter")
+#define __WDUG_LOG_FUNC_EXIT__ LOGV("Quit")
-#define assertm_if(expr, fmt, arg...) do { \
+#define assertm_if(expr, fmt, args...) do { \
if (expr) { \
- DBG(LOG_VERBOSE, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \
+ WDUG_LOGF(" ##(%s) -> assert!!## "fmt, #expr, ##args); \
assert(1); \
} \
} while (0)
+#else /** _DLOG_UTIL */
+
+#define WDUG_LOGV(format, args...) \
+ printf("[V/UG_WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUG_LOGD(format, args...) \
+ printf("[D/UG_WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUG_LOGI(format, args...) \
+ printf("[I/UG_WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUG_LOGW(format, args...) \
+ printf("[W/UG_WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUG_LOGE(format, args...) \
+ printf("[E/UG_WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUG_LOGF(format, args...) \
+ printf("[F/UG_WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+
+#define __WDUG_LOG_FUNC_ENTER__ \
+ printf("[V/UG_WIFI_DIRECT] %s: %s()(%4d)> Enter", __FILE__, __FUNCTION__, __LINE__)
+#define __WDUG_LOG_FUNC_EXIT__ \
+ printf("[V/UG_WIFI_DIRECT] %s: %s()(%4d)> Exit", __FILE__, __FUNCTION__, __LINE__)
+
+#endif /** _DLOG_UTIL */
+
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
*/
static void _wifi_state_cb(keynode_t *key, void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
int wifi_state;
res = vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_state);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to get wifi state from vconf. [%d]\n", res);
+ WDUG_LOGE("Failed to get wifi state from vconf. [%d]\n", res);
return;
}
if (wifi_state == VCONFKEY_WIFI_OFF) {
- DBG(LOG_VERBOSE, "WiFi is turned off\n");
+ WDUG_LOGI("WiFi is turned off\n");
wfd_client_swtch_force(ugd, TRUE);
} else {
- DBG(LOG_VERBOSE, "WiFi is turned on\n");
+ WDUG_LOGI("WiFi is turned on\n");
}
res = net_deregister_client();
if (res != NET_ERR_NONE) {
- DBG(LOG_ERROR, "Failed to deregister network client. [%d]\n", res);
+ WDUG_LOGE("Failed to deregister network client. [%d]\n", res);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _network_event_cb(net_event_info_t *event_info, void *user_data)
{
- __FUNC_ENTER__;
- DBG(LOG_VERBOSE, "Event from network. [%d]\n", event_info->Event);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_ENTER__;
+ WDUG_LOGI("Event from network. [%d]\n", event_info->Event);
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
int wfd_wifi_off(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
res = vconf_notify_key_changed(VCONFKEY_WIFI_STATE, _wifi_state_cb, ugd);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to register vconf callback\n");
+ WDUG_LOGE("Failed to register vconf callback\n");
return -1;
}
- DBG(LOG_VERBOSE, "Vconf key callback is registered\n");
+ WDUG_LOGI("Vconf key callback is registered\n");
res = net_register_client((net_event_cb_t) _network_event_cb, NULL);
if (res != NET_ERR_NONE) {
- DBG(LOG_ERROR, "Failed to register network client. [%d]\n", res);
+ WDUG_LOGE("Failed to register network client. [%d]\n", res);
return -1;
}
- DBG(LOG_VERBOSE, "Network client is registered\n");
+ WDUG_LOGI("Network client is registered\n");
res = net_wifi_power_off();
if (res != NET_ERR_NONE) {
- DBG(LOG_ERROR, "Failed to turn off wifi. [%d]\n", res);
+ WDUG_LOGE("Failed to turn off wifi. [%d]\n", res);
return -1;
}
- DBG(LOG_VERBOSE, "WiFi power off\n");
+ WDUG_LOGI("WiFi power off\n");
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
static void _enable_hotspot_state_cb(keynode_t *key, void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
int hotspot_mode;
res = vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &hotspot_mode);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to get mobile hotspot state from vconf. [%d]\n", res);
+ WDUG_LOGE("Failed to get mobile hotspot state from vconf. [%d]\n", res);
return;
}
if (hotspot_mode & VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) {
- DBG(LOG_VERBOSE, " Mobile hotspot is activated\n");
+ WDUG_LOGI(" Mobile hotspot is activated\n");
}
th = ugd->hotspot_handle;
/* Deregister cbs */
ret = tethering_unset_enabled_cb(th, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_unset_enabled_cb is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_unset_enabled_cb is failed(%d)\n", ret);
}
/* Destroy tethering handle */
ret = tethering_destroy(th);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_destroy is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_destroy is failed(%d)\n", ret);
}
ugd->hotspot_handle = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _disable_hotspot_state_cb(keynode_t *key, void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
int hotspot_mode;
res = vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &hotspot_mode);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to get mobile hotspot state from vconf. [%d]\n", res);
+ WDUG_LOGE("Failed to get mobile hotspot state from vconf. [%d]\n", res);
return;
}
if (!(hotspot_mode & VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI)) {
- DBG(LOG_VERBOSE, " Mobile hotspot is deactivated\n");
+ WDUG_LOGI(" Mobile hotspot is deactivated\n");
wfd_client_swtch_force(ugd, TRUE);
}
/* Deregister cbs */
ret = tethering_unset_disabled_cb(th, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_unset_disabled_cb is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_unset_disabled_cb is failed(%d)\n", ret);
}
/* Destroy tethering handle */
ret = tethering_destroy(th);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_destroy is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_destroy is failed(%d)\n", ret);
}
ugd->hotspot_handle = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void __enabled_cb(tethering_error_e error, tethering_type_e type, bool is_requested, void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (error != TETHERING_ERROR_NONE) {
if (is_requested != TRUE) {
return;
}
- DBG(LOG_ERROR, "error !!! TETHERING is not enabled.\n");
+ WDUG_LOGE("error !!! TETHERING is not enabled.\n");
return;
}
- DBG(LOG_VERBOSE, "TETHERING is enabled.\n");
+ WDUG_LOGI("TETHERING is enabled.\n");
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
static void __disabled_cb(tethering_error_e error, tethering_type_e type, tethering_disabled_cause_e code, void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (error != TETHERING_ERROR_NONE) {
if (code != TETHERING_DISABLED_BY_REQUEST) {
return;
}
- DBG(LOG_ERROR, "error !!! TETHERING is not disabled.\n");
+ WDUG_LOGE("error !!! TETHERING is not disabled.\n");
return;
}
- DBG(LOG_VERBOSE, "TETHERING is disabled.\n");
+ WDUG_LOGI("TETHERING is disabled.\n");
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
int wfd_mobile_ap_on(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
tethering_error_e ret = TETHERING_ERROR_NONE;
res = vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, _enable_hotspot_state_cb, ugd);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to register vconf callback\n");
+ WDUG_LOGE("Failed to register vconf callback\n");
return -1;
}
/* Create tethering handle */
ret = tethering_create(&th);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to tethering_create() [%d]\n", ret);
+ WDUG_LOGE("Failed to tethering_create() [%d]\n", ret);
return -1;
} else {
- DBG(LOG_VERBOSE, "Succeeded to tethering_create()\n");
+ WDUG_LOGI("Succeeded to tethering_create()\n");
}
/* Register cbs */
ret = tethering_set_enabled_cb(th, TETHERING_TYPE_WIFI, __enabled_cb, NULL);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_set_enabled_cb is failed\n", ret);
+ WDUG_LOGE("tethering_set_enabled_cb is failed\n", ret);
return -1;
}
/* Enable tethering */
ret = tethering_enable(th, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to turn on mobile hotspot. [%d]\n", ret);
+ WDUG_LOGE("Failed to turn on mobile hotspot. [%d]\n", ret);
return -1;
} else {
- DBG(LOG_VERBOSE, "Succeeded to turn on mobile hotspot\n");
+ WDUG_LOGI("Succeeded to turn on mobile hotspot\n");
}
ugd->hotspot_handle = th;
ugd->is_hotspot_off = FALSE;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_mobile_ap_off(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
tethering_error_e ret = TETHERING_ERROR_NONE;
res = vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, _disable_hotspot_state_cb, ugd);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to register vconf callback\n");
+ WDUG_LOGE("Failed to register vconf callback\n");
return -1;
}
/* Create tethering handle */
ret = tethering_create(&th);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to tethering_create() [%d]\n", ret);
+ WDUG_LOGE("Failed to tethering_create() [%d]\n", ret);
return -1;
} else {
- DBG(LOG_VERBOSE, "Succeeded to tethering_create()\n");
+ WDUG_LOGI("Succeeded to tethering_create()\n");
}
/* Register cbs */
ret = tethering_set_disabled_cb(th, TETHERING_TYPE_WIFI, __disabled_cb, NULL);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_set_disabled_cb is failed\n", ret);
+ WDUG_LOGE("tethering_set_disabled_cb is failed\n", ret);
return -1;
}
/* Disable tethering */
ret = tethering_disable(th, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to turn off mobile hotspot. [%d]\n", ret);
+ WDUG_LOGE("Failed to turn off mobile hotspot. [%d]\n", ret);
return -1;
} else {
- DBG(LOG_VERBOSE, "Succeeded to turn off mobile hotspot\n");
+ WDUG_LOGI("Succeeded to turn off mobile hotspot\n");
}
ugd->hotspot_handle = th;
ugd->is_hotspot_off = TRUE;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
static device_type_s *wfd_client_find_peer_by_mac(void *data, const char *mac_addr)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int i;
if (ugd == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
if (ugd->multi_connect_mode != WFD_MULTI_CONNECT_MODE_NONE) {
for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "[Multi Connect] check %dth peer\n", i);
+ WDUG_LOGI("[Multi Connect] check %dth peer\n", i);
if (!strncmp(mac_addr, (const char *)ugd->raw_multi_selected_peers[i].mac_addr, MAC_LENGTH)) {
- DBG(LOG_VERBOSE, "selected found peer. [%d]\n", i);
- __FUNC_EXIT__;
+ WDUG_LOGI("selected found peer. [%d]\n", i);
+ __WDUG_LOG_FUNC_EXIT__;
return &ugd->raw_multi_selected_peers[i];
}
}
} else {
for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "check %dth peer\n", i);
+ WDUG_LOGI("check %dth peer\n", i);
if (!strncmp(mac_addr, (const char *)ugd->raw_discovered_peers[i].mac_addr, MAC_LENGTH)) {
- DBG(LOG_VERBOSE, "found peer. [%d]\n", i);
- __FUNC_EXIT__;
+ WDUG_LOGI("found peer. [%d]\n", i);
+ __WDUG_LOG_FUNC_EXIT__;
return &ugd->raw_discovered_peers[i];
}
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
*/
void _activation_cb(int error_code, wifi_direct_device_state_e device_state, void *user_data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res = -1;
struct ug_data *ugd = (struct ug_data *)user_data;
switch (device_state) {
case WIFI_DIRECT_DEVICE_STATE_ACTIVATED:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_DEVICE_STATE_ACTIVATED\n");
+ WDUG_LOGI("WIFI_DIRECT_DEVICE_STATE_ACTIVATED\n");
if (error_code != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Error in Activation/Deactivation [%d]\n", error_code);
+ WDUG_LOGE("Error in Activation/Deactivation [%d]\n", error_code);
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_ACTIVATE_FAIL"), POPUP_TYPE_ACTIVATE_FAIL);
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
res = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wifi_state_cb);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to ignore vconf key callback for wifi state\n");
+ WDUG_LOGE("Failed to ignore vconf key callback for wifi state\n");
}
res = vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, _disable_hotspot_state_cb);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to ignore vconf key callback for hotspot state\n");
+ WDUG_LOGE("Failed to ignore vconf key callback for hotspot state\n");
}
res = wifi_direct_start_discovery(FALSE, MAX_SCAN_TIME_OUT);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to start discovery. [%d]\n", res);
+ WDUG_LOGE("Failed to start discovery. [%d]\n", res);
ugd->is_re_discover = TRUE;
wifi_direct_cancel_discovery();
} else {
- DBG(LOG_VERBOSE, "Discovery is started\n");
+ WDUG_LOGI("Discovery is started\n");
ugd->is_re_discover = FALSE;
}
break;
case WIFI_DIRECT_DEVICE_STATE_DEACTIVATED:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_DEVICE_STATE_DEACTIVATED\n");
+ WDUG_LOGI("WIFI_DIRECT_DEVICE_STATE_DEACTIVATED\n");
if (error_code != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Error in Activation/Deactivation [%d]\n", error_code);
+ WDUG_LOGE("Error in Activation/Deactivation [%d]\n", error_code);
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_DEACTIVATE_FAIL"), POPUP_TYPE_DEACTIVATE_FAIL);
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
ugd->wfd_onoff = 1;
/* remove the callback for hotspot */
res = vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, _enable_hotspot_state_cb);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to ignore vconf key callback for hotspot state\n");
+ WDUG_LOGE("Failed to ignore vconf key callback for hotspot state\n");
}
/* when deactivated, stop the timer */
elm_object_disabled_set(ugd->back_btn, FALSE);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
bool _wfd_discoverd_peer_cb(wifi_direct_discovered_peer_info_s *peer, void *user_data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (NULL == peer || NULL == user_data) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
- __FUNC_EXIT__;
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
+ __WDUG_LOG_FUNC_EXIT__;
return FALSE;
}
struct ug_data *ugd = (struct ug_data *)user_data;
int peer_cnt = ugd->raw_discovered_peer_cnt;
- DBG(LOG_VERBOSE, "%dth discovered peer. [%s] [%s]\n", peer_cnt, peer->device_name, peer->mac_address);
+ WDUG_LOGI("%dth discovered peer. [%s] [%s]\n", peer_cnt, peer->device_name, peer->mac_address);
strncpy(ugd->raw_discovered_peers[peer_cnt].ssid, peer->device_name, sizeof(ugd->raw_discovered_peers[peer_cnt].ssid));
ugd->raw_discovered_peers[peer_cnt].category = peer->primary_device_type;
ugd->raw_discovered_peers[peer_cnt].conn_status = PEER_CONN_STATUS_DISCONNECTED;
}
- DBG(LOG_VERBOSE, "\tSSID: [%s]\n", ugd->raw_discovered_peers[peer_cnt].ssid);
- DBG(LOG_VERBOSE, "\tPeer category [%d] -> [%d]\n", peer->primary_device_type, ugd->raw_discovered_peers[peer_cnt].category);
- DBG(LOG_VERBOSE, "\tStatus: [%d]\n", ugd->raw_discovered_peers[peer_cnt].conn_status);
+ WDUG_LOGI("\tSSID: [%s]\n", ugd->raw_discovered_peers[peer_cnt].ssid);
+ WDUG_LOGI("\tPeer category [%d] -> [%d]\n", peer->primary_device_type, ugd->raw_discovered_peers[peer_cnt].category);
+ WDUG_LOGI("\tStatus: [%d]\n", ugd->raw_discovered_peers[peer_cnt].conn_status);
ugd->raw_discovered_peer_cnt++;
free(peer->interface_address);
free(peer);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return TRUE;
}
*/
bool _wfd_connected_peer_cb(wifi_direct_connected_peer_info_s *peer, void *user_data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (NULL == peer || NULL == user_data) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
- __FUNC_EXIT__;
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
+ __WDUG_LOG_FUNC_EXIT__;
return FALSE;
}
struct ug_data *ugd = (struct ug_data *)user_data;
int peer_cnt = ugd->raw_connected_peer_cnt;
- DBG(LOG_VERBOSE, "%dth connected peer. [%s] [%s]\n", peer_cnt, peer->device_name, peer->mac_address);
+ WDUG_LOGI("%dth connected peer. [%s] [%s]\n", peer_cnt, peer->device_name, peer->mac_address);
strncpy(ugd->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ugd->raw_connected_peers[peer_cnt].ssid));
ugd->raw_connected_peers[peer_cnt].category = peer->primary_device_type;
strncpy(ugd->raw_connected_peers[peer_cnt].if_addr, peer->interface_address, MAC_LENGTH);
ugd->raw_connected_peers[peer_cnt].conn_status = PEER_CONN_STATUS_CONNECTED;
- DBG(LOG_VERBOSE, "\tStatus: [%d]\n", ugd->raw_connected_peers[peer_cnt].conn_status);
- DBG(LOG_VERBOSE, "\tCategory: [%d]\n", ugd->raw_connected_peers[peer_cnt].category);
- DBG(LOG_VERBOSE, "\tSSID: [%s]\n", ugd->raw_connected_peers[peer_cnt].ssid);
+ WDUG_LOGI("\tStatus: [%d]\n", ugd->raw_connected_peers[peer_cnt].conn_status);
+ WDUG_LOGI("\tCategory: [%d]\n", ugd->raw_connected_peers[peer_cnt].category);
+ WDUG_LOGI("\tSSID: [%s]\n", ugd->raw_connected_peers[peer_cnt].ssid);
ugd->raw_connected_peer_cnt++;
free(peer->interface_address);
free(peer);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return TRUE;
}
*/
int wfd_ug_get_discovered_peers(struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res = 0;
if (ugd == NULL) {
res = wifi_direct_foreach_discovered_peers(_wfd_discoverd_peer_cb, (void *)ugd);
if (res != WIFI_DIRECT_ERROR_NONE) {
ugd->raw_discovered_peer_cnt = 0;
- DBG(LOG_ERROR, "Get discovery result failed: %d\n", res);
+ WDUG_LOGE("Get discovery result failed: %d\n", res);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_ug_get_connected_peers(struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res = 0;
if (ugd == NULL) {
res = wifi_direct_foreach_connected_peers(_wfd_connected_peer_cb, (void *)ugd);
if (res != WIFI_DIRECT_ERROR_NONE) {
ugd->raw_connected_peer_cnt = 0;
- DBG(LOG_ERROR, "Get connected peer failed: %d\n", res);
+ WDUG_LOGE("Get connected peer failed: %d\n", res);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
struct ug_data *ugd = (struct ug_data *)user_data;
if (NULL == ugd) {
- DBG(LOG_ERROR, "NULL parameters.\n");
+ WDUG_LOGE("NULL parameters.\n");
return ECORE_CALLBACK_CANCEL;
}
/* check the action, if action is exist, keep the cb */
res = wifi_direct_get_state(&ugd->wfd_status);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to get link status. [%d]\n", res);
+ WDUG_LOGE("Failed to get link status. [%d]\n", res);
return ECORE_CALLBACK_CANCEL;
}
if (ugd->last_wfd_status != ugd->wfd_status) {
- DBG(LOG_ERROR, "Action is exist, last status: %d\n",
+ WDUG_LOGE("Action is exist, last status: %d\n",
ugd->last_wfd_status);
ugd->last_wfd_status = ugd->wfd_status;
ugd->last_wfd_time = time(NULL);
/* turn off the Wi-Fi Direct */
wifi_direct_get_state(&ugd->wfd_status);
if (ugd->wfd_status < WIFI_DIRECT_STATE_ACTIVATING) {
- DBG(LOG_ERROR, "Wi-Fi Direct is already deactivated\n");
+ WDUG_LOGE("Wi-Fi Direct is already deactivated\n");
} else {
wfd_ug_warn_popup(ugd, IDS_WFD_POP_AUTOMATIC_TURN_OFF, POP_TYPE_AUTOMATIC_TURN_OFF);
}
*/
void _discover_cb(int error_code, wifi_direct_discovery_state_e discovery_state, void *user_data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)user_data;
if (ugd == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return;
}
- DBG(LOG_VERBOSE, "Discovery event [%d], error_code [%d]\n", discovery_state, error_code);
+ WDUG_LOGI("Discovery event [%d], error_code [%d]\n", discovery_state, error_code);
if (discovery_state == WIFI_DIRECT_ONLY_LISTEN_STARTED) {
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
} else if (discovery_state == WIFI_DIRECT_DISCOVERY_STARTED) {
ugd->head_text_mode = HEAD_TEXT_TYPE_SCANING;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
void _connection_cb(int error_code, wifi_direct_connection_state_e connection_state, const char *mac_address, void *user_data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)user_data;
device_type_s *peer = NULL;
bool owner = FALSE;
int res = 0;
- DBG(LOG_VERBOSE, "Connection event [%d], error_code [%d], multi_connect_mode [%d]\n",
+ WDUG_LOGI("Connection event [%d], error_code [%d], multi_connect_mode [%d]\n",
connection_state, error_code, ugd->multi_connect_mode);
if (mac_address == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(peer mac is NULL)\n");
+ WDUG_LOGE("Incorrect parameter(peer mac is NULL)\n");
return;
}
peer = wfd_client_find_peer_by_mac(ugd, mac_address);
if (NULL == peer || '\0' == peer->ssid[0]) {
- DBG(LOG_ERROR, "invalid peer from connection !!\n");
+ WDUG_LOGE("invalid peer from connection !!\n");
goto refresh_button;
}
}
if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS) {
switch (connection_state) {
case WIFI_DIRECT_CONNECTION_RSP:
- DBG(LOG_VERBOSE, "MULTI: WIFI_DIRECT_CONNECTION_RSP\n");
+ WDUG_LOGI("MULTI: WIFI_DIRECT_CONNECTION_RSP\n");
if (error_code == WIFI_DIRECT_ERROR_NONE) {
peer->conn_status = PEER_CONN_STATUS_CONNECTED;
ugd->g_source_multi_connect_next = g_timeout_add(1000, wfd_multi_connect_next_cb, ugd);
break;
case WIFI_DIRECT_CONNECTION_IN_PROGRESS:
- DBG(LOG_VERBOSE, "MULTI: WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
+ WDUG_LOGI("MULTI: WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
peer->conn_status = PEER_CONN_STATUS_CONNECTING;
wfd_ug_view_update_peers(ugd);
break;
case WIFI_DIRECT_GROUP_CREATED:
- DBG(LOG_VERBOSE, "MULTI: WIFI_DIRECT_GROUP_CREATED\n");
+ WDUG_LOGI("MULTI: WIFI_DIRECT_GROUP_CREATED\n");
wfd_multi_connect_next_cb(ugd);
break;
default:
} else {
switch (connection_state) {
case WIFI_DIRECT_CONNECTION_RSP:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_CONNECTION_RSP\n");
+ WDUG_LOGI("WIFI_DIRECT_CONNECTION_RSP\n");
if (error_code == WIFI_DIRECT_ERROR_NONE) {
peer->conn_status = PEER_CONN_STATUS_CONNECTED;
wfd_ug_view_update_peers(ugd);
break;
case WIFI_DIRECT_DISASSOCIATION_IND:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_DISASSOCIATION_IND\n");
+ WDUG_LOGI("WIFI_DIRECT_DISASSOCIATION_IND\n");
/* change the multi connection mode, it can be connected now */
if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_COMPLETED) {
ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_IN_PROGRESS;
break;
case WIFI_DIRECT_DISCONNECTION_RSP:
case WIFI_DIRECT_DISCONNECTION_IND:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_DISCONNECTION_X\n");
+ WDUG_LOGI("WIFI_DIRECT_DISCONNECTION_X\n");
/* when disconnection, clear all the connected peers */
if (ugd->raw_connected_peer_cnt > 0) {
/* start discovery again */
res = wifi_direct_start_discovery(FALSE, MAX_SCAN_TIME_OUT);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to start discovery. [%d]\n", res);
+ WDUG_LOGE("Failed to start discovery. [%d]\n", res);
ugd->is_re_discover = TRUE;
wifi_direct_cancel_discovery();
} else {
- DBG(LOG_VERBOSE, "Discovery is started\n");
+ WDUG_LOGI("Discovery is started\n");
ugd->is_re_discover = FALSE;
}
break;
case WIFI_DIRECT_CONNECTION_IN_PROGRESS:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
+ WDUG_LOGI("WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
peer->conn_status = PEER_CONN_STATUS_CONNECTING;
wfd_ug_view_update_peers(ugd);
break;
case WIFI_DIRECT_CONNECTION_REQ:
case WIFI_DIRECT_CONNECTION_WPS_REQ:
- DBG(LOG_VERBOSE, "WIFI_DIRECT_CLI_EVENT_CONNECTION_REQ\n");
+ WDUG_LOGI("WIFI_DIRECT_CLI_EVENT_CONNECTION_REQ\n");
break;
default:
break;
}
}
} else {
- DBG(LOG_ERROR, "Failed to get whether client is group owner. [%d]\n", res);
+ WDUG_LOGE("Failed to get whether client is group owner. [%d]\n", res);
}
} else {
if (ugd->scan_btn) {
/* if no connection, start the monitor timer */
wifi_direct_get_state(&ugd->wfd_status);
- DBG(LOG_VERBOSE, "status: %d", ugd->wfd_status);
+ WDUG_LOGI("status: %d", ugd->wfd_status);
if (ugd->wfd_status >= WIFI_DIRECT_STATE_CONNECTED) {
if (ugd->monitor_timer) {
}
} else {
if (NULL == ugd->monitor_timer) {
- DBG(LOG_VERBOSE, "start the monitor timer\n");
+ WDUG_LOGI("start the monitor timer\n");
ugd->last_wfd_time = time(NULL);
ugd->monitor_timer = ecore_timer_add(5.0,
(Ecore_Task_Cb)_wfd_automatic_deactivated_for_no_connection_cb, ugd);
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
int wfd_get_vconf_status(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
char *dev_name;
int wifi_direct_state = 0;
/* get wifi direct status from vconf */
if (vconf_get_int(VCONFKEY_WIFI_DIRECT_STATE, &wifi_direct_state) < 0) {
- DBG(LOG_ERROR, "Error reading vconf (%s)\n", VCONFKEY_WIFI_DIRECT_STATE);
+ WDUG_LOGE("Error reading vconf (%s)\n", VCONFKEY_WIFI_DIRECT_STATE);
return -1;
}
dev_name = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
if (dev_name == NULL) {
ugd->dev_name = strdup(DEFAULT_DEV_NAME);
- DBG(LOG_ERROR, "The AP name is NULL(setting default value)\n");
+ WDUG_LOGE("The AP name is NULL(setting default value)\n");
} else {
ugd->dev_name = strdup(dev_name);
free(dev_name);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_refresh_wifi_direct_state(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
wifi_direct_state_e wfd_status;
res = wifi_direct_get_state(&wfd_status);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to get link status. [%d]\n", res);
+ WDUG_LOGE("Failed to get link status. [%d]\n", res);
return -1;
}
- DBG(LOG_VERBOSE, "WFD status [%d]", wfd_status);
+ WDUG_LOGI("WFD status [%d]", wfd_status);
ugd->wfd_status = wfd_status;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int init_wfd_client(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res = 0;
res = wifi_direct_initialize();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to initialize wifi direct. [%d]\n", res);
+ WDUG_LOGE("Failed to initialize wifi direct. [%d]\n", res);
return -1;
}
res = wifi_direct_initialize();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to initialize Wi-Fi Direct. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to initialize Wi-Fi Direct. error code = [%d]\n", res);
return -1;
}
res = wifi_direct_set_device_state_changed_cb(_activation_cb, (void *)ugd);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to register _cb_activation. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to register _cb_activation. error code = [%d]\n", res);
return -1;
}
res = wifi_direct_set_discovery_state_changed_cb(_discover_cb, (void *)ugd);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to register _cb_discover. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to register _cb_discover. error code = [%d]\n", res);
return -1;
}
res = wifi_direct_set_connection_state_changed_cb(_connection_cb, (void *)ugd);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to register _cb_connection. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to register _cb_connection. error code = [%d]\n", res);
return -1;
}
ugd->wfd_onoff = 0;
}
- DBG(LOG_VERBOSE, "WFD link status. [%d]\n", ugd->wfd_status);
+ WDUG_LOGI("WFD link status. [%d]\n", ugd->wfd_status);
/* start the monitor timer */
ugd->last_wfd_time = time(NULL);
ugd->is_re_discover = FALSE;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int deinit_wfd_client(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res = 0;
tethering_error_e ret = TETHERING_ERROR_NONE;
wfd_refresh_wifi_direct_state(ugd);
if (ugd->wfd_status == WIFI_DIRECT_STATE_DISCOVERING) {
- DBG(LOG_VERBOSE, "Stop discovery before deregister client\n");
+ WDUG_LOGI("Stop discovery before deregister client\n");
wifi_direct_cancel_discovery();
}
res = wifi_direct_deinitialize();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to deregister client. [%d]\n", res);
+ WDUG_LOGE("Failed to deregister client. [%d]\n", res);
}
/* release monitor timer */
/* release vconf, hotspot.. */
res = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wifi_state_cb);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to ignore vconf key callback for wifi state\n");
+ WDUG_LOGE("Failed to ignore vconf key callback for wifi state\n");
}
res = net_deregister_client();
if (res != NET_ERR_NONE) {
- DBG(LOG_ERROR, "Failed to deregister network client. [%d]\n", res);
+ WDUG_LOGE("Failed to deregister network client. [%d]\n", res);
}
res = vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, _enable_hotspot_state_cb);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to ignore vconf key callback for hotspot state\n");
+ WDUG_LOGE("Failed to ignore vconf key callback for hotspot state\n");
}
res = vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, _disable_hotspot_state_cb);
if (res == -1) {
- DBG(LOG_ERROR, "Failed to ignore vconf key callback for hotspot state\n");
+ WDUG_LOGE("Failed to ignore vconf key callback for hotspot state\n");
}
th = ugd->hotspot_handle;
/* Deregister cbs */
ret = tethering_unset_enabled_cb(th, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_unset_enabled_cb is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_unset_enabled_cb is failed(%d)\n", ret);
}
ret = tethering_unset_disabled_cb(th, TETHERING_TYPE_WIFI);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_unset_disabled_cb is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_unset_disabled_cb is failed(%d)\n", ret);
}
/* Destroy tethering handle */
ret = tethering_destroy(th);
if (ret != TETHERING_ERROR_NONE) {
- DBG(LOG_ERROR, "tethering_destroy is failed(%d)\n", ret);
+ WDUG_LOGE("tethering_destroy is failed(%d)\n", ret);
}
ugd->hotspot_handle = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_switch_on(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
wfd_refresh_wifi_direct_state(ugd);
- DBG(LOG_VERBOSE, "WFD status [%d]\n", ugd->wfd_status);
+ WDUG_LOGI("WFD status [%d]\n", ugd->wfd_status);
if (ugd->wfd_status < WIFI_DIRECT_STATE_ACTIVATING) {
int wifi_state;
res = vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_state);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to get wifi state from vconf. [%d]\n", res);
+ WDUG_LOGE("Failed to get wifi state from vconf. [%d]\n", res);
return -1;
}
int hotspot_mode;
res = vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &hotspot_mode);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to get mobile hotspot state from vconf. [%d]\n", res);
+ WDUG_LOGE("Failed to get mobile hotspot state from vconf. [%d]\n", res);
return -1;
}
if (wifi_state > VCONFKEY_WIFI_OFF) {
- DBG(LOG_VERBOSE, "WiFi is connected, so have to turn off WiFi");
+ WDUG_LOGI("WiFi is connected, so have to turn off WiFi");
wfd_ug_act_popup(ugd, _("IDS_WFD_POP_WIFI_OFF"), POPUP_TYPE_WIFI_OFF);
} else if (hotspot_mode & VCONFKEY_MOBILE_HOTSPOT_MODE_WIFI) {
- DBG(LOG_VERBOSE, "WiFi is connected, so have to turn off WiFi");
+ WDUG_LOGI("WiFi is connected, so have to turn off WiFi");
wfd_ug_act_popup(ugd, _("IDS_WFD_POP_HOTSPOT_OFF"), POPUP_TYPE_HOTSPOT_OFF);
} else {
res = wifi_direct_activate();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to activate Wi-Fi Direct. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to activate Wi-Fi Direct. error code = [%d]\n", res);
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_ACTIVATE_FAIL"), POPUP_TYPE_TERMINATE);
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
}
}
} else {
- DBG(LOG_VERBOSE, "Wi-Fi Direct is already activated\n");
+ WDUG_LOGI("Wi-Fi Direct is already activated\n");
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_switch_off(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
wfd_refresh_wifi_direct_state(ugd);
- DBG(LOG_VERBOSE, "WFD status [%d]\n", ugd->wfd_status);
+ WDUG_LOGI("WFD status [%d]\n", ugd->wfd_status);
if (ugd->wfd_status < WIFI_DIRECT_STATE_ACTIVATING) {
- DBG(LOG_VERBOSE, "Wi-Fi Direct is already deactivated\n");
+ WDUG_LOGI("Wi-Fi Direct is already deactivated\n");
} else {
/*if connected, disconnect all devices*/
if (WIFI_DIRECT_STATE_CONNECTED == ugd->wfd_status) {
res = wifi_direct_disconnect_all();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to send disconnection request to all. [%d]\n", res);
+ WDUG_LOGE("Failed to send disconnection request to all. [%d]\n", res);
return -1;
}
}
res = wifi_direct_deactivate();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to deactivate Wi-Fi Direct. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to deactivate Wi-Fi Direct. error code = [%d]\n", res);
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_DEACTIVATE_FAIL"), POPUP_TYPE_TERMINATE);
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_swtch_force(void *data, int onoff)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
if (onoff) {
res = wifi_direct_activate();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to activate Wi-Fi Direct. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to activate Wi-Fi Direct. error code = [%d]\n", res);
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_ACTIVATE_FAIL"), POPUP_TYPE_TERMINATE);
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
} else {
res = wifi_direct_deactivate();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to deactivate Wi-Fi Direct. error code = [%d]\n", res);
+ WDUG_LOGE("Failed to deactivate Wi-Fi Direct. error code = [%d]\n", res);
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_DEACTIVATE_FAIL"), POPUP_TYPE_TERMINATE);
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_group_add()
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res;
res = wifi_direct_create_group();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to add group");
- __FUNC_EXIT__;
+ WDUG_LOGE("Failed to add group");
+ __WDUG_LOG_FUNC_EXIT__;
return -1;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_connect(const char *mac_addr)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res;
- DBG(LOG_ERROR, "connect to peer=[%s]\n", mac_addr);
+ WDUG_LOGE("connect to peer=[%s]\n", mac_addr);
res = wifi_direct_connect(mac_addr);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to send connection request. [%d]\n", res);
+ WDUG_LOGE("Failed to send connection request. [%d]\n", res);
return -1;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_disconnect(const char *mac_addr)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res;
if (mac_addr == NULL) {
res = wifi_direct_disconnect_all();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to send disconnection request to all. [%d]\n", res);
+ WDUG_LOGE("Failed to send disconnection request to all. [%d]\n", res);
return -1;
}
} else {
res = wifi_direct_disconnect(mac_addr);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to send disconnection request. [%d]\n", res);
+ WDUG_LOGE("Failed to send disconnection request. [%d]\n", res);
return -1;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_client_set_p2p_group_owner_intent(int go_intent)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res;
res = wifi_direct_set_group_owner_intent(go_intent);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to wifi_direct_set_go_intent(%d). [%d]\n", go_intent, res);
+ WDUG_LOGE("Failed to wifi_direct_set_go_intent(%d). [%d]\n", go_intent, res);
return -1;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
static Evas_Object *_create_bg(Evas_Object *parent, char *style)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
Evas_Object *bg;
bg = elm_bg_add(parent);
elm_win_resize_object_add(parent, bg);
evas_object_show(bg);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return bg;
}
*/
static Evas_Object *_create_fullview(Evas_Object *parent, struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
Evas_Object *base;
if (parent == NULL) {
- DBG(LOG_ERROR, "Incorrenct parameter");
+ WDUG_LOGE( "Incorrenct parameter");
return NULL;
}
/* Create Full view */
base = elm_layout_add(parent);
if (!base) {
- DBG(LOG_ERROR, "Failed to add layout");
+ WDUG_LOGE( "Failed to add layout");
return NULL;
}
evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return base;
}
*/
static Evas_Object *_create_frameview(Evas_Object *parent, struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
Evas_Object *base;
if (parent == NULL) {
- DBG(LOG_ERROR, "Incorrenct parameter");
+ WDUG_LOGE( "Incorrenct parameter");
return NULL;
}
/* Create Frame view */
base = elm_layout_add(parent);
if (!base) {
- DBG(LOG_ERROR, "Failed to add layout");
+ WDUG_LOGE( "Failed to add layout");
return NULL;
}
evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return base;
}
*/
void destroy_wfd_ug_view(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (ugd->genlist) {
ugd->naviframe = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
gboolean _wfd_init_cb(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res = -1;
struct ug_data *ugd = (struct ug_data *) data;
if (ugd->wfd_status == WIFI_DIRECT_STATE_DEACTIVATED) {
res = init_wfd_client(ugd);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to initialize WFD client library\n");
+ WDUG_LOGE( "Failed to initialize WFD client library\n");
return true;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return false;
}
static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd;
int res = 0;
ugd->bg = _create_bg(ugd->win, "group_list");
elm_object_part_content_set(ugd->base, "elm.swallow.bg", ugd->bg);
} else {
- DBG(LOG_ERROR, "Failed to create base layout\n");
+ WDUG_LOGE( "Failed to create base layout\n");
return NULL;
}
if (ugd->wfd_status > WIFI_DIRECT_STATE_DEACTIVATED || service) {
res = init_wfd_client(ugd);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to initialize WFD client library\n");
+ WDUG_LOGE( "Failed to initialize WFD client library\n");
}
if (service) {
/* start discovery */
res = wifi_direct_start_discovery(FALSE, MAX_SCAN_TIME_OUT);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to start discovery. [%d]\n", res);
+ WDUG_LOGE( "Failed to start discovery. [%d]\n", res);
ugd->is_re_discover = TRUE;
wifi_direct_cancel_discovery();
} else {
- DBG(LOG_VERBOSE, "Discovery is started\n");
+ WDUG_LOGI("Discovery is started\n");
ugd->is_re_discover = FALSE;
}
}
evas_object_show(ugd->base);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return ugd->base;
}
static void on_start(ui_gadget_h ug, service_h service, void *priv)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd;
int res;
struct utsname kernel_info;
res = uname(&kernel_info);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to detect target type\n");
+ WDUG_LOGE( "Failed to detect target type\n");
} else {
- DBG(LOG_VERBOSE, "HW ID of this device [%s]\n", kernel_info.machine);
+ WDUG_LOGI("HW ID of this device [%s]\n", kernel_info.machine);
if (strncmp(kernel_info.machine, "arm", 3) != 0) {
wfd_ug_warn_popup(ugd, _("IDS_WFD_POP_NOT_SUPPORTED_DEVICE"), POPUP_TYPE_TERMINATE);
return;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
static void on_pause(ui_gadget_h ug, service_h service, void *priv)
{
- __FUNC_ENTER__;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_ENTER__;
+ __WDUG_LOG_FUNC_EXIT__;
}
static void on_resume(ui_gadget_h ug, service_h service, void *priv)
{
- __FUNC_ENTER__;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_ENTER__;
+ __WDUG_LOG_FUNC_EXIT__;
}
static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (!ug || !priv) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE( "The param is NULL\n");
return;
}
struct ug_data *ugd = priv;
if (ugd == NULL || ugd->base == NULL) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE( "The param is NULL\n");
return;
}
deinit_wfd_client(ugd);
- DBG(LOG_VERBOSE, "WFD client deregistered");
+ WDUG_LOGI("WFD client deregistered");
destroy_wfd_ug_view(ugd);
- DBG(LOG_VERBOSE, "Destroying About item");
+ WDUG_LOGI("Destroying About item");
wfd_ug_view_free_peers(ugd);
- DBG(LOG_VERBOSE, "WFD client deregistered");
+ WDUG_LOGI("WFD client deregistered");
if (ugd->bg) {
evas_object_del(ugd->bg);
ugd->bg = NULL;
}
- DBG(LOG_VERBOSE, "WFD client deregistered");
+ WDUG_LOGI("WFD client deregistered");
if (ugd->base) {
evas_object_del(ugd->base);
ugd->base = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
static void on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv)
{
- __FUNC_ENTER__;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_ENTER__;
+ __WDUG_LOG_FUNC_EXIT__;
}
static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (!ug || !priv) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE( "The param is NULL\n");
return;
}
switch (event) {
case UG_EVENT_LOW_MEMORY:
- DBG(LOG_VERBOSE, "UG_EVENT_LOW_MEMORY\n");
+ WDUG_LOGI("UG_EVENT_LOW_MEMORY\n");
break;
case UG_EVENT_LOW_BATTERY:
- DBG(LOG_VERBOSE, "UG_EVENT_LOW_BATTERY\n");
+ WDUG_LOGI("UG_EVENT_LOW_BATTERY\n");
break;
case UG_EVENT_LANG_CHANGE:
- DBG(LOG_VERBOSE, "UG_EVENT_LANG_CHANGE\n");
+ WDUG_LOGI("UG_EVENT_LANG_CHANGE\n");
break;
case UG_EVENT_ROTATE_PORTRAIT:
- DBG(LOG_VERBOSE, "UG_EVENT_ROTATE_PORTRAIT\n");
+ WDUG_LOGI("UG_EVENT_ROTATE_PORTRAIT\n");
break;
case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
- DBG(LOG_VERBOSE, "UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN\n");
+ WDUG_LOGI("UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN\n");
break;
case UG_EVENT_ROTATE_LANDSCAPE:
- DBG(LOG_VERBOSE, "UG_EVENT_ROTATE_LANDSCAPE\n");
+ WDUG_LOGI("UG_EVENT_ROTATE_LANDSCAPE\n");
break;
case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
- DBG(LOG_VERBOSE, "UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN\n");
+ WDUG_LOGI("UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN\n");
break;
default:
- DBG(LOG_VERBOSE, "default\n");
+ WDUG_LOGI("default\n");
break;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
static void on_key_event(ui_gadget_h ug, enum ug_key_event event, service_h service, void *priv)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (!ug || !priv) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE( "The param is NULL\n");
return;
}
switch (event) {
case UG_KEY_EVENT_END:
- DBG(LOG_VERBOSE, "UG_KEY_EVENT_END\n");
+ WDUG_LOGI("UG_KEY_EVENT_END\n");
break;
default:
break;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd;
if (!ops) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE( "The param is NULL\n");
return -1;
}
ugd = calloc(1, sizeof(struct ug_data));
if (ugd == NULL) {
- DBG(LOG_ERROR, "Failed to allocate memory for UG data\n");
+ WDUG_LOGE( "Failed to allocate memory for UG data\n");
return -1;
}
ops->priv = ugd;
ops->opt = UG_OPT_INDICATOR_ENABLE;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd;
if (!ops) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE( "The param is NULL\n");
return;
}
free(ugd);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
UG_MODULE_API int setting_plugin_reset(service_h service, void *priv)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int res = -1;
wifi_direct_state_e state;
res = wifi_direct_initialize();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to initialize wifi direct. [%d]\n", res);
+ WDUG_LOGE( "Failed to initialize wifi direct. [%d]\n", res);
return -1;
}
res = wifi_direct_get_state(&state);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to get link status. [%d]\n", res);
+ WDUG_LOGE( "Failed to get link status. [%d]\n", res);
return -1;
}
if (state < WIFI_DIRECT_STATE_ACTIVATING) {
- DBG(LOG_VERBOSE, "No need to reset Wi-Fi Direct.\n");
+ WDUG_LOGI("No need to reset Wi-Fi Direct.\n");
} else {
/*if connected, disconnect all devices*/
if (WIFI_DIRECT_STATE_CONNECTED == state) {
res = wifi_direct_disconnect_all();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to send disconnection request to all. [%d]\n", res);
+ WDUG_LOGE( "Failed to send disconnection request to all. [%d]\n", res);
return -1;
}
}
res = wifi_direct_deactivate();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to reset Wi-Fi Direct. [%d]\n", res);
+ WDUG_LOGE( "Failed to reset Wi-Fi Direct. [%d]\n", res);
return -1;
}
}
res = wifi_direct_deinitialize();
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to deinitialize wifi direct. [%d]\n", res);
+ WDUG_LOGE( "Failed to deinitialize wifi direct. [%d]\n", res);
return -1;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
void _about_view_back_btn_cb(void *data, Evas_Object * obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (!ugd) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE("The param is NULL\n");
return;
}
elm_naviframe_item_pop(ugd->naviframe);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
void _wifid_create_about_view(struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
Evas_Object *back_btn = NULL;
Elm_Object_Item *navi_item = NULL;
Elm_Object_Item *item = NULL;
if (ugd == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)");
+ WDUG_LOGE("Incorrect parameter(NULL)");
return;
}
genlist = elm_genlist_add(ugd->naviframe);
if (NULL == genlist) {
- DBG(LOG_ERROR, "Create genlist failed\n");
+ WDUG_LOGE("Create genlist failed\n");
return;
}
navi_item = elm_naviframe_item_push(ugd->naviframe, IDS_WFD_TITLE_ABOUT_WIFI_DIRECT, back_btn, NULL, genlist, NULL);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
*/
static char *_gl_header_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
if (!strcmp(part, "elm.text.1")) {
- DBG(LOG_VERBOSE, "Current text mode [%d]\n", ugd->head_text_mode);
+ WDUG_LOGI("Current text mode [%d]\n", ugd->head_text_mode);
switch (ugd->head_text_mode) {
case HEAD_TEXT_TYPE_DIRECT:
case HEAD_TEXT_TYPE_ACTIVATED:
return strdup(ugd->dev_name);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
*/
static Evas_Object *_gl_header_icon_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
Evas_Object *onoff = NULL;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
evas_object_show(onoff);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return onoff;
}
*/
static char *_gl_name_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
if (!strcmp(part, "elm.text")) {
return strdup(IDS_WFD_TITLE_ABOUT_WIFI_DIRECT);
return strdup(ugd->dev_name);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
*/
static char *_gl_title_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
struct ug_data *ugd = (struct ug_data *) data;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
*/
static char *_gl_peer_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == part, "NULL!!");
device_type_s *peer = (device_type_s *) data;
char buf[WFD_GLOBALIZATION_STR_LENGTH] = { 0, };
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
if (!strcmp(part, "elm.text.1")) {
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return strdup(peer->ssid);
} else if (!strcmp(part, "elm.text.2")) {
switch (peer->conn_status) {
break;
}
} else {
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return strdup(buf);
}
*/
static Evas_Object *_gl_peer_icon_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == part, "NULL!!");
device_type_s *peer = (device_type_s *) data;
struct ug_data *ugd = wfd_get_ug_data();
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
if (!strcmp(part, "elm.icon.2")) {
- DBG(LOG_VERBOSE, "elm.icon.2 - connection status [%d]\n", peer->conn_status);
+ WDUG_LOGI("elm.icon.2 - connection status [%d]\n", peer->conn_status);
if (peer->conn_status == PEER_CONN_STATUS_CONNECTING) {
icon = elm_progressbar_add(obj);
elm_object_style_set(icon, "list_process");
elm_icon_resizable_set(icon, 1, 1);
evas_object_show(icon);
} else if (!strcmp(part, "elm.icon.1")) {
- DBG(LOG_VERBOSE, "elm.icon.1 - category [%d]\n", peer->category);
+ WDUG_LOGI("elm.icon.1 - category [%d]\n", peer->category);
char *img_path = NULL;
int status = -1;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return icon;
}
*/
static char *_gl_noitem_text_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return strdup(_("IDS_WFD_NOCONTENT"));
}
*/
static Evas_Object *_gl_button_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
ugd->multi_btn = elm_button_add(obj);
wfd_refresh_wifi_direct_state(ugd);
if (ugd->wfd_status == WIFI_DIRECT_STATE_CONNECTING) {
elm_object_text_set(ugd->multi_btn, _("IDS_WFD_BUTTON_CANCEL"));
- DBG(LOG_VERBOSE, "button: Cancel connect\n");
+ WDUG_LOGI("button: Cancel connect\n");
} else {
if (ugd->gl_connected_peer_cnt > 1) {
elm_object_text_set(ugd->multi_btn, _("IDS_WFD_BUTTON_DISCONNECT_ALL"));
- DBG(LOG_VERBOSE, "button: Disconnect All\n");
+ WDUG_LOGI("button: Disconnect All\n");
} else if (ugd->gl_connected_peer_cnt == 1) {
elm_object_text_set(ugd->multi_btn, _("IDS_WFD_BUTTON_DISCONNECT"));
- DBG(LOG_VERBOSE, "button: Disconnect\n");
+ WDUG_LOGI("button: Disconnect\n");
} else {
elm_object_text_set(ugd->multi_btn, _("IDS_WFD_BUTTON_MULTI"));
- DBG(LOG_VERBOSE, "button: Multi connect\n");
+ WDUG_LOGI("button: Multi connect\n");
}
}
evas_object_smart_callback_add(ugd->multi_btn, "clicked", _wifid_create_multibutton_cb, ugd);
evas_object_show(ugd->multi_btn);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return ugd->multi_btn;
}
*/
static char *_gl_conn_dev_title_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
return strdup(_("IDS_WFD_BODY_CONNECTED_DEVICES"));
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
*/
static char *_gl_peer_conn_dev_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == part, "NULL!!");
device_type_s *peer = (device_type_s *) data;
char buf[WFD_GLOBALIZATION_STR_LENGTH] = { 0, };
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
return strdup(peer->ssid);
} else {
g_strlcpy(buf, _("IDS_WFD_CONNECTED"), WFD_GLOBALIZATION_STR_LENGTH);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return strdup(buf);
}
}
static char *_gl_conn_failed_dev_title_label_get(void *data, Evas_Object *obj,
const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
return strdup(IDS_WFD_BODY_FAILED_DEVICES);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
*/
static char *_gl_peer_conn_failed_dev_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == part, "NULL!!");
device_type_s *peer = (device_type_s *) data;
char buf[WFD_GLOBALIZATION_STR_LENGTH] = { 0, };
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
return strdup(peer->ssid);
} else {
g_strlcpy(buf, _("IDS_WFD_FAILED_TO_CONNECT"), WFD_GLOBALIZATION_STR_LENGTH);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return strdup(buf);
}
}
*/
static char *_gl_multi_connect_dev_title_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = wfd_get_ug_data();
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
static char *_gl_busy_dev_title_label_get(void *data, Evas_Object *obj,
const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
return strdup(_("IDS_WFD_BODY_BUSY_DEVICES"));
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return NULL;
}
*/
static char *_gl_peer_busy_dev_label_get(void *data, Evas_Object *obj, const char *part)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == part, "NULL!!");
device_type_s *peer = (device_type_s *) data;
char buf[WFD_GLOBALIZATION_STR_LENGTH] = { 0, };
- DBG(LOG_VERBOSE, "%s", part);
+ WDUG_LOGI("%s", part);
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return NULL;
}
- DBG(LOG_VERBOSE, "peer->ssid = %s", peer->ssid);
+ WDUG_LOGI("peer->ssid = %s", peer->ssid);
if (!strcmp(part, "elm.text.1")) {
return strdup(peer->ssid);
} else {
g_strlcpy(buf, _("IDS_WFD_CONNECTED_WITH_OTHER_DEVICE"), WFD_GLOBALIZATION_STR_LENGTH);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return strdup(buf);
}
}
*/
static void _gl_peer_del(void *data, Evas_Object *obj)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == data, "NULL!!");
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
void initialize_gen_item_class()
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
head_itc.item_style = "dialogue/2text.1icon.10";
head_itc.func.text_get = _gl_header_label_get;
head_itc.func.content_get = _gl_header_icon_get;
title_multi_connect_itc.func.state_get = NULL;
title_multi_connect_itc.func.del = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
*/
void _back_btn_cb(void *data, Evas_Object * obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (!ugd) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE("The param is NULL\n");
return;
}
service_h service = NULL;
ret = service_create(&service);
if (ret) {
- DBG(LOG_ERROR, "Failed to create service");
+ WDUG_LOGE("Failed to create service");
return;
}
service_destroy(service);
ug_destroy_me(ugd->ug);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
void _scan_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
int ret = -1;
char *btn_text = NULL;
if (NULL == ugd) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return;
}
btn_text = (char *)elm_object_text_get(obj);
if (NULL == btn_text) {
- DBG(LOG_ERROR, "Incorrect button text(NULL)\n");
+ WDUG_LOGE("Incorrect button text(NULL)\n");
return;
}
if (0 == strcmp(btn_text, _("IDS_WFD_BUTTON_SCAN"))) {
wfd_refresh_wifi_direct_state(ugd);
- DBG(LOG_VERBOSE, "Start discovery again, status: %d\n", ugd->wfd_status);
+ WDUG_LOGD("Start discovery again, status: %d\n", ugd->wfd_status);
/* if connected, show the popup*/
if (ugd->wfd_status >= WIFI_DIRECT_STATE_CONNECTED) {
wfd_ug_act_popup(ugd, IDS_WFD_POP_SCAN_AGAIN, POP_TYPE_SCAN_AGAIN);
} else if (WIFI_DIRECT_STATE_DEACTIVATED == ugd->wfd_status) {
wfd_client_switch_on(ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
} else {
ret = wifi_direct_start_discovery(FALSE, MAX_SCAN_TIME_OUT);
if (ret != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to start discovery. [%d]\n", ret);
+ WDUG_LOGE("Failed to start discovery. [%d]\n", ret);
ugd->is_re_discover = TRUE;
wifi_direct_cancel_discovery();
} else {
- DBG(LOG_VERBOSE, "Discovery is started\n");
+ WDUG_LOGD("Discovery is started\n");
ugd->is_re_discover = FALSE;
}
}
} else if (0 == strcmp(btn_text, _("IDS_WFD_BUTTON_STOPSCAN"))) {
- DBG(LOG_VERBOSE, "Stop discoverying.\n");
+ WDUG_LOGD("Stop discoverying.\n");
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
wfd_ug_view_refresh_glitem(ugd->head);
wifi_direct_cancel_discovery();
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
static void _gl_header_sel(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (NULL == data) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
- __FUNC_EXIT__;
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
/* turn on/off wfd */
if (!ugd->wfd_onoff) {
- DBG(LOG_VERBOSE, "wifi-direct switch on\n");
+ WDUG_LOGD("wifi-direct switch on\n");
wfd_client_switch_on(ugd);
} else {
- DBG(LOG_VERBOSE, "wifi-direct switch off\n");
+ WDUG_LOGD("wifi-direct switch off\n");
wfd_client_switch_off(ugd);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _gl_peer_sel(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == obj, "NULL!!");
assertm_if(NULL == data, "NULL!!");
device_type_s *peer = (device_type_s *) data;
int res;
if (data == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return;
}
}
if (peer->conn_status == PEER_CONN_STATUS_DISCONNECTED || peer->is_group_owner == TRUE) {
- DBG(LOG_VERBOSE, "Connect with peer [%s]\n", peer->mac_addr);
+ WDUG_LOGD("Connect with peer [%s]\n", peer->mac_addr);
res = wfd_client_connect((const char *) peer->mac_addr);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to send connection request. [%d]\n", res);
+ WDUG_LOGE("Failed to send connection request. [%d]\n", res);
return;
}
} else {
res = wfd_client_disconnect((const char *)peer->mac_addr);
if (res != 0) {
- DBG(LOG_ERROR, "Failed to send disconnection request. [%d]\n", res);
+ WDUG_LOGE("Failed to send disconnection request. [%d]\n", res);
return;
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
static void _gl_busy_peer_sel(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- DBG(LOG_VERBOSE, "Busy device is clicked");
+ WDUG_LOGD("Busy device is clicked");
wfd_ug_warn_popup(ugd, IDS_WFD_POP_WARN_BUSY_DEVICE, POP_TYPE_BUSY_DEVICE_POPUP);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _gl_about_wifi_sel(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
- DBG(LOG_VERBOSE, "About wifi clicked");
+ WDUG_LOGD("About wifi clicked");
_wifid_create_about_view(ugd);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void _wifid_create_multibutton_cb(void *data, Evas_Object * obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
const char *text_lbl = NULL;
text_lbl = elm_object_text_get(ugd->multi_btn);
- DBG(LOG_VERBOSE, "text_lbl = %s", text_lbl);
+ WDUG_LOGD("text_lbl = %s", text_lbl);
if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS) {
ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_NONE;
if (0 == strcmp(_("IDS_WFD_BUTTON_CANCEL"), text_lbl)) {
wfd_ug_act_popup(ugd, _("IDS_WFD_POP_CANCEL_CONNECT"), POP_TYPE_DISCONNECT_ALL);
} else {
- DBG(LOG_VERBOSE, "Invalid Case\n");
+ WDUG_LOGD("Invalid Case\n");
}
} else {
if (0 == strcmp(_("IDS_WFD_BUTTON_MULTI"), text_lbl)) {
} else if (0 == strcmp(_("IDS_WFD_BUTTON_DISCONNECT"), text_lbl)) {
wfd_ug_act_popup(ugd, _("IDS_WFD_POP_DISCONNECT"), POP_TYPE_DISCONNECT);
} else {
- DBG(LOG_VERBOSE, "Invalid Case\n");
+ WDUG_LOGD("Invalid Case\n");
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
int _change_multi_button_title(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (ugd->multi_button_item == NULL) {
}
evas_object_show(ugd->multi_btn);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
void wfd_ug_view_refresh_glitem(void *obj)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
elm_genlist_item_update(obj);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void wfd_ug_view_refresh_button(void *obj, const char *text, int enable)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (NULL == obj || NULL == text) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return;
}
- DBG(LOG_VERBOSE, "Set the attributes of button: text[%s], enabled[%d]\n", text, enable);
+ WDUG_LOGD("Set the attributes of button: text[%s], enabled[%d]\n", text, enable);
elm_object_text_set(obj, text);
elm_object_disabled_set(obj, !enable);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static bool __wfd_is_device_connected_with_me(struct ug_data *ugd, device_type_s *dev)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
for (i = 0; i < ugd->raw_connected_peer_cnt; i++) {
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return FALSE;
}
*/
static bool __wfd_is_device_busy(struct ug_data *ugd, device_type_s *dev)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
if (ugd->I_am_group_owner == TRUE) {
if (dev->is_connected || dev->is_group_owner) {
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return FALSE;
}
*/
static bool __wfd_is_any_device_available(struct ug_data *ugd, int* no_of_available_dev)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return TRUE;
}
*/
static bool __wfd_is_any_device_busy(struct ug_data *ugd, int* no_of_busy_dev)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return TRUE;
}
*/
static bool __wfd_is_any_device_connect_failed(struct ug_data *ugd, int* no_of_connect_failed_dev)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return TRUE;
}
*/
int wfd_get_device_status(void *data, device_type_s *device)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int ret = -1;
int status = -1;
struct ug_data *ugd = (struct ug_data *) data;
if (ugd == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)");
+ WDUG_LOGE("Incorrect parameter(NULL)");
return -1;
}
/* check whether it is connected device */
ret = __wfd_is_device_connected_with_me(ugd, device);
if (ret) {
- DBG(LOG_VERBOSE, "This is connected device");
+ WDUG_LOGD("This is connected device");
status = 1;
goto err_exit;
}
/* check whether it is busy device */
ret = __wfd_is_device_busy(ugd, device);
if (ret) {
- DBG(LOG_VERBOSE, "This is busy device");
+ WDUG_LOGD("This is busy device");
status = 2;
goto err_exit;
}
/* check whether it is available device */
if (device->conn_status != PEER_CONN_STATUS_FAILED_TO_CONNECT) {
- DBG(LOG_VERBOSE, "This is available device");
+ WDUG_LOGD("This is available device");
status = 0;
} else {
- DBG(LOG_VERBOSE, "This is connected failed device");
+ WDUG_LOGD("This is connected failed device");
status = 3;
}
err_exit:
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return status;
}
*/
static void __wfd_separator_del(void *data, Evas_Object *obj)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
elm_genlist_item_class_free(data);
return;
}
*/
Elm_Object_Item *wfd_add_dialogue_separator(Evas_Object *genlist, const char *separator_style)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
assertm_if(NULL == genlist, "NULL!!");
static Elm_Genlist_Item_Class *separator_itc;
elm_genlist_item_select_mode_set(sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return sep;
}
*/
static Evas_Object *_create_basic_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
Evas_Object *genlist;
ugd->head = elm_genlist_item_append(genlist, &head_itc, ugd, NULL,
ELM_GENLIST_ITEM_NONE, _gl_header_sel, (void *)ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return genlist;
}
*/
static Evas_Object *_create_about_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->about_wfd_sep_high_item = wfd_add_dialogue_separator(ugd->genlist, "dialogue/separator");
ELM_GENLIST_ITEM_NONE, _gl_about_wifi_sel, (void *)ugd);
ugd->about_wfd_sep_low_item = wfd_add_dialogue_separator(ugd->genlist, "dialogue/separator/end");
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return ugd->genlist;
}
*/
static Evas_Object *_create_no_device_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->nodevice_title_item = elm_genlist_item_append(ugd->genlist, &title_itc, (void *)ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(ugd->nodevice_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return ugd->genlist;
}
*/
int _create_multi_button_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
wfd_refresh_wifi_direct_state(ugd);
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int _create_busy_dev_list(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->busy_wfd_item = elm_genlist_item_append(ugd->genlist, &title_busy_itc, (void *)ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(ugd->busy_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
static int _create_available_dev_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->avlbl_wfd_item = elm_genlist_item_append(ugd->genlist, &title_itc, (void *)ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
static int _create_multi_connect_dev_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->multi_connect_wfd_item = elm_genlist_item_append(ugd->genlist, &title_multi_connect_itc, (void *)ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int _create_connected_dev_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->conn_wfd_item = elm_genlist_item_append(ugd->genlist, &title_conn_itc, (void *)ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(ugd->conn_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int _create_connected_failed_dev_genlist(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->conn_failed_wfd_item = elm_genlist_item_append(ugd->genlist, &title_conn_failed_itc, (void *)ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(ugd->conn_failed_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
struct ug_data *ugd = (struct ug_data *) user_data;
if (NULL == ugd) {
- DBG(LOG_ERROR, "NULL parameters.\n");
+ WDUG_LOGE("NULL parameters.\n");
return ECORE_CALLBACK_CANCEL;
}
/* start discovery again */
res = wifi_direct_start_discovery(FALSE, MAX_SCAN_TIME_OUT);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to start discovery. [%d]\n", res);
+ WDUG_LOGE("Failed to start discovery. [%d]\n", res);
ugd->is_re_discover = TRUE;
wifi_direct_cancel_discovery();
} else {
- DBG(LOG_VERBOSE, "Discovery is started\n");
+ WDUG_LOGD("Discovery is started\n");
ugd->is_re_discover = FALSE;
}
*/
void wfd_ug_view_free_peers(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
int i = 0;
for (i = 0; i < ugd->gl_connected_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "%dth connected peer = %x is deleted\n", i, ugd->gl_connected_peers[i]);
+ WDUG_LOGD("%dth connected peer = %x is deleted\n", i, ugd->gl_connected_peers[i]);
if (ugd->gl_connected_peers[i].gl_item != NULL) {
elm_object_item_del(ugd->gl_connected_peers[i].gl_item);
ugd->gl_connected_peers[i].gl_item = NULL;
- DBG(LOG_VERBOSE, "Deleted item\n");
+ WDUG_LOGD("Deleted item\n");
}
}
ugd->gl_connected_peer_cnt = 0;
for (i = 0; i < ugd->gl_connected_failed_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "%dth connected failed peer = %x is deleted\n", i, ugd->gl_connected_failed_peers[i]);
+ WDUG_LOGD("%dth connected failed peer = %x is deleted\n", i, ugd->gl_connected_failed_peers[i]);
if (ugd->gl_connected_failed_peers[i].gl_item != NULL) {
elm_object_item_del(ugd->gl_connected_failed_peers[i].gl_item);
ugd->gl_connected_failed_peers[i].gl_item = NULL;
- DBG(LOG_VERBOSE, "Deleted item\n");
+ WDUG_LOGD("Deleted item\n");
}
}
ugd->gl_connected_failed_peer_cnt = 0;
for (i = 0; i < ugd->gl_available_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "%dth discovered peer = %x is deleted\n", i, ugd->gl_available_peers[i]);
+ WDUG_LOGD("%dth discovered peer = %x is deleted\n", i, ugd->gl_available_peers[i]);
if (ugd->gl_available_peers[i].gl_item != NULL) {
elm_object_item_del(ugd->gl_available_peers[i].gl_item);
ugd->gl_available_peers[i].gl_item = NULL;
- DBG(LOG_VERBOSE, "Deleted item\n");
+ WDUG_LOGD("Deleted item\n");
}
}
ugd->gl_available_peer_cnt = 0;
for (i = 0; i < ugd->gl_busy_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "%dth busy peer = %x is deleted\n", i, ugd->gl_busy_peers[i]);
+ WDUG_LOGD("%dth busy peer = %x is deleted\n", i, ugd->gl_busy_peers[i]);
if (ugd->gl_busy_peers[i].gl_item != NULL) {
elm_object_item_del(ugd->gl_busy_peers[i].gl_item);
ugd->gl_busy_peers[i].gl_item = NULL;
- DBG(LOG_VERBOSE, "Deleted item\n");
+ WDUG_LOGD("Deleted item\n");
}
}
ugd->gl_busy_peer_cnt = 0;
for (i = 0; i < ugd->gl_multi_connect_peer_cnt; i++) {
- DBG(LOG_VERBOSE, "%dth multi connect peer = %x is deleted\n", i, ugd->gl_multi_connect_peers[i]);
+ WDUG_LOGD("%dth multi connect peer = %x is deleted\n", i, ugd->gl_multi_connect_peers[i]);
if (ugd->gl_multi_connect_peers[i].gl_item != NULL) {
elm_object_item_del(ugd->gl_multi_connect_peers[i].gl_item);
ugd->gl_multi_connect_peers[i].gl_item = NULL;
- DBG(LOG_VERBOSE, "Deleted item\n");
+ WDUG_LOGD("Deleted item\n");
}
}
ugd->multi_button_sep_item = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void wfd_ug_view_update_peers(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
int no_of_busy_dev = 0;
int no_of_available_dev = 0;
wfd_ug_view_free_peers(ugd);
if (ugd->wfd_status == WIFI_DIRECT_STATE_DEACTIVATED) {
- DBG(LOG_VERBOSE, "Device is deactivated, no need to update UI.");
+ WDUG_LOGD("Device is deactivated, no need to update UI.");
_create_about_genlist(ugd);
return;
}
res = wifi_direct_is_group_owner(&is_group_owner);
if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_VERBOSE, "Fail to get group_owner_state. ret=[%d]", res);
+ WDUG_LOGD("Fail to get group_owner_state. ret=[%d]", res);
ugd->I_am_group_owner = FALSE;
} else {
ugd->I_am_group_owner = is_group_owner;
ugd->gl_connected_failed_peer_cnt = no_of_conn_failed_dev;
ugd->gl_busy_peer_cnt = no_of_busy_dev;
- DBG(LOG_VERBOSE, "conn_dev=[%d], conn_failed_dev=[%d], avail_dev=[%d], busy_dev=[%d], GO=[%d]\n",
+ WDUG_LOGD("conn_dev=[%d], conn_failed_dev=[%d], avail_dev=[%d], busy_dev=[%d], GO=[%d]\n",
no_of_conn_dev, no_of_conn_failed_dev, no_of_available_dev, no_of_busy_dev, is_group_owner);
if (no_of_conn_dev == 0 && no_of_conn_failed_dev == 0 &&
no_of_available_dev == 0 && no_of_busy_dev == 0) {
- DBG(LOG_ERROR, "There are No peers\n");
+ WDUG_LOGE("There are No peers\n");
_create_no_device_genlist(ugd);
_create_about_genlist(ugd);
return;
}
_create_about_genlist(ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void create_wfd_ug_view(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
Elm_Object_Item *navi_item = NULL;
if (ugd == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)");
+ WDUG_LOGE("Incorrect parameter(NULL)");
return;
}
ugd->genlist = _create_basic_genlist(ugd);
if (ugd->genlist == NULL) {
- DBG(LOG_ERROR, "Failed to create basic genlist");
+ WDUG_LOGE("Failed to create basic genlist");
return;
}
evas_object_smart_callback_add(ugd->scan_btn, "clicked", _scan_btn_cb, (void *)ugd);
elm_object_item_part_content_set(navi_item, "toolbar_button1", ugd->scan_btn);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
*/
void _multiconnect_view_back_btn_cb(void *data, Evas_Object * obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
if (!ugd) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE("The param is NULL\n");
return;
}
ugd->multiconn_view_genlist = NULL;
elm_naviframe_item_pop(ugd->naviframe);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
gboolean __wfd_multi_connect_reset_cb(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
struct ug_data *ugd = (struct ug_data *)data;
wfd_ug_view_update_peers(ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return false;
}
*/
void wfd_free_multi_selected_peers(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
struct ug_data *ugd = (struct ug_data *)data;
ugd->raw_multi_selected_peer_cnt = 0;
ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_NONE;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
*/
int wfd_stop_multi_connect(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
/* change the title of failed peers */
/* after 30s, remove the failed peers */
g_timeout_add(30000 /*ms*/, __wfd_multi_connect_reset_cb, ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_start_multi_connect(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int res;
res = wfd_client_group_add();
if (res == -1) {
- DBG(LOG_ERROR, "Failed to add group");
+ WDUG_LOGE("Failed to add group");
wfd_free_multi_selected_peers(ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return -1;
}
} else {
- DBG(LOG_VERBOSE, "No selected peers.\n");
+ WDUG_LOGD("No selected peers.\n");
return -1;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
gboolean wfd_multi_connect_next_cb(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int i;
int res;
if (ugd->raw_multi_selected_peers[i].conn_status == PEER_CONN_STATUS_WAIT_FOR_CONNECT) {
res = wfd_client_connect(ugd->raw_multi_selected_peers[i].mac_addr);
if (res == -1) {
- DBG(LOG_VERBOSE, "Failed to connect [%s].\n", ugd->raw_multi_selected_peers[i].ssid);
+ WDUG_LOGD("Failed to connect [%s].\n", ugd->raw_multi_selected_peers[i].ssid);
ugd->raw_multi_selected_peers[i].conn_status = PEER_CONN_STATUS_FAILED_TO_CONNECT;
} else {
ugd->raw_multi_selected_peers[i].conn_status = PEER_CONN_STATUS_CONNECTING;
if (i >= ugd->raw_multi_selected_peer_cnt) {
// All selected peers are touched.
- DBG(LOG_VERBOSE, "Stop Multi Connect...\n");
+ WDUG_LOGD("Stop Multi Connect...\n");
wfd_stop_multi_connect(ugd);
}
} else {
- DBG(LOG_VERBOSE, "No selected peers.\n");
+ WDUG_LOGD("No selected peers.\n");
return -1;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return false;
}
*/
void _connect_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
int i = 0;
int count = 0;
char popup_text[MAX_POPUP_TEXT_SIZE] = {0};
- DBG(LOG_VERBOSE, "_connect_btn_cb \n");
+ WDUG_LOGD("_connect_btn_cb \n");
for (i = 0; i < ugd->gl_available_peer_cnt ; i++) {
if (TRUE == ugd->multi_conn_dev_list[i].dev_sel_state) {
- DBG(LOG_VERBOSE, "ugd->peers[i].mac_addr = %s, i = %d\n", ugd->multi_conn_dev_list[i].peer.mac_addr, i);
+ WDUG_LOGD("ugd->peers[i].mac_addr = %s, i = %d\n", ugd->multi_conn_dev_list[i].peer.mac_addr, i);
memcpy(&ugd->raw_multi_selected_peers[count], &ugd->multi_conn_dev_list[i].peer, sizeof(device_type_s));
ugd->raw_multi_selected_peers[count].conn_status = PEER_CONN_STATUS_WAIT_FOR_CONNECT;
ugd->multiconn_view_genlist = NULL;
_change_multi_button_title(ugd);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
static void _wfd_multi_del_select_info_label(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *)data;
if (NULL == ugd) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE("The param is NULL\n");
return;
}
ugd->notify_layout = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
static void _wfd_multi_add_select_info_label(void *data, int count)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
char select_lablel[MAX_POPUP_TEXT_SIZE] = {0};
struct ug_data *ugd = (struct ug_data *)data;
if (NULL == ugd || count <= 0) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE("The param is NULL\n");
return;
}
/* add notify */
ugd->notify = elm_notify_add(ugd->base);
if (NULL == ugd->notify) {
- DBG(LOG_ERROR, "Add notify failed\n");
+ WDUG_LOGE("Add notify failed\n");
return;
}
elm_notify_timeout_set(ugd->notify, 3);
evas_object_show(ugd->notify);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return;
}
*/
static void _wfd_gl_multi_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
int index = 0;
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
if (NULL == ugd || NULL == item) {
- DBG(LOG_ERROR, "The param is NULL\n");
+ WDUG_LOGE("The param is NULL\n");
return;
}
elm_genlist_item_selected_set(item, EINA_FALSE);
index = elm_genlist_item_index_get(item) - 3; /* subtract the previous items */
- DBG(LOG_VERBOSE, "selected index = %d \n", index);
+ WDUG_LOGD("selected index = %d \n", index);
if (index < 0) {
- DBG(LOG_ERROR, "The index is invalid.\n");
+ WDUG_LOGE("The index is invalid.\n");
return;
}
chk_box = elm_object_item_part_content_get((Elm_Object_Item *)event_info, "elm.icon.1");
state = elm_check_state_get(chk_box);
- DBG(LOG_VERBOSE, "state = %d \n", state);
+ WDUG_LOGD("state = %d \n", state);
elm_check_state_set(chk_box, !state);
ugd->multi_conn_dev_list[index].dev_sel_state = !state;
- DBG(LOG_VERBOSE, "ptr->dev_sel_state = %d \n", ugd->multi_conn_dev_list[index].dev_sel_state);
- DBG(LOG_VERBOSE, "ptr->peer.mac_addr = %s \n", ugd->multi_conn_dev_list[index].peer.mac_addr);
+ WDUG_LOGD("ptr->dev_sel_state = %d \n", ugd->multi_conn_dev_list[index].dev_sel_state);
+ WDUG_LOGD("ptr->peer.mac_addr = %s \n", ugd->multi_conn_dev_list[index].peer.mac_addr);
/* update the checkbox and button */
for (; i < ugd->gl_available_dev_cnt_at_multiconn_view; i++) {
_wfd_multi_del_select_info_label(ugd);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
if (NULL == ugd || NULL == obj) {
- DBG(LOG_ERROR, "NULL parameters.\n");
+ WDUG_LOGE("NULL parameters.\n");
return;
}
Evas_Object *sel_chkbox = elm_object_item_part_content_get(ugd->mcview_select_all_item, "elm.icon");
if (sel_chkbox == NULL) {
- DBG(LOG_VERBOSE, "select-all chkbox is NULL\n");
+ WDUG_LOGD("select-all chkbox is NULL\n");
return;
}
}
elm_check_state_set(sel_chkbox, state);
- DBG(LOG_VERBOSE, "state = %d \n", state);
+ WDUG_LOGD("state = %d \n", state);
int i = 0;
bool is_sel = FALSE;
*/
static char *_wfd_gl_device_label_get(void *data, Evas_Object *obj, const char *part)
{
- DBG(LOG_VERBOSE, "part %s", part);
+ WDUG_LOGD("part %s", part);
device_type_s *peer = (device_type_s *)data;
if (NULL == peer) {
static void _wfd_check_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
if (NULL == obj) {
- DBG(LOG_ERROR, "NULL parameters.\n");
+ WDUG_LOGE("NULL parameters.\n");
return;
}
Eina_Bool state = elm_check_state_get(obj);
elm_check_state_set(obj, !state);
- DBG(LOG_VERBOSE, "state = %d \n", state);
+ WDUG_LOGD("state = %d \n", state);
}
/**
device_type_s *peer = (device_type_s *) data;
Evas_Object *icon = NULL;
- DBG(LOG_VERBOSE, "Part %s", part);
+ WDUG_LOGD("Part %s", part);
if (!strcmp(part, "elm.icon.1")) {
- DBG(LOG_VERBOSE, "Part %s", part);
+ WDUG_LOGD("Part %s", part);
icon = elm_check_add(obj);
elm_check_state_set(icon, EINA_FALSE);
evas_object_smart_callback_add(icon, "changed", _wfd_check_clicked_cb, (void *)data);
static char *_wfd_gl_select_all_label_get(void *data, Evas_Object *obj, const char *part)
{
if (!strcmp(part, "elm.text")) {
- DBG(LOG_VERBOSE, "Adding text %s", part);
+ WDUG_LOGD("Adding text %s", part);
return strdup("Select all");
}
return NULL;
Evas_Object *icon = NULL;
if (!strcmp(part, "elm.icon")) {
- DBG(LOG_VERBOSE, "Part %s", part);
+ WDUG_LOGD("Part %s", part);
icon = elm_check_add(obj);
elm_check_state_set(icon, EINA_FALSE);
evas_object_smart_callback_add(icon, "changed", _wfd_check_clicked_cb, (void *)data);
*/
int wfd_free_multiconnect_device(struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
}
ugd->gl_available_dev_cnt_at_multiconn_view = 0;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
int wfd_update_multiconnect_device(struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int count = 0;
device_type_s *device = NULL;
ugd->gl_available_dev_cnt_at_multiconn_view = count;
if (ugd->gl_available_dev_cnt_at_multiconn_view == 0) {
- DBG(LOG_ERROR, "There are No peers\n");
+ WDUG_LOGE("There are No peers\n");
ugd->mcview_title_item = elm_genlist_item_append(genlist, &title_itc, ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(ugd->mcview_title_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
ugd->mcview_nodevice_item = elm_genlist_item_append(genlist, &noitem_itc, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
device = &ugd->raw_discovered_peers[i];
if (device->is_connected == FALSE) {
- DBG(LOG_VERBOSE, "%dth peer being added on genlist\n", i);
+ WDUG_LOGD("%dth peer being added on genlist\n", i);
if (ugd->multi_conn_dev_list[count].peer.gl_item != NULL) {
elm_object_item_del(ugd->multi_conn_dev_list[count].peer.gl_item);
}
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
return 0;
}
*/
void wfd_create_multiconnect_view(struct ug_data *ugd)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
Evas_Object *back_btn = NULL;
Evas_Object *genlist = NULL;
Elm_Object_Item *navi_item = NULL;
if (ugd == NULL) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)");
+ WDUG_LOGE("Incorrect parameter(NULL)");
return;
}
device_itc.func.state_get = NULL;
device_itc.func.del = NULL;
- DBG(LOG_VERBOSE, "_wifid_create_multiconnect_view");
+ WDUG_LOGD("_wifid_create_multiconnect_view");
back_btn = elm_button_add(ugd->naviframe);
elm_object_style_set(back_btn, "naviframe/back_btn/default");
evas_object_smart_callback_add(back_btn, "clicked", _multiconnect_view_back_btn_cb, (void *)ugd);
elm_object_disabled_set(ugd->multi_connect_btn, EINA_TRUE);
elm_object_item_part_content_set(navi_item, "toolbar_button2", ugd->multi_connect_btn);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
*/
static void _wfd_ug_act_popup_hotspot_ok_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int result = -1;
struct ug_data *ugd = (struct ug_data *) data;
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_act_popup_hotspot_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_act_popup_wifi_ok_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int result = -1;
struct ug_data *ugd = (struct ug_data *) data;
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_act_popup_wifi_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
ugd->head_text_mode = HEAD_TEXT_TYPE_DIRECT;
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_act_popup_disconnect_all_ok_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
int i = 0;
struct ug_data *ugd = (struct ug_data *) data;
if (NULL == ugd) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return;
}
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_act_popup_disconnect_all_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (NULL == ugd) {
- DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
+ WDUG_LOGE("Incorrect parameter(NULL)\n");
return;
}
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void wfd_ug_act_popup(void *data, const char *message, int popup_type)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
Evas_Object *popup = NULL;
Evas_Object *btn1 = NULL, *btn2 = NULL;
evas_object_show(popup);
ugd->act_popup = popup;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void wfg_ug_act_popup_remove(void *data)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
if (ugd->act_popup) {
evas_object_del(ugd->act_popup);
ugd->act_popup = NULL;
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_terminate_popup_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
evas_object_del(ugd->warn_popup);
wfd_ug_view_free_peers(ugd);
ug_destroy_me(ugd->ug);
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_automatic_turn_off_popup_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
evas_object_del(ugd->warn_popup);
wfd_mobile_ap_on(ugd);
}
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
static void _wfd_ug_warn_popup_cb(void *data, Evas_Object *obj, void *event_info)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
evas_object_del(ugd->warn_popup);
ugd->warn_popup = NULL;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
/**
*/
void wfd_ug_warn_popup(void *data, const char *message, int popup_type)
{
- __FUNC_ENTER__;
+ __WDUG_LOG_FUNC_ENTER__;
struct ug_data *ugd = (struct ug_data *) data;
Evas_Object *popup = NULL;
Evas_Object *btn = NULL;
evas_object_show(popup);
ugd->warn_popup = popup;
- __FUNC_EXIT__;
+ __WDUG_LOG_FUNC_EXIT__;
}
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -DVITA_FEATURE")
+SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -DUSE_DLOG")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
* @version 0.1
*/
-
#ifndef __WFD_APP_UTIL_H__
#define __WFD_APP_UTIL_H__
-
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-#ifdef VITA_FEATURE
+#ifdef USE_DLOG
#include <dlog.h>
-#define WIFI_DIRECT_APP_MID "wfd-ugapp"
-
-#define WFD_APP_LOG_LOW LOG_VERBOSE
-#define WFD_APP_LOG_HIGH LOG_INFO
-#define WFD_APP_LOG_ERROR LOG_ERROR
-#define WFD_APP_LOG_WARN LOG_WARN
-#define WFD_APP_LOG_ASSERT LOG_FATAL
-#define WFD_APP_LOG_EXCEPTION LOG_FATAL
-#define WFD_MAX_SIZE 128
-#define WFD_MAC_ADDRESS_SIZE 18
-
-char *wfd_app_trim_path(const char *filewithpath);
-int wfd_app_gettid();
-
-#define WFD_APP_LOG(log_level, format, args...) \
- LOG(log_level, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] " format, wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), ##args)
-#define __WFD_APP_FUNC_ENTER__ LOG(LOG_VERBOSE, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] Enter: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
-#define __WFD_APP_FUNC_EXIT__ LOG(LOG_VERBOSE, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] Quit: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
+#undef LOG_TAG
+#define LOG_TAG "WIFI_DIRECT_UGAPP"
-#else /** _DLOG_UTIL */
-
-#define WFD_APP_LOG(log_level, format, args...) printf("[%s:%04d,%d] " format, wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), ##args)
-#define __WFD_APP_FUNC_ENTER__ printf("[%s:%04d,%d] Entering: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
-#define __WFD_APP_FUNC_EXIT__ printf("[%s:%04d,%d] Quit: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__)
-
-#endif /** _USE_DLOG_UTIL */
+#define WDUA_LOGV(format, args...) LOGV(format, ##args)
+#define WDUA_LOGD(format, args...) LOGD(format, ##args)
+#define WDUA_LOGI(format, args...) LOGI(format, ##args)
+#define WDUA_LOGW(format, args...) LOGW(format, ##args)
+#define WDUA_LOGE(format, args...) LOGE(format, ##args)
+#define WDUA_LOGF(format, args...) LOGF(format, ##args)
+#define __WDUA_LOG_FUNC_ENTER__ LOGV("Enter")
+#define __WDUA_LOG_FUNC_EXIT__ LOGV("Quit")
-
-#define assertm_if(expr, fmt, arg...) do { \
+#define assertm_if(expr, fmt, args...) do { \
if (expr) { \
- WFD_APP_LOG(WFD_APP_LOG_ASSERT, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \
- exit(1); \
+ WDUA_LOGF(" ##(%s) -> assert!!## "fmt, #expr, ##args); \
+ exit(1); \
} \
} while (0)
+#else /** _DLOG_UTIL */
+#define WDUA_LOGV(format, args...) \
+ printf("[V/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUA_LOGD(format, args...) \
+ printf("[D/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUA_LOGI(format, args...) \
+ printf("[I/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUA_LOGW(format, args...) \
+ printf("[W/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUA_LOGE(format, args...) \
+ printf("[E/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+#define WDUA_LOGF(format, args...) \
+ printf("[F/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
+
+#define __WDUA_LOG_FUNC_ENTER__\
+ printf("[V/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> Enter", __FILE__, __FUNCTION__, __LINE__)
+#define __WDUA_LOG_FUNC_EXIT__ \
+ printf("[V/WIFI_DIRECT_UGAPP] %s: %s()(%4d)> Exit", __FILE__, __FUNCTION__, __LINE__)
+
+#endif /** _DLOG_UTIL */
#endif /* __WFD_APP_UTIL_H__ */
void _ug_layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
Evas_Object *base = NULL;
base = ug_get_layout(ug);
if (!base) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "ug_get_layout failed!");
+ WDUA_LOGE("ug_get_layout failed!");
ug_destroy(ug);
+ __WDUA_LOG_FUNC_EXIT__;
return;
}
default:
break;
}
+
+ __WDUA_LOG_FUNC_EXIT__;
}
void _ug_destroy_cb(ui_gadget_h ug, void *priv)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
// TODO: free all memory allocation
void ug_result_cb(ui_gadget_h ug, service_h service, void *priv)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
// TODO: free all memory allocation
+ __WDUA_LOG_FUNC_EXIT__;
}
static int load_wifi_direct_ug(ui_gadget_h parent_ug, void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
wfd_appdata_t *ugd = (wfd_appdata_t *)data;
service_h handle = NULL;
ugd->wifi_direct_ug = ug_create(parent_ug, "setting-wifidirect-efl", UG_MODE_FULLVIEW, handle, &wifi_direct_cbs);
if (ugd->wifi_direct_ug) {
+ __WDUA_LOG_FUNC_EXIT__;
return TRUE;
} else {
+ __WDUA_LOG_FUNC_EXIT__;
return FALSE;
}
+
+ __WDUA_LOG_FUNC_EXIT__;
}
static Evas_Object* _set_win_icon(wfd_appdata_t *ad)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
Evas_Object *icon = evas_object_image_add(evas_object_evas_get(ad->win));
evas_object_image_file_set(icon, DESKTOP_ICON, NULL);
elm_win_icon_object_set(ad->win, icon);
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
return icon;
}
static Evas_Object *_create_bg(Evas_Object *parent)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
if (NULL == parent) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter\n");
+ WDUA_LOGE("Incorrect parameter\n");
return NULL;
}
Evas_Object *bg = elm_bg_add(parent);
if (NULL == bg) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Create background failed\n");
+ WDUA_LOGE("Create background failed\n");
return NULL;
}
elm_win_resize_object_add(parent, bg);
evas_object_show(bg);
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
return bg;
}
static Evas_Object *_create_layout_main(Evas_Object *parent)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
if (NULL == parent) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter\n");
+ WDUA_LOGE("Incorrect parameter\n");
return NULL;
}
Evas_Object *layout = elm_layout_add(parent);
if (NULL == layout) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Create layout failed\n");
+ WDUA_LOGE("Create layout failed\n");
return NULL;
}
elm_object_content_set(parent, layout);
evas_object_show(layout);
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
return layout;
}
static void _win_profile_changed_cb(void *data, Evas_Object * obj, void *event_info)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
if (data == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter\n");
+ WDUA_LOGE("Incorrect parameter\n");
return -1;
}
elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
}
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
}
static int _app_create(void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
if (data == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter\n");
+ WDUA_LOGE("Incorrect parameter\n");
return -1;
}
/*Add conformat for indicator */
ad->bg = _create_bg(ad->win);
if (ad->bg == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to create background");
+ WDUA_LOGE("Failed to create background");
return -1;
}
ad->conform = elm_conformant_add(ad->win);
if (ad->conform == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to create elm conformant");
+ WDUA_LOGE("Failed to create elm conformant");
return -1;
}
ad->top_layout = _create_layout_main(ad->conform);
if (ad->top_layout == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to create top layout");
+ WDUA_LOGE("Failed to create top layout");
return -1;
}
r = appcore_set_i18n(PACKAGE, NULL);
if (r != 0) {
- WFD_APP_LOG(WFD_APP_LOG_LOW, "appcore_set_i18n error\n");
+ WDUA_LOGE("appcore_set_i18n error\n");
return -1;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
return 0;
}
static int _app_terminate(void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
if (data == NULL) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "Incorrect parameter\n");
+ WDUA_LOGE("Incorrect parameter\n");
return -1;
}
ad->icon = NULL;
}
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
return 0;
}
static int _app_pause(void *data)
{
- __WFD_APP_FUNC_ENTER__;
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_EXIT__;
return 0;
}
static int _app_resume(void *data)
{
- __WFD_APP_FUNC_ENTER__;
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_EXIT__;
return 0;
}
static int _app_reset(bundle *b, void *data)
{
- __WFD_APP_FUNC_ENTER__;
+ __WDUA_LOG_FUNC_ENTER__;
wfd_appdata_t *ad = wfd_get_appdata();
load_wifi_direct_ug(NULL, ad);
- __WFD_APP_FUNC_EXIT__;
+ __WDUA_LOG_FUNC_EXIT__;
return 0;
}