@@ -146,8 +146,7 @@ bool NimBLEClient::connect(bool deleteAttibutes) {
146146 */
147147bool NimBLEClient::connect (NimBLEAdvertisedDevice* device, bool deleteAttibutes) {
148148 NimBLEAddress address (device->getAddress ());
149- uint8_t type = device->getAddressType ();
150- return connect (address, type, deleteAttibutes);
149+ return connect (address, 0 , deleteAttibutes);
151150}
152151
153152
@@ -181,7 +180,7 @@ bool NimBLEClient::connect(const NimBLEAddress &address, uint8_t type, bool dele
181180
182181 ble_addr_t peerAddrt;
183182 memcpy (&peerAddrt.val , address.getNative (),6 );
184- peerAddrt.type = type ;
183+ peerAddrt.type = address. getType () ;
185184
186185 ble_task_data_t taskData = {this , xTaskGetCurrentTaskHandle (), 0 , nullptr };
187186 m_pTaskData = &taskData;
@@ -199,10 +198,9 @@ bool NimBLEClient::connect(const NimBLEAddress &address, uint8_t type, bool dele
199198 }while (rc == BLE_HS_EBUSY);
200199
201200 if (rc != 0 && rc != BLE_HS_EDONE) {
202- NIMBLE_LOGE (LOG_TAG, " Error: Failed to connect to device; addr_type=%d "
201+ NIMBLE_LOGE (LOG_TAG, " Error: Failed to connect to device; "
203202 " addr=%s, rc=%d; %s" ,
204- type,
205- m_peerAddress.toString ().c_str (),
203+ std::string (m_peerAddress).c_str (),
206204 rc, NimBLEUtils::returnCodeToString (rc));
207205 m_pTaskData = nullptr ;
208206 m_waitingToConnect = false ;
@@ -219,7 +217,6 @@ bool NimBLEClient::connect(const NimBLEAddress &address, uint8_t type, bool dele
219217 }
220218
221219 if (deleteAttibutes) {
222- NIMBLE_LOGD (LOG_TAG, " Refreshing Services for: (%s)" , address.toString ().c_str ());
223220 deleteServices ();
224221 }
225222
@@ -373,7 +370,7 @@ void NimBLEClient::setPeerAddress(const NimBLEAddress &address) {
373370 }
374371
375372 m_peerAddress = address;
376- NIMBLE_LOGE (LOG_TAG, " Peer address set: %s" , std::string (m_peerAddress).c_str ());
373+ NIMBLE_LOGD (LOG_TAG, " Peer address set: %s" , std::string (m_peerAddress).c_str ());
377374} // setPeerAddress
378375
379376
0 commit comments