From 04ee66d76b6102c6f615154bca402b55422ae302 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 13 Oct 2026 20:18:15 -1000 Subject: [PATCH] Log the CCCD write status as a signed int and name the handle The neutral write callback reports an int status, so %x printed errno-style negatives as ffffff..; include the failing handle too. Also correct the hex buffer comment: the size comes from the V2 minimum payload, not the longest message. --- esphome/components/radon_eye_rd200/radon_eye_rd200.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp b/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp index ab335de4840..05cd08fe285 100644 --- a/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp +++ b/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp @@ -121,7 +121,7 @@ void RadonEyeRD200::on_write_result(uint16_t handle, int error) { return; } if (error != 0) { - ESP_LOGE(TAG, "write descr failed, error status = %x", error); + ESP_LOGE(TAG, "CCCD write on handle 0x%04x failed, status=%d", handle, error); this->parent()->set_enabled(false); return; } @@ -163,7 +163,7 @@ void RadonEyeRD200::read_sensors_(const uint8_t *value, uint16_t value_len) { // Example data V2: // 4042323230313033525532303338330652443230304e56322e302e3200014a00060a00080000000300010079300000e01108001c00020000003822005c8f423fa4709d3f #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE - // Sized for the longest supported message; format_hex_to truncates longer. + // Sized for the V2 minimum payload; format_hex_to truncates longer messages. char hex_buf[format_hex_size(MESSAGE_MIN_LEN_V2)]; ESP_LOGV(TAG, "radon sensors raw bytes: %s", format_hex_to(hex_buf, value, value_len)); #endif