altitude mic-e decoding added

This commit is contained in:
richonguzman 2023-12-18 11:33:15 -03:00
parent ef69c7c2ac
commit eb0be837de
1 changed files with 13 additions and 10 deletions

View File

@ -456,13 +456,17 @@ namespace APRSPacketLib {
int altitude; int altitude;
String temp; String temp;
if (informationField.indexOf("`")==8 && informationField.indexOf("}")==12) { if (informationField.indexOf("`")==8 && informationField.indexOf("}")==12) {
temp = informationField.substring(9,12); // completar decoding de los 3 bytes temp = informationField.substring(9,12);
Serial.println(temp);
altitude = 12;
} else if (informationField.indexOf("}")==11) { } else if (informationField.indexOf("}")==11) {
temp = informationField.substring(8,11); // completar decoding de los 3 bytes temp = informationField.substring(8,11);
Serial.println(temp); } else {
altitude = 11; temp = "";
}
if (temp.length()!=0) {
int a = int(temp[0]) - 33;
int b = int(temp[1]) - 33;
int c = int(temp[2]) - 33;
altitude = (a*pow(91,2) + b*91 + c) - 10000;
} else { } else {
altitude = 0; altitude = 0;
} }
@ -598,16 +602,15 @@ namespace APRSPacketLib {
aprsPacket.latitude = decodeMiceLatitude(aprsPacket.tocall); aprsPacket.latitude = decodeMiceLatitude(aprsPacket.tocall);
//Serial.println(aprsPacket.latitude); //Serial.println(aprsPacket.latitude);
aprsPacket.altitude = decodeMiceAltitude(aprsPacket.message); // completar decoding aprsPacket.altitude = decodeMiceAltitude(aprsPacket.message);
Serial.println(aprsPacket.altitude);
/* /*
decodeMiceLongitud(aprsPacket.tocall, aprsPacket.message); decodeMiceLongitud(aprsPacket.tocall, aprsPacket.message);
decodeMiceCourseSpeed(aprsPacket.tocall, aprsPacket.message); decodeMiceCourseSpeed(aprsPacket.tocall, aprsPacket.message);
---------decodeMiceAltitude(aprsPacket.tocall, aprsPacket.message); ---------decodeMiceAltitude(aprsPacket.tocall, aprsPacket.message);
tocall entrega LAT, North, longitude offset , West (y miceType) tocall entrega longitude offset , West
message es longitud, curso, velocidad y altura message es longitud, curso, velocidad
*/ */
} else if (receivedPacket.indexOf(":;") > 10) { } else if (receivedPacket.indexOf(":;") > 10) {