Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
log_helpers.h File Reference

Hub-layer log tag and log/format helpers shared by the hub and its collaborators. More...

#include "log_frame.h"
#include "proto_frame.h"
#include "proto_sizes.h"
#include "radio_interface.h"
#include "esphome/core/log.h"
#include <array>
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <string>
Include dependency graph for log_helpers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  esphome
namespace  esphome::home_io_control
namespace  esphome::home_io_control::detail

Functions

std::string esphome::home_io_control::detail::format_name_and_hex (const char *name, uint8_t value)
 Format a name/value pair as "name(0xXX)", e.g. "execute(0x00)".
std::string esphome::home_io_control::detail::format_key_hex (const uint8_t key[AES_KEY_SIZE])
 Format a 16-byte key as an uppercase, unseparated hex string for display.
void esphome::home_io_control::detail::log_component_capture (const RadioDriver *radio, const char *stage, const uint8_t *buf, uint8_t len, const IoFrame *frame=nullptr)
 Log a frame at the "io_capture" tag with structured fields.
void esphome::home_io_control::detail::log_multiline_result (const char *tag, bool is_warning, const std::string &prefix, const std::string &message)
 Log prefix followed by message, one line per log call rather than one call for the whole (possibly multi-line) string.

Variables

constexpr const char * esphome::home_io_control::detail::TAG = "home_io_control"
 Shared log tag for hub-level messages.
constexpr size_t esphome::home_io_control::detail::NAME_AND_HEX_BUFFER_SIZE = 40
 Buffer size for format_name_and_hex(): longest command name plus "(0xXX)" and a margin.

Detailed Description

Hub-layer log tag and log/format helpers shared by the hub and its collaborators.

Carries no dependency on the hub itself, so a collaborator that only needs to log can include this header instead of the hub's private helpers (make include-graph enforces that split).

Definition in file log_helpers.h.