Refactor RF Configuration Management (#2245)

- Introduced RFConfiguration class to encapsulate RF settings and operations.
- Replaced direct usage of RFConfig structure with iRFConfig instance across multiple files.
- Updated frequency handling in actuatorSomfy, gatewayPilight, gatewayRF, and gatewayRF2 to use iRFConfig.
- Modified webUI to interact with iRFConfig for RF settings management.
- Removed deprecated RFConfig structure and related functions.
- Enhanced JSON handling for RF configuration loading and saving.
- Improved logging for RF configuration operations.
This commit is contained in:
Alessandro Staniscia authored and GitHub committed 2025-12-07 09:56:15 -06:00
1 parent 401be5f10c
commit c6b2aae965
12 files changed
+553 -206

No files matched your search

+5 -11
View File
@@ -25,11 +25,11 @@
*/
#ifndef config_RF_h
#define config_RF_h
#pragma once
#include "TheengsCommon.h"
#include <rf/RFConfiguration.h>
#ifdef ZgatewayRF
extern void setupRF();
extern void RFtoX();
extern void XtoRF(const char* topicOri, const char* datacallback);
extern void XtoRF(const char* topicOri, JsonObject& RFdata);
@@ -137,6 +137,9 @@ const char parameters[51][4][24] = {
# define DISCOVERY_TRACE_LOG(...)
# endif
#endif
extern RFConfiguration iRFConfig;
/*-------------------RF topics & parameters----------------------*/
//433Mhz MQTT Subjects and keys
#define subjectMQTTtoRF "/commands/MQTTto433"
@@ -198,13 +201,6 @@ const char parameters[51][4][24] = {
* 4 = ZgatewayRF2
*/
struct RFConfig_s {
float frequency;
int rssiThreshold;
int newOokThreshold;
int activeReceiver;
};
#define ACTIVE_NONE -1
#define ACTIVE_RECERROR 0
#define ACTIVE_PILIGHT 1
@@ -224,8 +220,6 @@ struct RFConfig_s {
# define ACTIVE_RECEIVER ACTIVE_NONE
#endif
extern RFConfig_s RFConfig;
/*-------------------CC1101 DefaultTXPower----------------------*/
//Adjust the default TX-Power for sending radio if ZradioCC1101 is used.
//The following settings are possible depending on the frequency band. (-30 -20 -15 -10 -6 0 5 7 10 11 12) Default is max!