negative altitude bug fixed

* negative altitude values causing display bug on aprs.fi fixed
* setPreamble option added for LibAPRS.
* Added new countries for NO AIRBORNE APRS
pull/3/head
lightaprs 2020-01-16 22:07:53 +03:00
rodzic 34edf81869
commit 829ad8d912
3 zmienionych plików z 40 dodań i 7 usunięć

Wyświetl plik

@ -41,7 +41,7 @@ char Symbol='O'; // '/O' for balloon, '/>' for car, for more info : http://www.
bool alternateSymbolTable = false ; //false = '/' , true = '\'
char comment[50] = "http://www.lightaprs.com"; // Max 50 char
char StatusMessage[50] = "LightAPRS by TA9OHC & TA2MUN";
char StatusMessage[50] = "LightAPRS by TA2NHP & TA2MUN";
//*****************************************************************************
@ -120,6 +120,8 @@ void setup() {
APRS_setPath2("WIDE2", Wide2);
APRS_useAlternateSymbolTable(alternateSymbolTable);
APRS_setSymbol(Symbol);
//increase following value (for example to 500UL) if you experience packet loss/decode issues.
APRS_setPreamble(350UL);
APRS_setPathSize(pathSize);
AprsPinInput;
@ -386,7 +388,19 @@ void updateTelemetry() {
telemetry_buff[7] = '/';
telemetry_buff[8] = 'A';
telemetry_buff[9] = '=';
sprintf(telemetry_buff + 10, "%06lu", (long)gps.altitude.feet());
//sprintf(telemetry_buff + 10, "%06lu", (long)gps.altitude.feet());
//fixing negative altitude values causing display bug on aprs.fi
float tempAltitude = gps.altitude.feet();
if (tempAltitude>0){
//for positive values
sprintf(telemetry_buff + 10, "%06lu", (long)tempAltitude);
} else{
//for negative values
sprintf(telemetry_buff + 10, "%06d", (long)tempAltitude);
}
telemetry_buff[16] = ' ';
sprintf(telemetry_buff + 17, "%03d", TxCount);
telemetry_buff[20] = 'T';

Wyświetl plik

@ -101,10 +101,11 @@ int32_t pointInPolygonF(int32_t polyCorners, float * polygon, float latitude, fl
Indonesia 144.390
Malaysia 144.390
NO AIRBORNE APRS:
France
NO AIRBORNE APRS:
Latvia
North Korea
United Kingdom
Yemen
Expected input FLOAT for latitude and longitude as in GPS_UBX_latitude_Float and GPS_UBX_longitude_Float.
*/
@ -120,6 +121,7 @@ void GEOFENCE_position(float latitude, float longitude)
{
if(pointInPolygonF(9, UKF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1;GEOFENCE_APRS_frequency = 144800000;}
else if(pointInPolygonF(10, LatviaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1;GEOFENCE_APRS_frequency = 144800000;}
else if(pointInPolygonF(5, YemenF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1;GEOFENCE_APRS_frequency = 144800000;}
else {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144800000;}
}
@ -158,9 +160,10 @@ void GEOFENCE_position(float latitude, float longitude)
// S 1/2
if(latitude > 19.2)
{
if(pointInPolygonF(12, ChinaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144640000;}
else if(pointInPolygonF(7, JapanF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144660000;}
{
if(pointInPolygonF(6, North_KoreaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 1; GEOFENCE_APRS_frequency = 144620000;}
else if(pointInPolygonF(12, ChinaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144640000;}
else if(pointInPolygonF(7, JapanF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144660000;}
else if(pointInPolygonF(5, South_KoreaF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144620000;}
else if(pointInPolygonF(5, ThailandF, latitude, longitude) == 1) {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 145525000;}
else {GEOFENCE_no_tx = 0; GEOFENCE_APRS_frequency = 144800000;}

Wyświetl plik

@ -114,6 +114,15 @@ static float RomaniaF[] = {
27.12520, 47.95310
};
static float North_KoreaF[] = {
130.14189, 4321627,
124.03574, 39.8949,
125.18292, 37.39202,
128.47240, 38.66888,
130.69478, 42.3274,
130.14189, 43.21627
};
static float South_KoreaF[] = {
132.17653, 41.01310,
124.61794, 36.70367,
@ -152,6 +161,13 @@ static float VenezuelaF[] = {
-66.65410, 0.18680
};
static float YemenF[] = {
52.20302, 19.48287,
41.92009, 17.42198,
43.59620, 12.27820,
53.68201, 15.80024,
52.20302, 19.48287
};
// VARIABLES
extern uint32_t GEOFENCE_APRS_frequency;