Commit graph

403 commits

Author SHA1 Message Date
Ember
c9a2d5802e Fix crash on empty MQTT command
An empty or whitespace-only MQTT command message caused an unhandled
std::out_of_range exception that terminated the process. Check for
empty args before accessing. Also add null check on m_mqtt before
publishing response.
2026-04-04 16:47:58 -07:00
Jonathan Naylor
0e04ebae0f Add MQTT retain to some JSON messages. 2026-03-23 17:51:28 +00:00
Jonathan Naylor
f320e82be4 Remove some old remote control weirdness. 2026-03-23 17:49:19 +00:00
Jonathan Naylor
7bbd64c386 create timestamps in rfc3339 format 2026-03-23 12:52:29 +00:00
Jonathan Naylor
4786d779b5 Improve the build process. 2026-03-11 17:25:22 +00:00
Jonathan Naylor
a2b30fcc1f
Merge pull request #140 from MW0MWZ/fix/mqtt-client-id
Fix MQTT client ID collision on 32-bit ARM userland
2026-03-08 15:19:39 +00:00
Andy Taylor
139d9dbff5 Add mosquitto_loop_stop before mosquitto_destroy in close()
The background network thread started by mosquitto_loop_start() was not
being stopped before mosquitto_destroy(), which can cause a use-after-free
if the thread is still running when the mosquitto structure is freed.
2026-03-08 14:16:32 +00:00
Andy Taylor
50a3567335 Fix MQTT client ID collision on ARM 32-bit userland with 64-bit kernel
The MQTT client ID was generated using sprintf with %ld and time(nullptr).
On platforms with 32-bit userland but 64-bit kernel (such as Raspberry Pi OS
and some custom Alpine Linux builds), time_t is a 64-bit long long but %ld
only reads 32 bits. Since the upper 32 bits of the current Unix timestamp
are zero, this always produces a client ID ending in .0, causing collisions
when multiple instances or restarts occur.

Replace time()-based client IDs with PID-based IDs using getpid(), which is
always a portable 32-bit value and unique per process. Platform-guarded for
Windows (_getpid) and POSIX (getpid).
2026-03-08 12:51:36 +00:00
Jonathan Naylor
32c3d7360e Update README.md 2026-02-14 18:20:45 +00:00
Jonathan Naylor
1028225a8d Merge branch 'master' into mqtt 2026-02-14 18:11:16 +00:00
Jonathan Naylor
3d099ae24d
Merge pull request #137 from f1rmb/f1rmb_nullptr_vs_NULL_with_getaddrinfo
Fix nullptr instead of NULL argument usage in getaddrinfo().
2025-06-09 13:38:04 +01:00
Daniel Caujolle-Bert
2aeaa71e87 Fix nullptr instead of NULL argument usage in getaddrinfo().
Bump version.
2025-06-07 17:29:32 +02:00
Jonathan Naylor
804478c328
Merge pull request #136 from olympy/unlim-networks
Unlimited number of DMR networks
2025-06-02 17:12:39 +01:00
Alexander Mokrov UR6LKW
fbdd2f36bf [unlim-networks] RemoteControl 2025-06-02 18:31:23 +03:00
Alexander Mokrov UR6LKW
366b32a29a [unlim-networks] DMRGateway 2025-06-02 01:40:35 +03:00
Alexander Mokrov UR6LKW
fa558552d8 [unlim-networks] Config 2025-06-02 01:40:29 +03:00
Alexander Mokrov UR6LKW
68e68c9c79 [unlim-networks] indentation fix 2025-06-02 01:39:51 +03:00
Jonathan Naylor
538108b192 Add optional MQTT authentication. 2025-03-21 17:37:30 +00:00
Jonathan Naylor
a2e2ea3675 Linux cleanups. 2025-03-17 14:29:13 +00:00
Jonathan Naylor
4ff688045f Update the C++ version and other changes. 2025-03-17 14:09:42 +00:00
Jonathan Naylor
fd54e3eb7c Merge branch 'master' into mqtt 2025-03-15 17:23:14 +00:00
Jonathan Naylor
ec5c32b57a Update the C++ code. 2025-03-15 17:03:06 +00:00
Jonathan Naylor
330fdd7158 Merge branch 'master' into mqtt 2024-08-31 20:06:29 +01:00
Jonathan Naylor
29397cf65e Fix signal logging. 2024-08-31 20:04:32 +01:00
Jonathan Naylor
e4e17ae74b Merge branch 'master' into mqtt 2024-08-28 16:53:49 +01:00
Jonathan Naylor
6d42e46285 Upgrade the signal handling. 2024-08-28 16:53:25 +01:00
Jonathan Naylor
870de67a2d Merge branch 'master' into mqtt 2024-08-28 16:10:16 +01:00
Jonathan Naylor
e1e41be3a0
Merge pull request #131 from nweisenfeld/nweisenfeld/correct-SIGHUP-handling
Fix SIGHUP treatment to loop/restart as intended
2024-08-28 15:47:32 +01:00
Neil Weisenfeld
9f73f66101 Fix SIGHUP treatment to loop/restart as intended
There's a do...while(m_signal==1) intended to allow a SIGHUP (1) to
cause a restart, rather than an exit.  But the current code doesn't
reset m_killed, so it does instantiate a new DMRGateway object, but
immediately exits.
2024-08-27 10:17:24 -04:00
Jonathan Naylor
8f428cf86b Fix a small bug. 2024-07-08 17:04:40 +01:00
Jonathan Naylor
0dffbf9ddb Allow it to build on Windows again. 2024-04-22 13:57:09 +01:00
Jonathan Naylor
b205134508 Merge branch 'master' into mqtt 2024-02-02 11:35:50 +00:00
Jonathan Naylor
2b81fe225b Re-organise the UDP handling. 2024-02-02 11:35:07 +00:00
Jonathan Naylor
f6b4698f14 Merge branch 'master' into mqtt 2024-01-29 16:49:31 +00:00
Jonathan Naylor
11683af7e4 Simplify the UDP socket handling. 2024-01-29 16:47:34 +00:00
Jonathan Naylor
3a6e47d39e
Merge pull request #127 from qradiolink/embedded_data_passing
Embedded data was not being passed through during rewrite
2024-01-25 18:23:34 +00:00
adrian
ad3fea93fb Embedded data was not being passed through during rewrite 2023-11-01 19:11:12 +02:00
Jonathan Naylor
8ca1bb8d72 Add DMR Master logging-in to the JSON status messages. 2023-07-23 14:30:49 +01:00
Jonathan Naylor
852caca96e Ad simple JSON logging. 2023-07-11 16:54:30 +01:00
Jonathan Naylor
61ccb47afd Don't close MQTT except at the end. 2023-07-07 19:19:26 +01:00
Jonathan Naylor
04146faa81 Convert to use of MQTT for command, APRS, and dynamic TG control. 2023-07-07 11:14:34 +01:00
Jonathan Naylor
a28aa7c549
Merge pull request #126 from f1rmb/f1rmb_gpsd_fix_status_check_api_version
Handle GPSd API version about fix status.
2023-05-21 12:57:52 +01:00
Daniel Caujolle-Bert
859c899ec8 Handle GPSd API version about fix status. 2023-05-21 05:28:55 +02:00
Jonathan Naylor
a858cf5276
Merge pull request #125 from W0CHP/master
Update sample INI with quoted `Symbol=` value.
2023-05-19 16:19:51 +01:00
Chipster
b6677007ec Update sample INI with quoted Symbol= value. 2023-05-19 09:58:50 -05:00
Jonathan Naylor
ac2f19c692
Merge pull request #123 from W0CHP/master 2023-02-17 18:04:52 +00:00
Chipster
3b0d2ff067 Add mode type to APRS string. Make APRS band/offset string a bit more consistent. 2023-02-17 06:06:58 -06:00
Jonathan Naylor
69b31b660b Update to he lastest gpsd 3.2.1 API. 2023-02-13 17:47:47 +00:00
Jonathan Naylor
d7a4c86dda
Merge pull request #122 from W0CHP/master 2023-02-13 13:35:14 +00:00
Chipster
32e4282de7 Update INI with new Symbol config item 2023-02-13 06:09:51 -06:00