[BREAKING] Asynchronous pin injections for Numeric Comparison and PassKey Input (#165)

* Make NimBLEConnInfo functions const.

* Update callback functions and update client to use new functions.

* Update examples.

* Update migration guide.

---------

Co-authored-by: Casey Smith <csmith@morningstarcorp.com>
This commit is contained in:
h2zero
2024-06-06 19:36:14 -06:00
committed by GitHub
co-authored by Casey Smith
parent 6ca61bbd9c
commit 9c1f1adf7a
14 changed files with 202 additions and 181 deletions
+5 -5
View File
@@ -147,23 +147,23 @@ public:
/**
* @brief Called when server requests a passkey for pairing.
* @return The passkey to be sent to the server.
* @param [in] connInfo A reference to a NimBLEConnInfo instance containing the peer info.
*/
virtual uint32_t onPassKeyRequest();
virtual void onPassKeyEntry(const NimBLEConnInfo& connInfo);
/**
* @brief Called when the pairing procedure is complete.
* @param [in] connInfo A reference to a NimBLEConnInfo instance containing the peer info.\n
* This can be used to check the status of the connection encryption/pairing.
*/
virtual void onAuthenticationComplete(NimBLEConnInfo& connInfo);
virtual void onAuthenticationComplete(const NimBLEConnInfo& connInfo);
/**
* @brief Called when using numeric comparision for pairing.
* @param [in] connInfo A reference to a NimBLEConnInfo instance containing the peer info.
* @param [in] pin The pin to compare with the server.
* @return True to accept the pin.
*/
virtual bool onConfirmPIN(uint32_t pin);
virtual void onConfirmPIN(const NimBLEConnInfo& connInfo, uint32_t pin);
};
#endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_CENTRAL */