From 8b06135b412d31ad63074ce8f2c8228b70c1ab26 Mon Sep 17 00:00:00 2001 From: Deun Lee <54697735+deunlee@users.noreply.github.com> Date: Tue, 20 Dec 2022 13:36:16 +0900 Subject: [PATCH] Fix UUID displaying incorrectly in BLE Tracker logs (#4187) --- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index b1d469025b..45509c489c 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -601,9 +601,9 @@ std::string ESPBTUUID::to_string() const { default: case ESP_UUID_LEN_128: std::string buf; - for (int8_t i = 15; i >= 0; i--) { + for (uint8_t i = 0; i < 16; i++) { buf += str_snprintf("%02X", 2, this->uuid_.uuid.uuid128[i]); - if (i == 6 || i == 8 || i == 10 || i == 12) + if (i == 3 || i == 5 || i == 7 || i == 9) buf += "-"; } return buf;