42 lines
769 B
C
42 lines
769 B
C
#ifndef CONTROLLER_CONFIG_H
|
|
#define CONTROLLER_CONFIG_H
|
|
|
|
#include <stdint.h>
|
|
#include <confini.h>
|
|
|
|
#include <constants.h>
|
|
#include <enums.h>
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t pin;
|
|
int inverted;
|
|
int init;
|
|
relay_driver_t driver;
|
|
uint8_t pulse_duration;
|
|
} config_relay_t;
|
|
|
|
int
|
|
config_load(IniDispatch *disp, void *config_void);
|
|
|
|
typedef struct
|
|
{
|
|
char *file;
|
|
char database[256];
|
|
char user[256];
|
|
char group[256];
|
|
int log_level;
|
|
FILE *log_file;
|
|
run_type_t run_type;
|
|
char name[MAX_NAME_LENGTH + 1];
|
|
uint16_t discovery_port;
|
|
uint16_t mqtt_port;
|
|
char mqtt_host[256];
|
|
uint8_t relay_count;
|
|
int relays_init;
|
|
config_relay_t *relay_configs;
|
|
} config_t;
|
|
|
|
extern config_t global_config;
|
|
|
|
#endif //CONTROLLER_CONFIG_H
|