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

Pure decision logic for the device-role "Accept Foreign Pairing" (system-key extraction) responder. More...

#include "proto_device_model.h"
#include "proto_sizes.h"
#include <cstdint>
Include dependency graph for pairing_responder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esphome::home_io_control::pairing_responder::ResponderContext
 Context for one key-extraction arm cycle. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control
namespace  esphome::home_io_control::pairing_responder

Enumerations

enum class  esphome::home_io_control::pairing_responder::ResponderState : uint8_t {
  esphome::home_io_control::pairing_responder::DISARMED , esphome::home_io_control::pairing_responder::ARMED_IDLE , esphome::home_io_control::pairing_responder::SENT_DISCOVER_RESP , esphome::home_io_control::pairing_responder::SENT_CONFIRM_ACK ,
  esphome::home_io_control::pairing_responder::SENT_CHALLENGE , esphome::home_io_control::pairing_responder::EXTRACTED
}
 State machine for the device-role key-extraction responder. More...

Functions

const char * esphome::home_io_control::pairing_responder::responder_stage_name (ResponderState state)
 Get a short, log/telemetry-friendly name for a responder state.
bool esphome::home_io_control::pairing_responder::on_discover_request (ResponderContext &ctx)
 Decide how to react to an inbound CMD_DISCOVER_REQ (0x28) while armed.
bool esphome::home_io_control::pairing_responder::on_discover_confirm (ResponderContext &ctx)
 Decide how to react to an inbound CMD_DISCOVER_CONFIRM (0x2C) addressed to our throwaway ID.
bool esphome::home_io_control::pairing_responder::on_key_init (ResponderContext &ctx, const uint8_t challenge[HMAC_SIZE], const uint8_t hub_node_id[NODE_ID_SIZE])
 Decide how to react to an inbound CMD_KEY_INIT (0x31) addressed to our throwaway ID.
bool esphome::home_io_control::pairing_responder::on_key_transfer (ResponderContext &ctx, const uint8_t transfer_payload[AES_KEY_SIZE])
 Decide how to react to an inbound CMD_KEY_TRANSFER (0x32) while armed.

Detailed Description

Pure decision logic for the device-role "Accept Foreign Pairing" (system-key extraction) responder.

Mirrors hub_pairing.h's PairingState enum but for the reverse role: here the hub emulates an unpaired device so a user's existing (foreign) hub can pair to it and hand over its node_id/system_key. This lets a user recover credentials from an installation they already own without a separate sniffing tool or a device reset.

This header holds only the pure state-transition decisions (no radio I/O, no timers), matching hub_decisions.h's split, so it is directly host-testable. The impure orchestration — arming, throwaway node-ID generation, transmitting replies, the auto-off timer, and the security log block — lives on IOHomeControlComponent (hub_key_extraction.cpp), which calls into this header from the 0x28/0x2C/0x31/0x32 branches in process_received_packet_() (hub_status.cpp).

Definition in file pairing_responder.h.