[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:
h2zeroandCasey Smith authored and GitHub committed 2024-06-06 19:36:14 -06:00
1 parent 6ca61bbd9c
commit 9c1f1adf7a
14 files changed
+202 -181

No files matched your search

+11 -10
View File
@@ -152,24 +152,25 @@ public:
virtual void onMTUChange(uint16_t MTU, NimBLEConnInfo& connInfo);
/**
* @brief Called when a client requests a passkey for pairing.
* @brief Called when a client requests a passkey for pairing (display).
* @return The passkey to be sent to the client.
*/
virtual uint32_t onPassKeyRequest();
virtual uint32_t onPassKeyDisplay();
/**
* @brief Called when using numeric comparision for pairing.
* @param [in] connInfo A reference to a NimBLEConnInfo instance with information
* Should be passed back to NimBLEDevice::injectConfirmPIN
* @param [in] pin The pin to compare with the client.
*/
virtual void onConfirmPIN(const NimBLEConnInfo& connInfo, uint32_t pin);
/**
* @brief Called when the pairing procedure is complete.
* @param [in] connInfo A reference to a NimBLEConnInfo instance with information
* about the peer connection parameters.
*/
virtual void onAuthenticationComplete(NimBLEConnInfo& connInfo);
/**
* @brief Called when using numeric comparision for pairing.
* @param [in] pin The pin to compare with the client.
* @return True to accept the pin.
*/
virtual bool onConfirmPIN(uint32_t pin);
virtual void onAuthenticationComplete(const NimBLEConnInfo& connInfo);
}; // NimBLEServerCallbacks
#endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL */