diff options
author | Kim Gibyoung <lastkgb.kim@samsung.com> | 2012-12-18 19:45:14 +0900 |
---|---|---|
committer | Kim Gibyoung <lastkgb.kim@samsung.com> | 2012-12-18 20:40:35 +0900 |
commit | af94492d7e6ee37186dc1cee14db6d9e712e7951 (patch) | |
tree | 7573345144a332ba1f65c947b096868403b4ae7e /popup-wifidirect | |
parent | f09664e72c04c01f427c6271d7ad76fd16aae905 (diff) | |
download | ug-wifi-direct-af94492d7e6ee37186dc1cee14db6d9e712e7951.tar.gz ug-wifi-direct-af94492d7e6ee37186dc1cee14db6d9e712e7951.tar.bz2 ug-wifi-direct-af94492d7e6ee37186dc1cee14db6d9e712e7951.zip |
DLog macro is changed
Change-Id: I1a51fa83335851bb7e4c0c265a6ad9883e274146
Diffstat (limited to 'popup-wifidirect')
-rwxr-xr-x | popup-wifidirect/CMakeLists.txt | 3 | ||||
-rwxr-xr-x | popup-wifidirect/include/wfd-app-util.h | 62 | ||||
-rwxr-xr-x | popup-wifidirect/src/wfd-app-client.c | 228 | ||||
-rwxr-xr-x | popup-wifidirect/src/wfd-app-main.c | 40 | ||||
-rwxr-xr-x | popup-wifidirect/src/wfd-app-popup-view.c | 104 |
5 files changed, 221 insertions, 216 deletions
diff --git a/popup-wifidirect/CMakeLists.txt b/popup-wifidirect/CMakeLists.txt index 9a81a60..d2654ec 100755 --- a/popup-wifidirect/CMakeLists.txt +++ b/popup-wifidirect/CMakeLists.txt @@ -18,8 +18,7 @@ SET(SRCS 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") diff --git a/popup-wifidirect/include/wfd-app-util.h b/popup-wifidirect/include/wfd-app-util.h index bff8201..e2f6d2f 100755 --- a/popup-wifidirect/include/wfd-app-util.h +++ b/popup-wifidirect/include/wfd-app-util.h @@ -32,46 +32,52 @@ #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__ */ diff --git a/popup-wifidirect/src/wfd-app-client.c b/popup-wifidirect/src/wfd-app-client.c index c198110..41e258b 100755 --- a/popup-wifidirect/src/wfd-app-client.c +++ b/popup-wifidirect/src/wfd-app-client.c @@ -41,27 +41,27 @@ */ 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; } @@ -72,11 +72,11 @@ bool _wfd_connected_peer_cb(wifi_direct_connected_peer_info_s *peer, void *user_ */ 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; } @@ -86,10 +86,10 @@ int _wfd_app_get_connected_peers(void *user_data) 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; } @@ -99,17 +99,17 @@ int _wfd_app_get_connected_peers(void *user_data) */ 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__; } /** @@ -119,11 +119,11 @@ void _del_wfd_notification() */ 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; } @@ -136,7 +136,7 @@ void _add_wfd_peers_connected_notification(void *user_data) /* 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; } @@ -145,14 +145,14 @@ void _add_wfd_peers_connected_notification(void *user_data) 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; } @@ -164,7 +164,7 @@ void _add_wfd_peers_connected_notification(void *user_data) 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; } @@ -173,18 +173,18 @@ void _add_wfd_peers_connected_notification(void *user_data) /* 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__; } /** @@ -194,11 +194,11 @@ void _add_wfd_peers_connected_notification(void *user_data) */ 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; } @@ -210,7 +210,7 @@ void _add_wfd_turn_off_notification(void *user_data) /* 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; } @@ -218,14 +218,14 @@ void _add_wfd_turn_off_notification(void *user_data) 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; } @@ -237,7 +237,7 @@ void _add_wfd_turn_off_notification(void *user_data) 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; } @@ -246,18 +246,18 @@ void _add_wfd_turn_off_notification(void *user_data) /* 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__; } /** @@ -272,7 +272,7 @@ static Eina_Bool _wfd_automatic_deactivated_for_connection_cb(void *user_data) 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; } @@ -284,17 +284,17 @@ static Eina_Bool _wfd_automatic_deactivated_for_connection_cb(void *user_data) /* 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; } @@ -311,17 +311,17 @@ static Eina_Bool _wfd_automatic_deactivated_for_connection_cb(void *user_data) */ 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) { @@ -336,7 +336,7 @@ void _cb_activation(int error_code, wifi_direct_device_state_e device_state, voi break; } - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; } /** @@ -347,28 +347,28 @@ void _cb_activation(int error_code, wifi_direct_device_state_e device_state, voi */ 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; } @@ -380,26 +380,26 @@ static wfd_device_info_t *_wfd_app_find_peer_by_mac_address(void *data, const ch */ 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; } @@ -413,25 +413,25 @@ bool _wfd_app_discoverd_peer_cb(wifi_direct_discovered_peer_info_s *peer, void * */ 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); @@ -443,7 +443,7 @@ void _cb_discover(int error_code, wifi_direct_discovery_state_e discovery_state, 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; @@ -451,7 +451,7 @@ void _cb_discover(int error_code, wifi_direct_discovery_state_e discovery_state, break; } - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; } /** @@ -464,7 +464,7 @@ void _cb_discover(int error_code, wifi_direct_discovery_state_e discovery_state, */ 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; @@ -473,7 +473,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st /* 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; } @@ -485,11 +485,11 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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)); } @@ -501,11 +501,11 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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); @@ -515,13 +515,13 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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"); } @@ -538,26 +538,26 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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; } @@ -565,14 +565,14 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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"); } } @@ -580,32 +580,32 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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"); } } } @@ -614,10 +614,10 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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); @@ -631,7 +631,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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); @@ -640,7 +640,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st 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")); } @@ -651,7 +651,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st /* 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) { @@ -660,14 +660,14 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st } } 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__; } /** @@ -678,31 +678,31 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st */ 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; } @@ -710,18 +710,18 @@ static void _wfd_flight_mode_changed(keynode_t *node, void *user_data) 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__; } /** @@ -731,10 +731,10 @@ static void _wfd_flight_mode_changed(keynode_t *node, void *user_data) */ 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; } @@ -742,32 +742,32 @@ int init_wfd_popup_client(wfd_appdata_t *ad) 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; } @@ -775,11 +775,11 @@ int init_wfd_popup_client(wfd_appdata_t *ad) 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; @@ -795,10 +795,10 @@ int init_wfd_popup_client(wfd_appdata_t *ad) */ 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; } @@ -810,7 +810,7 @@ int deinit_wfd_popup_client(wfd_appdata_t *ad) 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; } @@ -818,7 +818,7 @@ int deinit_wfd_popup_client(wfd_appdata_t *ad) 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) { @@ -826,7 +826,7 @@ int deinit_wfd_popup_client(wfd_appdata_t *ad) ad->transmit_timer = NULL; } - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; if (ret == WIFI_DIRECT_ERROR_NONE) { return TRUE; diff --git a/popup-wifidirect/src/wfd-app-main.c b/popup-wifidirect/src/wfd-app-main.c index d14fa1c..7d84f44 100755 --- a/popup-wifidirect/src/wfd-app-main.c +++ b/popup-wifidirect/src/wfd-app-main.c @@ -68,11 +68,11 @@ static Evas_Object *_create_win(Evas_Object *parent, const char *name) 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; } @@ -80,7 +80,7 @@ static int _app_create(void *data) 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; } @@ -96,32 +96,32 @@ static int _app_create(void *data) 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); @@ -137,30 +137,30 @@ static int _app_terminate(void *data) } } - __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; } @@ -169,13 +169,13 @@ static int _app_reset(bundle *b, void *data) 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); @@ -184,7 +184,7 @@ static int _app_reset(bundle *b, void *data) service_destroy(service); } - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return 0; } diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index 624c806..a754170 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -50,30 +50,30 @@ void wfd_tickernoti_popup(char *msg); */ 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); @@ -88,30 +88,30 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) { 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); @@ -121,17 +121,17 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) 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) { @@ -143,11 +143,11 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) //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); @@ -156,7 +156,7 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) 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")); @@ -175,7 +175,7 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) 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) { @@ -189,7 +189,7 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) 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(); @@ -199,7 +199,7 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) } 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); } @@ -207,13 +207,13 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) 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__; } /** @@ -223,11 +223,11 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) */ 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; } @@ -243,7 +243,7 @@ void wfd_destroy_popup() evas_object_hide(ad->win); - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return; } @@ -255,7 +255,7 @@ void wfd_destroy_popup() */ 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); @@ -265,7 +265,7 @@ static Evas_Object *wfd_draw_pop_type_a(Evas_Object * win, wfd_popup_t * pop) evas_object_show(popup); evas_object_show(win); - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return popup; } @@ -277,7 +277,7 @@ static Evas_Object *wfd_draw_pop_type_a(Evas_Object * win, wfd_popup_t * pop) */ 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; @@ -294,7 +294,7 @@ static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop) evas_object_show(popup); evas_object_show(win); - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return popup; } @@ -306,7 +306,7 @@ static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop) */ 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; @@ -331,7 +331,7 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop) evas_object_show(popup); evas_object_show(win); - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return popup; } @@ -344,26 +344,26 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop) */ 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__; } /** @@ -398,7 +398,7 @@ static Eina_Bool _fn_pb_timer(void *data) 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; } @@ -410,7 +410,7 @@ static Eina_Bool _fn_pb_timer(void *data) 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; @@ -423,7 +423,7 @@ static Eina_Bool _fn_pb_timer(void *data) 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) { @@ -495,7 +495,7 @@ static Evas_Object *_add_edit_field(Evas_Object *parent, const char *title, cons */ 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; @@ -579,7 +579,7 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) evas_object_show(popup); evas_object_show(win); - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return popup; } @@ -591,7 +591,7 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) */ 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; @@ -687,7 +687,7 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop) evas_object_show(win); elm_object_focus_set(ad->pin_entry, EINA_TRUE); - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return pinpopup; } @@ -699,7 +699,7 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop) */ 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; @@ -786,7 +786,7 @@ void wfd_prepare_popup(int type, void *userdata) break; } - __WFD_APP_FUNC_EXIT__; + __WDPOP_LOG_FUNC_EXIT__; return; } @@ -797,21 +797,21 @@ void wfd_prepare_popup(int type, void *userdata) */ 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; } @@ -819,7 +819,7 @@ void wfd_tickernoti_popup(char *msg) /* 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; } @@ -827,7 +827,7 @@ void wfd_tickernoti_popup(char *msg) /* 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; } @@ -835,7 +835,7 @@ void wfd_tickernoti_popup(char *msg) /* 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; } @@ -843,10 +843,10 @@ void wfd_tickernoti_popup(char *msg) /* 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__; } |