Closed dl9sau closed 2 years ago
If altitude is negative, /A= altitude is encoded wrong: /A=000-43 instead of /A=-00043
Fix:
TTGO_T-Beam_LoRa_APRS.ino:
@@ -274,7 +292,7 @@ void prepareAPRSFrame(){ double Tspeed=0, Tcourse=0; uint32_t aprs_lat, aprs_lon; int i; - int Talt; + long Talt; Tlat=gps.location.lat(); Tlon=gps.location.lng(); Tcourse=gps.course.deg(); @ -310,13 +336,13 @@ void prepareAPRSFrame(){ outString += "H"; if (showAltitude){ - Talt = gps.altitude.meters() * 3.28; - Altx = Talt; + Talt = gps.altitude.feet(); + char buf[7]; outString += "/A="; - for (i = 0; i < (6 - Altx.length()); ++i){ - outString += "0"; - } - outString += Talt; + if (Talt > 999999) Talt=999999; + else if (Talt < -99999) Talt=-99999; + sprintf(buf, "%06ld", Talt); + outString += buf; } }else{ //fixed position not compresed outString += aprsLatPreset;
Comments:
Feature is stable in my development version
If altitude is negative, /A= altitude is encoded wrong: /A=000-43 instead of /A=-00043
Fix:
TTGO_T-Beam_LoRa_APRS.ino:
Comments: