Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bluetooth signal strength between iphone devices

I have two iphone deveices connected by bluetooth. Is it possible to get signal strength between those deveices? if possible,How? Thanks, K.D

like image 279
K.D Avatar asked Feb 18 '23 16:02

K.D


1 Answers

Take a look on Apple Sample Project for Transferring Data from One device to another via Bluetooth. BTLE Apple Sample Code

You can find out the signal strength with the value of RSSI (Received signal strength indication)

In sample code you will get RSSI value when data is received. Check the following method in BTLECentralViewController.m in Project:

- (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];
    }
}

Each time when u received data from advertising by another device. You will receive a RSSI value from this u can find strength and Range of device.

Also take a look on RSSI Details on Wiki

I hope this will helps u.

like image 188
Satish Azad Avatar answered Feb 20 '23 06:02

Satish Azad