56 lines
685 B
C
56 lines
685 B
C
#ifndef CONFIG_H
|
|
#define CONFIG_H
|
|
|
|
#include "sdm.h"
|
|
|
|
typedef struct {
|
|
int addr;
|
|
char *friendlyname;
|
|
enum sdm_types type;
|
|
} config_meters_t;
|
|
|
|
static config_meters_t meters[] = {
|
|
{ 11,
|
|
"Feld",
|
|
SDM630M
|
|
},
|
|
{ 12,
|
|
"Vorzelt",
|
|
SDM630M
|
|
},
|
|
{ 0,
|
|
NULL,
|
|
SDMNONE
|
|
}
|
|
};
|
|
|
|
typedef struct {
|
|
char *ser_device;
|
|
int ser_baud;
|
|
int ser_databits;
|
|
char ser_parity;
|
|
int ser_stopbits;
|
|
config_meters_t *meters;
|
|
const char *mosq_name;
|
|
const char *mosq_topicprefix;
|
|
const char *mosq_host;
|
|
const int mosq_port;
|
|
const int mosq_keepalive;
|
|
} config_t;
|
|
|
|
static config_t cfg = {
|
|
"/dev/ttyUSB0",
|
|
38400,
|
|
8,
|
|
'N',
|
|
1,
|
|
meters,
|
|
"sdm2mqtt2",
|
|
"sdm2mqtt2",
|
|
"localhost",
|
|
1883,
|
|
5
|
|
};
|
|
|
|
#endif
|