forked from h2zero/esp-nimble-cpp
Add asynchronous client connection secure
* Adds parameter `rcPtr` to `NimBLEDevice::startSecurity`, default value works as the original method. * * `rcPtr`: if not nullptr, will allow caller to obtain the internal return code. * Adds parameter `async` to `NimBLEClient::secureConnection`, default value works as the original method. * * `async`; if true, will send the secure command and return immediately with a true value for successfully sending the command, else false.
This commit is contained in:
+2
-1
@@ -65,7 +65,7 @@ class NimBLEClient {
|
||||
bool setConnection(uint16_t connHandle);
|
||||
uint16_t getMTU() const;
|
||||
bool exchangeMTU();
|
||||
bool secureConnection() const;
|
||||
bool secureConnection(bool async = false) const;
|
||||
void setConnectTimeout(uint32_t timeout);
|
||||
bool setDataLen(uint16_t txOctets);
|
||||
bool discoverAttributes();
|
||||
@@ -131,6 +131,7 @@ class NimBLEClient {
|
||||
NimBLEClientCallbacks* m_pClientCallbacks;
|
||||
uint16_t m_connHandle;
|
||||
uint8_t m_terminateFailCount;
|
||||
mutable uint8_t m_asyncSecureAttempt;
|
||||
Config m_config;
|
||||
|
||||
# if CONFIG_BT_NIMBLE_EXT_ADV
|
||||
|
||||
Reference in New Issue
Block a user