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

Pure transition helpers for hub-owned exchange and pairing frame decisions. More...

#include "proto_frame.h"
#include <cstdint>
#include <cstring>
Include dependency graph for hub_decisions.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::decisions

Enumerations

enum class  esphome::home_io_control::decisions::ExchangeFirstResponseDisposition : uint8_t { esphome::home_io_control::decisions::IGNORE_UNRELATED , esphome::home_io_control::decisions::COMPLETE_DIRECT , esphome::home_io_control::decisions::REQUIRE_AUTH }
 Disposition for the first response in an authenticated exchange. More...
enum class  esphome::home_io_control::decisions::ExchangeFinalResponseDisposition : uint8_t { esphome::home_io_control::decisions::IGNORE_UNRELATED , esphome::home_io_control::decisions::ACCEPT }
 Disposition for the final response after authentication. More...
enum class  esphome::home_io_control::decisions::PairingDiscoveryDisposition : uint8_t { esphome::home_io_control::decisions::NO_RESPONSE , esphome::home_io_control::decisions::INVALID , esphome::home_io_control::decisions::ACCEPT }
 Disposition during pairing discovery phase. More...
enum class  esphome::home_io_control::decisions::PairingKeyChallengeDisposition : uint8_t { esphome::home_io_control::decisions::IGNORE , esphome::home_io_control::decisions::ACCEPT }
 Disposition during pairing key-challenge phase. More...

Functions

bool esphome::home_io_control::decisions::is_exchange_internal_command (uint8_t cmd)
 Returns true for commands that are internal to an exchange handshake and carry no useful information for a passive observer (challenge request/response).
bool esphome::home_io_control::decisions::frame_matches_nodes (const IoFrame &frame, const uint8_t expected_src[NODE_ID_SIZE], const uint8_t expected_dst[NODE_ID_SIZE])
 Check if two frames have identical src/dst node IDs.
bool esphome::home_io_control::decisions::frame_matches_exchange_endpoints (const IoFrame &request, const IoFrame &candidate)
 Check if candidate frame endpoints are the reverse of the request (dst==request.src, src==request.dst).
ExchangeFirstResponseDisposition esphome::home_io_control::decisions::classify_exchange_first_response (const IoFrame &request, const IoFrame &candidate)
 Decide how to handle the first response packet in an authenticated exchange.
ExchangeFinalResponseDisposition esphome::home_io_control::decisions::classify_exchange_final_response (const IoFrame &request, const IoFrame &candidate)
 Decide if a candidate frame is an acceptable final response after authentication.
PairingDiscoveryDisposition esphome::home_io_control::decisions::classify_pairing_discovery_response (const IoFrame &candidate)
 Decide if a frame is a valid discovery response (0x29) during pairing.
PairingKeyChallengeDisposition esphome::home_io_control::decisions::classify_pairing_key_challenge (const IoFrame &candidate, const uint8_t device_id[NODE_ID_SIZE], const uint8_t controller_id[NODE_ID_SIZE])
 Decide if a frame is a valid key-challenge (0x3C) during pairing key exchange.
uint32_t esphome::home_io_control::decisions::response_wait_slice_ms (uint32_t remaining_ms)
 Slice remaining wait time into bounded intervals to allow frequency hopping.

Detailed Description

Pure transition helpers for hub-owned exchange and pairing frame decisions.

This header contains inline, testable decision logic: frame classification for exchange and pairing flows, plus shared timing utilities. No state, no side effects — suitable for unit testing without radio hardware.

Definition in file hub_decisions.h.