This commit is contained in:
Wolfgang Hottgenroth 2021-02-09 19:17:14 +01:00
parent 01fbecfc33
commit 525a920e84
3 changed files with 8 additions and 7 deletions

View File

@ -2,16 +2,16 @@
#include <syslog.h> #include <syslog.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> // #include <stdio.h>
void logmsg(int prio, const char* format, ...) { void logmsg(int prio, const char* format, ...) {
va_list vl; va_list vl;
// openlog("counter", 0, LOG_LOCAL0); openlog("counter", 0, LOG_LOCAL0);
va_start(vl, format); va_start(vl, format);
//vsyslog(prio, format, vl); vsyslog(prio, format, vl);
vprintf(format, vl); //vprintf(format, vl);
va_end(vl); va_end(vl);
// closelog(); closelog();
} }

View File

@ -50,6 +50,7 @@ int receiver(config_t *cfg) {
logmsg(LOG_ERR, "No sharedsecret configured for device %s", buf.s.deviceId); logmsg(LOG_ERR, "No sharedsecret configured for device %s", buf.s.deviceId);
continue; continue;
} }
logmsg(LOG_INFO, "SharedSecret is %s", sharedSecret);
if (strlen(sharedSecret) > SHA256_BLOCK_SIZE) { if (strlen(sharedSecret) > SHA256_BLOCK_SIZE) {
logmsg(LOG_ERR, "Configured sharedsecret for device %s is too long", buf.s.deviceId); logmsg(LOG_ERR, "Configured sharedsecret for device %s is too long", buf.s.deviceId);

View File

@ -6,7 +6,7 @@ influxDatabase = "smarthome2";
influxMeasurement = "mainsfrequency"; influxMeasurement = "mainsfrequency";
devices = { devices = {
MainsCnt1 = { MainsCnt01 = {
sharedSecret = "strengGeheim"; sharedSecret = "Uj6*uKDp@8Kvfa4g5eRMLUfVsSuqjxW";
}; };
}; };