我想连接到wireless access point
使用WlanConnect
功能。
代码:
HANDLE hClient;
PWLAN_INTERFACE_INFO_LIST pIfList;
PWLAN_INTERFACE_INFO pIfInfo;
PWLAN_AVAILABLE_NETWORK_LIST pBssList;
DWORD dwResult = 0;
WLAN_CONNECTION_PARAMETERS connectionParameters;
memset(&connectionParameters, 0, sizeof(WLAN_CONNECTION_PARAMETERS));
connectionParameters.wlanConnectionMode = wlan_connection_mode_profile;
connectionParameters.strProfile = pBssList->Network[apIndex].strProfileName;
connectionParameters.dwFlags = 0;
connectionParameters.pDot11Ssid = NULL;
connectionParameters.pDesiredBssidList = 0;
connectionParameters.dot11BssType = dot11_BSS_type_any;
dwResult = WlanConnect(hClient, &pIfInfo->InterfaceGuid, &connectionParameters, NULL);
if (dwResult == ERROR_SUCCESS) {
qDebug() << "Connected!";
} else {
qDebug() << dwResult;
}
连接到open AP
I get87 error code
时,表示参数错误。任何想法什么参数可能是错误的?提前致谢。