From 572078cf357e896d8b36a72a158a85c6ab3a771b Mon Sep 17 00:00:00 2001 From: thovoigt <42041532+thovoigt@users.noreply.github.com> Date: Mon, 24 Jul 2023 13:23:11 +0200 Subject: [PATCH] Remove bug when humidity = 100% it was sent as 'h100', which is NOT as in APRS spec. Now it will be sent as 'h00'. --- src/TTGO_T-Beam_LoRa_APRS.ino | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 959c437..8ec0b0b 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -908,9 +908,14 @@ switch(tracker_mode) { outString += helper; outString += "r...p...P...h"; if(hum<10) {outString += "0"; } - helper = String(hum,0); - helper.trim(); - outString += helper; + if(hum<100) { + helper = String(hum,0); + helper.trim(); + outString += helper; + } else { + // if humidity = 100% then send it as "00" as defined in APRS spec + outString += "00"; + } #ifdef USE_BME280 outString += "b"; if(pressure<1000) {outString += "0"; } @@ -999,9 +1004,14 @@ switch(tracker_mode) { outString += helper; outString += "r...p...P...h"; if(hum<10) {outString += "0"; } - helper = String(hum,0); - helper.trim(); - outString += helper; + if(hum<100) { + helper = String(hum,0); + helper.trim(); + outString += helper; + } else { + // if humidity = 100% then send it as "00" as defined in APRS spec + outString += "00"; + } #ifdef USE_BME280 outString += "b"; if(pressure<1000) {outString += "0"; } @@ -1149,9 +1159,14 @@ case WX_MOVE: outString += helper; outString += "r...p...P...h"; if(hum<10) {outString += "0"; } - helper = String(hum,0); - helper.trim(); - outString += helper; + if(hum<100) { + helper = String(hum,0); + helper.trim(); + outString += helper; + } else { + // if humidity = 100% then send it as "00" as defined in APRS spec + outString += "00"; + } #ifdef USE_BME280 outString += "b"; if(pressure<1000) {outString += "0"; }