micropython-lib
micropython-lib copied to clipboard
aioble/security: Add option to limit number of peers stored.
This can be used to handle hardware that has a limit to the number of pairing / IRK keys that can be stored in the radio.
Needs to be enabled before aioble initialised to have any impact, eg.
import aioble.security
aioble.security.limit_peers = 3
Basically turns the pairing DB into a FIFO when once the set limit is reached, if any new devices are paired the oldest will be forgotten.