Posts

Post not yet marked as solved
5 Replies
2.6k Views
I am using CoreWLAN to get a list of wifi networks available to a Macbook. 'scanForNetworksWithName' returns a list of 'CWNetwork' which contains ssid, bssid, signal strength etc. On MacOS 10.15 (beta 3), the bssid is Nil while the ssid and signal strength have valid values. The exact same code works fine on Mac OS 10.14.5. I have added the 'location' entitlement and also codesigned and notarized the application. Any solutions to this problem?
Posted
by rohanak1.
Last updated
.
Post not yet marked as solved
0 Replies
630 Views
In our application, the scanForNetworksWithName (CWInterface in CoreWLAN framework) is used to get rssi and bssid of visible networks.On Mac OS 10.15 beta, the bssid received is Nil and the API does not return any error. The same API works on versions prior to 10.15 beta.I have provided the entitlement for location access using codesign.Sample code:#import <Foundation/Foundation.h>#import <CoreWLAN/CoreWLAN.h>#import <SystemConfiguration/SystemConfiguration.h>NSSet* ScanWirelessNetworks(CWInterface *wifiInterface){ NSError *err = NULL; NSSet *scannedNetworkSet = [wifiInterface scanForNetworksWithName:Nil error:&err]; if (err) { return [wifiInterface cachedScanResults]; } return scannedNetworkSet;}int main(){ for ( CWInterface *wifiInterface in CWWiFiClient.sharedWiFiClient.interfaces) { @autoreleasepool { if (!wifiInterface) continue; NSSet *wirelessNetworks = ScanWirelessNetworks (wifiInterface); for (CWNetwork *wifiNetwork in wirelessNetworks) { if (!wifiNetwork) continue; NSString* bssId = [wifiNetwork bssid]; NSString* ssId = [wifiNetwork ssid]; if (ssId) printf("ssid = %s rssi = %d\n", [ssId UTF8String], (int)[wifiNetwork rssiValue]); if (bssId) printf("bssid = %s\n", [bssId UTF8String]); } } } return 0;}
Posted
by rohanak1.
Last updated
.