From 2a16d65763314501f1011e14d23b4f3e237363fd Mon Sep 17 00:00:00 2001 From: Colin Cogle Date: Wed, 26 Oct 2022 23:19:11 -0400 Subject: [PATCH] Work around APRS.fi bug (issue #6) I thought I did this already (back in version 1.5.1), but I suppose I forgot about it. Sorry, Menno. --- CHANGELOG.md | 13 +++++++------ debian/changelog | 34 ++++++++++++++-------------------- src/aprs-wx.c | 16 ++++++++++------ 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e848a..b4038c1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ ## Version 1.6 -* Support for compiling with OpenWatcom (with `-D_DOS`). This will allow us to target 16-bit targets and retro machines, all the way back to MS-DOS and the 8086 (without APRS-IS support, unless we figure out [mTCP](https://www.brutman.com/mTCP/)). I've only tested it on FreeDos and an emulated 486 thus far. + +* This app now runs on DOS systems! Added support for compiling with OpenWatcom, to target 16-bit targets and retro machines, all the way back to MS-DOS and the 8086 (without APRS-IS support). I've only tested it on FreeDOS 1.3 and an emulated 486 thus far. * Custom comments can be added to packets! Use `--comment` to add your own notes to a packet. -* When not using custom comments, the "X" in the comment field is removed. APRS packets rarely, if ever, use the operating system identifier these days, so there is no need to prefix the user agent with it. -* Fix a bug ([#9](https://github.com/rhymeswithmogul/aprs-weather-submit/issues/9)) where minute values less than ten would result in invalud uncompressed positions. Thank you, [ploeffler](https://github.com/ploeffler)! -* Fix a bug where the `--altitude` parameter was not being detected in its short form (`-A`). -* Replace calls to `strncat()` with calls to `strcat()`. This eliminates on-by-default warnings in GCC 8.1. [Thank you](https://github.com/rhymeswithmogul/aprs-weather-submit/pull/4), [KR4DIO](https://github.com/KR4DIO)! +* When not using custom comments, the "X" in the comment field is removed. APRS packets rarely, if ever, use the operating system identifier these days, so there is no need to prefix the user agent or comment with it. +* Fixed a bug where [minute values less than ten would result in invalid uncompressed positions](https://github.com/rhymeswithmogul/aprs-weather-submit/issues/9). Thank you, [ploeffler](https://github.com/ploeffler)! +* Fixed a bug where the `--altitude` parameter was not being detected in its short form (`-A`). +* Worked around a bug with [APRS.fi](https://APRS.fi), where [their site would reject packets with the temperature listed before the wind gust speeds](https://github.com/rhymeswithmogul/aprs-weather-submit/issues/6). This was not a bug in this app. Thank you, [Menno](https://github.com/pd9mwo). +* [Replace calls to `strncat()` with calls to `strcat()`.](https://github.com/rhymeswithmogul/aprs-weather-submit/pull/4) This eliminates on-by-default warnings in GCC 8.1., [KR4DIO](https://github.com/KR4DIO)! * Removed dependency on ``. ## Version 1.5.2 @@ -19,7 +21,6 @@ * Completely rewrite the build script to have a standard `autogen`, `configure`, and `make`. * Eliminate compiler errors when using `-Wextra`. -* Fix a bug where [APRS.fi](https://APRS.fi) would not accept wind gust speeds if it was placed before the temperature. This is a bug on their end, but it's a painless change over here. (Thank you, [Menno](https://github.com/pd9mwo)!) ## Version 1.5 diff --git a/debian/changelog b/debian/changelog index 5edc6d6..ff65099 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,26 +1,20 @@ -aprs-weather-submit (1.6-2) unstable; urgency=medium +aprs-weather-submit (1.6-4) unstable; urgency=medium - * Support for compiling with OpenWatcom (with -D_DOS). This will allow us to - target 16-bit targets and retro machines, all the way back to MS-DOS and the - 8086 (without APRS-IS support, unless we figure out mTCP). I've only tested - it on FreeDos and an emulated 486 thus far. - - * Custom comments can be added to packets! Use --comment to add your own + * Custom comments can be added to packets! Use --comment` to add your own notes to a packet. * When not using custom comments, the "X" in the comment field is removed. - APRS packets rarely, if ever, use the operating system identifier these - days, so there is no need to prefix the user agent with it. - - * Fix a bug (#9) where minute values less than ten would result in invalid - uncompressed positions. Thank you, ploeffler! - * Fix a bug where the --altitude parameter was not being detected in its + APRS packets rarely, if ever, use the operating system identifier these days, + so there is no need to prefix the user agent or comment with it. + * Fixed GitHub issue #9: minute values less than ten would result in invalid + uncompressed positions. (Thank you, ploeffler!) + * Fixed a bug where the --altitude parameter was not being detected in its short form (-A). - * Replace calls to strncat() with calls to strcat(). This eliminates on- - by-default warnings in GCC 8.1. Thank you, KR4DIO! - + * Fixed GitHub issue #6 (for real this time): Worked around a bug with APRS.fi + where their site would reject packets with the temperature listed before the + wind gust speeds. This was not a bug in this app. Thank you, PD9MWO! + * Fixed GitHub issue #4 where GCC 8.1 would emit spurious warnings. This was + fixed by replacing calls to strncat() with strcat(). Thank you for the report + and the pull request, KR4DIO! * Removed dependency on . - * 1.6-2 fixes some packaging errors for Debian. The app itself is unchanged - from 1.6-1, and 1.6 upstream. - - -- Colin Cogle Wed, 26 Oct 2022 20:15:33 -0400 + -- Colin Cogle Wed, 26 Oct 2022 22:53:17 -0400 diff --git a/src/aprs-wx.c b/src/aprs-wx.c index d5243a7..54cdef1 100755 --- a/src/aprs-wx.c +++ b/src/aprs-wx.c @@ -274,19 +274,19 @@ printAPRSPacket (APRSPacket* restrict const p, char* restrict const ret, */ snprintf_verify(snprintf( result, 48, - /* header_________ timestamp____ pos_wc_s_Tt__*/ - "%s>APRS,TCPIP*:@%.2d%.2d%.2dz/%s%s_%c%cCt%s", + /* header_________ timestamp____ pos_wc_s_T*/ + "%s>APRS,TCPIP*:@%.2d%.2d%.2dz/%s%s_%c%cC", p->callsign, now->tm_mday, now->tm_hour, now->tm_min, p->latitude, - p->longitude, p->windDirection[0], p->windSpeed[0], p->temperature + p->longitude, p->windDirection[0], p->windSpeed[0] )); } else { snprintf_verify(snprintf( result, 61, - /* header_________ timestamp____pos__wc_ s_t__*/ - "%s>APRS,TCPIP*:@%.2d%.2d%.2dz%s/%s_%s/%st%s", + /* header_________ timestamp____pos__wc_ s_*/ + "%s>APRS,TCPIP*:@%.2d%.2d%.2dz%s/%s_%s/%s", p->callsign, now->tm_mday, now->tm_hour, now->tm_min, p->latitude, - p->longitude, p->windDirection, p->windSpeed, p->temperature + p->longitude, p->windDirection, p->windSpeed )); } @@ -296,6 +296,10 @@ printAPRSPacket (APRSPacket* restrict const p, char* restrict const ret, strcat(result, p->gust); } + /* The temperature field is mandatory. */ + strcat(result, "t"); + strcat(result, p->temperature); + if (notNull(p->rainfallLastHour)) { strcat(result, "r");