smartPOC-tx/include/config.h
2025-04-02 00:15:31 +02:00

89 lines
No EOL
1.7 KiB
C

#define CFG_TIME_RIC "time_ric"
#if !defined(_CONFIG_H)
#define _CONFIG_H
#include "FS.h"
#define FORMAT_SPIFFS_IF_FAILED true
#include "SPIFFS.h"
#include <ArduinoJson.h>
typedef struct {
byte version;
char wifi1_ssid[33];
char wifi1_pass[65];
char wifi2_ssid[33];
char wifi2_pass[65];
char ap_ssid[33];
char ap_pass[65];
//
float tx_freq;
float tx_dev;
int tx_baud;
int tx_power;
//
char mqtt_host[63];
uint16_t mqtt_port;
char mqtt_user[63];
char mqtt_pass[63];
char mqtt_topic[63];
//
bool tx_empty_queue;
// brodcasts
int broadcast_ric;
int broadcast_fun;
// dwd
int dwd_interval;
bool dwd_enable;
char dwd_region[8];
int dwd_fun;
// mowas
int mowas_interval;
bool mowas_enable;
char mowas_region[32];
int mowas_fun;
//time
int time_interval;
bool time_enable;
int time_ric;
int time_fun;
int time_mode;
char time_zone[33];
//idle
bool idle_enable;
int idle_interval;
int idle_mode;
// umlauts
bool pocsag_german;
// device name
char device_name[33];
// oled
int oled_timeout;
bool webserver_protect;
} cfg_t;
void setup_storage(cfg_t *out);
void read_config(cfg_t *out);
void write_config();
void create_default_config();
// contacts
void create_default_contactlist();
String contacts_tostring();
void contacts_write(String data);
//
String cfg_tostring(void);
void cfg_adjust(String key, bool val);
void cfg_adjust(String key, int val);
void cfg_adjust(String key, float val);
void cfg_adjust(String key, String value);
void cfg_startTransaction();
void cfg_write();
#endif