in order to connecto to an open access point I fill the WLAN_CONNECTION_PARAMETERS structure as below
WLAN_CONNECTION_PARAMETERS ConnectionParameters;
ConnectionParameters.wlanConnectionMode = wlan_connection_mode_discovery_unsecure;
ConnectionParameters.strProfile = L"";
ConnectionParameters.pDot11Ssid = &Dot11Ssid;
ConnectionParameters.pDesiredBssidList = nullptr;
ConnectionParameters.dot11BssType = dot11_BSS_type_independent;
ConnectionParameters.dwFlags = WLAN_CONNECTION_ADHOC_JOIN_ONLY;
The WlanConnect()
function returns ERROR_SUCCESS
.
The NotificationCallback()
function prints:
wlan_notification_acm_connection_start
Currently connecting to "BT.03" using profile "BT.03" **// Correct**
WLAN_NOTIFICATION_SOURCE_ACM
**wlan_notification_acm_connection_attempt_fail**
The connection failed. wlanReasonCode: 163851
The reason is "La rete specificata non è disponibile."
Where is the error?
Have you got a piece of code to connect to a new open wireless access point with a specific ssid?