7#include "esphome/core/log.h"
17inline void bytes_to_hex(
const uint8_t *data, uint8_t len,
char *out,
size_t out_size) {
22 for (uint8_t i = 0; i < len && pos + 4 < out_size; i++)
23 pos += snprintf(out + pos, out_size - pos,
"%02X ", data[i]);
26#ifdef IOHOME_FRAME_LOG
27inline void log_frame(
const char *prefix,
const uint8_t *data, uint8_t len, uint32_t freq, uint16_t preamble = 0) {
31 ESP_LOGI(
"io_frame",
"%s [%u bytes] freq=%u preamble=%u: %s", prefix, len, freq, preamble, hex);
33 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.