This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Secure connection between nRF51822 and iPhone

image description

In iOS, I have developed one sample code for BLE scanning and connection with peripheral.

I have one nRF51822 Ble. It has secure pairing mechanism. (Claimed by Hardware programmer.)

when i connect this ble, App never trigger Pair dialog from iOS.

where this iOS code works with Other BLE (Not nRF51822) for pairing..

What was the reason ??

Is there any missing in Hardware firmware or iOS side ?

Here is sample code of iOS

//Creating Central

        NSDictionary *options = @{ CBCentralManagerOptionShowPowerAlertKey : @(NO), CBCentralManagerOptionRestoreIdentifierKey : BLECentralManagerIdentifier };
        
        dispatch_queue_t centralQueue = dispatch_queue_create("com.company.ble", DISPATCH_QUEUE_SERIAL);// or however you want to create your dispatch_queue_t
        self.centralManager = [[BLECentral alloc] initWithDelegate:self queue:centralQueue options:options];
        self.peripheralManager = [[BLEPeripheral alloc] initWithDelegate:self queue:nil];

//Start Scan
    NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:true] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
    [self.centralManager scanForPeripheralsWithServices:@[ [CBUUID UUIDWithString:SERVICE_UUID] ] options:options];

//Discover and Connect
    [self.centralManager connectPeripheral:self.connectPeripheral options:nil];

At this point my Bluetooth LE hardware 1 pop up Pairing dialog, But nRF51822 not..
Parents
  • On iOS bonding is handled by coreBluetooth, not the application. According to the guidelines bonding will be initiated if the iOS device receives an att error with "insufficient authentichation". This will only happen if you have configured the attribute table on the nRF51 correctly, e.g. to require security for read/write of a characteristic (in addition the iOS app will have to do a read/write of this characteristic to trigger the error). If your peripheral require encryption you should make sure you configure the attributes accordingly anyway.

    Another option to trigger pairing is if the peripheral send a smp request to the iOS device. This will work, but it's not according to apples bluetooth design guidelines.

  • Hello, Is there any example available github.com/.../ here to give me info about iOS Pairing with nRF51822 ? Please respond.

Reply Children
No Data
Related