I couldn't get NimBLE to pair with an old oven controller (Okida OT-2000, BLE 4.0 era, legacy pairing, Passkey Entry). Bluedroid paired first try, which led me to the cause.
The oven sends a Security Request the instant a central connects. NimBLE is, err, too nimble: it replies with a Pairing Request immediately, from inside ble_sm_sec_req_rx(). The oven can't handle it that fast — it shows its PIN, never sends a Pairing Response, and drops the link after its 30 s SMP timeout.
Nothing at the sketch level helps, because the stack has already sent the request before control is returned to the app.
This PR allows the app to disable the automatic pairing request.
#1181
The app then can initiate pairing itself later on, giving time for older bluetooth devices to finish their connection setup before the Pairing Request arrives. Default behaviour is unchanged, and bonded peers are unaffected.
NimBLE is a far nicer library than Bluedriod but as things stand this class of device simply can't be paired with it; the only way out is Bluedroid. This change is small and keeps the default behaviour, so hopefully it's an easy one to take.
I couldn't get NimBLE to pair with an old oven controller (Okida OT-2000, BLE 4.0 era, legacy pairing, Passkey Entry). Bluedroid paired first try, which led me to the cause.
The oven sends a Security Request the instant a central connects. NimBLE is, err, too nimble: it replies with a Pairing Request immediately, from inside ble_sm_sec_req_rx(). The oven can't handle it that fast — it shows its PIN, never sends a Pairing Response, and drops the link after its 30 s SMP timeout.
Nothing at the sketch level helps, because the stack has already sent the request before control is returned to the app.
This PR allows the app to disable the automatic pairing request.
#1181
The app then can initiate pairing itself later on, giving time for older bluetooth devices to finish their connection setup before the Pairing Request arrives. Default behaviour is unchanged, and bonded peers are unaffected.
NimBLE is a far nicer library than Bluedriod but as things stand this class of device simply can't be paired with it; the only way out is Bluedroid. This change is small and keeps the default behaviour, so hopefully it's an easy one to take.