dl9rdz / rdz_ttgo_sonde

270 stars 94 forks source link

AXUDP active not used #375

Closed mmadela closed 1 year ago

mmadela commented 1 year ago

The config setting "AXUDP active" is not effective. Regardless of its value, the UDP is always sent (somewhere)

The above setting is stored in variable sonde.config.udpfeed.active which is never read

A simple if block around lines 2358 - 2363 does the staff

       char *str = aprs_senddata(s, sonde.config.call, sonde.config.objcall, sonde.config.udpfeed.symbol);
       char raw[201];
       int rawlen = aprsstr_mon2raw(str, raw, APRS_MAXLEN);
-      Serial.println("Sending AXUDP");
-      //Serial.println(raw);
-      udp.beginPacket(sonde.config.udpfeed.host, sonde.config.udpfeed.port);
-      udp.write((const uint8_t *)raw, rawlen);
-      udp.endPacket();
+      if (sonde.config.udpfeed.active) {
+         Serial.println("Sending AXUDP");
+         //Serial.println(raw);
+         udp.beginPacket(sonde.config.udpfeed.host, sonde.config.udpfeed.port);
+         udp.write((const uint8_t *)raw, rawlen);
+         udp.endPacket();
+      }
       if (tncclient.connected()) {
         Serial.println("Sending position via TCP");
         char raw[201];
hr-ru commented 1 year ago

Thanks for the comment. I have been doing some code reorganization to simplify the structure, so all aprs-related stuff is now in src/conn-aprs.cpp, and I have fixed this problem there (in the most recent devel version).