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) {