#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include <notification.h>
+#include <vconf.h>
+
#include "wfd-app.h"
#include "wfd-app-util.h"
#include "wfd-app-strings.h"
-#include <vconf.h>
/**
* This function let the app make a callback for connected peer
}
/* when disconnection, mac_address is empty */
- if (connection_state <= WIFI_DIRECT_CONNECTION_RSP) {
+ if (connection_state <= WIFI_DIRECT_CONNECTION_RSP ||
+ connection_state == WIFI_DIRECT_INVITATION_REQ) {
memset(ad->peer_mac, 0, sizeof(ad->peer_mac));
memset(ad->peer_name, 0, sizeof(ad->peer_name));
strncpy(ad->peer_mac, mac_address, strlen(mac_address));
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECTED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
} else if (error_code == WIFI_DIRECT_ERROR_AUTH_FAILED) {
WDPOP_LOGD(
"Error Code - WIFI_DIRECT_ERROR_AUTH_FAILED\n");
- wfd_tickernoti_popup(_("IDS_WFD_POP_PIN_INVALID"));
+ notification_status_message_post(_("IDS_WFD_POP_PIN_INVALID"));
} else {
if (error_code == WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT) {
WDPOP_LOGD(
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
}
break;
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_DISCONNECTED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
break;
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_DISCONNECTED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
break;
case WIFI_DIRECT_CONNECTION_IN_PROGRESS:
{
WDPOP_LOGD( "event ------------------ WIFI_DIRECT_CONNECTION_IN_PROGRESS\n");
/* tickernoti popup */
- wfd_tickernoti_popup(_("IDS_WFD_POP_CONNECTING"));
+ notification_status_message_post(_("IDS_WFD_POP_CONNECTING"));
+ }
+ break;
+ case WIFI_DIRECT_INVITATION_REQ:
+ {
+ WDPOP_LOGD( "event ------------------ WIFI_DIRECT_INVITATION_REQ\n");
+ bool auto_connection_mode = FALSE;
+
+ wifi_direct_is_autoconnection_mode(&auto_connection_mode);
+ if (auto_connection_mode == TRUE) {
+ result = wifi_direct_connect(ad->peer_mac);
+ printf("wifi_direct_accept_connection() result=[%d]\n", result);
+ } else {
+ wfd_prepare_popup(WFD_POP_APRV_CONNECTION_INVITATION_REQ, NULL);
+ }
}
+ break;
default:
break;
}
__WDPOP_LOG_FUNC_EXIT__;
-
if (ret == WIFI_DIRECT_ERROR_NONE) {
return TRUE;
} else {