site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=bbWH4n4hL+U1YsutjqcDtq/Kq254l3Rw3ZCFxw+cdp0=; b=MYex9bacCyH6maOCYg4PaBrDMnOW4vZqIfsvsb8F32AuQpEkPPOgWMumedp2S0vVT6 2i1JBEJjMjEu7U1k6aaZW9eJxkIplm+HhAC1E8uX/Flfk/fl1s3+gLyL+Lv9ek6WVLb/ BH5URU2FuDC4bRvo2kmi/2H/kIHlkHRMKIvAQ= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=qVEumNcJEEYI8jyKv/7CNrHWmVAymR85R4U+nnEgb0usFDgLS7t5nF2dYg7ly2dEKF 1UtyNPh9OwgW0/36fTSf/s9EMm5t29Q0bArase+rG9aQ5ATyVhYb8R/DxxkIpDdkFRcH rfv4mX4feAGylriBz9FVh5l2QpFEUoSJGJjws= All, I've written a fairly basic application that just spits out the RSSI of a connected device. However, the value I get back is different than can be found via option clicking the bluetooth icon at the top of the screen. Any guidance would be highly appreciated. #import <Foundation/Foundation.h> #import <Cocoa/Cocoa.h> #import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h> #import <IOBluetooth/objc/IOBluetoothDevice.h> #import <IOBluetooth/objc/IOBluetoothHostController.h> #import <IOBluetooth/IOBluetoothUtilities.h> @interface getRSSI: NSObject {} -(void) readRSSIForDeviceComplete:(id)controller device:(IOBluetoothDevice*)device info:(BluetoothHCIRSSIInfo*)info error:(IOReturn)error; @end @implementation getRSSI - (void) readRSSIForDeviceComplete:(id)controller device:(IOBluetoothDevice*)device info:(BluetoothHCIRSSIInfo*)info error:(IOReturn)error { if (error != kIOReturnSuccess) { NSLog(@"readRSSIForDeviceComplete return error"); CFRunLoopStop(CFRunLoopGetCurrent()); } if (info->handle == kBluetoothConnectionHandleNone) { NSLog(@"readRSSIForDeviceComplete no handle"); CFRunLoopStop(CFRunLoopGetCurrent()); } [device retain]; NSLog(@"RSSI = %i dBm", (info->RSSIValue)); [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 5]]; [device closeConnection]; [device openConnection]; [controller readRSSIForDevice:device]; } @end int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog(@"start"); IOBluetoothHostController *hci = [IOBluetoothHostController defaultController]; NSString *addrStr = @"xx:xx:xx:xx:xx:xx"; BluetoothDeviceAddress addr; IOBluetoothNSStringToDeviceAddress(addrStr, &addr); IOBluetoothDevice *device = [[IOBluetoothDevice alloc] init]; device = [IOBluetoothDevice withAddress:&addr]; [device retain]; [device openConnection]; getRSSI *rssi = [[getRSSI alloc] init]; [hci setDelegate:rssi]; [hci readRSSIForDevice:device]; CFRunLoopRun(); [hci release]; [rssi release]; [pool release]; return 0; } Cheers Tanner Ezell _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com