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

Fundamental IO-Homecontrol frame and crypto size constants. More...

#include <cstdint>
Include dependency graph for proto_sizes.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

Variables

static constexpr uint8_t esphome::home_io_control::NODE_ID_SIZE = 3
 Device/node addresses are 3 bytes (e.g., "123ABC").
static constexpr uint8_t esphome::home_io_control::NODE_ID_STRING_SIZE = (NODE_ID_SIZE * 2) + 1
 Uppercase hex node ID plus null terminator.
static constexpr uint8_t esphome::home_io_control::HMAC_SIZE = 6
 Authentication HMAC is 6 bytes (truncated AES output).
static constexpr uint8_t esphome::home_io_control::AES_KEY_SIZE = 16
 AES-128 key size.
static constexpr uint8_t esphome::home_io_control::AES_BLOCK_SIZE = 16
 AES block size.
static constexpr uint8_t esphome::home_io_control::IV_SIZE = 16
 Initialization vector size for AES.
static constexpr uint8_t esphome::home_io_control::IV_PADDING = 0x55
 Padding byte used in IV construction.
static constexpr uint8_t esphome::home_io_control::BITS_PER_BYTE = 8
 Number of bits in one protocol byte.
static constexpr uint8_t esphome::home_io_control::FRAME_MIN_SIZE = 9
 Minimum frame: CTRL0+CTRL1+DST(3)+SRC(3)+CMD(1).
static constexpr uint8_t esphome::home_io_control::FRAME_MAX_DECLARED_SIZE = 32
 Largest frame length CTRL0's 5-bit length field (bits [4:0], length - 1) can express.
static constexpr uint8_t esphome::home_io_control::FRAME_MAX_SIZE = FRAME_MAX_DECLARED_SIZE
 Historical name for FRAME_MAX_DECLARED_SIZE, kept as an alias rather than a second literal so the two names can never disagree — most call sites (set_cmd, serialize, parse, every fixed-size frame buffer that only ever holds a declared-length frame) predate the trailer/wire distinction and still read most naturally as "the max frame size".
static constexpr uint8_t esphome::home_io_control::FRAME_MAX_DATA_SIZE = 23
 Maximum data bytes after command ID (declared length - header).
static constexpr uint8_t esphome::home_io_control::FRAME_CMD_OFFSET = 8
 Byte offset of the command ID in a raw wire buffer.
static constexpr uint8_t esphome::home_io_control::FRAME_CRC_SIZE = 2
 Size of the on-air CRC-CCITT trailer appended after every frame (declared bytes, plus the out-of-length MAC trailer when present).
static constexpr uint8_t esphome::home_io_control::FRAME_MAX_TRAILER_SIZE = HMAC_SIZE
 Largest out-of-length authenticator a frame can carry.
static constexpr uint8_t esphome::home_io_control::FRAME_MAX_WIRE_SIZE = FRAME_MAX_DECLARED_SIZE + FRAME_MAX_TRAILER_SIZE + FRAME_CRC_SIZE
 Largest number of bytes a buffer must hold to receive or transmit any frame this project knows about, trailer and CRC included: FRAME_MAX_DECLARED_SIZE (what CTRL0 can declare).

Detailed Description

Fundamental IO-Homecontrol frame and crypto size constants.

These sizes are the lowest layer of the protocol model: node-ID widths, AES/HMAC sizes and frame bounds. They live in their own header so the other protocol headers can depend on them without pulling in the full frame API.

Definition in file proto_sizes.h.