In aioble calling DeviceConnection.pair() or security.pair() gives 'unknown config param'
In the aioble library attempting to pair gives 'unknown config param' regardless of which attempt I use (one can call the pair method through the DeviceConnection object which calls the pair method in the security module or call the security module pair method direct). The difference as far as the application is concerned is in the latter one has to pass the DeviceConnection parameter in the first argument. The documentation in the code says use the DeviceConnection object.
I think the offending parameter is the bond parameter. When I try and set the config at the low level programmatically I get an error with the bond parameter as unknown., I did not try setting other parameters.
extmod/modbluetooth: Add gap_unpair command.
This function deletes the pairing details from the DB on both the application and the radio, so can be used to free up IRK slots on the radio.
Note: this only works on nimble as pairing/bonding has not been fully implemented on other stacks.
Background
In my application, we have a stm327f765 chip running micropython, with a build of the official nimble uart/hci application running on a separate nrf52810 (https://github.com/apache/mynewt-nimble/tree/master/apps/blehci)
We use this with aioble and paring/bonding.
It's been found that this nimble hci radio only has buffer/storage for 4 RPA / IRK addressing lookups, so if you've got more devices than this stored in the pairing/bonding database, any new devices that come along and try to pair/bond seem to work initially, but upon disconnect/reconnect the pairing details are lost.
Also, if you've got more devices than this stored in the bond database, with the current inplementation of aioble the fact these are stored in a dict/json file means the order is not strictly controlled, so you can't know for certain which devices keys will be loaded first/last into the radio - which ever ones don't fit can fail to connect correctly.
As part of work to provide some control over this issue by allowing an application to limit the number of devices bonded, this gap_unpair() function is needed to remove keys from the ble stack / radio.