This commit is contained in:
Wolfgang Hottgenroth 2021-02-10 11:14:42 +01:00
parent be20d335ed
commit 66a409dadb
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -61,7 +61,7 @@ void initReceiver() {
} }
} }
int receiveAndVerify(t_minuteBuffer *buf) { int receiveAndVerifyMinuteBuffer(t_minuteBuffer *buf) {
struct sockaddr_in servaddr, cliaddr; struct sockaddr_in servaddr, cliaddr;
socklen_t cliaddrlen = sizeof(cliaddr); socklen_t cliaddrlen = sizeof(cliaddr);
@ -110,7 +110,7 @@ int receiveAndVerify(t_minuteBuffer *buf) {
return 0; return 0;
} }
int send(t_minuteBuffer &buf) { int forwardMinuteBuffer(t_minuteBuffer &buf) {
logmsg(LOG_INFO, "DeviceId: %s", buf->s.deviceId); logmsg(LOG_INFO, "DeviceId: %s", buf->s.deviceId);
logmsg(LOG_INFO, "Location: %s", buf->s.location); logmsg(LOG_INFO, "Location: %s", buf->s.location);
for (uint8_t j = 0; j < SECONDS_PER_MINUTE; j++) { for (uint8_t j = 0; j < SECONDS_PER_MINUTE; j++) {
@ -127,10 +127,10 @@ int main() {
while (1) { while (1) {
t_minuteBuffer buf; t_minuteBuffer buf;
if (receiveAndVerify(&buf) < 0) { if (receiveAndVerifyMinuteBuffer(&buf) < 0) {
logmsg(LOG_ERR, "error in receiveAndVerify"); logmsg(LOG_ERR, "error in receiveAndVerify");
} else { } else {
if (send(&buf) < 0) { if (forwardMinuteBuffer(&buf) < 0) {
logmsg(LOG_ERR, "error in send"); logmsg(LOG_ERR, "error in send");
} }
} }