wfd_state_set(manager, WIFI_DIRECT_STATE_CONNECTING);
wfd_util_set_wifi_direct_state(WIFI_DIRECT_STATE_CONNECTING);
- char peer_mac_address[MACSTR_LEN+1] = {0, };
- g_snprintf(peer_mac_address, MACSTR_LEN, MACSTR, MAC2STR(event->dev_addr));
- wfd_manager_dbus_emit_signal(WFD_MANAGER_MANAGE_INTERFACE,
- "Connection",
- g_variant_new("(iis)", WIFI_DIRECT_ERROR_NONE,
- WFD_EVENT_CONNECTION_REQ,
- peer_mac_address));
+ if (manager->autoconnection == TRUE) {
+ /**
+ * TODO: Add autoconnection peer matching logic.
+ */
+ /**
+ * In autoconnection mode, connection request notification
+ * should not be sent to library.
+ */
+ res = wfd_session_connect(session);
+ } else {
+ char peer_mac_address[MACSTR_LEN+1] = {0, };
+ g_snprintf(peer_mac_address, MACSTR_LEN, MACSTR, MAC2STR(event->dev_addr));
+ wfd_manager_dbus_emit_signal(WFD_MANAGER_MANAGE_INTERFACE,
+ "Connection",
+ g_variant_new("(iis)", WIFI_DIRECT_ERROR_NONE,
+ WFD_EVENT_CONNECTION_REQ,
+ peer_mac_address));
+ }
} else {
/* Sometimes, Provision Discovery response is not received.
* At this time, connection should be triggered by GO Negotiation request event */
break;
res = wfd_session_connect(session);
} else {
- /* In autoconnection mode, MT should not send GO Nego Req
- before receiving the GO Nego Req from peer (MO). */
+ /**
+ * TODO: Add autoconnection peer matching logic.
+ */
+ /**
+ * In autoconnection mode, MT should not send GO Nego Req
+ * before receiving the GO Nego Req from peer (MO).
+ */
if (manager->autoconnection == TRUE)
res = wfd_session_connect(session);
}