configuration
This commit is contained in:
@ -2,9 +2,10 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <eeprom.h>
|
||||
|
||||
#include <logger.h>
|
||||
|
||||
t_configBlock defaultConfigBlock = {
|
||||
.configMagic = CONFIG_MAGIC,
|
||||
.deviceName = "MBGW3",
|
||||
.macAddress = { 0x00, 0xA0, 0x57, 0x05, 0x3E, 0x0D },
|
||||
.frontendThreshold = 240,
|
||||
@ -14,7 +15,7 @@ t_configBlock defaultConfigBlock = {
|
||||
.statusTopic = "IoT/MBGW3/Status",
|
||||
.mbusDataTopic = "IoT/MBGW3/Measurement",
|
||||
.syslogServerName = "syslogserver",
|
||||
.filler = { 0, 0, 0 }
|
||||
.filler = { 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@ -28,5 +29,10 @@ t_configBlock* getConfig() {
|
||||
|
||||
|
||||
void configInit() {
|
||||
coloredMsg(LOG_BLUE, false, "cfg ci Reading configuration block from eeprom");
|
||||
eepromReadConfigBlock(0, &mainConfigBlock);
|
||||
|
||||
if (mainConfigBlock.configMagic != CONFIG_MAGIC) {
|
||||
coloredMsg(LOG_BLUE, false, "cfg ci Invalid configuration block read from eeprom");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user