cancel
Showing results for 
Search instead for 
Did you mean: 

MITM pairing not working when peripheral(nucleo board) tries to initiate it

GBert
Associate II

Hi

When I connect to the STM32WB55 nucleo(set up as peripheral) with my phone, I receive the EVT_LE_CONN_COMPLETE . Now I want to bond them with MITM, so I use aci_gap_slave_security_req() to let the phone know, I get a notification to pair, press pair, but then it keeps trying but doesn't work. In the documentation (STM32_BLEstack.pdf) they just say to use the command like that. Prior to the command(when not connected), I also set up the IO capability and authentication requirements like so:

/**

  * Initialize IO capability

  */

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability = CFG_IO_CAPABILITY;

 aci_gap_set_io_capability(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability);

 /**

  * Initialize authentication

  */

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION;

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0;

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8;

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16;

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 0;

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 111111;

 BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 1;

 for (index = 0; index < 16; index++)

 {

  BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data[index] = (uint8_t) index;

 }

 aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,

                     BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,

                     0x02,

                     0,

                     BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,

                     BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,

                     BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin,

                     BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin,

0

 );

thx in advance 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
GBert
Associate II

Okay after a long search, I discovered the aci_gap_allow_rebond() function. I needed to call this function when the EVT_LE_CONN_UPDATE_COMPLETE occured. This is not described in the documentation...... Does anyone has some good documentation?

View solution in original post

1 REPLY 1
GBert
Associate II

Okay after a long search, I discovered the aci_gap_allow_rebond() function. I needed to call this function when the EVT_LE_CONN_UPDATE_COMPLETE occured. This is not described in the documentation...... Does anyone has some good documentation?