Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::IoFrame Struct Reference

Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data). More...

#include <proto_frame.h>

Collaboration diagram for esphome::home_io_control::IoFrame:

Public Attributes

uint8_t ctrl0
 Control byte 0: flags + length.
uint8_t ctrl1
 Control byte 1: low power, beacon, etc.
uint8_t dst [NODE_ID_SIZE]
 Destination node ID (3 bytes).
uint8_t src [NODE_ID_SIZE]
 Source node ID (3 bytes).
uint8_t cmd
 Command ID.
uint8_t data [FRAME_MAX_DATA_SIZE]
 Command parameters (0–23 bytes). Never includes mac.
uint8_t data_len
 Actual length of data.
uint8_t mac [HMAC_SIZE]
 Out-of-length authenticator trailer; meaningful only when has_mac.
bool has_mac = false
 True if this frame carries the mac trailer (see struct doc).

Detailed Description

Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data).

Over the air layout: [CTRL0][CTRL1][DST 3B][SRC 3B][CMD][DATA 0-23B][MAC 0/6B][CRC 2B]. The on-air CRC is the radio driver's responsibility (hardware or software, depending on the chip); it is not included in this struct.

The MAC trailer exists because at least one frame shape's authenticator does not fit inside CTRL0's 5-bit length field alongside its payload: a 1W CMD 0x30 "add controller" frame is 29 declared bytes plus a 6-byte MAC, and 35 has no 5-bit encoding. That MAC rides after the declared length instead — still under the CRC, but outside what CTRL0's length bits describe — so it is modeled as a distinct trailer rather than folded into data[]. has_mac is false for every frame shape that predates this (i.e. everything except a MAC-bearing 1W frame), so data_len/frame_length() keep meaning exactly what they meant before this field existed.

Definition at line 88 of file proto_frame.h.

Member Data Documentation

◆ cmd

uint8_t esphome::home_io_control::IoFrame::cmd

Command ID.

Definition at line 93 of file proto_frame.h.

◆ ctrl0

uint8_t esphome::home_io_control::IoFrame::ctrl0

Control byte 0: flags + length.

Definition at line 89 of file proto_frame.h.

◆ ctrl1

uint8_t esphome::home_io_control::IoFrame::ctrl1

Control byte 1: low power, beacon, etc.

Definition at line 90 of file proto_frame.h.

◆ data

uint8_t esphome::home_io_control::IoFrame::data[FRAME_MAX_DATA_SIZE]

Command parameters (0–23 bytes). Never includes mac.

Definition at line 94 of file proto_frame.h.

◆ data_len

uint8_t esphome::home_io_control::IoFrame::data_len

Actual length of data.

FRAME_MIN_SIZE + data_len == frame_length() always holds, trailer or not — see mac/has_mac.

Definition at line 95 of file proto_frame.h.

◆ dst

uint8_t esphome::home_io_control::IoFrame::dst[NODE_ID_SIZE]

Destination node ID (3 bytes).

Definition at line 91 of file proto_frame.h.

◆ has_mac

bool esphome::home_io_control::IoFrame::has_mac = false

True if this frame carries the mac trailer (see struct doc).

Definition at line 98 of file proto_frame.h.

◆ mac

uint8_t esphome::home_io_control::IoFrame::mac[HMAC_SIZE]

Out-of-length authenticator trailer; meaningful only when has_mac.

Definition at line 97 of file proto_frame.h.

◆ src

uint8_t esphome::home_io_control::IoFrame::src[NODE_ID_SIZE]

Source node ID (3 bytes).

Definition at line 92 of file proto_frame.h.


The documentation for this struct was generated from the following file: