6#include "esphome/core/log.h"
16inline void bytes_to_hex(
const uint8_t *data, uint8_t len,
char *out,
size_t out_size) {
21 for (uint8_t i = 0; i < len && pos + 4 < out_size; i++)
22 pos += snprintf(out + pos, out_size - pos,
"%02X ", data[i]);
25#ifdef IOHOME_FRAME_LOG
26inline void log_frame(
const char *prefix,
const uint8_t *data, uint8_t len, uint32_t freq, uint16_t preamble = 0) {
30 ESP_LOGI(
"io_frame",
"%s [%u bytes] freq=%u preamble=%u: %s", prefix, len, freq, preamble, hex);
32 ESP_LOGI(
"io_frame",
"%s [%u bytes] freq=%u: %s", prefix, len, freq, hex);
void bytes_to_hex(const uint8_t *data, uint8_t len, char *out, size_t out_size)
constexpr size_t FRAME_LOG_HEX_BUFFER_SIZE
Fits a full 32-byte frame rendered as spaced hex text.