116 [[nodiscard]] uint8_t
event_count()
const {
return this->event_count_; }
118 [[nodiscard]] uint16_t
heard_count()
const {
return this->heard_count_; }
124 [[nodiscard]]
bool truncated()
const {
return this->truncated_; }
132 [[nodiscard]] uint8_t
lbt_retries()
const {
return this->lbt_retries_; }
136 [[nodiscard]]
const uint8_t *
paired_node_id()
const {
return this->paired_node_id_; }
159 uint8_t aux,
bool oneway);
162 uint8_t event_count_{0};
163 uint16_t heard_count_{0};
164 bool truncated_{
false};
165 uint32_t start_ms_{0};
170 uint8_t discovery_attempts_{0};
171 uint8_t lbt_retries_{0};
172 bool has_paired_device_{
false};
175 std::string advice_codes_;
Fixed-size per-attempt telemetry recorder for the pairing flow.
void record_rx_reject(const IoFrame &frame, int16_t rssi)
Record that we received a frame that parsed but was rejected by a classifier.
void increment_discovery_attempt()
Increment the discovery attempt counter (one call per discovery command retry).
void set_paired_device(const uint8_t node_id[NODE_ID_SIZE], DeviceType type)
Record the successfully paired device, if any.
void set_advice_codes(const std::string &codes)
Record the advisor's short advice codes for the ;advice= result-sensor field.
PairingOutcome outcome() const
void set_phase(pairing::PairingState phase)
Record a pairing state-machine phase transition.
std::string result_sensor_string() const
Render the frozen v1; machine-readable result string.
const uint8_t * paired_node_id() const
uint32_t duration_ms() const
void record_tx(uint8_t cmd)
Record that we transmitted a frame.
void record_hop()
Record a frequency hop while waiting.
void log_summary() const
Emit a multi-line human-readable summary via ESP_LOGI. Call once, at the end of the attempt.
uint8_t event_count() const
void record_lbt_defer(int16_t rssi)
Record a listen-before-talk defer (channel busy).
uint16_t heard_count() const
const PairingTelemetryEvent * events() const
void begin()
Reset all state and start a new attempt. Call once at discover_and_pair() entry.
pairing::PairingState phase() const
void set_outcome(PairingOutcome outcome)
Record the final outcome of the attempt.
DeviceType paired_device_type() const
void record_rx(const IoFrame &frame, int16_t rssi)
Record that we received and accepted a frame.
uint8_t discovery_attempts() const
bool has_paired_device() const
uint8_t lbt_retries() const
Internal pairing-state model for hub‑owned discovery and key‑exchange flows.
PairingState
State machine for the three‑phase pairing flow.
@ IDLE
No pairing in progress; idle state.
static constexpr uint8_t NODE_ID_SIZE
Device/node addresses are 3 bytes (e.g., "123ABC").
DeviceType
Device type identifiers reported by IO‑Homecontrol products.
@ UNKNOWN
Unknown/unspecified device.
PairingTelemetryEventKind
Kind of a recorded telemetry event.
@ PHASE
The pairing state machine advanced to a new phase.
@ RX_REJECT
We received a frame that parsed but was rejected (wrong source, wrong command, etc....
@ HOP
The radio hopped to a different channel while waiting.
@ TX
We transmitted a frame.
@ LBT_DEFER
A listen-before-talk check deferred a transmit because the channel was busy.
@ RX
We received and accepted a frame for the current wait.
static constexpr uint8_t PAIRING_TELEMETRY_MAX_EVENTS
Maximum number of events recorded per pairing attempt.
PairingOutcome
Final disposition of a pairing attempt, used by the result sensor string.
@ INVALID_RESPONSE
Discovery saw traffic but nothing valid.
@ KEY_EXCHANGE_FAILED
Discovery succeeded but the key exchange did not complete.
@ PAIRED
All three phases completed successfully.
@ CONFIG_FAILED
Key exchange succeeded but SetConfig1 failed (still counted as paired).
@ NO_RESPONSE
No device responded to discovery.
@ NONE
No attempt has completed yet (initial state).
@ NONE
target_fw is unknown, or its required bootloader matches bootloader_version.
IO-Homecontrol device-type model, capabilities and runtime device state.
IO-Homecontrol 2W frame container: control bytes, IoFrame and (de)serialization.
Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data).
One recorded telemetry event.
uint8_t cmd
Frame command byte (TX/RX/RX_REJECT); unused otherwise.
PairingTelemetryEventKind kind
What happened.
bool oneway
CTRL0 1W-protocol bit (RX/RX_REJECT only); false otherwise.
uint32_t millis_offset
millis() at record time, relative to PairingTelemetry::begin().
uint8_t dst_node[NODE_ID_SIZE]
Destination node ID (RX/RX_REJECT only); zero otherwise.
int16_t rssi
RSSI in dBm (RX/RX_REJECT/LBT_DEFER); zero otherwise.
uint8_t aux
Kind-specific extra byte: PHASE -> pairing::PairingState value; LBT_DEFER -> retry number reached; un...
uint8_t src_node[NODE_ID_SIZE]
Sender node ID (RX/RX_REJECT only); zero otherwise.