cancel
Showing results for 
Search instead for 
Did you mean: 

What is the API call to get the stm32wb to reject all pairing requests? The bonding_mode argument to aci_gap_set_authentication_requirement() looks like it honors pairing requests always.

User1655833706281357277
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
User1655833706281357277
Associate III

It isn't at all obvious how you do that from the link you provided, but okay, uncle. The whitelist option isn't great if you don't know ahead of time the devices you want to whitelist. As I stated before, other vendors let you do this. You might want to think about it.

View solution in original post

10 REPLIES 10
Remy ISSALYS
ST Employee

Hello,

There isn't any API to reject all pairing requests, it's sufficient to not answer to the pairing request. Can you explain a bit more your use case ? Are you working with a PC, a smartphone or another STM32WB ?

Best Regards

WMcKi.1924
Associate II

Sorry for the long delay, I didn't see a notice that there was a response. For my device I'm using a passkey to pair to an iOS device. The only API calls that I see that have anything to do with pairing are the ones that ask me for the passkey and tell me pairing is complete. I don't see a callback that tells me a pairing request has come in. Are you saying just don't respond to the passkey callback to effectively disable pairing?

Remy ISSALYS
ST Employee

Hello,

Which smartphone application are you using? Can you explain why you want to reject the pairing, if you don't ask pairing from the smartphone, I don't really understand your use case.

Best Regards

User1655833706281357277
Associate III

This isn't that hard a question. There are other BLE/microprocessor systems out there that make this easy. I know, we have fielded them. We have a custom iOS application that is part of a medical device system. You can probably understand why I want complete control of the pairing process. It should be simple to just refuse the pairing request. The ST part really can't do this?

Remy ISSALYS
ST Employee

Hello,

The pairing request are managed by the BLE Stack and not by the application. Indeed, there isn't any API to reject all pairing requests. If you want to have only specific devices that can connect to your device, you can use the whitelist mechanism. If you want to ignore every pairing request, you can bypass the SMP using the ACI_HAL_WRITE_CONFIG_DATA command, see STM32WB_BLE_Wireless_Interface.html documentation.

Best Regards

User1655833706281357277
Associate III

It isn't at all obvious how you do that from the link you provided, but okay, uncle. The whitelist option isn't great if you don't know ahead of time the devices you want to whitelist. As I stated before, other vendors let you do this. You might want to think about it.

Remy ISSALYS
ST Employee

Hello,

To bypass the SMP, call ACI_HAL_WRITE_CONFIG_DATA command with the following parameters in Ble_Hci_Gap_Gatt_Init function (app_ble.c):

static const uint8_t SMP_bypass = 0x01;
 
ret = aci_hal_write_config_data(CONFIG_DATA_SMP_MODE_OFFSET, CONFIG_DATA_SMP_MODE_LEN, &SMP_bypass);
if (ret != BLE_STATUS_SUCCESS)
{
  APP_DBG_MSG("  Fail   : aci_hal_write_config_data command - CONFIG_DATA_SMP_MODE_OFFSET, result: 0x%x \n", ret);
}
else
{
  APP_DBG_MSG("  Success: aci_hal_write_config_data command - CONFIG_DATA_SMP_MODE_OFFSET\n");
}

When the SMP is bypassed, the pairing request will be ignored by the BLE Stack.

Best Regards

User1655833706281357277
Associate III

All right, just to complain a little more then: I really don't want to bypass the security manager and wonder what else happens when that's set. I have to use at least security level three for my application. This started because I was using aci_gap_set_authentication_requirement() and was surprised that the "no bonding mode" argument still let clients temporarily pair and connect it. I have a workaround for this, but it still seems to me to be a deficiency in the API.

Remy ISSALYS
ST Employee

Hello,

The "bonding mode" parameter allow if enabled (0x01) to store the bonding information in flash.

Best Regards