update BLE library for ESP32 env compatibility
with the last version of ESP32 arduino env it is not possible to compile on ESP32, we get "missing gatt_api.h" ERROR. So as to avoid that we need to use the last version of the nkolban library for BLE 0.4.16
This commit is contained in:
1 parent
1dd68ab078
commit
42be3fe0f2
48 files changed
+2970
-426
No files matched your search
@@ -27,6 +27,7 @@ BLERemoteDescriptor::BLERemoteDescriptor(
|
||||
m_pRemoteCharacteristic = pRemoteCharacteristic;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Retrieve the handle associated with this remote descriptor.
|
||||
* @return The handle associated with this remote descriptor.
|
||||
@@ -36,6 +37,15 @@ uint16_t BLERemoteDescriptor::getHandle() {
|
||||
} // getHandle
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get the characteristic that owns this descriptor.
|
||||
* @return The characteristic that owns this descriptor.
|
||||
*/
|
||||
BLERemoteCharacteristic* BLERemoteDescriptor::getRemoteCharacteristic() {
|
||||
return m_pRemoteCharacteristic;
|
||||
} // getRemoteCharacteristic
|
||||
|
||||
|
||||
/**
|
||||
* @brief Retrieve the UUID associated this remote descriptor.
|
||||
* @return The UUID associated this remote descriptor.
|
||||
@@ -46,6 +56,14 @@ BLEUUID BLERemoteDescriptor::getUUID() {
|
||||
|
||||
|
||||
std::string BLERemoteDescriptor::readValue(void) {
|
||||
ESP_LOGD(LOG_TAG, ">> readValue: %s", toString().c_str());
|
||||
|
||||
// Check to see that we are connected.
|
||||
if (!getRemoteCharacteristic()->getRemoteService()->getClient()->isConnected()) {
|
||||
ESP_LOGE(LOG_TAG, "Disconnected");
|
||||
throw BLEDisconnectedException();
|
||||
}
|
||||
|
||||
m_semaphoreReadDescrEvt.take("readValue");
|
||||
|
||||
// Ask the BLE subsystem to retrieve the value for the remote hosted characteristic.
|
||||
@@ -66,7 +84,6 @@ std::string BLERemoteDescriptor::readValue(void) {
|
||||
|
||||
ESP_LOGD(LOG_TAG, "<< readValue(): length: %d", m_value.length());
|
||||
return m_value;
|
||||
return "";
|
||||
} // readValue
|
||||
|
||||
|
||||
@@ -119,6 +136,12 @@ void BLERemoteDescriptor::writeValue(
|
||||
size_t length,
|
||||
bool response) {
|
||||
ESP_LOGD(LOG_TAG, ">> writeValue: %s", toString().c_str());
|
||||
// Check to see that we are connected.
|
||||
if (!getRemoteCharacteristic()->getRemoteService()->getClient()->isConnected()) {
|
||||
ESP_LOGE(LOG_TAG, "Disconnected");
|
||||
throw BLEDisconnectedException();
|
||||
}
|
||||
|
||||
esp_err_t errRc = ::esp_ble_gattc_write_char_descr(
|
||||
m_pRemoteCharacteristic->getRemoteService()->getClient()->getGattcIf(),
|
||||
m_pRemoteCharacteristic->getRemoteService()->getClient()->getConnId(),
|
||||
|
||||
Reference in new issue
Block a user