more string cleaning
This commit is contained in:
parent
95a8796a80
commit
6cd38c8204
|
|
@ -33,10 +33,12 @@ namespace APRSPacketLib {
|
||||||
north_south = "N";
|
north_south = "N";
|
||||||
latitude += degrees.substring(0, degrees.indexOf("."));
|
latitude += degrees.substring(0, degrees.indexOf("."));
|
||||||
}
|
}
|
||||||
convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat()));
|
convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat()));
|
||||||
convDeg2 = (convDeg * 60)/100;
|
convDeg2 = (convDeg * 60)/100;
|
||||||
convDeg3 = String(convDeg2,6);
|
convDeg3 = String(convDeg2,6);
|
||||||
latitude += convDeg3.substring(convDeg3.indexOf(".") + 1, convDeg3.indexOf(".") + 3) + "." + convDeg3.substring(convDeg3.indexOf(".") + 3, convDeg3.indexOf(".") + 5);
|
latitude += convDeg3.substring(convDeg3.indexOf(".") + 1, convDeg3.indexOf(".") + 3);
|
||||||
|
latitude += ".";
|
||||||
|
latitude += convDeg3.substring(convDeg3.indexOf(".") + 3, convDeg3.indexOf(".") + 5);
|
||||||
latitude += north_south;
|
latitude += north_south;
|
||||||
return latitude;
|
return latitude;
|
||||||
}
|
}
|
||||||
|
|
@ -58,10 +60,12 @@ namespace APRSPacketLib {
|
||||||
east_west = "E";
|
east_west = "E";
|
||||||
longitude += degrees.substring(0, degrees.indexOf("."));
|
longitude += degrees.substring(0, degrees.indexOf("."));
|
||||||
}
|
}
|
||||||
convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat()));
|
convDeg = abs(degrees.toFloat()) - abs(int(degrees.toFloat()));
|
||||||
convDeg2 = (convDeg * 60)/100;
|
convDeg2 = (convDeg * 60)/100;
|
||||||
convDeg3 = String(convDeg2,6);
|
convDeg3 = String(convDeg2,6);
|
||||||
longitude += convDeg3.substring(convDeg3.indexOf(".") + 1, convDeg3.indexOf(".") + 3) + "." + convDeg3.substring(convDeg3.indexOf(".") + 3, convDeg3.indexOf(".") + 5);
|
longitude += convDeg3.substring(convDeg3.indexOf(".") + 1, convDeg3.indexOf(".") + 3);
|
||||||
|
longitude += ".";
|
||||||
|
longitude += convDeg3.substring(convDeg3.indexOf(".") + 3, convDeg3.indexOf(".") + 5);
|
||||||
longitude += east_west;
|
longitude += east_west;
|
||||||
return longitude;
|
return longitude;
|
||||||
}
|
}
|
||||||
|
|
@ -71,12 +75,12 @@ namespace APRSPacketLib {
|
||||||
alt_m = 0;
|
alt_m = 0;
|
||||||
}
|
}
|
||||||
uint32_t altoff;
|
uint32_t altoff;
|
||||||
altoff=alt_m + 10000;
|
altoff = alt_m + 10000;
|
||||||
buf[0]=(altoff/8281) + 33;
|
buf[0] = (altoff/8281) + 33;
|
||||||
altoff=altoff%8281;
|
altoff = altoff%8281;
|
||||||
buf[1]=(altoff/91) + 33;
|
buf[1] = (altoff/91) + 33;
|
||||||
buf[2]=(altoff%91) + 33;
|
buf[2] = (altoff%91) + 33;
|
||||||
buf[3]='}';
|
buf[3] = '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
void encodeMiceCourseSpeed(uint8_t *buf, uint32_t speed_kt, uint32_t course_deg) {
|
void encodeMiceCourseSpeed(uint8_t *buf, uint32_t speed_kt, uint32_t course_deg) {
|
||||||
|
|
@ -98,11 +102,11 @@ namespace APRSPacketLib {
|
||||||
course_deg = 0;
|
course_deg = 0;
|
||||||
}
|
}
|
||||||
uint32_t course_hun = course_deg/100;
|
uint32_t course_hun = course_deg/100;
|
||||||
DC28 = (speed_kt-ten * 10) * 10 + course_hun + 32;
|
DC28 = (speed_kt-ten * 10) * 10 + course_hun + 32;
|
||||||
buf[1] = DC28;
|
buf[1] = DC28;
|
||||||
|
|
||||||
SE28 = (course_deg - course_hun * 100) + 28;
|
SE28 = (course_deg - course_hun * 100) + 28;
|
||||||
buf[2] = SE28;
|
buf[2] = SE28;
|
||||||
}
|
}
|
||||||
|
|
||||||
void encodeMiceLongitude(uint8_t *buf, gpsLongitudeStruct *lon) {
|
void encodeMiceLongitude(uint8_t *buf, gpsLongitudeStruct *lon) {
|
||||||
|
|
@ -129,8 +133,8 @@ namespace APRSPacketLib {
|
||||||
buf[1] = m28;
|
buf[1] = m28;
|
||||||
|
|
||||||
uint32_t h28;
|
uint32_t h28;
|
||||||
h28 = 28 + lon->minuteHundredths;
|
h28 = 28 + lon->minuteHundredths;
|
||||||
buf[2] = h28;
|
buf[2] = h28;
|
||||||
}
|
}
|
||||||
|
|
||||||
void encodeMiceDestinationField(const String& msgType, uint8_t *buf, const gpsLatitudeStruct *lat, const gpsLongitudeStruct *lon) {
|
void encodeMiceDestinationField(const String& msgType, uint8_t *buf, const gpsLatitudeStruct *lat, const gpsLongitudeStruct *lon) {
|
||||||
|
|
@ -152,7 +156,7 @@ namespace APRSPacketLib {
|
||||||
}
|
}
|
||||||
buf[3] = (lat->minutes - temp * 10 + 0x30) + (lat->north ? 0x20 : 0); // North validation
|
buf[3] = (lat->minutes - temp * 10 + 0x30) + (lat->north ? 0x20 : 0); // North validation
|
||||||
|
|
||||||
temp = lat->minuteHundredths/10; // minute hundredths
|
temp = lat->minuteHundredths/10; // minute hundredths
|
||||||
buf[4] = (temp + 0x30) + ((lon->degrees >= 100 || lon->degrees <= 9) ? 0x20 : 0); // Longitude Offset
|
buf[4] = (temp + 0x30) + ((lon->degrees >= 100 || lon->degrees <= 9) ? 0x20 : 0); // Longitude Offset
|
||||||
buf[5] = (lat->minuteHundredths - temp * 10 + 0x30) + (!lon->east ? 0x20 : 0); // West validation
|
buf[5] = (lat->minuteHundredths - temp * 10 + 0x30) + (!lon->east ? 0x20 : 0); // West validation
|
||||||
}
|
}
|
||||||
|
|
@ -177,10 +181,10 @@ namespace APRSPacketLib {
|
||||||
gpsLongitudeStruct miceLongitudeStruct;
|
gpsLongitudeStruct miceLongitudeStruct;
|
||||||
String lng = gpsDecimalToDegreesLongitude(longitude);
|
String lng = gpsDecimalToDegreesLongitude(longitude);
|
||||||
char longitudeArray[10];
|
char longitudeArray[10];
|
||||||
strncpy(longitudeArray,lng.c_str(),9);
|
strncpy(longitudeArray,lng.c_str(), 9);
|
||||||
miceLongitudeStruct.degrees = 100 * (longitudeArray[0] - '0') + 10 * (longitudeArray[1] - '0') + longitudeArray[2] - '0';
|
miceLongitudeStruct.degrees = 100 * (longitudeArray[0] - '0') + 10 * (longitudeArray[1] - '0') + longitudeArray[2] - '0';
|
||||||
miceLongitudeStruct.minutes = 10 * (longitudeArray[3] - '0') + longitudeArray[4] - '0';
|
miceLongitudeStruct.minutes = 10 * (longitudeArray[3] - '0') + longitudeArray[4] - '0';
|
||||||
miceLongitudeStruct.minuteHundredths = 10 * (longitudeArray[6] - '0') + longitudeArray[7] - '0';
|
miceLongitudeStruct.minuteHundredths = 10 * (longitudeArray[6] - '0') + longitudeArray[7] - '0';
|
||||||
if (longitudeArray[8] == 'E') {
|
if (longitudeArray[8] == 'E') {
|
||||||
miceLongitudeStruct.east = 1;
|
miceLongitudeStruct.east = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -190,8 +194,8 @@ namespace APRSPacketLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
String generateMiceGPSBeacon(const String& miceMsgType, const String& callsign, const String& symbol, const String& overlay, const String& path, float latitude, float longitude, float course, float speed, int altitude) {
|
String generateMiceGPSBeacon(const String& miceMsgType, const String& callsign, const String& symbol, const String& overlay, const String& path, float latitude, float longitude, float course, float speed, int altitude) {
|
||||||
gpsLatitudeStruct latitudeStruct = gpsDecimalToDegreesMiceLatitude(latitude);
|
gpsLatitudeStruct latitudeStruct = gpsDecimalToDegreesMiceLatitude(latitude);
|
||||||
gpsLongitudeStruct longitudeStruct = gpsDecimalToDegreesMiceLongitude(longitude);
|
gpsLongitudeStruct longitudeStruct = gpsDecimalToDegreesMiceLongitude(longitude);
|
||||||
|
|
||||||
uint8_t miceDestinationArray[7];
|
uint8_t miceDestinationArray[7];
|
||||||
encodeMiceDestinationField(miceMsgType, &miceDestinationArray[0], &latitudeStruct, &longitudeStruct);
|
encodeMiceDestinationField(miceMsgType, &miceDestinationArray[0], &latitudeStruct, &longitudeStruct);
|
||||||
|
|
@ -213,18 +217,25 @@ namespace APRSPacketLib {
|
||||||
miceInfoFieldArray[13] = 0x00; // por repetidor?
|
miceInfoFieldArray[13] = 0x00; // por repetidor?
|
||||||
String miceInformationField = (char*)miceInfoFieldArray;
|
String miceInformationField = (char*)miceInfoFieldArray;
|
||||||
|
|
||||||
String miceAPRSPacket = callsign + ">" + miceDestination;
|
String miceAPRSPacket = callsign;
|
||||||
|
miceAPRSPacket += ">";
|
||||||
|
miceAPRSPacket += miceDestination;
|
||||||
if (path != "") {
|
if (path != "") {
|
||||||
miceAPRSPacket += "," + path;
|
miceAPRSPacket += ",";
|
||||||
|
miceAPRSPacket += path;
|
||||||
}
|
}
|
||||||
miceAPRSPacket += ":" + miceInformationField;
|
miceAPRSPacket += ":";
|
||||||
|
miceAPRSPacket += miceInformationField;
|
||||||
return miceAPRSPacket;
|
return miceAPRSPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
String generateBasePacket(const String& callsign, const String& tocall, const String& path) {
|
String generateBasePacket(const String& callsign, const String& tocall, const String& path) {
|
||||||
String packet = callsign + ">" + tocall;
|
String packet = callsign;
|
||||||
|
packet += ">";
|
||||||
|
packet += tocall;
|
||||||
if (path != "") {
|
if (path != "") {
|
||||||
packet += "," + path;
|
packet += ",";
|
||||||
|
packet += path;
|
||||||
}
|
}
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
@ -245,6 +256,7 @@ namespace APRSPacketLib {
|
||||||
|
|
||||||
String generateDigiRepeatedPacket(APRSPacket packet, const String& callsign) {
|
String generateDigiRepeatedPacket(APRSPacket packet, const String& callsign) {
|
||||||
if (packet.path.indexOf("WIDE1-") >= 0) {
|
if (packet.path.indexOf("WIDE1-") >= 0) {
|
||||||
|
|
||||||
String hop = packet.path.substring(packet.path.indexOf("WIDE1-") + 6, packet.path.indexOf("WIDE1-") + 7);
|
String hop = packet.path.substring(packet.path.indexOf("WIDE1-") + 6, packet.path.indexOf("WIDE1-") + 7);
|
||||||
if (hop.toInt() >= 1 && hop.toInt() <= 7) {
|
if (hop.toInt() >= 1 && hop.toInt() <= 7) {
|
||||||
if (hop.toInt() == 1) {
|
if (hop.toInt() == 1) {
|
||||||
|
|
@ -252,7 +264,13 @@ namespace APRSPacketLib {
|
||||||
} else {
|
} else {
|
||||||
packet.path.replace("WIDE1-" + hop , callsign + "*,WIDE1-" + String(hop.toInt() - 1));
|
packet.path.replace("WIDE1-" + hop , callsign + "*,WIDE1-" + String(hop.toInt() - 1));
|
||||||
}
|
}
|
||||||
String repeatedPacket = packet.sender + ">" + packet.tocall + "," + packet.path;
|
|
||||||
|
String repeatedPacket = packet.sender;
|
||||||
|
repeatedPacket += ">";
|
||||||
|
repeatedPacket += packet.tocall;
|
||||||
|
repeatedPacket += ",";
|
||||||
|
repeatedPacket += packet.path;
|
||||||
|
|
||||||
switch (packet.type) {
|
switch (packet.type) {
|
||||||
case 0: // gps
|
case 0: // gps
|
||||||
repeatedPacket += ":!";
|
repeatedPacket += ":!";
|
||||||
|
|
@ -261,7 +279,9 @@ namespace APRSPacketLib {
|
||||||
for(int i = packet.addressee.length(); i < 9; i++) {
|
for(int i = packet.addressee.length(); i < 9; i++) {
|
||||||
packet.addressee += ' ';
|
packet.addressee += ' ';
|
||||||
}
|
}
|
||||||
repeatedPacket += "::" + packet.addressee + ":";
|
repeatedPacket += "::";
|
||||||
|
repeatedPacket += packet.addressee;
|
||||||
|
repeatedPacket += ":";
|
||||||
break;
|
break;
|
||||||
case 2: // status
|
case 2: // status
|
||||||
repeatedPacket += ":>";
|
repeatedPacket += ":>";
|
||||||
|
|
@ -446,7 +466,7 @@ namespace APRSPacketLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
String decodeMiceSymbol(const String& informationField) {
|
String decodeMiceSymbol(const String& informationField) {
|
||||||
return informationField.substring(6, 7);
|
return informationField.substring(6,7);
|
||||||
}
|
}
|
||||||
|
|
||||||
String decodeMiceOverlay(const String& informationField) {
|
String decodeMiceOverlay(const String& informationField) {
|
||||||
|
|
@ -493,11 +513,11 @@ namespace APRSPacketLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
float gpsDegreesToDecimalLatitude(const String& degreesLatitude) {
|
float gpsDegreesToDecimalLatitude(const String& degreesLatitude) {
|
||||||
int degrees = degreesLatitude.substring(0, 2).toInt();
|
int degrees = degreesLatitude.substring(0, 2).toInt();
|
||||||
int minute = degreesLatitude.substring(2, 4).toInt();
|
int minute = degreesLatitude.substring(2, 4).toInt();
|
||||||
int minuteHundredths = degreesLatitude.substring(5, 7).toInt();
|
int minuteHundredths = degreesLatitude.substring(5, 7).toInt();
|
||||||
String northSouth = degreesLatitude.substring(7);
|
String northSouth = degreesLatitude.substring(7);
|
||||||
float decimalLatitude = degrees + (minute/60.0) + (minuteHundredths/10000.0);
|
float decimalLatitude = degrees + (minute/60.0) + (minuteHundredths/10000.0);
|
||||||
if (northSouth == "N") {
|
if (northSouth == "N") {
|
||||||
return decimalLatitude;
|
return decimalLatitude;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -506,11 +526,11 @@ namespace APRSPacketLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
float gpsDegreesToDecimalLongitude(const String& degreesLongitude) {
|
float gpsDegreesToDecimalLongitude(const String& degreesLongitude) {
|
||||||
int degrees = degreesLongitude.substring(0, 3).toInt();
|
int degrees = degreesLongitude.substring(0, 3).toInt();
|
||||||
int minute = degreesLongitude.substring(3, 5).toInt();
|
int minute = degreesLongitude.substring(3, 5).toInt();
|
||||||
int minuteHundredths = degreesLongitude.substring(6, 8).toInt();
|
int minuteHundredths = degreesLongitude.substring(6, 8).toInt();
|
||||||
String westEast = degreesLongitude.substring(8);
|
String westEast = degreesLongitude.substring(8);
|
||||||
float decimalLongitude = degrees + (minute/60.0) + (minuteHundredths/10000.0);
|
float decimalLongitude = degrees + (minute/60.0) + (minuteHundredths/10000.0);
|
||||||
if (westEast == "W") {
|
if (westEast == "W") {
|
||||||
return -decimalLongitude;
|
return -decimalLongitude;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -591,11 +611,11 @@ namespace APRSPacketLib {
|
||||||
aprsPacket.sender = receivedPacket.substring(0, receivedPacket.indexOf(">"));
|
aprsPacket.sender = receivedPacket.substring(0, receivedPacket.indexOf(">"));
|
||||||
String temp0 = receivedPacket.substring(receivedPacket.indexOf(">") + 1, receivedPacket.indexOf(":"));
|
String temp0 = receivedPacket.substring(receivedPacket.indexOf(">") + 1, receivedPacket.indexOf(":"));
|
||||||
if (temp0.indexOf(",") > 2) {
|
if (temp0.indexOf(",") > 2) {
|
||||||
aprsPacket.tocall = temp0.substring(0, temp0.indexOf(","));
|
aprsPacket.tocall = temp0.substring(0, temp0.indexOf(","));
|
||||||
aprsPacket.path = temp0.substring(temp0.indexOf(",") + 1, temp0.indexOf(":"));
|
aprsPacket.path = temp0.substring(temp0.indexOf(",") + 1, temp0.indexOf(":"));
|
||||||
} else {
|
} else {
|
||||||
aprsPacket.tocall = temp0;
|
aprsPacket.tocall = temp0;
|
||||||
aprsPacket.path = "";
|
aprsPacket.path = "";
|
||||||
}
|
}
|
||||||
if (receivedPacket.indexOf(":!") > 10 || receivedPacket.indexOf(":=") > 10 ) {
|
if (receivedPacket.indexOf(":!") > 10 || receivedPacket.indexOf(":=") > 10 ) {
|
||||||
aprsPacket.type = 0;
|
aprsPacket.type = 0;
|
||||||
|
|
|
||||||
|
|
@ -39,45 +39,45 @@ struct gpsLongitudeStruct {
|
||||||
|
|
||||||
namespace APRSPacketLib {
|
namespace APRSPacketLib {
|
||||||
|
|
||||||
String doubleToString(double n, int ndec);
|
String doubleToString(double n, int ndec);
|
||||||
String gpsDecimalToDegreesLatitude(double lat);
|
String gpsDecimalToDegreesLatitude(double lat);
|
||||||
String gpsDecimalToDegreesLongitude(double lon);
|
String gpsDecimalToDegreesLongitude(double lon);
|
||||||
|
|
||||||
void encodeMiceAltitude(uint8_t *buf, uint32_t alt_m);
|
void encodeMiceAltitude(uint8_t *buf, uint32_t alt_m);
|
||||||
void encodeMiceCourseSpeed(uint8_t *buf, uint32_t speed_kt, uint32_t course_deg);
|
void encodeMiceCourseSpeed(uint8_t *buf, uint32_t speed_kt, uint32_t course_deg);
|
||||||
void encodeMiceLongitude(uint8_t *buf, gpsLongitudeStruct *lon);
|
void encodeMiceLongitude(uint8_t *buf, gpsLongitudeStruct *lon);
|
||||||
void encodeMiceDestinationField(const String& msgType, uint8_t *buf, const gpsLatitudeStruct *lat, const gpsLongitudeStruct *lon);
|
void encodeMiceDestinationField(const String& msgType, uint8_t *buf, const gpsLatitudeStruct *lat, const gpsLongitudeStruct *lon);
|
||||||
|
|
||||||
gpsLatitudeStruct gpsDecimalToDegreesMiceLatitude(float latitude);
|
gpsLatitudeStruct gpsDecimalToDegreesMiceLatitude(float latitude);
|
||||||
gpsLongitudeStruct gpsDecimalToDegreesMiceLongitude(float longitude);
|
gpsLongitudeStruct gpsDecimalToDegreesMiceLongitude(float longitude);
|
||||||
String generateMiceGPSBeacon(const String& miceMsgType, const String& callsign, const String& symbol, const String& overlay, const String& path, float latitude, float longitude, float course, float speed, int altitude);
|
String generateMiceGPSBeacon(const String& miceMsgType, const String& callsign, const String& symbol, const String& overlay, const String& path, float latitude, float longitude, float course, float speed, int altitude);
|
||||||
|
|
||||||
String generateBasePacket(const String& callsign, const String& tocall, const String& path);
|
String generateBasePacket(const String& callsign, const String& tocall, const String& path);
|
||||||
String generateStatusPacket(const String& callsign, const String& tocall, const String& path, const String& status);
|
String generateStatusPacket(const String& callsign, const String& tocall, const String& path, const String& status);
|
||||||
String generateMessagePacket(const String& callsign, const String& tocall, const String& path, const String& addressee, const String& message);
|
String generateMessagePacket(const String& callsign, const String& tocall, const String& path, const String& addressee, const String& message);
|
||||||
String generateDigiRepeatedPacket(APRSPacket packet, const String &callsign);
|
String generateDigiRepeatedPacket(APRSPacket packet, const String &callsign);
|
||||||
|
|
||||||
char *ax25_base91enc(char *s, uint8_t n, uint32_t v);
|
char *ax25_base91enc(char *s, uint8_t n, uint32_t v);
|
||||||
String encodeGPS(float latitude, float longitude, float course, float speed, const String& symbol, bool sendAltitude, int altitude, bool sendStandingUpdate, const String& packetType);
|
String encodeGPS(float latitude, float longitude, float course, float speed, const String& symbol, bool sendAltitude, int altitude, bool sendStandingUpdate, const String& packetType);
|
||||||
String generateGPSBeaconPacket(const String& callsign, const String& tocall, const String& path, const String& overlay, const String& gpsData);
|
String generateGPSBeaconPacket(const String& callsign, const String& tocall, const String& path, const String& overlay, const String& gpsData);
|
||||||
|
|
||||||
float decodeEncodedLatitude(const String& receivedPacket);
|
float decodeEncodedLatitude(const String& receivedPacket);
|
||||||
float decodeEncodedLongitude(const String& receivedPacket);
|
float decodeEncodedLongitude(const String& receivedPacket);
|
||||||
float decodeLatitude(const String& receivedPacket);
|
float decodeLatitude(const String& receivedPacket);
|
||||||
float decodeLongitude(const String& receivedPacket);
|
float decodeLongitude(const String& receivedPacket);
|
||||||
int decodeSpeed(const String& speed);
|
int decodeSpeed(const String& speed);
|
||||||
int decodeAltitude(const String& altitude);
|
int decodeAltitude(const String& altitude);
|
||||||
|
|
||||||
String decodeMiceMsgType(const String& tocall);
|
String decodeMiceMsgType(const String& tocall);
|
||||||
String decodeMiceSymbol(const String& informationField);
|
String decodeMiceSymbol(const String& informationField);
|
||||||
String decodeMiceOverlay(const String& informationField);
|
String decodeMiceOverlay(const String& informationField);
|
||||||
int decodeMiceSpeed(const String& informationField);
|
int decodeMiceSpeed(const String& informationField);
|
||||||
int decodeMiceCourse(const String& informationField);
|
int decodeMiceCourse(const String& informationField);
|
||||||
int decodeMiceAltitude(const String& informationField);
|
int decodeMiceAltitude(const String& informationField);
|
||||||
float gpsDegreesToDecimalLatitude(const String& degreesLatitude);
|
float gpsDegreesToDecimalLatitude(const String& degreesLatitude);
|
||||||
float gpsDegreesToDecimalLongitude(const String& degreesLongitude);
|
float gpsDegreesToDecimalLongitude(const String& degreesLongitude);
|
||||||
float decodeMiceLatitude(const String& destinationField);
|
float decodeMiceLatitude(const String& destinationField);
|
||||||
float decodeMiceLongitude(const String& destinationField, const String& informationField);
|
float decodeMiceLongitude(const String& destinationField, const String& informationField);
|
||||||
|
|
||||||
APRSPacket processReceivedPacket(const String& receivedPacket, int rssi, float snr, int freqError);
|
APRSPacket processReceivedPacket(const String& receivedPacket, int rssi, float snr, int freqError);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ namespace AX25_Utils {
|
||||||
}
|
}
|
||||||
byte ssid = (frame[6]>>1) & 0x0f;
|
byte ssid = (frame[6]>>1) & 0x0f;
|
||||||
if (String(ssid) != "0") {
|
if (String(ssid) != "0") {
|
||||||
packet += "-" + String(ssid);
|
packet += "-";
|
||||||
|
packet += String(ssid);
|
||||||
}
|
}
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
@ -32,17 +33,17 @@ namespace AX25_Utils {
|
||||||
payloadFrameStart = i+1;
|
payloadFrameStart = i+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decodedFrame->tocall = frame.substring(2, 9); // Extract destination address
|
decodedFrame->tocall = frame.substring(2, 9); // Extract destination address
|
||||||
decodedFrame->sender = frame.substring(9, 16); // Extract source address
|
decodedFrame->sender = frame.substring(9, 16); // Extract source address
|
||||||
if (payloadFrameStart >= 21) { // is there path1?
|
if (payloadFrameStart >= 21) { // is there path1?
|
||||||
decodedFrame->path1 = frame.substring(16, 23);
|
decodedFrame->path1 = frame.substring(16, 23);
|
||||||
}
|
}
|
||||||
if (payloadFrameStart >= 28) { // is there path2?
|
if (payloadFrameStart >= 28) { // is there path2?
|
||||||
decodedFrame->path2 = frame.substring(23, 30);
|
decodedFrame->path2 = frame.substring(23, 30);
|
||||||
}
|
}
|
||||||
decodedFrame->control = frame.substring(payloadFrameStart-1, payloadFrameStart); // Extract control information // 0x03
|
decodedFrame->control = frame.substring(payloadFrameStart-1, payloadFrameStart); // Extract control information // 0x03
|
||||||
decodedFrame->pid = frame.substring(payloadFrameStart, payloadFrameStart + 1); // Extract pid information // 0xF0
|
decodedFrame->pid = frame.substring(payloadFrameStart, payloadFrameStart + 1); // Extract pid information // 0xF0
|
||||||
decodedFrame->payload = frame.substring(payloadFrameStart + 1, frameSize - 1); // Extract payload
|
decodedFrame->payload = frame.substring(payloadFrameStart + 1, frameSize - 1); // Extract payload
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,10 +54,12 @@ namespace AX25_Utils {
|
||||||
packetToLoRa = decodeFrame(decodedFrame.sender) + ">" + decodeFrame(decodedFrame.tocall);
|
packetToLoRa = decodeFrame(decodedFrame.sender) + ">" + decodeFrame(decodedFrame.tocall);
|
||||||
|
|
||||||
if (decodedFrame.path1[0] != 0) {
|
if (decodedFrame.path1[0] != 0) {
|
||||||
packetToLoRa += "," + decodeFrame(decodedFrame.path1);
|
packetToLoRa += ",";
|
||||||
|
packetToLoRa += decodeFrame(decodedFrame.path1);
|
||||||
}
|
}
|
||||||
if (decodedFrame.path2[0] != 0) {
|
if (decodedFrame.path2[0] != 0) {
|
||||||
packetToLoRa += "," + decodeFrame(decodedFrame.path2);
|
packetToLoRa += ",";
|
||||||
|
packetToLoRa += decodeFrame(decodedFrame.path2);
|
||||||
}
|
}
|
||||||
packetToLoRa += ":";
|
packetToLoRa += ":";
|
||||||
packetToLoRa += decodedFrame.payload;
|
packetToLoRa += decodedFrame.payload;
|
||||||
|
|
@ -118,19 +121,19 @@ namespace AX25_Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
String LoRaPacketToAX25Frame(const String& packet) {
|
String LoRaPacketToAX25Frame(const String& packet) {
|
||||||
String encodedPacket = "";
|
String encodedPacket = "";
|
||||||
String tocall = "";
|
String tocall = "";
|
||||||
String sender = packet.substring(0, packet.indexOf(">"));
|
String sender = packet.substring(0, packet.indexOf(">"));
|
||||||
bool lastAddress = false;
|
bool lastAddress = false;
|
||||||
String payload = packet.substring(packet.indexOf(":") + 1);
|
String payload = packet.substring(packet.indexOf(":") + 1);
|
||||||
String temp = packet.substring(packet.indexOf(">") + 1, packet.indexOf(":"));
|
String temp = packet.substring(packet.indexOf(">") + 1, packet.indexOf(":"));
|
||||||
|
|
||||||
if (temp.indexOf(",")>0) {
|
if (temp.indexOf(",")>0) {
|
||||||
tocall = temp.substring(0, temp.indexOf(","));
|
tocall = temp.substring(0, temp.indexOf(","));
|
||||||
temp = temp.substring(temp.indexOf(",") + 1);
|
temp = temp.substring(temp.indexOf(",") + 1);
|
||||||
} else {
|
} else {
|
||||||
tocall = temp;
|
tocall = temp;
|
||||||
temp = "";
|
temp = "";
|
||||||
lastAddress = true;
|
lastAddress = true;
|
||||||
}
|
}
|
||||||
encodedPacket = encodeAX25Address(tocall, 1, false);
|
encodedPacket = encodeAX25Address(tocall, 1, false);
|
||||||
|
|
@ -140,11 +143,11 @@ namespace AX25_Utils {
|
||||||
int repeatedPath = 0;
|
int repeatedPath = 0;
|
||||||
String address = "";
|
String address = "";
|
||||||
if (temp.indexOf(",") > 0) {
|
if (temp.indexOf(",") > 0) {
|
||||||
address = temp.substring(0, temp.indexOf(","));
|
address = temp.substring(0, temp.indexOf(","));
|
||||||
temp = temp.substring(temp.indexOf(",") + 1);
|
temp = temp.substring(temp.indexOf(",") + 1);
|
||||||
} else {
|
} else {
|
||||||
address = temp;
|
address = temp;
|
||||||
temp = "";
|
temp = "";
|
||||||
lastAddress = true;
|
lastAddress = true;
|
||||||
}
|
}
|
||||||
if (address.indexOf("*") > 0) {
|
if (address.indexOf("*") > 0) {
|
||||||
|
|
|
||||||
|
|
@ -268,14 +268,30 @@ namespace BME_Utils {
|
||||||
presStr = generatePresString(newPress + (Config.bme.heightCorrection/CORRECTION_FACTOR), type);
|
presStr = generatePresString(newPress + (Config.bme.heightCorrection/CORRECTION_FACTOR), type);
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
if (wxModuleType == 1 || wxModuleType == 3) {
|
if (wxModuleType == 1 || wxModuleType == 3) {
|
||||||
wx = tempStr + "C " + humStr + "% " + presStr + "hPa";
|
wx = tempStr;
|
||||||
|
wx += "C ";
|
||||||
|
wx += humStr;
|
||||||
|
wx += "% ";
|
||||||
|
wx += presStr;
|
||||||
|
wx += "hPa";
|
||||||
} else if (wxModuleType == 2) {
|
} else if (wxModuleType == 2) {
|
||||||
wx = "T: " + tempStr + "C " + "P: " + presStr + "hPa";
|
wx = "T: ";
|
||||||
|
wx += tempStr;
|
||||||
|
wx += "C P: ";
|
||||||
|
wx += presStr;
|
||||||
|
wx += "hPa";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wx = ".../...g...t" + tempStr + "r...p...P...h" + humStr + "b" + presStr;
|
wx = ".../...g...t";
|
||||||
|
wx += tempStr;
|
||||||
|
wx += "r...p...P...h";
|
||||||
|
wx += humStr;
|
||||||
|
wx += "b";
|
||||||
|
wx += presStr;
|
||||||
if (wxModuleType == 3) {
|
if (wxModuleType == 3) {
|
||||||
wx += "Gas: " + String(newGas) + "Kohms";
|
wx += "Gas: ";
|
||||||
|
wx += String(newGas);
|
||||||
|
wx += "Kohms";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return wx;
|
return wx;
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,15 @@ namespace LoRa_Utils {
|
||||||
case 1: loraCountryFreq = "POLAND"; break;
|
case 1: loraCountryFreq = "POLAND"; break;
|
||||||
case 2: loraCountryFreq = "UK"; break;
|
case 2: loraCountryFreq = "UK"; break;
|
||||||
}
|
}
|
||||||
String currentLoRainfo = "LoRa " + loraCountryFreq + " / Freq: " + String(currentLoRaType->frequency) + " / SF:" + String(currentLoRaType->spreadingFactor) + " / CR: " + String(currentLoRaType->codingRate4);
|
String currentLoRainfo = "LoRa ";
|
||||||
|
currentLoRainfo += loraCountryFreq;
|
||||||
|
currentLoRainfo += " / Freq: ";
|
||||||
|
currentLoRainfo += String(currentLoRaType->frequency);
|
||||||
|
currentLoRainfo += " / SF:";
|
||||||
|
currentLoRainfo += String(currentLoRaType->spreadingFactor);
|
||||||
|
currentLoRainfo += " / CR: ";
|
||||||
|
currentLoRainfo += String(currentLoRaType->codingRate4);
|
||||||
|
|
||||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "LoRa", currentLoRainfo.c_str());
|
logger.log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, "LoRa", currentLoRainfo.c_str());
|
||||||
show_display("LORA FREQ>", "", "CHANGED TO: " + loraCountryFreq, "", "", "", 2000);
|
show_display("LORA FREQ>", "", "CHANGED TO: " + loraCountryFreq, "", "", "", 2000);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,10 +314,11 @@ namespace MENU_Utils {
|
||||||
double courseTo = TinyGPSPlus::courseTo(gps.location.lat(), gps.location.lng(), lastReceivedPacket.latitude, lastReceivedPacket.longitude);
|
double courseTo = TinyGPSPlus::courseTo(gps.location.lat(), gps.location.lng(), lastReceivedPacket.latitude, lastReceivedPacket.longitude);
|
||||||
|
|
||||||
if (lastReceivedPacket.path.length()>14) {
|
if (lastReceivedPacket.path.length()>14) {
|
||||||
pathDec = "P:" + lastReceivedPacket.path;
|
pathDec = "P:";
|
||||||
} else {
|
} else {
|
||||||
pathDec = "PATH: " +lastReceivedPacket.path;
|
pathDec = "PATH: ";
|
||||||
}
|
}
|
||||||
|
pathDec += lastReceivedPacket.path;
|
||||||
|
|
||||||
show_display(firstLineDecoder, "GPS " + String(lastReceivedPacket.latitude,2) + " " + String(lastReceivedPacket.longitude,2), courseSpeedAltitude, "D:" + String(distanceKm) + "km " + String(courseTo,0), pathDec, "< RSSI:" + String(lastReceivedPacket.rssi) + " SNR:" + String(lastReceivedPacket.snr));
|
show_display(firstLineDecoder, "GPS " + String(lastReceivedPacket.latitude,2) + " " + String(lastReceivedPacket.longitude,2), courseSpeedAltitude, "D:" + String(distanceKm) + "km " + String(courseTo,0), pathDec, "< RSSI:" + String(lastReceivedPacket.rssi) + " SNR:" + String(lastReceivedPacket.snr));
|
||||||
} else if (lastReceivedPacket.type==1) { // message
|
} else if (lastReceivedPacket.type==1) { // message
|
||||||
|
|
@ -525,7 +526,9 @@ namespace MENU_Utils {
|
||||||
const auto time_now = now();
|
const auto time_now = now();
|
||||||
secondRowMainMenu = Utils::createDateString(time_now) + " " + Utils::createTimeString(time_now);
|
secondRowMainMenu = Utils::createDateString(time_now) + " " + Utils::createTimeString(time_now);
|
||||||
if (time_now % 10 < 5) {
|
if (time_now % 10 < 5) {
|
||||||
thirdRowMainMenu = String(gps.location.lat(), 4) + " " + String(gps.location.lng(), 4);
|
thirdRowMainMenu = String(gps.location.lat(), 4);
|
||||||
|
thirdRowMainMenu += " ";
|
||||||
|
thirdRowMainMenu += String(gps.location.lng(), 4);
|
||||||
} else {
|
} else {
|
||||||
thirdRowMainMenu = String(Utils::getMaidenheadLocator(gps.location.lat(), gps.location.lng(), 8));
|
thirdRowMainMenu = String(Utils::getMaidenheadLocator(gps.location.lat(), gps.location.lng(), 8));
|
||||||
thirdRowMainMenu += " LoRa[";
|
thirdRowMainMenu += " LoRa[";
|
||||||
|
|
@ -548,11 +551,9 @@ namespace MENU_Utils {
|
||||||
hdopState = "+";
|
hdopState = "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gps.satellites.value() > 9) {
|
if (gps.satellites.value() <= 9) thirdRowMainMenu += " ";
|
||||||
thirdRowMainMenu += String(gps.satellites.value()) + hdopState;
|
thirdRowMainMenu += String(gps.satellites.value());
|
||||||
} else {
|
thirdRowMainMenu += hdopState;
|
||||||
thirdRowMainMenu += " " + String(gps.satellites.value()) + hdopState;
|
|
||||||
}
|
|
||||||
|
|
||||||
String fourthRowAlt = String(gps.altitude.meters(),0);
|
String fourthRowAlt = String(gps.altitude.meters(),0);
|
||||||
fourthRowAlt.trim();
|
fourthRowAlt.trim();
|
||||||
|
|
@ -573,43 +574,54 @@ namespace MENU_Utils {
|
||||||
fourthRowCourse = "0" + fourthRowCourse;
|
fourthRowCourse = "0" + fourthRowCourse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Config.bme.active) {
|
fourthRowMainMenu = "A=";
|
||||||
if (time_now % 10 < 5) {
|
fourthRowMainMenu += fourthRowAlt;
|
||||||
fourthRowMainMenu = "A=" + fourthRowAlt + "m " + fourthRowSpeed + "km/h " + fourthRowCourse;
|
fourthRowMainMenu += "m ";
|
||||||
} else {
|
fourthRowMainMenu += fourthRowSpeed;
|
||||||
if (wxModuleType != 0) {
|
fourthRowMainMenu += "km/h ";
|
||||||
fourthRowMainMenu = BME_Utils::readDataSensor(1);
|
fourthRowMainMenu += fourthRowCourse;
|
||||||
} else {
|
if (Config.bme.active && (time_now % 10 < 5) && wxModuleType != 0) {
|
||||||
fourthRowMainMenu = "A=" + fourthRowAlt + "m " + fourthRowSpeed + "km/h " + fourthRowCourse;
|
fourthRowMainMenu = BME_Utils::readDataSensor(1);
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
fourthRowMainMenu = "A=" + fourthRowAlt + "m " + fourthRowSpeed + "km/h " + fourthRowCourse;
|
|
||||||
}
|
}
|
||||||
if (MSG_Utils::getNumWLNKMails() > 0) {
|
if (MSG_Utils::getNumWLNKMails() > 0) {
|
||||||
fourthRowMainMenu = "** WLNK MAIL: " + String(MSG_Utils::getNumWLNKMails()) + " **";
|
fourthRowMainMenu = "** WLNK MAIL: ";
|
||||||
|
fourthRowMainMenu += String(MSG_Utils::getNumWLNKMails());
|
||||||
|
fourthRowMainMenu += " **";
|
||||||
}
|
}
|
||||||
if (MSG_Utils::getNumAPRSMessages() > 0) {
|
if (MSG_Utils::getNumAPRSMessages() > 0) {
|
||||||
fourthRowMainMenu = "*** MESSAGES: " + String(MSG_Utils::getNumAPRSMessages()) + " ***";
|
fourthRowMainMenu = "*** MESSAGES: ";
|
||||||
|
fourthRowMainMenu += String(MSG_Utils::getNumAPRSMessages());
|
||||||
|
fourthRowMainMenu += " ***";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fifthRowMainMenu = "LAST Rx = " + MSG_Utils::getLastHeardTracker();
|
fifthRowMainMenu = "LAST Rx = ";
|
||||||
|
fifthRowMainMenu += MSG_Utils::getLastHeardTracker();
|
||||||
|
|
||||||
if (POWER_Utils::getBatteryInfoIsConnected()) {
|
if (POWER_Utils::getBatteryInfoIsConnected()) {
|
||||||
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
||||||
String batteryCharge = POWER_Utils::getBatteryInfoCurrent();
|
String batteryCharge = POWER_Utils::getBatteryInfoCurrent();
|
||||||
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS)
|
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS)
|
||||||
sixthRowMainMenu = "Bat: " + batteryVoltage + "V";
|
sixthRowMainMenu = "Bat: ";
|
||||||
|
sixthRowMainMenu += batteryVoltage;
|
||||||
|
sixthRowMainMenu += "V";
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||||
if (batteryCharge.toInt() == 0) {
|
if (batteryCharge.toInt() == 0) {
|
||||||
sixthRowMainMenu = "Battery Charged " + batteryVoltage + "V";
|
sixthRowMainMenu = "Battery Charged ";
|
||||||
|
sixthRowMainMenu += batteryVoltage;
|
||||||
|
sixthRowMainMenu += "V";
|
||||||
} else if (batteryCharge.toInt() > 0) {
|
} else if (batteryCharge.toInt() > 0) {
|
||||||
sixthRowMainMenu = "Bat: " + batteryVoltage + "V (charging)";
|
sixthRowMainMenu = "Bat: ";
|
||||||
|
sixthRowMainMenu += batteryVoltage;
|
||||||
|
sixthRowMainMenu += "V (charging)";
|
||||||
} else {
|
} else {
|
||||||
sixthRowMainMenu = "Battery " + batteryVoltage + "V " + batteryCharge + "mA";
|
sixthRowMainMenu = "Battery ";
|
||||||
|
sixthRowMainMenu += batteryVoltage;
|
||||||
|
sixthRowMainMenu += "V ";
|
||||||
|
sixthRowMainMenu += batteryCharge;
|
||||||
|
sixthRowMainMenu += "mA";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||||
|
|
@ -625,11 +637,19 @@ namespace MENU_Utils {
|
||||||
}
|
}
|
||||||
batteryVoltage = batteryVoltage.toFloat()/1000;
|
batteryVoltage = batteryVoltage.toFloat()/1000;
|
||||||
if (POWER_Utils::isCharging() && batteryCharge!="100") {
|
if (POWER_Utils::isCharging() && batteryCharge!="100") {
|
||||||
sixthRowMainMenu = "Bat: " + String(batteryVoltage) + "V (charging)";
|
sixthRowMainMenu = "Bat: ";
|
||||||
|
sixthRowMainMenu += String(batteryVoltage);
|
||||||
|
sixthRowMainMenu += "V (charging)";
|
||||||
} else if (!POWER_Utils::isCharging() && batteryCharge=="100") {
|
} else if (!POWER_Utils::isCharging() && batteryCharge=="100") {
|
||||||
sixthRowMainMenu = "Battery Charged " + String(batteryVoltage) + "V";
|
sixthRowMainMenu = "Battery Charged ";
|
||||||
|
sixthRowMainMenu += String(batteryVoltage);
|
||||||
|
sixthRowMainMenu += "V";
|
||||||
} else {
|
} else {
|
||||||
sixthRowMainMenu = "Battery " + String(batteryVoltage) + "V " + batteryCharge + "%";
|
sixthRowMainMenu = "Battery ";
|
||||||
|
sixthRowMainMenu += String(batteryVoltage);
|
||||||
|
sixthRowMainMenu += "V ";
|
||||||
|
sixthRowMainMenu += batteryCharge;
|
||||||
|
sixthRowMainMenu += "%";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -432,7 +432,8 @@ namespace MSG_Utils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lastReceivedPacket.message.indexOf("{") >= 0) {
|
if (lastReceivedPacket.message.indexOf("{") >= 0) {
|
||||||
String ackMessage = "ack" + lastReceivedPacket.message.substring(lastReceivedPacket.message.indexOf("{") + 1);
|
String ackMessage = "ack";
|
||||||
|
ackMessage += lastReceivedPacket.message.substring(lastReceivedPacket.message.indexOf("{") + 1);
|
||||||
ackMessage.trim();
|
ackMessage.trim();
|
||||||
MSG_Utils::addToOutputBuffer(0, lastReceivedPacket.sender, ackMessage);
|
MSG_Utils::addToOutputBuffer(0, lastReceivedPacket.sender, ackMessage);
|
||||||
lastMsgRxTime = millis();
|
lastMsgRxTime = millis();
|
||||||
|
|
@ -464,8 +465,19 @@ namespace MSG_Utils {
|
||||||
String windCleaning = humCleaning.substring(humCleaning.indexOf(",")+1);
|
String windCleaning = humCleaning.substring(humCleaning.indexOf(",")+1);
|
||||||
String windDegrees = windCleaning.substring(windCleaning.indexOf(",")+1,windCleaning.indexOf("\n"));
|
String windDegrees = windCleaning.substring(windCleaning.indexOf(",")+1,windCleaning.indexOf("\n"));
|
||||||
|
|
||||||
String fifthLineWR = temperature + "C " + pressure + "hPa " + humidity +"%";
|
String fifthLineWR = temperature;
|
||||||
String sixthLineWR = "(wind " + windSpeed + "m/s " + windDegrees + "deg)";
|
fifthLineWR += "C ";
|
||||||
|
fifthLineWR += pressure;
|
||||||
|
fifthLineWR += "hPa ";
|
||||||
|
fifthLineWR += humidity;
|
||||||
|
fifthLineWR += "%";
|
||||||
|
|
||||||
|
String sixthLineWR = "(wind ";
|
||||||
|
sixthLineWR += windSpeed;
|
||||||
|
sixthLineWR += "m/s ";
|
||||||
|
sixthLineWR += windDegrees;
|
||||||
|
sixthLineWR += "deg)";
|
||||||
|
|
||||||
show_display("<WEATHER>", "From --> " + lastReceivedPacket.sender, place, summary, fifthLineWR, sixthLineWR);
|
show_display("<WEATHER>", "From --> " + lastReceivedPacket.sender, place, summary, fifthLineWR, sixthLineWR);
|
||||||
menuDisplay = 40;
|
menuDisplay = 40;
|
||||||
menuTime = millis();
|
menuTime = millis();
|
||||||
|
|
|
||||||
|
|
@ -420,13 +420,23 @@ namespace STATION_Utils {
|
||||||
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
|
||||||
String batteryChargeCurrent = POWER_Utils::getBatteryInfoCurrent();
|
String batteryChargeCurrent = POWER_Utils::getBatteryInfoCurrent();
|
||||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
|
||||||
comment += " Bat=" + batteryVoltage + "V (" + batteryChargeCurrent + "mA)";
|
comment += " Bat=";
|
||||||
|
comment += batteryVoltage;
|
||||||
|
comment += "V (";
|
||||||
|
comment += batteryChargeCurrent;
|
||||||
|
comment += "mA)";
|
||||||
#endif
|
#endif
|
||||||
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
#if defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
|
||||||
comment += " Bat=" + String(batteryVoltage.toFloat()/1000,2) + "V (" + batteryChargeCurrent + "%)";
|
comment += " Bat=";
|
||||||
|
comment += String(batteryVoltage.toFloat()/1000,2);
|
||||||
|
comment += "V (";
|
||||||
|
comment += batteryChargeCurrent;
|
||||||
|
cooment += "%)";
|
||||||
#endif
|
#endif
|
||||||
#if defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
#if defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER)
|
||||||
comment += " Bat=" + String(batteryVoltage.toFloat(),2) + "V";
|
comment += " Bat=";
|
||||||
|
comment += String(batteryVoltage.toFloat(),2);
|
||||||
|
comment += "V";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (comment != "") {
|
if (comment != "") {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue