@@ -75,14 +75,14 @@ BLEClient::~BLEClient() {
75
75
*
76
76
*/
77
77
void BLEClient::clearServices () {
78
- ESP_LOGD (LOG_TAG, " >> clearServices" );
78
+ ESP_LOGV (LOG_TAG, " >> clearServices" );
79
79
// Delete all the services.
80
80
for (auto &myPair : m_servicesMap) {
81
81
delete myPair.second ;
82
82
}
83
83
m_servicesMap.clear ();
84
84
m_haveServices = false ;
85
- ESP_LOGD (LOG_TAG, " << clearServices" );
85
+ ESP_LOGV (LOG_TAG, " << clearServices" );
86
86
} // clearServices
87
87
88
88
/* *
@@ -100,7 +100,7 @@ bool BLEClient::connect(BLEAdvertisedDevice* device) {
100
100
* @return True on success.
101
101
*/
102
102
bool BLEClient::connect (BLEAddress address, esp_ble_addr_type_t type) {
103
- ESP_LOGD (LOG_TAG, " >> connect(%s)" , address.toString ().c_str ());
103
+ ESP_LOGV (LOG_TAG, " >> connect(%s)" , address.toString ().c_str ());
104
104
105
105
// We need the connection handle that we get from registering the application. We register the app
106
106
// and then block on its completion. When the event has arrived, we will have the handle.
@@ -133,7 +133,7 @@ bool BLEClient::connect(BLEAddress address, esp_ble_addr_type_t type) {
133
133
}
134
134
135
135
uint32_t rc = m_semaphoreOpenEvt.wait (" connect" ); // Wait for the connection to complete.
136
- ESP_LOGD (LOG_TAG, " << connect(), rc=%d" , rc==ESP_GATT_OK);
136
+ ESP_LOGV (LOG_TAG, " << connect(), rc=%d" , rc==ESP_GATT_OK);
137
137
return rc == ESP_GATT_OK;
138
138
} // connect
139
139
@@ -143,13 +143,13 @@ bool BLEClient::connect(BLEAddress address, esp_ble_addr_type_t type) {
143
143
* @return N/A.
144
144
*/
145
145
void BLEClient::disconnect () {
146
- ESP_LOGD (LOG_TAG, " >> disconnect()" );
146
+ ESP_LOGV (LOG_TAG, " >> disconnect()" );
147
147
esp_err_t errRc = ::esp_ble_gattc_close (getGattcIf (), getConnId ());
148
148
if (errRc != ESP_OK) {
149
149
ESP_LOGE (LOG_TAG, " esp_ble_gattc_close: rc=%d %s" , errRc, GeneralUtils::errorToString (errRc));
150
150
return ;
151
151
}
152
- ESP_LOGD (LOG_TAG, " << disconnect()" );
152
+ ESP_LOGV (LOG_TAG, " << disconnect()" );
153
153
} // disconnect
154
154
155
155
@@ -343,9 +343,9 @@ BLEAddress BLEClient::getPeerAddress() {
343
343
* @return The RSSI value.
344
344
*/
345
345
int BLEClient::getRssi () {
346
- ESP_LOGD (LOG_TAG, " >> getRssi()" );
346
+ ESP_LOGV (LOG_TAG, " >> getRssi()" );
347
347
if (!isConnected ()) {
348
- ESP_LOGD (LOG_TAG, " << getRssi(): Not connected" );
348
+ ESP_LOGV (LOG_TAG, " << getRssi(): Not connected" );
349
349
return 0 ;
350
350
}
351
351
// We make the API call to read the RSSI value which is an asynchronous operation. We expect to receive
@@ -358,7 +358,7 @@ int BLEClient::getRssi() {
358
358
return 0 ;
359
359
}
360
360
int rssiValue = m_semaphoreRssiCmplEvt.wait (" getRssi" );
361
- ESP_LOGD (LOG_TAG, " << getRssi(): %d" , rssiValue);
361
+ ESP_LOGV (LOG_TAG, " << getRssi(): %d" , rssiValue);
362
362
return rssiValue;
363
363
} // getRssi
364
364
@@ -380,7 +380,7 @@ BLERemoteService* BLEClient::getService(const char* uuid) {
380
380
* @throws BLEUuidNotFound
381
381
*/
382
382
BLERemoteService* BLEClient::getService (BLEUUID uuid) {
383
- ESP_LOGD (LOG_TAG, " >> getService: uuid: %s" , uuid.toString ().c_str ());
383
+ ESP_LOGV (LOG_TAG, " >> getService: uuid: %s" , uuid.toString ().c_str ());
384
384
// Design
385
385
// ------
386
386
// We wish to retrieve the service given its UUID. It is possible that we have not yet asked the
@@ -393,11 +393,11 @@ BLERemoteService* BLEClient::getService(BLEUUID uuid) {
393
393
std::string uuidStr = uuid.toString ();
394
394
for (auto &myPair : m_servicesMap) {
395
395
if (myPair.first == uuidStr) {
396
- ESP_LOGD (LOG_TAG, " << getService: found the service with uuid: %s" , uuid.toString ().c_str ());
396
+ ESP_LOGV (LOG_TAG, " << getService: found the service with uuid: %s" , uuid.toString ().c_str ());
397
397
return myPair.second ;
398
398
}
399
399
} // End of each of the services.
400
- ESP_LOGD (LOG_TAG, " << getService: not found" );
400
+ ESP_LOGV (LOG_TAG, " << getService: not found" );
401
401
return nullptr ;
402
402
} // getService
403
403
@@ -416,7 +416,7 @@ std::map<std::string, BLERemoteService*>* BLEClient::getServices() {
416
416
* peer BLE partner to be returned as events. Each event will be an an instance of ESP_GATTC_SEARCH_RES_EVT
417
417
* and will culminate with an ESP_GATTC_SEARCH_CMPL_EVT when all have been received.
418
418
*/
419
- ESP_LOGD (LOG_TAG, " >> getServices" );
419
+ ESP_LOGV (LOG_TAG, " >> getServices" );
420
420
// TODO implement retrieving services from cache
421
421
clearServices (); // Clear any services that may exist.
422
422
@@ -433,7 +433,7 @@ std::map<std::string, BLERemoteService*>* BLEClient::getServices() {
433
433
}
434
434
// If sucessfull, remember that we now have services.
435
435
m_haveServices = (m_semaphoreSearchCmplEvt.wait (" getServices" ) == 0 );
436
- ESP_LOGD (LOG_TAG, " << getServices" );
436
+ ESP_LOGV (LOG_TAG, " << getServices" );
437
437
return &m_servicesMap;
438
438
} // getServices
439
439
@@ -445,9 +445,9 @@ std::map<std::string, BLERemoteService*>* BLEClient::getServices() {
445
445
* @throws BLEUuidNotFound
446
446
*/
447
447
std::string BLEClient::getValue (BLEUUID serviceUUID, BLEUUID characteristicUUID) {
448
- ESP_LOGD (LOG_TAG, " >> getValue: serviceUUID: %s, characteristicUUID: %s" , serviceUUID.toString ().c_str (), characteristicUUID.toString ().c_str ());
448
+ ESP_LOGV (LOG_TAG, " >> getValue: serviceUUID: %s, characteristicUUID: %s" , serviceUUID.toString ().c_str (), characteristicUUID.toString ().c_str ());
449
449
std::string ret = getService (serviceUUID)->getCharacteristic (characteristicUUID)->readValue ();
450
- ESP_LOGD (LOG_TAG, " <<getValue" );
450
+ ESP_LOGV (LOG_TAG, " <<getValue" );
451
451
return ret;
452
452
} // getValue
453
453
@@ -508,9 +508,9 @@ void BLEClient::setClientCallbacks(BLEClientCallbacks* pClientCallbacks) {
508
508
* @throws BLEUuidNotFound
509
509
*/
510
510
void BLEClient::setValue (BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value) {
511
- ESP_LOGD (LOG_TAG, " >> setValue: serviceUUID: %s, characteristicUUID: %s" , serviceUUID.toString ().c_str (), characteristicUUID.toString ().c_str ());
511
+ ESP_LOGV (LOG_TAG, " >> setValue: serviceUUID: %s, characteristicUUID: %s" , serviceUUID.toString ().c_str (), characteristicUUID.toString ().c_str ());
512
512
getService (serviceUUID)->getCharacteristic (characteristicUUID)->writeValue (value);
513
- ESP_LOGD (LOG_TAG, " << setValue" );
513
+ ESP_LOGV (LOG_TAG, " << setValue" );
514
514
} // setValue
515
515
516
516
uint16_t BLEClient::getMTU () {
0 commit comments