Post

Replies

Boosts

Views

Activity

Mac OS Sonoma SSID Info missing even though app has location service
Hello Experts, After updating to Mac OS sonoma, I am not able to get SSID info and going through already issue, I can see that on update location access is mandatory to get SSID info from API - scanForNetworksWithName:includeHidden:error: Now my application is already able to get latitude and longitude info, but when I call API mentioned above, it gives nil in ssid name field. Questions - Is there any known issue? Is there any other better way to get CWNetwork object so that I can use it directly instead of scanning and then connecting? Note - I have created app package, but application has no GUI. Application is also combination of Golang and Objective-C
8
0
746
Jan ’24
Memory management between Objective-C Core WLAN Functions called from Go lang
Hi Experts, I am working on a application where I am calling Objective-C Core WLAN API from golang with below code, darwin_lib.m void ConnectWiFi(char * cInterfacename, char * cSSID, char * cSecurity, char *cSubsecurity, char * cPassphrase, char * cOnexuser, char * cOnexpass) { @autoreleasepool { NSString * interfacename = [[NSString alloc] initWithUTF8String:cInterfacename]; NSString * ssid = [[NSString alloc] initWithUTF8String:cSSID]; NSString * security = [[NSString alloc] initWithUTF8String:cSecurity]; NSString * subsecurity = [[NSString alloc] initWithUTF8String:cSubsecurity]; NSString * passphrase = [[NSString alloc] initWithUTF8String:cPassphrase]; NSString * onexuser = [[NSString alloc] initWithUTF8String:cOnexuser]; NSString * onexpass = [[NSString alloc] initWithUTF8String:cOnexpass]; NSError * connecterr = nil; CWWiFiClient * cwwificlient = [CWWiFiClient sharedWiFiClient]; CWInterface *a = [cwwificlient interfaceWithName:interfacename]; NSSet<CWNetwork *> * network = [a scanForNetworksWithName:ssid error:&connecterr]; **** some more code ***** BOOL result = [a associateToEnterpriseNetwork:network.anyObject identity:nil username:onexuser password:onexpass error:&connecterr]; main.go package main // #cgo CFLAGS: -x objective-c // #cgo LDFLAGS: -framework CoreWLAN // #cgo LDFLAGS: -framework Foundation // #include "clib.h" import "C" import "fmt" func main() { var status C.int = C.ConnectWiFi() time.Sleep(20) *** some more code and long running process *** } Now what I am trying to understand here from memory release point of view is, Is object created in C code will be freed once I reach time.Sleep(20) e.g cwwificlient a spcifically to Core WLAN side or do I have to call release specifically on object? I tried calling release on cwwificlient and program is crashing on second execution, not sure why it would crash on only second execution, why not first time itself? I tried calling release on a and program is not crashing. Do I have to free all the Core WLAN related object myself or autoreleasepool will take care of it? As whole code is inside autoreleasepool, will all the objects be released on it's own even though function is being called from go code? As go's garbage collector has no idea how many objects C code created so go's garbage collector won't be of any help here Is autoreleasepool, can also take care of releasing any alloc object e.g ssid created inside C code ?
3
0
752
Aug ’23
Getting error -108 while setting eap username and password through CoreWLAN
Hello Experts, I am trying to connect Mac Pro through command line utility using Mac OS API. I am successfully able to connect client though when network goes down and comes up again, on GUI dialog is again asking for username and password even though it was connected earlier. So I tried to use helper method CWKeychainSetWiFiEAPUsernameAndPassword but unfortunately it is giving error code -108 Error: 0xFFFFFF94 -108 Failed to allocate memory. My little code snippet looks as below, BOOL result = [a associateToEnterpriseNetwork:network.anyObject identity:nil username:onexuser password:onexpass error:&amp;connecterr]; NSLog(@"Association Result: %d", result); NSLog(@"Error: %@", connecterr); NSData *nssid = [network.anyObject ssidData]; CWKeychainDomain d = kCWKeychainDomainUser; OSStatus er = CWKeychainSetWiFiEAPUsernameAndPassword(kCWKeychainDomainUser, nssid, onexuser, onexpass); NSLog(@"Status: %d", er); Now I am not sure what could be the cause of error? Any pointers would be appreciated.
4
0
915
Aug ’23
Connecting to Enterprise SSID always asking for Verify Certificate
Hi Experts, I am using Mac OS API - associateToEnterpriseNetwork:identity:username:password:error: and trying to connect to SSID, Client is able to associate to SSID On UI Verify Certificate Dialogue Box appears Is there any flag I can set into request, so that we can skip that dialogue and connect to SSID? Any other method to accept that dialogue message would be appreciated. Any help will be appreciated.
1
0
861
Mar ’23
How to add Enterprise SSID with username and password stored in keychain
Hi Experts, I am connecting to SSID with API associateToEnterpriseNetwork:identity:username:password:error: I am successfully able to connect Problem is when I turn off/on my wifi, it can not connect to SSID back again without asking username and password Wondering if there is any way to store this permanently into key store so user do not have to enter it again? Any hint here would be helpful.
2
0
863
Mar ’23
Empty BSSID CoreWLAN scanForNetworksWithName
Hello All, I am trying to get BSSID value using pyobjc CoreWLAN module and I know there are quite a few opened query there which suggest to use CoreLocation service to allow location service first and then user CoreWLAN API to get that info. I have made this small script and I have enabled location service for my app as well after creating it with py2app, but still I don't get BSSID value from that. Can someone help here? Here is the link to my work - https://github.com/tejaskumark/ssid-scan-macos/
11
0
1.9k
Oct ’22