iPhone设备之间的蓝牙信号强度

我有两个iPhone deveices通过蓝牙连接。 这些发明之间有可能获得信号强度吗? 如果可能,如何? 谢谢,KD

看看苹果示例项目,通过蓝牙将数据从一台设备传输到另一台设备。 BTLE苹果示例代码

您可以通过RSSI(接收信号强度指示)的值找出信号强度

在示例代码中,您将在收到数据时获取RSSI值。 在Project中检查BTLECentralViewController.m中的以下方法:

- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { // Reject any where the value is above reasonable range if (RSSI.integerValue > -15) { return; } // Reject if the signal strength is too low to be close enough (Close is around -22dB) if (RSSI.integerValue < -35) { return; } NSLog(@"Discovered %@ at %@", peripheral.name, RSSI); // Ok, it's in range - have we already seen it? if (self.discoveredPeripheral != peripheral) { // Save a local copy of the peripheral, so CoreBluetooth doesn't get rid of it self.discoveredPeripheral = peripheral; // And connect NSLog(@"Connecting to peripheral %@", peripheral); [self.centralManager connectPeripheral:peripheral options:nil]; } } 

每当你收到来自其他设备的广告数据。 您将从此获得一个RSSI值,您可以find设备的强度和范围。

另请参阅Wiki上的RSSI详细信息

我希望这会帮助你。