AnsweredAssumed Answered

Bonding problem

Question asked by Francesco Sarasini on Jan 3, 2018
Latest reply on Jan 12, 2018 by Francesco Sarasini

Hi,

 

I'm using BlueNRG as bt peripheral. I can successfully pair my android smartphone, but the BlueNRG doesn't add the smartphone to the bonding list.

 

aci_gap_init(GAP_PERIPHERAL_ROLE, 0x00, 0x08, &BluetoothIOService_ServiceHandle, &dev_name_char_handle, &appearance_char_handle);

aci_gap_set_authentication_requirement(BONDING, MITM_PROTECTION_NOT_REQUIRED, SC_IS_NOT_SUPPORTED, KEYPRESS_IS_NOT_SUPPORTED,
7, 16, USE_FIXED_PIN_FOR_PAIRING, 123456, 0x01);

 

On pairing complete event the bonded devices list is always empty. I suppose it should contains the smartphone address. 

 

numBonds is always 0

void aci_gap_pairing_complete_event(uint16_t Connection_Handle, uint8_t Status, uint8_t Reason) {

     if (Status == 0x00) {

          uint8_t ret = aci_gap_configure_whitelist();

          uint8_t numBonds;
          Bonded_Device_Entry_t bonds[12];

          ret = aci_gap_get_bonded_devices(&numBonds, bonds);

          if (numBonds > 0) {

               Whitelist_Identity_Entry_t wle;
               wle.Peer_Identity_Address_Type = bonds[0].Address_Type;
               memcpy(wle.Peer_Identity_Address, bonds[0].Address, 6);

               ret = aci_gap_add_devices_to_resolving_list(1, &wle, 0);

               uint8_t i;
               for (i = 0; i < numBonds; i++) {
                    printf("bonded %0X:%0X:%0X:%0X:%0X:%0X", bonds[i].Address[0], bonds[i].Address[1],
                              bonds[i].Address[2], bonds[i].Address[3], bonds[i].Address[4], bonds[i].Address[5]);
               }
          }
     }
}

 

What I'm doing wrong?

 

Thanks

Outcomes