mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 12:15:33 +01:00
Fix compatibility with new ByteBuffer
This commit is contained in:
parent
240de01205
commit
15b87b5fb7
@ -33,10 +33,8 @@ BLECharacteristic::BLECharacteristic(const ESPBTUUID uuid, uint32_t properties)
|
||||
}
|
||||
|
||||
void BLECharacteristic::set_value(ByteBuffer buffer) {
|
||||
size_t length = buffer.get_capacity();
|
||||
uint8_t *data = buffer.array();
|
||||
xSemaphoreTake(this->set_value_lock_, 0L);
|
||||
this->value_ = std::vector<uint8_t>(data, data + length);
|
||||
this->value_ = buffer.get_data();
|
||||
xSemaphoreGive(this->set_value_lock_);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ void BLEDescriptor::set_value(ByteBuffer buffer) {
|
||||
return;
|
||||
}
|
||||
this->value_.attr_len = length;
|
||||
memcpy(this->value_.attr_value, buffer.array(), length);
|
||||
memcpy(this->value_.attr_value, buffer.get_data().data(), length);
|
||||
}
|
||||
|
||||
void BLEDescriptor::gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if,
|
||||
|
Loading…
Reference in New Issue
Block a user