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

Enumerations

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

Functions

bool 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 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 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 classify_exchange_first_response (const IoFrame &request, const IoFrame &candidate)
 Decide how to handle the first response packet in an authenticated exchange.
ExchangeFinalResponseDisposition classify_exchange_final_response (const IoFrame &request, const IoFrame &candidate)
 Decide if a candidate frame is an acceptable final response after authentication.
PairingDiscoveryDisposition classify_pairing_discovery_response (const IoFrame &candidate)
 Decide if a frame is a valid discovery response (0x29) during pairing.
PairingKeyChallengeDisposition 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 response_wait_slice_ms (uint32_t remaining_ms)
 Slice remaining wait time into bounded intervals to allow frequency hopping.

Enumeration Type Documentation

◆ ExchangeFinalResponseDisposition

Disposition for the final response after authentication.

Enumerator
IGNORE_UNRELATED 

Frame doesn't match endpoints — ignore.

ACCEPT 

Frame matches expected response — exchange succeeds.

Definition at line 27 of file hub_decisions.h.

◆ ExchangeFirstResponseDisposition

Disposition for the first response in an authenticated exchange.

Enumerator
IGNORE_UNRELATED 

Frame doesn't match endpoints or failed parse — keep waiting.

COMPLETE_DIRECT 

Matching non-challenge frame — operation complete, no auth needed.

REQUIRE_AUTH 

Matching 0x3C challenge — device demands authentication.

Definition at line 20 of file hub_decisions.h.

◆ PairingDiscoveryDisposition

Disposition during pairing discovery phase.

Enumerator
NO_RESPONSE 

No packets received on the channel within timeout.

INVALID 

Packets seen but none were valid discovery (0x29) frames.

ACCEPT 

Valid discovery response received.

Definition at line 33 of file hub_decisions.h.

◆ PairingKeyChallengeDisposition

Disposition during pairing key-challenge phase.

Enumerator
IGNORE 

Not a valid challenge (wrong cmd, length, or sender).

ACCEPT 

Valid 0x3C challenge from target device.

Definition at line 40 of file hub_decisions.h.

Function Documentation

◆ classify_exchange_final_response()

ExchangeFinalResponseDisposition esphome::home_io_control::decisions::classify_exchange_final_response ( const IoFrame & request,
const IoFrame & candidate )
inline

Decide if a candidate frame is an acceptable final response after authentication.

Only endpoint matching is checked here; command validity is encoded in the disposition mapping by the caller.

Parameters
requestOriginal outbound request frame.
candidateParsed IoFrame from the device.
Returns
ACCEPT if endpoints match; IGNORE_UNRELATED otherwise.

Definition at line 98 of file hub_decisions.h.

Here is the call graph for this function:

◆ classify_exchange_first_response()

ExchangeFirstResponseDisposition esphome::home_io_control::decisions::classify_exchange_first_response ( const IoFrame & request,
const IoFrame & candidate )
inline

Decide how to handle the first response packet in an authenticated exchange.

Used by wait_for_first_response_() to determine whether the exchange:

  • completes immediately (direct response),
  • requires authentication (challenge received), or
  • should ignore the frame and keep waiting.
Parameters
requestOriginal outbound request frame.
candidateParsed IoFrame from the device.
Returns
Disposition indicating next step.

Definition at line 79 of file hub_decisions.h.

Here is the call graph for this function:

◆ classify_pairing_discovery_response()

PairingDiscoveryDisposition esphome::home_io_control::decisions::classify_pairing_discovery_response ( const IoFrame & candidate)
inline

Decide if a frame is a valid discovery response (0x29) during pairing.

Parameters
candidateParsed IoFrame.
Returns
ACCEPT if command is CMD_DISCOVER_RESP; INVALID otherwise.

Definition at line 110 of file hub_decisions.h.

◆ classify_pairing_key_challenge()

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] )
inline

Decide if a frame is a valid key-challenge (0x3C) during pairing key exchange.

The challenge must:

  • be CMD_CHALLENGE_REQ,
  • have data_len == HMAC_SIZE (6),
  • originate from the discovered device node ID,
  • be addressed to this controller's node ID.
Parameters
candidateParsed IoFrame.
device_idNode ID of the device being paired (expected sender).
controller_idNode ID of this controller (expected destination).
Returns
ACCEPT if all criteria met; IGNORE otherwise.

Definition at line 127 of file hub_decisions.h.

Here is the call graph for this function:

◆ frame_matches_exchange_endpoints()

bool esphome::home_io_control::decisions::frame_matches_exchange_endpoints ( const IoFrame & request,
const IoFrame & candidate )
inline

Check if candidate frame endpoints are the reverse of the request (dst==request.src, src==request.dst).

Definition at line 63 of file hub_decisions.h.

Here is the call graph for this function:

◆ frame_matches_nodes()

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] )
inline

Check if two frames have identical src/dst node IDs.

Definition at line 56 of file hub_decisions.h.

◆ is_exchange_internal_command()

bool esphome::home_io_control::decisions::is_exchange_internal_command ( uint8_t cmd)
inline

Returns true for commands that are internal to an exchange handshake and carry no useful information for a passive observer (challenge request/response).

These frames appear in every authenticated exchange between other controllers and devices on the network, but contain only ephemeral cryptographic data.

Definition at line 51 of file hub_decisions.h.

◆ response_wait_slice_ms()

uint32_t esphome::home_io_control::decisions::response_wait_slice_ms ( uint32_t remaining_ms)
inline

Slice remaining wait time into bounded intervals to allow frequency hopping.

The wait loops (exchange and pairing) use this to avoid blocking the radio for too long without hopping. Each slice is at most RESPONSE_CHANNEL_WAIT_MS.

Parameters
remaining_msTotal time left in the wait window.
Returns
Time slice to wait in milliseconds.

Definition at line 148 of file hub_decisions.h.