Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
tuning_config.h
Go to the documentation of this file.
1#pragma once
2
3/// @file tuning_config.h
4/// @brief Runtime tuning configuration for pairing and radio diagnostics.
5/// @ingroup hioc_tuning
6///
7/// Provides a centralized, non-persistent tuning layer used by the hub and radio
8/// drivers. The `TuningConfig` struct carries all tunable parameters and helpers
9/// for logging and applying defaults.
10
11#include "proto_frame.h"
12#include "proto_timing.h"
13
14#include <cstdint>
15#include <optional>
16#include <string>
17#include <vector>
18
19namespace esphome {
20namespace home_io_control {
21
22/// @brief Valid SX1262 RX bandwidth options (kHz register values).
23///
24/// The numeric values are the register-encoded (double-sideband) bandwidth selectors used by
25/// `RadioSX1262::set_rx_bandwidth()`.
26enum class SX1262RxBandwidth : uint8_t {
27 BW_58_6_KHZ = 0x0C, ///< 58.6 kHz — narrowest; SX1276-equivalent width, marginal on the default TX→RX turnaround.
28 BW_78_2_KHZ = 0x1B, ///< 78.2 kHz — narrow.
29 BW_117_3_KHZ = 0x0B, ///< 117.3 kHz — default.
30 BW_156_2_KHZ = 0x09, ///< 156.2 kHz — wider tolerance for LO offset.
31 BW_187_2_KHZ = 0x07, ///< 187.2 kHz — widest selectable option.
32};
33
34/// @brief Valid SX1276 RX bandwidth options (RegRxBw register bytes).
35///
36/// The numeric values are the SX1276 RegRxBw encodings (RxBwMant in bits[4:3], RxBwExp in
37/// bits[2:0]) written verbatim to both REG_RX_BW and REG_AFC_BW. Double-sideband bandwidth =
38/// FXOSC / (RxBwMant * 2^(RxBwExp+2)) with FXOSC = 32 MHz. Narrower rejects more out-of-band
39/// noise (higher sensitivity); wider tolerates more LO frequency offset.
40enum class SX1276RxBandwidth : uint8_t {
41 BW_20_8_KHZ = 0x14, ///< 20.8 kHz — narrowest; maximal noise rejection, least LO-offset tolerance.
42 BW_41_7_KHZ = 0x13, ///< 41.7 kHz — default (validated against real devices).
43 BW_62_5_KHZ = 0x03, ///< 62.5 kHz.
44 BW_83_3_KHZ = 0x12, ///< 83.3 kHz.
45 BW_125_0_KHZ = 0x02, ///< 125.0 kHz — widest selectable option.
46};
47
48/// @brief Valid LR1121 RX bandwidth options (register values).
49///
50/// NOT the same encoding as SX1262, despite the earlier design assumption ("same encoding, same
51/// table") that this enum used to be a type alias of `SX1262RxBandwidth` on. 2026-07-17 hardware
52/// bring-up cross-checked the actual byte values against RadioLib's `LR11x0_commands.h` and found
53/// two of the five borrowed SX1262 values were wrong for this chip: the byte reused here for
54/// "156.2 kHz" actually selects 467.0 kHz on real LR1121 silicon, and the byte reused for
55/// "187.2 kHz" isn't a valid GFSK bandwidth code at all. This is now its own distinct enum with
56/// every value confirmed against RadioLib, plus two narrower options (39.0/46.9 kHz) added for
57/// tuning-bed experimentation — SX1276's own default (41.7 kHz, see `SX1276RxBandwidth`) is
58/// documented as validated against real devices, notably narrower than LR1121/SX1262's shared
59/// 117.3 kHz default, and a plausible lever for the marginal reception seen during bring-up.
60enum class LR1121RxBandwidth : uint8_t {
61 BW_39_0_KHZ = 0x1C, ///< 39.0 kHz — narrowest; close to SX1276's validated 41.7 kHz default.
62 BW_46_9_KHZ = 0x14, ///< 46.9 kHz — narrow.
63 BW_58_6_KHZ = 0x0C, ///< 58.6 kHz.
64 BW_78_2_KHZ = 0x1B, ///< 78.2 kHz.
65 BW_117_3_KHZ = 0x0B, ///< 117.3 kHz — default.
66 BW_156_2_KHZ = 0x1A, ///< 156.2 kHz — wider tolerance for LO offset.
67 BW_187_2_KHZ = 0x12, ///< 187.2 kHz — widest selectable option.
68};
69
70/// @brief Discovery request command codes.
71enum class DiscoveryCommand : uint8_t {
72 DISCOVER = 0x28, ///< Standard broadcast discovery request (to 0x00003B).
73 DISCOVER_SPE = 0x2A, ///< SPE roll-call request (self-authenticating; see CMD_DISCOVER_SPE_REQ).
74 ///< Deliberately **not** offered as a `pairing_discovery_commands` preset
75 ///< in tuning.py: only devices that already hold the system key answer it,
76 ///< so it can never help reach a device in learning mode. Retained here
77 ///< because the command byte is still needed to *send* a roll-call, and
78 ///< because discovery_command_from_string() stays permissive enough to
79 ///< parse it — do not remove either as dead code.
80 DISCOVER_ALT = 0x2E, ///< Alternate broadcast discovery (to 0x00003F), with optional payload byte.
81};
82
83// Chip-specific radio defaults live here beside the TuningConfig fields they initialize — the
84// single source of truth for defaults. proto_timing.h holds only chip-neutral protocol values;
85// the radio drivers consume these via apply_tuning / discovery_hop_slice_ms.
86
87/// SX1262-specific preamble for response/continuation frames within an exchange.
88///
89/// Applies to any tight-turnaround frame sent immediately after receiving from the device —
90/// 0x3D challenge responses, 0x32 key transfers after receiving 0x3C, and any future protocol
91/// frame in that position — giving the peer's receiver time to lock back on after the SX1262's
92/// own TX→RX turnaround.
93///
94/// 8 bytes was validated on real hardware (Heltec V3.2 ↔ Device actuator) as the minimum that
95/// gives reliable lock-on without perturbing exchange timing; it matches the protocol's own
96/// nominal SHORT_PREAMBLE floor.
97///
98/// This constant is byte-denominated, like every other preamble value in this codebase
99/// (LONG_PREAMBLE, SHORT_PREAMBLE) — `RadioSX1262::set_packet_params_()` is the one place that
100/// converts to the chip's bit-denominated SetPacketParams field, right before the value leaves
101/// for the wire.
102static constexpr uint16_t SX1262_RESPONSE_PREAMBLE = 8;
103
104/// SX1262-specific post-TX settling delay before re-entering RX.
105///
106/// The SX1262 GFSK demodulator needs time to stabilize after TX before it can
107/// reliably receive the next frame. A 500 µs delay was validated as the minimum
108/// that prevents challenge-byte corruption during pairing and tight-turnaround
109/// authenticated exchanges.
110static constexpr uint16_t SX1262_POST_TX_SETTLE_US = 500;
111
112/// SX1276 preamble for response/continuation frames within an exchange.
113///
114/// The SX1276 originally reused the protocol's 8-byte SHORT_PREAMBLE for reply frames. A
115/// slightly longer 12-byte preamble was found on real hardware to improve the peer device's
116/// lock-on without measurably affecting exchange timing, so 12 is the default. Runtime-tunable
117/// down to SHORT_PREAMBLE or up for a marginal-range install.
118static constexpr uint16_t SX1276_RESPONSE_PREAMBLE = 12;
119
120/// Per-channel dwell while SX1276 pairing discovery hops across channels.
121///
122/// The SX1276 supports FastHop (no standby transition), so a short slice keeps
123/// discovery sweeping all three channels quickly.
124static constexpr uint16_t SX1276_DISCOVERY_HOP_SLICE_MS = 5;
125
126/// Per-channel dwell while SX1262 pairing discovery hops across channels.
127///
128/// SX1262 frequency changes require a standby→SetRfFrequency→RX cycle, so the
129/// dwell must be much longer than on the SX1276 for short-preamble responses on
130/// alternate channels to be caught reliably.
131static constexpr uint16_t SX1262_DISCOVERY_HOP_SLICE_MS = 200;
132
133/// LR1121-specific preamble for response/continuation frames within an exchange.
134///
135/// Seeded from the SX1262-validated default (design doc §3.2: "seed every timing/tuning
136/// default from the validated SX1262 values ... they encode protocol-side realities more
137/// than chip quirks"). Not yet independently validated on LR1121 hardware — see the
138/// implementation plan's Step 7 (loopback tuning), which folds a measured value back here.
140
141/// LR1121-specific post-TX settling delay before re-entering RX.
142///
143/// Seeded from the SX1262-validated default; same rationale as @ref LR1121_RESPONSE_PREAMBLE.
145
146/// Per-channel dwell while LR1121 pairing discovery hops across channels.
147///
148/// LR1121 frequency changes require a standby→SetRfFrequency→RX cycle, same as the SX1262,
149/// so the dwell is seeded from the SX1262-validated default pending Step 7 hardware tuning.
151
152/// @brief All runtime tunable parameters for pairing and radio diagnostics.
153///
154/// Values reset to their defaults on every boot. Each field initializes from a
155/// canonical constant — chip-neutral defaults live in `proto_timing.h`, chip-specific
156/// defaults in this header — shared with the ESPHome YAML schema. The hub stores a single
157/// `TuningConfig` instance and passes it to the radio driver and pairing flow. UI
158/// callbacks update the hub instance directly; the snapshot helpers emit the current
159/// values in YAML-compatible form so a working combination can be copied back into the
160/// configuration file.
162 // --- Radio / physical layer ---
164 uint16_t sx1262_response_preamble{SX1262_RESPONSE_PREAMBLE}; ///< SX1262 response preamble in bytes.
165 uint16_t sx1262_post_tx_settle_us{SX1262_POST_TX_SETTLE_US}; ///< Delay after SX1262 TX before RX (µs).
167 uint16_t sx1276_response_preamble{SX1276_RESPONSE_PREAMBLE}; ///< SX1276 response preamble in bytes.
169 SX1276_DISCOVERY_HOP_SLICE_MS}; ///< Per-channel dwell while SX1276 discovery hops.
171 SX1262_DISCOVERY_HOP_SLICE_MS}; ///< Per-channel dwell while SX1262 discovery hops.
173 uint16_t lr1121_response_preamble{LR1121_RESPONSE_PREAMBLE}; ///< LR1121 response preamble in bytes.
174 uint16_t lr1121_post_tx_settle_us{LR1121_POST_TX_SETTLE_US}; ///< Delay after LR1121 TX before RX (µs).
176 LR1121_DISCOVERY_HOP_SLICE_MS}; ///< Per-channel dwell while LR1121 discovery hops.
177 uint8_t lbt_max_retries{LBT_MAX_RETRIES}; ///< LBT retries before forced TX.
178 int16_t lbt_rssi_threshold_dbm{LBT_RSSI_THRESHOLD_DBM}; ///< LBT channel-free threshold (dBm).
179
180 // --- Exchange response windows ---
181 // How long the hub listens for a device's reply. Tunable because the right value is a property
182 // of the *device*, not of the radio or the protocol: observed reply latencies on one network
183 // span two orders of magnitude (a mains Oximo 40 at ~23 ms, a solar RS100 at 29-3052 ms). See
184 // RESPONSE_START_WAIT_MS for the measurements behind the defaults.
186 RESPONSE_START_WAIT_MS}; ///< Reply window for a start frame (wakes a sleeping device).
188 RESPONSE_WAIT_MS}; ///< Reply window for continuation frames and the post-auth final response.
189
190 // --- Pairing protocol ---
191 std::vector<DiscoveryCommand> pairing_discovery_commands{
192 DiscoveryCommand::DISCOVER}; ///< Ordered discovery commands.
193 std::vector<uint8_t> pairing_discovery_destination{0x00, 0x00, 0x00}; ///< Destination when auto=false.
194 bool pairing_discovery_destination_auto{true}; ///< When true, map commands to conventional addresses.
195 uint8_t pairing_discovery_payload{0}; ///< Optional payload byte (used for 0x2E).
196 bool pairing_discovery_payload_enabled{false}; ///< Whether the optional payload is enabled.
197 bool pairing_discovery_low_power{false}; ///< Set LOW_POWER flag in discovery frames.
199 PAIRING_DISCOVERY_WAIT_MS}; ///< Total wait window after sending discovery commands.
201 PAIRING_DISCOVERY_INITIAL_DWELL_MS}; ///< Initial dwell on CH2 before discovery hopping begins.
203 PAIRING_KEY_EXCHANGE_RETRIES}; ///< Retries for the authenticated key exchange phase.
204
205 // --- Internal state ---
206 bool active{false}; ///< True when the YAML `tuning:` block is present.
207};
208
209/// @brief Convert a bandwidth enum to the numeric kHz value used in YAML/logs.
210/// @param bw SX1262 bandwidth enum.
211/// @return Floating-point kHz value (58.6, 78.2, 117.3, 156.2, or 187.2).
213
214/// @brief Format a bandwidth enum as its YAML/UI option string (bare kHz number, e.g. "117.3").
215/// @param bw SX1262 bandwidth enum.
216/// @return Bandwidth rendered with one decimal place and a "kHz" suffix.
218
219/// @brief Convert a YAML bandwidth string to the enum value.
220/// @param value YAML string such as "117.3kHz" or "156.2kHz".
221/// @return Bandwidth enum, or std::nullopt on invalid input.
222std::optional<SX1262RxBandwidth> sx1262_bandwidth_from_string(const std::string &value);
223
224/// @brief Convert an SX1276 bandwidth enum to the numeric kHz value used in YAML/logs.
225/// @param bw SX1276 bandwidth enum.
226/// @return Floating-point kHz value (20.8, 41.7, 62.5, 83.3, or 125.0).
228
229/// @brief Format an SX1276 bandwidth enum as its YAML/UI option string (bare kHz number).
230/// @param bw SX1276 bandwidth enum.
231/// @return Bandwidth rendered with one decimal place (e.g. "41.7").
233
234/// @brief Convert a YAML SX1276 bandwidth string to the enum value.
235/// @param value YAML string such as "41.7" or "83.3kHz".
236/// @return Bandwidth enum, or std::nullopt on invalid input.
237std::optional<SX1276RxBandwidth> sx1276_bandwidth_from_string(const std::string &value);
238
239/// @brief Convert an LR1121 bandwidth enum to the numeric kHz value used in YAML/logs.
240/// @param bw LR1121 bandwidth enum.
241/// @return Floating-point kHz value (39.0, 46.9, 58.6, 78.2, 117.3, 156.2, or 187.2).
243
244/// @brief Format an LR1121 bandwidth enum as its YAML/UI option string (bare kHz number).
245/// @param bw LR1121 bandwidth enum.
246/// @return Bandwidth rendered with one decimal place (e.g. "117.3").
248
249/// @brief Convert a YAML LR1121 bandwidth string to the enum value.
250/// @param value YAML string such as "117.3" or "39.0kHz".
251/// @return Bandwidth enum, or std::nullopt on invalid input.
252std::optional<LR1121RxBandwidth> lr1121_bandwidth_from_string(const std::string &value);
253
254/// @brief Format the current tuning configuration as a one-line YAML-compatible snapshot.
255///
256/// Only values that differ from the default are emitted, so the line can be copied
257/// back into YAML with minimal editing. When all values are default, an empty string
258/// is returned.
259///
260/// @param cfg Current tuning configuration.
261/// @return One-line snapshot string, or empty when no overrides are active.
262std::string tuning_config_snapshot(const TuningConfig &cfg);
263
264/// @brief Format the current tuning configuration as a full one-line snapshot.
265///
266/// Emits every non-default value, regardless of whether it was changed from YAML or
267/// from the HA UI. This is logged at the start of every pairing attempt.
268///
269/// @param cfg Current tuning configuration.
270/// @return One-line snapshot string, or a "defaults" marker when nothing is overridden.
271std::string tuning_config_full_snapshot(const TuningConfig &cfg);
272
273/// @brief Format a single tuning update for the log.
274///
275/// @param name YAML key name of the updated parameter.
276/// @param value YAML-compatible string representation of the new value.
277/// @return One-line log string suitable for ESP_LOGI.
278std::string tuning_update_log_line(const std::string &name, const std::string &value);
279
280/// @brief Resolve the destination address for a discovery command.
281///
282/// When `destination_auto` is true, returns the conventional address for the
283/// given command code. Otherwise returns the configured `destination` value.
284///
285/// @param command Discovery command code.
286/// @param destination_auto Whether to use the automatic mapping.
287/// @param destination Explicit 3-byte destination when auto is false.
288/// @return Pointer to the resolved 3-byte node ID.
289const uint8_t *resolve_discovery_destination(uint8_t command, bool destination_auto,
290 const uint8_t destination[NODE_ID_SIZE]);
291
292/// @brief Parse a discovery command string (e.g., "0x28") into the enum.
293/// @param value String to parse.
294/// @return Discovery command enum, or std::nullopt on invalid input.
295std::optional<DiscoveryCommand> discovery_command_from_string(const std::string &value);
296
297/// @brief Format a discovery command enum for YAML/logs.
298/// @param cmd Discovery command enum.
299/// @return Lowercase hex string such as "0x28".
301
302/// @brief Format a destination option for YAML/logs.
303///
304/// @param destination_auto Whether automatic destination mapping is used.
305/// @param destination Explicit 3-byte destination when auto is false.
306/// @return "auto" or a hex address such as "0x00003B".
307std::string discovery_destination_to_string(bool destination_auto, const uint8_t destination[NODE_ID_SIZE]);
308
309/// @brief Format a payload option for YAML/logs.
310///
311/// @param payload_enabled Whether the optional payload is enabled.
312/// @param payload The payload byte when enabled.
313/// @return "none" or a hex byte such as "0x00".
314std::string discovery_payload_to_string(bool payload_enabled, uint8_t payload);
315
316/// @brief Format the ordered discovery command list for logs.
317///
318/// @param commands Ordered list of discovery commands.
319/// @return Bracketed comma-separated list such as "[0x28,0x2E]".
320std::string discovery_commands_to_string(const std::vector<DiscoveryCommand> &commands);
321
322/// @brief Format the ordered discovery command list as a UI/preset option string.
323///
324/// Matches the comma-separated `select` option labels (no brackets) so a boot-time
325/// snapshot round-trips to a selectable dropdown value.
326///
327/// @param commands Ordered list of discovery commands.
328/// @return Comma-separated list such as "0x28,0x2E" (empty string when the list is empty).
329std::string discovery_commands_to_csv(const std::vector<DiscoveryCommand> &commands);
330
331} // namespace home_io_control
332} // namespace esphome
static constexpr uint8_t PAIRING_KEY_EXCHANGE_RETRIES
Retries for the authenticated key-exchange phase.
std::string discovery_commands_to_csv(const std::vector< DiscoveryCommand > &commands)
Format the ordered discovery command list as a UI/preset option string.
static constexpr uint8_t NODE_ID_SIZE
Device/node addresses are 3 bytes (e.g., "123ABC").
Definition proto_sizes.h:20
std::optional< LR1121RxBandwidth > lr1121_bandwidth_from_string(const std::string &value)
Convert a YAML LR1121 bandwidth string to the enum value.
SX1262RxBandwidth
Valid SX1262 RX bandwidth options (kHz register values).
@ BW_58_6_KHZ
58.6 kHz — narrowest; SX1276-equivalent width, marginal on the default TX→RX turnaround.
@ BW_156_2_KHZ
156.2 kHz — wider tolerance for LO offset.
@ BW_187_2_KHZ
187.2 kHz — widest selectable option.
std::string discovery_payload_to_string(bool payload_enabled, uint8_t payload)
Format a payload option for YAML/logs.
std::optional< DiscoveryCommand > discovery_command_from_string(const std::string &value)
Parse a discovery command string (e.g., "0x28") into the enum.
static constexpr uint8_t LBT_MAX_RETRIES
Max carrier-sense attempts before TX anyway.
LR1121RxBandwidth
Valid LR1121 RX bandwidth options (register values).
@ BW_39_0_KHZ
39.0 kHz — narrowest; close to SX1276's validated 41.7 kHz default.
std::string lr1121_bandwidth_to_string(LR1121RxBandwidth bw)
Format an LR1121 bandwidth enum as its YAML/UI option string (bare kHz number).
static constexpr uint16_t SX1276_RESPONSE_PREAMBLE
SX1276 preamble for response/continuation frames within an exchange.
std::string tuning_config_snapshot(const TuningConfig &cfg)
Format the current tuning configuration as a one-line YAML-compatible snapshot.
std::optional< SX1262RxBandwidth > sx1262_bandwidth_from_string(const std::string &value)
Convert a YAML bandwidth string to the enum value.
std::string sx1276_bandwidth_to_string(SX1276RxBandwidth bw)
Format an SX1276 bandwidth enum as its YAML/UI option string (bare kHz number).
float lr1121_bandwidth_to_khz(LR1121RxBandwidth bw)
Convert an LR1121 bandwidth enum to the numeric kHz value used in YAML/logs.
std::string discovery_commands_to_string(const std::vector< DiscoveryCommand > &commands)
Format the ordered discovery command list for logs.
std::string tuning_config_full_snapshot(const TuningConfig &cfg)
Format the current tuning configuration as a full one-line snapshot.
static constexpr uint16_t SX1262_DISCOVERY_HOP_SLICE_MS
Per-channel dwell while SX1262 pairing discovery hops across channels.
float sx1262_bandwidth_to_khz(SX1262RxBandwidth bw)
Convert a bandwidth enum to the numeric kHz value used in YAML/logs.
static constexpr uint16_t LR1121_RESPONSE_PREAMBLE
LR1121-specific preamble for response/continuation frames within an exchange.
std::string sx1262_bandwidth_to_string(SX1262RxBandwidth bw)
Format a bandwidth enum as its YAML/UI option string (bare kHz number, e.g.
static constexpr uint16_t SX1276_DISCOVERY_HOP_SLICE_MS
Per-channel dwell while SX1276 pairing discovery hops across channels.
std::string tuning_update_log_line(const std::string &name, const std::string &value)
Format a single tuning update for the log.
static constexpr uint16_t SX1262_RESPONSE_PREAMBLE
SX1262-specific preamble for response/continuation frames within an exchange.
static constexpr uint16_t PAIRING_DISCOVERY_WAIT_MS
Canonical defaults for the chip-neutral runtime-tunable pairing/discovery parameters.
DiscoveryCommand
Discovery request command codes.
@ DISCOVER_SPE
SPE roll-call request (self-authenticating; see CMD_DISCOVER_SPE_REQ).
@ DISCOVER
Standard broadcast discovery request (to 0x00003B).
@ DISCOVER_ALT
Alternate broadcast discovery (to 0x00003F), with optional payload byte.
float sx1276_bandwidth_to_khz(SX1276RxBandwidth bw)
Convert an SX1276 bandwidth enum to the numeric kHz value used in YAML/logs.
std::string discovery_command_to_string(DiscoveryCommand cmd)
Format a discovery command enum for YAML/logs.
SX1276RxBandwidth
Valid SX1276 RX bandwidth options (RegRxBw register bytes).
@ BW_41_7_KHZ
41.7 kHz — default (validated against real devices).
@ BW_125_0_KHZ
125.0 kHz — widest selectable option.
@ BW_20_8_KHZ
20.8 kHz — narrowest; maximal noise rejection, least LO-offset tolerance.
static constexpr int32_t RESPONSE_WAIT_MS
Wait for response to non-start frame.
static constexpr uint16_t SX1262_POST_TX_SETTLE_US
SX1262-specific post-TX settling delay before re-entering RX.
std::optional< SX1276RxBandwidth > sx1276_bandwidth_from_string(const std::string &value)
Convert a YAML SX1276 bandwidth string to the enum value.
static constexpr uint16_t LR1121_POST_TX_SETTLE_US
LR1121-specific post-TX settling delay before re-entering RX.
static constexpr uint16_t LR1121_DISCOVERY_HOP_SLICE_MS
Per-channel dwell while LR1121 pairing discovery hops across channels.
const uint8_t * resolve_discovery_destination(uint8_t command, bool destination_auto, const uint8_t destination[NODE_ID_SIZE])
Resolve the destination address for a discovery command.
std::string discovery_destination_to_string(bool destination_auto, const uint8_t destination[NODE_ID_SIZE])
Format a destination option for YAML/logs.
static constexpr int16_t LBT_RSSI_THRESHOLD_DBM
Listen-before-talk (LBT) parameters for ETSI EN 300 220 compliance.
static constexpr uint16_t PAIRING_DISCOVERY_INITIAL_DWELL_MS
Dwell on CH2 before discovery hopping begins.
static constexpr int32_t RESPONSE_START_WAIT_MS
Wait for a response to a start frame — the first frame of an exchange, and the one a sleeping device ...
IO-Homecontrol 2W frame container: control bytes, IoFrame and (de)serialization.
Physical-layer radio and timing parameters for the IO-Homecontrol protocol.
All runtime tunable parameters for pairing and radio diagnostics.
bool active
True when the YAML tuning: block is present.
uint16_t pairing_discovery_initial_dwell_ms
Initial dwell on CH2 before discovery hopping begins.
bool pairing_discovery_destination_auto
When true, map commands to conventional addresses.
SX1276RxBandwidth sx1276_rx_bandwidth
SX1276 RX bandwidth selector.
int16_t lbt_rssi_threshold_dbm
LBT channel-free threshold (dBm).
SX1262RxBandwidth sx1262_rx_bandwidth
SX1262 RX bandwidth selector.
std::vector< uint8_t > pairing_discovery_destination
Destination when auto=false.
std::vector< DiscoveryCommand > pairing_discovery_commands
Ordered discovery commands.
uint16_t lr1121_discovery_hop_slice_ms
Per-channel dwell while LR1121 discovery hops.
uint16_t sx1276_response_preamble
SX1276 response preamble in bytes.
uint16_t exchange_response_wait_ms
Reply window for continuation frames and the post-auth final response.
uint16_t sx1262_post_tx_settle_us
Delay after SX1262 TX before RX (µs).
uint8_t pairing_key_exchange_retries
Retries for the authenticated key exchange phase.
bool pairing_discovery_low_power
Set LOW_POWER flag in discovery frames.
uint16_t sx1276_discovery_hop_slice_ms
Per-channel dwell while SX1276 discovery hops.
uint16_t exchange_start_response_wait_ms
Reply window for a start frame (wakes a sleeping device).
uint16_t sx1262_response_preamble
SX1262 response preamble in bytes.
uint16_t pairing_discovery_wait_ms
Total wait window after sending discovery commands.
bool pairing_discovery_payload_enabled
Whether the optional payload is enabled.
LR1121RxBandwidth lr1121_rx_bandwidth
LR1121 RX bandwidth selector.
uint16_t lr1121_post_tx_settle_us
Delay after LR1121 TX before RX (µs).
uint8_t lbt_max_retries
LBT retries before forced TX.
uint16_t sx1262_discovery_hop_slice_ms
Per-channel dwell while SX1262 discovery hops.
uint16_t lr1121_response_preamble
LR1121 response preamble in bytes.
uint8_t pairing_discovery_payload
Optional payload byte (used for 0x2E).