correct version of BLE libraries

last working version of this library with the ESP32 env revision pointed in the wiki
This commit is contained in:
Florian
2018-07-04 22:39:33 +02:00
parent 9dd7b97b11
commit b602e406ef
23 changed files with 72 additions and 461 deletions

View File

@@ -77,7 +77,6 @@ void BLEClient::clearServices() {
delete myPair.second;
}
m_servicesMap.clear();
m_haveServices = false;
ESP_LOGD(LOG_TAG, "<< clearServices");
} // clearServices
@@ -111,7 +110,6 @@ bool BLEClient::connect(BLEAddress address) {
errRc = ::esp_ble_gattc_open(
getGattcIf(),
*getPeerAddress().getNative(), // address
BLE_ADDR_TYPE_PUBLIC, // Note: This was added on 2018-04-03 when the latest ESP-IDF was detected to have changed the signature.
1 // direct connection
);
if (errRc != ESP_OK) {
@@ -167,8 +165,6 @@ void BLEClient::gattClientEventHandler(
m_pClientCallbacks->onDisconnect(this);
}
m_isConnected = false;
m_semaphoreRssiCmplEvt.give();
m_semaphoreSearchCmplEvt.give(1);
break;
} // ESP_GATTC_DISCONNECT_EVT
@@ -216,7 +212,7 @@ void BLEClient::gattClientEventHandler(
// - uint16_t conn_id
//
case ESP_GATTC_SEARCH_CMPL_EVT: {
m_semaphoreSearchCmplEvt.give(0);
m_semaphoreSearchCmplEvt.give();
break;
} // ESP_GATTC_SEARCH_CMPL_EVT
@@ -369,8 +365,8 @@ std::map<std::string, BLERemoteService*>* BLEClient::getServices() {
ESP_LOGE(LOG_TAG, "esp_ble_gattc_search_service: rc=%d %s", errRc, GeneralUtils::errorToString(errRc));
return &m_servicesMap;
}
// If sucessfull, remember that we now have services.
m_haveServices = (m_semaphoreSearchCmplEvt.wait("getServices") == 0);
m_semaphoreSearchCmplEvt.wait("getServices");
m_haveServices = true; // Remember that we now have services.
ESP_LOGD(LOG_TAG, "<< getServices");
return &m_servicesMap;
} // getServices