From 0bddfa1b39ff162d0afe489140bfb5af8a3f4c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Mart=C3=ADn?= Date: Sun, 20 Oct 2024 11:38:31 +0200 Subject: [PATCH] Update esphome/components/esp32_ble_server/ble_characteristic.cpp Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> --- esphome/components/esp32_ble_server/ble_characteristic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/esp32_ble_server/ble_characteristic.cpp b/esphome/components/esp32_ble_server/ble_characteristic.cpp index c08963c243..07fd337e75 100644 --- a/esphome/components/esp32_ble_server/ble_characteristic.cpp +++ b/esphome/components/esp32_ble_server/ble_characteristic.cpp @@ -72,7 +72,7 @@ void BLECharacteristic::add_descriptor(BLEDescriptor *descriptor) { [this](const std::vector &value, uint16_t conn_id) { if (value.size() != 2) return; - uint16_t cccd = (value[1] << 8) | value[0]; + uint16_t cccd = encode_uint16(value[1], value[0]); bool notify = (cccd & 1) != 0; bool indicate = (cccd & 2) != 0; if (notify || indicate) {