mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 08:41:59 +00:00
[jsn_sr04t] Use stack buffer for hex formatting in error logging (#12729)
This commit is contained in:
@@ -39,7 +39,9 @@ void Jsnsr04tComponent::check_buffer_() {
|
||||
ESP_LOGV(TAG, "Distance from sensor: %umm, %.3fm", distance, meters);
|
||||
this->publish_state(meters);
|
||||
} else {
|
||||
ESP_LOGW(TAG, "Invalid data read from sensor: %s", format_hex_pretty(this->buffer_).c_str());
|
||||
char hex_buf[format_hex_pretty_size(4)];
|
||||
ESP_LOGW(TAG, "Invalid data read from sensor: %s",
|
||||
format_hex_pretty_to(hex_buf, this->buffer_.data(), this->buffer_.size()));
|
||||
}
|
||||
} else {
|
||||
ESP_LOGW(TAG, "checksum failed: %02x != %02x", checksum, this->buffer_[3]);
|
||||
|
||||
Reference in New Issue
Block a user