ios - Bluetooth signal strength between iphone devices -
ios - Bluetooth signal strength between iphone devices -
i have 2 iphone deveices connected bluetooth. possible signal strength between deveices? if possible,how? thanks, k.d
take on apple sample project transferring info 1 device via bluetooth. btle apple sample code
you can find out signal strength value of rssi (received signal strength indication)
in sample code rssi value when info received. check next method in btlecentralviewcontroller.m in project:
- (void)centralmanager:(cbcentralmanager *)central diddiscoverperipheral:(cbperipheral *)peripheral advertisementdata:(nsdictionary *)advertisementdata rssi:(nsnumber *)rssi { // reject value above reasonable range if (rssi.integervalue > -15) { return; } // reject if signal strength low close plenty (close around -22db) if (rssi.integervalue < -35) { return; } nslog(@"discovered %@ @ %@", peripheral.name, rssi); // ok, it's in range - have seen it? if (self.discoveredperipheral != peripheral) { // save local re-create of peripheral, corebluetooth doesn't rid of self.discoveredperipheral = peripheral; // , connect nslog(@"connecting peripheral %@", peripheral); [self.centralmanager connectperipheral:peripheral options:nil]; } }
each time when u received info advertising device. receive rssi value u can find strength , range of device.
also take on rssi details on wiki
i hope helps u.
iphone ios objective-c ipad
Comments
Post a Comment