|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Internal exchange-state model for hub-owned authenticated non‑pairing flows. More...
#include "proto_frame.h"#include "radio_interface.h"#include <cstdint>#include <functional>#include <string>Go to the source code of this file.
Classes | |
| struct | esphome::home_io_control::exchange::OutboundExchangeContext |
| Context carried across one outbound authenticated exchange. More... | |
| struct | esphome::home_io_control::exchange::InboundAuthContext |
| Context for a single inbound authentication (device‑initiated command). More... | |
| struct | esphome::home_io_control::ListenSpec |
| How one listen window is to be spent — everything ExchangeEngine::listen() needs; everything else is the handler's business. More... | |
Namespaces | |
| namespace | esphome |
| namespace | esphome::home_io_control |
| namespace | esphome::home_io_control::exchange |
Typedefs | |
| using | esphome::home_io_control::ReplyHandler = std::function<ReplyDisposition(const IoFrame *parsed, const RadioRxPacket &packet)> |
| Invoked for every packet the radio delivers during a listen, before the listen decides whether to keep waiting. | |
Internal exchange-state model for hub-owned authenticated non‑pairing flows.
This module defines the progress-stage enums and context structures used for outbound authenticated exchanges (controller → device) and inbound authentication (device → controller). These are the building blocks that power commands like set_position, request_status, and handling unsolicited status‑update frames.
Note on the enums: ExchangeEngine's blocking helpers drive control flow through the decisions:: classifiers; the state enums below are written at each step but only read back by the exchange debug snapshot, so log lines can name the stage an exchange reached before failing.
Exchange lifecycle (outbound):
Inbound authentication (device-initiated): Device sends a command that requires verification (e.g., CMD_STATUS_UPDATE). Controller challenges with 0x3C, device proves knowledge of system key with 0x3D, controller acknowledges with CMD_STATUS_UPDATE_RESP (0x72).
Both paths rely on the HMAC construction defined in proto_crypto.h which uses AES-128-ECB to encrypt an IV derived from the original frame bytes and a 6-byte random challenge.
This header also defines the shared listen primitive's types (ListenPolicy, ReplyDisposition, ListenOutcome, ReplyHandler, ListenSpec) — the single channel-policy-aware wait loop both ExchangeEngine's outbound waits and PairingEngine's waits are built on. See ExchangeEngine::listen() (exchange_engine.h) for the loop itself.
Definition in file hub_exchange.h.