Bluetooth: SMP: Handle both devices initiating security

Handle case where:
 - Peripheral sends security request after master has sent pairing
   request or started encryption procedure.
   This packet can be ignored, as long as the slave has not already
   responded with pairing response.
 - Central wants to start security after peripheral initiated security
   request, return error code busy in this case

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2019-09-06 14:29:32 +02:00 committed by Andrew Boie
commit 2ac5841928
2 changed files with 59 additions and 7 deletions

View file

@ -327,6 +327,9 @@ typedef enum __packed {
* to achieve due to local or remote device limitation (e.g., input output
* capabilities), or if the maximum number of paired devices has been reached.
*
* This function may return error if the pairing procedure has already been
* initiated by the local device or the peer device.
*
* @param conn Connection object.
* @param sec Requested security level.
*