File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed
Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,7 @@ static NimBLEClientCallbacks defaultCallbacks;
5353 * @brief Constructor, private - only callable by NimBLEDevice::createClient
5454 * to ensure proper handling of the list of client objects.
5555 */
56- NimBLEClient::NimBLEClient ()
57- {
56+ NimBLEClient::NimBLEClient (const NimBLEAddress &peerAddress) : m_peerAddress(peerAddress) {
5857 m_pClientCallbacks = &defaultCallbacks;
5958 m_conn_id = BLE_HS_CONN_HANDLE_NONE;
6059 m_isConnected = false ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class NimBLEClient {
7171 void discoverAttributes ();
7272
7373private:
74- NimBLEClient ();
74+ NimBLEClient (const NimBLEAddress &peerAddress );
7575 ~NimBLEClient ();
7676
7777 friend class NimBLEDevice ;
@@ -84,7 +84,7 @@ class NimBLEClient {
8484 void *arg);
8585 bool retrieveServices (const NimBLEUUID *uuid_filter = nullptr );
8686
87- NimBLEAddress m_peerAddress = NimBLEAddress( " " ) ;
87+ NimBLEAddress m_peerAddress;
8888 uint16_t m_conn_id;
8989 bool m_isConnected;
9090 bool m_waitingToConnect;
Original file line number Diff line number Diff line change @@ -148,10 +148,7 @@ void NimBLEDevice::stopAdvertising() {
148148 NIMBLE_MAX_CONNECTIONS);
149149 }
150150
151- NimBLEClient* pClient = new NimBLEClient ();
152- if (peerAddress != NimBLEAddress (" " )) {
153- pClient->setPeerAddress (peerAddress);
154- }
151+ NimBLEClient* pClient = new NimBLEClient (peerAddress);
155152 m_cList.push_back (pClient);
156153
157154 return pClient;
You can’t perform that action at this time.
0 commit comments