fix M10 dir and sondehub frame#

pull/114/head
Hansi, dl9rdz 2021-07-27 13:11:44 +02:00
rodzic 7555eda024
commit 045b61bf23
3 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -3216,7 +3216,11 @@ void sondehub_send_data(WiFiClient *client, SondeInfo *s, struct st_sondehub *co
// For M10, this is real GPS time (seconds since Jqn 6 1980, without adjusting for leap seconds)
// DFM and MP3H send real UTC (with leap seconds considered), so for them the frame number actually
// is gps time plus number of leap seconds since the beginning of GPS time.
sprintf(w, "\"frame\": %d,", int(t - 315964800));
int frame = (int)(t - 315964800);
if (s->type == STYPE_M10) {
frame += 18;
};
sprintf(w, "\"frame\": %d,", frame);
} else {
sprintf(w, "\"frame\": %d,", s->frame);
}

Wyświetl plik

@ -1,4 +1,4 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "devel20210726";
const char *version_id = "devel20210727";
const int SPIFFS_MAJOR=2;
const int SPIFFS_MINOR=11;

Wyświetl plik

@ -320,7 +320,7 @@ int M10M20::decodeframeM10(uint8_t *data) {
sonde.si()->vs = getint16(data+8) * VMUL;
sonde.si()->hs = sqrt(ve*ve+vn*vn);
sonde.si()->sats = data[30];
float dir = atan2(vn, ve)*(1.0/RAD);
float dir = atan2(ve, vn)*(1.0/RAD);
if(dir<0) dir+=360;
sonde.si()->dir = dir;
sonde.si()->validPos = 0x3f;
@ -566,7 +566,7 @@ int M10M20::decodeframeM20(uint8_t *data) {
//0x18 2 byte
sonde.si()->vs = getint16(data+24) * VMUL_M20;
sonde.si()->hs = sqrt(ve*ve+vn*vn);
float dir = atan2(vn, ve)*(1.0/RAD);
float dir = atan2(ve, vn)*(1.0/RAD);
if(dir<0) dir+=360;
sonde.si()->dir = dir;
sonde.si()->validPos = 0x3f;