# HG changeset patch # User Chiel Broek # Date 1676298163 -3600 # Node ID dab1a7450a42572b7a0a381c237b49df068c17ff # Parent 32082a19912c52f76bdbc52d49e7ca2570424c7f Updates for cabled networks diff -r 32082a19912c -r dab1a7450a42 thermferm/mqtt.c --- 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);