Can I measure Bluetooth signal strength in iOS?

11,396

Solution 1

Yes there is a way to measure the signal strength for Bluetooth Low Energy (4.0) it is the RSSI number. When you scan for peripherals you will set the flag CBCentralManagerScanOptionAllowDuplicatesKey to YES as shown below:

NSDictionary * dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@YES, CBCentralManagerScanOptionAllowDuplicatesKey, nil];

// Start scanning for peripherals
[cmanager scanForPeripheralsWithServices:nil options:dictionary];

If you want to see the RSSI number work without writing any code you should check out the app LightBlue in iTunes. When you connect to a peripheral it will show you the updated RSSI number every second when it is connected.

Solution 2

Have a look to the CoreBluetooth documentation:

- (void)centralManager:(CBCentralManager *)central 
 didDiscoverPeripheral:(CBPeripheral *)peripheral 
     advertisementData:(NSDictionary *)advertisementData 
                  RSSI:(NSNumber *)RSSI
{ ... }

RSSI is what you are looking for. Disclaimer: Core Bluetooth is made for Bluetooth 4 LE only.

If the exact range does not matter, but you are interested in scanning devices which are available in general, you may have a look to the github project BeeTee, which allows you to scan for all Bluetooth devices around you (not only Bluetooth LE). Again disclaimer: I am the author of BeeTee. ;-)

Share:
11,396
Samuel Rosen
Author by

Samuel Rosen

Updated on June 19, 2022

Comments

  • Samuel Rosen
    Samuel Rosen almost 2 years

    Can I measure the signal strength of Bluetooth devices within range of my iPhone?

    Basically what I want to do is scan for a list of devices within range, and then see which one has the highest signal strength.

    Is it possible in iOS and how would I do it if so?