From 7a5c874f4d2111365aa9c6610814363c8b0c8eaf Mon Sep 17 00:00:00 2001 From: Spencer Yan Date: Tue, 22 Oct 2024 17:28:18 +0800 Subject: [PATCH] chore(mr60fda2): correct the ESP_LOGV with `buffer` included --- esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp b/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp index 523035c4d9..1a53e23e26 100644 --- a/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp +++ b/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp @@ -187,8 +187,9 @@ void MR60FDA2Component::split_frame_(uint8_t buffer) { this->current_frame_locate_++; } else { ESP_LOGD(TAG, "HEAD_CKSUM_FRAME ERROR: 0x%02x", buffer); - ESP_LOGV(TAG, "FRAME: %s", format_hex_pretty(this->current_frame_buf_, this->current_frame_len_).c_str(), - buffer); + ESP_LOGV(TAG, "CURRENT_FRAME: %s %s", + format_hex_pretty(this->current_frame_buf_, this->current_frame_len_).c_str(), + format_hex_pretty(&buffer, 1).c_str()); this->current_frame_locate_ = LOCATE_FRAME_HEADER; } break; @@ -212,8 +213,10 @@ void MR60FDA2Component::split_frame_(uint8_t buffer) { this->process_frame_(); } else { ESP_LOGD(TAG, "DATA_CKSUM_FRAME ERROR: 0x%02x", buffer); - ESP_LOGV(TAG, "GET CURRENT_FRAME: %s", - format_hex_pretty(this->current_frame_buf_, this->current_frame_len_).c_str(), buffer); + ESP_LOGV(TAG, "GET CURRENT_FRAME: %s %s", + format_hex_pretty(this->current_frame_buf_, this->current_frame_len_).c_str(), + format_hex_pretty(&buffer, 1).c_str()); + this->current_frame_locate_ = LOCATE_FRAME_HEADER; } break;