forked from h2zero/esp-nimble-cpp
Add support for creating a NimBLEClient from a NimBLEServer peer.
This allows the NimBLEServer instance to create a NimBLEClient instance to read/write form/to a connected peer. Only one instance is supported subsequent calls will overwrite the previous client connection information and data.
This commit is contained in:
+2
-4
@@ -60,9 +60,6 @@ class NimBLEClient {
|
||||
void setClientCallbacks(NimBLEClientCallbacks* pClientCallbacks, bool deleteCallbacks = true);
|
||||
std::string toString() const;
|
||||
uint16_t getConnHandle() const;
|
||||
void clearConnection();
|
||||
bool setConnection(const NimBLEConnInfo& connInfo);
|
||||
bool setConnection(uint16_t connHandle);
|
||||
uint16_t getMTU() const;
|
||||
bool exchangeMTU();
|
||||
bool secureConnection(bool async = false) const;
|
||||
@@ -140,6 +137,7 @@ class NimBLEClient {
|
||||
ble_gap_conn_params m_connParams;
|
||||
|
||||
friend class NimBLEDevice;
|
||||
friend class NimBLEServer;
|
||||
}; // class NimBLEClient
|
||||
|
||||
/**
|
||||
@@ -155,7 +153,7 @@ class NimBLEClientCallbacks {
|
||||
*/
|
||||
virtual void onConnect(NimBLEClient* pClient);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Called when a connection attempt fails.
|
||||
* @param [in] pClient A pointer to the connecting client object.
|
||||
* @param [in] reason Contains the reason code for the connection failure.
|
||||
|
||||
Reference in New Issue
Block a user