If physicaladdress BSSID is not equal to null, the connection cannot be successful
bool result = NativeWifi.ConnectNetwork( interfaceId: interfaceInfo.Id, profileName: ssid, bssType: BssType.Infrastructure, System.Net.NetworkInformation.PhysicalAddress.Parse("78:9C:E7:A0:C8:56") );
Could you add some more explanation?
Code1: bool result = NativeWifi.ConnectNetwork( interfaceId: interfaceInfo.Id, profileName: ssid, bssType: BssType.Infrastructure, System.Net.NetworkInformation.PhysicalAddress.Parse("78:9C:E7:A0:C8:56") );
Code2: bool result = NativeWifi.ConnectNetwork( interfaceId: interfaceInfo.Id, profileName: ssid, bssType: BssType.Infrastructure, null );
Both pieces of code return true, but the last thing that can be connected is Code 2.
If I understand correctly, the BSSID should be the physical address of the AP. I have tried the physical address of the wireless network card of the computer itself and the physical address of the AP, but the connection cannot succeed.
Moreover, the return of true in this function 'NativeWifi.ConnectNetwork' does not mean that the WiFi connection is ready. I still need to judge the connection status of the WiFi adapter to judge whether the connection is successful.