From f7dc810f9410522d20bb2270a678e9bcbef0f895 Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Fri, 21 Jan 2022 11:59:39 +0000 Subject: [PATCH] RS41: send real type if available --- RX_FSK/src/aprs.cpp | 13 ++++++++++++- RX_FSK/src/aprs.h | 1 + RX_FSK/version.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/RX_FSK/src/aprs.cpp b/RX_FSK/src/aprs.cpp index 7be1e91..ea6cfdb 100644 --- a/RX_FSK/src/aprs.cpp +++ b/RX_FSK/src/aprs.cpp @@ -18,6 +18,7 @@ #include "aprs.h" extern const char *version_name; +extern const char *version_id; #if 0 int openudp(const char *ip, int port, struct sockaddr_in *si) { int fd; @@ -288,6 +289,9 @@ char *aprs_send_beacon(const char *usercall, float lat, float lon, const char *s // maybe add DAO? i = strlen(b); snprintf(b+i, APRS_MAXLEN-i, "%s", comment); + + i = strlen(b); + snprintf(b+i, APRS_MAXLEN-i, " %s-%s", version_name, version_id); //sprintf(b + strlen(b), "%s", version_name); return b; } @@ -343,7 +347,14 @@ char *aprs_senddata(SondeInfo *si, const char *usercall, const char *objcall, co if( !isnan(s->relativeHumidity) ) { sprintf(b+strlen(b), "h=%.1f%% ", s->relativeHumidity); } - sprintf(b+strlen(b), "%.3fMHz Type=%s ", si->freq, sondeTypeStr[sonde.realType(si)]); + char type[12]; + if ( si->type == STYPE_RS41 && RS41::getSubtype(type, 11, si) == 0 ) { + // type was copied to type + } else { + strncpy(type, sondeTypeStr[sonde.realType(si)], 11); type[11]=0; + } + + sprintf(b+strlen(b), "%.3fMHz Type=%s ", si->freq, type /* sondeTypeStr[sonde.realType(si)] */ ); if( s->countKT != 0xffff && s->vframe - s->crefKT < 51 ) { sprintf(b+strlen(b), "TxOff=%dh%dm ", s->countKT/3600, (s->countKT-s->countKT/3600*3600)/60); } diff --git a/RX_FSK/src/aprs.h b/RX_FSK/src/aprs.h index 3439973..d2e50c5 100644 --- a/RX_FSK/src/aprs.h +++ b/RX_FSK/src/aprs.h @@ -2,6 +2,7 @@ #ifndef _aprs_h #define _aprs_h #include "Sonde.h" +#include "RS41.h" #define APRS_MAXLEN 201 diff --git a/RX_FSK/version.h b/RX_FSK/version.h index 831b802..7b2c646 100644 --- a/RX_FSK/version.h +++ b/RX_FSK/version.h @@ -1,4 +1,4 @@ const char *version_name = "rdzTTGOsonde"; -const char *version_id = "devel20211101"; +const char *version_id = "devel20220121"; const int SPIFFS_MAJOR=2; const int SPIFFS_MINOR=16;