configuration

This commit is contained in:
2020-11-27 13:27:24 +01:00
parent 3c25a7d9e1
commit 0b1c6217c4
6 changed files with 68 additions and 16 deletions

View File

@ -6,6 +6,7 @@
#include <ringbuffer.h>
#include <wizHelper.h>
#include <socket.h>
#include <config.h>
#include <stdint.h>
#include <stdlib.h>
@ -26,14 +27,17 @@
#define MSGBUFFER_SIZE 256
static t_configBlock *config;
extern const uint8_t SYSLOG_SOCK;
uint8_t syslogAddr[] = { 172, 16, 11, 15 };
uint8_t syslogAddr[4];
uint8_t singleOctetTXBuffer;
static ringbuffer_t logBuffer;
void logInit() {
void logInit() {
config = getConfig();
ringbufferInit(&logBuffer, LOGBUFFER_SIZE);
}
@ -81,7 +85,7 @@ void syslog(char *msg) {
state = 1;
// no break
case 1:
if (! wizDnsQuery("syslogserver", syslogAddr)) {
if (! wizDnsQuery(config->syslogServerName, syslogAddr)) {
disconnect(SYSLOG_SOCK);
state = 0;
break;