Make all variables configurable.

This commit is contained in:
Balazs Kelemen
2022-01-12 09:26:42 +01:00
parent f5004a66a1
commit 3fa00f603b
11 changed files with 165 additions and 67 deletions

View File

@@ -79,6 +79,17 @@ typedef enum _PositionFlags {
PositionFlags_POS_TIMESTAMP = 256
} PositionFlags;
typedef enum _InputEventChar {
InputEventChar_NULL = 0,
InputEventChar_UP = 17,
InputEventChar_DOWN = 18,
InputEventChar_LEFT = 19,
InputEventChar_RIGHT = 20,
InputEventChar_SELECT = 10,
InputEventChar_BACK = 27,
InputEventChar_CANCEL = 24
} InputEventChar;
typedef enum _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType {
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11 = 0,
RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20 = 1
@@ -157,6 +168,17 @@ typedef struct _RadioConfig_UserPreferences {
char mqtt_password[32];
bool is_lora_tx_disabled;
bool is_power_saving;
bool rotary1_enabled;
uint32_t rotary1_pin_a;
uint32_t rotary1_pin_b;
uint32_t rotary1_pin_press;
InputEventChar rotary1_event_cw;
InputEventChar rotary1_event_ccw;
InputEventChar rotary1_event_press;
bool canned_message_plugin_enabled;
char canned_message_plugin_allow_input_origin[16];
char canned_message_plugin_messages[1024];
bool canned_message_plugin_send_bell;
} RadioConfig_UserPreferences;
typedef struct _RadioConfig {
@@ -190,6 +212,10 @@ typedef struct _RadioConfig {
#define _PositionFlags_MAX PositionFlags_POS_TIMESTAMP
#define _PositionFlags_ARRAYSIZE ((PositionFlags)(PositionFlags_POS_TIMESTAMP+1))
#define _InputEventChar_MIN InputEventChar_NULL
#define _InputEventChar_MAX InputEventChar_BACK
#define _InputEventChar_ARRAYSIZE ((InputEventChar)(InputEventChar_BACK+1))
#define _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DHT11
#define _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MAX RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20
#define _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_ARRAYSIZE ((RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType)(RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_DS18B20+1))
@@ -276,6 +302,17 @@ extern "C" {
#define RadioConfig_UserPreferences_mqtt_password_tag 156
#define RadioConfig_UserPreferences_is_lora_tx_disabled_tag 157
#define RadioConfig_UserPreferences_is_power_saving_tag 158
#define RadioConfig_UserPreferences_rotary1_enabled_tag 160
#define RadioConfig_UserPreferences_rotary1_pin_a_tag 161
#define RadioConfig_UserPreferences_rotary1_pin_b_tag 162
#define RadioConfig_UserPreferences_rotary1_pin_press_tag 163
#define RadioConfig_UserPreferences_rotary1_event_cw_tag 164
#define RadioConfig_UserPreferences_rotary1_event_ccw_tag 165
#define RadioConfig_UserPreferences_rotary1_event_press_tag 166
#define RadioConfig_UserPreferences_canned_message_plugin_enabled_tag 170
#define RadioConfig_UserPreferences_canned_message_plugin_allow_input_origin_tag 171
#define RadioConfig_UserPreferences_canned_message_plugin_messages_tag 172
#define RadioConfig_UserPreferences_canned_message_plugin_send_bell_tag 173
#define RadioConfig_preferences_tag 1
/* Struct field encoding specification for nanopb */
@@ -356,6 +393,18 @@ X(a, STATIC, SINGULAR, STRING, mqtt_username, 155) \
X(a, STATIC, SINGULAR, STRING, mqtt_password, 156) \
X(a, STATIC, SINGULAR, BOOL, is_lora_tx_disabled, 157) \
X(a, STATIC, SINGULAR, BOOL, is_power_saving, 158)
X(a, STATIC, SINGULAR, STRING, mqtt_password, 156) \
X(a, STATIC, SINGULAR, BOOL, rotary1_enabled, 160) \
X(a, STATIC, SINGULAR, UINT32, rotary1_pin_a, 161) \
X(a, STATIC, SINGULAR, UINT32, rotary1_pin_b, 162) \
X(a, STATIC, SINGULAR, UINT32, rotary1_pin_press, 163) \
X(a, STATIC, SINGULAR, UENUM, rotary1_event_cw, 164) \
X(a, STATIC, SINGULAR, UENUM, rotary1_event_ccw, 165) \
X(a, STATIC, SINGULAR, UENUM, rotary1_event_press, 166) \
X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_enabled, 170) \
X(a, STATIC, SINGULAR, STRING, canned_message_plugin_allow_input_origin, 171) \
X(a, STATIC, SINGULAR, STRING, canned_message_plugin_messages, 172) \
X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_send_bell, 173)
#define RadioConfig_UserPreferences_CALLBACK NULL
#define RadioConfig_UserPreferences_DEFAULT NULL