Post

Replies

Boosts

Views

Activity

IOPSNotificationCreateRunLoopSource query
Hello, I have the below program in Objective-C++ for IOPSNotificationCreateRunLoopSource. But, I am not able to receive power source change events without the infinite do { } while(!done) loop in startThread() function. Please suggest a way to get rind of the infinite loop to receive power source change events.#import "PowerSourceInfoWorker.h"@implementation PowerSourceInfoWorker -(void) dealloc { [self stopThread]; [super dealloc];}-(void) startThread { BOOL done = NO; do { runLoopSource = (CFRunLoopSourceRef)IOPSNotificationCreateRunLoopSource(powerSourceChange, self); if(runLoopSource) { NSLog(@"Waiting for power source change........ "); CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode); } int result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, YES); done = (result == kCFRunLoopRunStopped) || (result == kCFRunLoopRunFinished); } while (!done);} -(void) stopThread { if(runLoopSource) { CFRunLoopSourceInvalidate(runLoopSource); CFRelease(runLoopSource); } } void powerSourceChange(void* context) { NSLog(@"Power Source has changed");}int main(int argc, const char * argv[]) { NSLog(@"Power Source Change detection"); PowerSourceInfoWorker *psiWorker = [[PowerSourceInfoWorker alloc]init]; NSLog(@"before startThread"); [psiWorker startThread];} @end
1
0
435
May ’20
BSSID returning null
Hi SIr,I am using the below code and API to fetch BSSID, but BSSID value is always null.Please suggest a better way to fetch BSSID value:API:CWInterface *wif = [wifiInterface interface];NSString *bssidName = wif.bssid; NSLog(@"BSSID %@",bssidName);Output:2020-04-16 14:37:50.976 mysample[99186:5816581] BSSID (null)
3
0
2.1k
Apr ’20
APIs for Bluetooth parameters on Macbook
Please let know the C++(preferably) or Objective-C APIs to fetch the below parameters for Bluetooth on Macbook:Bluetooth Parameters:-----------------------------1) BTRadioOnAC_Pct - percentage of time the radio was on when the system was on AC2) BTConnectedAC_Pct - percentage of time the Bluetooth module was connected when the system was on AC.3) BTDisconnectedAC_Pct - percentage of time the module was not connected when the system was on AC.4) BTRadioOnDC_Pct - same as above but for DC5) BTConnectedDC_Pct - same as above but for DC6) BTDisconnectedDC_Pct - same as above but for DC7) Packet Loss8) Latency9) Power consumption10) Data RateI could find how to read RSSI from https://developer.apple.com/documentation/iobluetooth/iobluetoothdevice/1434998-rawrssi?language=objc.But I cannot find the above 10 parameters from IOBlueToothDevice.
0
0
309
Apr ’20
Query on BlueTooth and Wifi Parameters for Macbook
Hello, Please let know the C++(preferably) or Objective-C APIs to fetch the below parameters for Bluetooth and Wifi for Macbook:Bluetooth Parameters:-----------------------------1) BTRadioOnAC_Pct - percentage of time the radio was on when the system was on AC2) BTConnectedAC_Pct - percentage of time the Bluetooth module was connected when the system was on AC.3) BTDisconnectedAC_Pct - percentage of time the module was not connected when the system was on AC.4) BTRadioOnDC_Pct - same as above but for DC5) BTConnectedDC_Pct - same as above but for DC6) BTDisconnectedDC_Pct - same as above but for DC7) Packet Loss 8) Latency9) Power consumption10) Data Rate11)RSSIWIFI Parameters:------------------------1) WLanRadioOffAC_Pct - percentage of time the radio was off when the system was on AC.2) WlanConnectedAC_Pct - percentage of time the WLAN adapter was connected when the system was on AC3) WlanDisconnectedAC_Pct -percentage of time the adapter was not connected when the system was on AC4) WlanRadioOffDC_Pct - same as above but for DC5) WlanConnectedDC_Pct - same as above but for DC6) WlanDisconnectedDC_Pct - same as above but for DC7) Quality Parameters a. Noise b. RSSI c. Transmit Rate d. Transmit Power8) Additional parameter: a. bssidDidChange b. countryCodeDidChange c. linkDidChange d. linkQualityDidChange e. modeDidChange f. powerDidChange g. ssidDidChange h. scanCacheUpdated i. rangingReportEvent j. virtualInterfaceStateChanged
1
0
448
Apr ’20