2020-01-07 01:23:16 +00:00
|
|
|
#ifndef CONTROLLER_CONFIG_H
|
|
|
|
#define CONTROLLER_CONFIG_H
|
|
|
|
|
2020-04-16 23:38:25 +00:00
|
|
|
#include <stdint.h>
|
2020-02-08 12:50:54 +00:00
|
|
|
|
2020-04-16 23:38:25 +00:00
|
|
|
#include <constants.h>
|
|
|
|
#include <enums.h>
|
2020-01-07 01:23:16 +00:00
|
|
|
|
2020-04-16 23:38:25 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint8_t pin;
|
2020-04-18 00:09:50 +00:00
|
|
|
int inverted;
|
2020-04-16 23:38:25 +00:00
|
|
|
relay_driver_t driver;
|
2020-06-27 16:27:49 +00:00
|
|
|
uint8_t pulse_duration;
|
2020-04-16 23:38:25 +00:00
|
|
|
} config_relay_t;
|
2020-01-07 01:23:16 +00:00
|
|
|
|
2020-04-16 23:38:25 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2020-04-17 23:24:36 +00:00
|
|
|
char *file;
|
2020-07-14 18:43:58 +00:00
|
|
|
char database[256];
|
2020-04-24 13:08:26 +00:00
|
|
|
log_level_t log_level;
|
2020-04-17 23:24:36 +00:00
|
|
|
run_type_t run_type;
|
2020-04-16 23:38:25 +00:00
|
|
|
char name[MAX_NAME_LENGTH + 1];
|
|
|
|
uint16_t discovery_port;
|
2020-06-25 23:28:00 +00:00
|
|
|
uint16_t mqtt_port;
|
2020-07-14 18:43:58 +00:00
|
|
|
char mqtt_host[256];
|
2020-04-16 23:38:25 +00:00
|
|
|
uint8_t relay_count;
|
|
|
|
config_relay_t *relay_configs;
|
|
|
|
} config_t;
|
2020-02-23 00:13:27 +00:00
|
|
|
|
2020-04-16 23:38:25 +00:00
|
|
|
extern config_t global_config;
|
2020-02-08 12:50:54 +00:00
|
|
|
|
2020-01-07 01:23:16 +00:00
|
|
|
#endif //CONTROLLER_CONFIG_H
|