scanForNetworksWithName in CoreWLAN framework returns Nil BSSID

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;

}