From 27e89ee70be6f9f3c782a602938e5dd3d4888ad2 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sat, 24 Oct 2026 09:15:48 +0300 Subject: [PATCH] feat: added sensor pairing to gateway --- zh_rf_config.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/zh_rf_config.h b/zh_rf_config.h index 5beebd6..5bd4bb4 100644 --- a/zh_rf_config.h +++ b/zh_rf_config.h @@ -67,6 +67,22 @@ extern "C" int16_t value_10; /*!< Tenth measurement or status value */ } zh_rf_sensor_transmitted_data_t; + /** + * @brief States of the RF sensor pairing state machine. + * + * Describes the current step of the pairing exchange between a sensor and + * the hub. The machine cycles through sending a pairing request, waiting + * for the transmission to complete, listening for the acknowledge, and + * backing off before retrying when no answer arrived. + */ + typedef enum + { + ZH_RF_PAIR_SEND, /*!< Build and submit a pairing request packet for transmission */ + ZH_RF_PAIR_TX_WAIT, /*!< Wait until the radio has finished sending the request */ + ZH_RF_PAIR_RX_WAIT, /*!< Listen for the acknowledge packet from the hub */ + ZH_RF_PAIR_BACKOFF /*!< Idle for a random delay before restarting the pairing attempt */ + } zh_rf_sensor_pairing_state_t; + /** * @brief Pairing packet exchanged between a sensor and the hub. *