Updates for cabled networks

Mon, 13 Feb 2023 15:22:43 +0100

author
Chiel Broek <mbse@mbse.eu>
date
Mon, 13 Feb 2023 15:22:43 +0100
changeset 629
dab1a7450a42
parent 628
32082a19912c
child 630
ee8afcdf2982

Updates for cabled networks

thermferm/mqtt.c file | annotate | diff | comparison | revisions
--- a/thermferm/mqtt.c	Mon Feb 13 15:11:20 2023 +0100
+++ b/thermferm/mqtt.c	Mon Feb 13 15:22:43 2023 +0100
@@ -1529,9 +1529,7 @@
 			    }
 
 			    wrq.u.essid.pointer = essid;
-			    if (ioctl(sock, SIOCGIWESSID, &wrq) == -1) {
-				syslog(LOG_NOTICE, "Can't open socket to obtain essid");
-			    } else {
+			    if (ioctl(sock, SIOCGIWESSID, &wrq) != -1) {
 			    	payload = xstrcat(payload, (char *)",\"ssid\":\"");
 			    	payload = xstrcat(payload, wrq.u.essid.pointer);
 			    	payload = xstrcat(payload, (char *)"\"");
@@ -1541,9 +1539,7 @@
 			    wrq.u.data.pointer = &iwstats;
 			    wrq.u.data.length = sizeof(struct iw_statistics);
 			    wrq.u.data.flags = 1;
-			    if (ioctl(sock, SIOCGIWSTATS, &wrq) == -1) {
-				syslog(LOG_NOTICE, "Can't open socket to obtain iwstats");
-			    } else {
+			    if (ioctl(sock, SIOCGIWSTATS, &wrq) != -1) {
 				syslog(LOG_NOTICE, "Signal level is %d %d %d", iwstats.qual.updated & IW_QUAL_DBM, iwstats.qual.level, iwstats.qual.noise);
 				if ((iwstats.qual.updated & (IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID)) == 0) {
 				    /* iwstats.qual.level is __u8 */
@@ -1576,7 +1572,6 @@
 neterr:
 
     payload = xstrcat(payload, (char *)"}}");
-syslog(LOG_NOTICE, payload);
     if (birth) {
 	topic = topic_base((char *)"NBIRTH");
     	publisher(mosq, topic, payload, true);

mercurial