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

iphone设备之间的蓝牙信号强度,iphone,ios,objective-c,ipad,Iphone,Ios,Objective C,Ipad,我有两个通过蓝牙连接的iphone设备。有可能在这些设备之间获得信号强度吗?如果可能,怎么做? 谢谢 K.D看看苹果公司通过蓝牙将数据从一台设备传输到另一台设备的示例项目 您可以通过RSSI(接收信号强度指示)的值找到信号强度 在示例代码中,当接收到数据时,您将获得RSSI值。在项目中的BTLECentralViewController.m中检查以下方法: - (void)centralManager:(CBCentralManager *)central didDiscoverPeripher

我有两个通过蓝牙连接的iphone设备。有可能在这些设备之间获得信号强度吗?如果可能,怎么做? 谢谢
K.D

看看苹果公司通过蓝牙将数据从一台设备传输到另一台设备的示例项目

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

在示例代码中,当接收到数据时,您将获得RSSI值。在项目中的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];
    }
}
-(无效)中央管理器:(CBCentralManager*)中央发现外围设备:(CBPeripheral*)外围广告数据:(NSDictionary*)广告数据RSSI:(NSNumber*)RSSI
{
//如果该值高于合理范围,则拒绝该值
if(RSSI.integerValue>-15){
返回;
}
//如果信号强度太低而不够接近,则拒绝(接近约为-22dB)
if(RSSI.integerValue<-35){
返回;
}
NSLog(@“发现%@在%@”,peripheral.name,RSSI);
//好的,在射程内-我们已经看到了吗?
if(自我发现外围设备!=外围设备){
//保存外设的本地副本,这样CoreBooth就不会删除它
self.discoveredPeripheral=外围设备;
//连接
NSLog(@“连接到外围设备%@”,外围设备);
[self.centralManager connectPeripheral:peripheral options:nil];
}
}
每次当你从另一台设备接收到广告数据时。您将从该设备接收RSSI值,您可以找到设备的强度和范围

再看一看


我希望这将有助于您。

标准蓝牙还是蓝牙LE?苹果公司实际上有一个示例应用程序为后者展示了这一点。如果它能帮助你接受这一点,那么其他人也可以知道这一点。这也有助于解决他们的问题。