linux-native: allow multiple processes to all bind to the same multicast 2tuple (#6391)

* cleanup UdpMulticastThread.h preprocessor rules a tiny bit

* bump platform-native to allow for multiple multicast listeners on the same machine

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Jorropo 2025-03-25 01:30:47 +01:00 committed by GitHub
parent e9d8a3d7f9
commit 3afe84c4f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated). ; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
[portduino_base] [portduino_base]
platform = https://github.com/meshtastic/platform-native.git#df71ed0040e9aad767a002829330965b78fc452a platform = https://github.com/meshtastic/platform-native.git#e82ba1a19b6cd1dc55cbde29b33ea8dd0640014f
framework = arduino framework = arduino
build_src_filter = build_src_filter =

View File

@ -23,7 +23,7 @@ class UdpMulticastThread : public concurrency::OSThread
void start() void start()
{ {
if (udp.listenMulticast(udpIpAddress, UDP_MULTICAST_DEFAUL_PORT, 64)) { if (udp.listenMulticast(udpIpAddress, UDP_MULTICAST_DEFAUL_PORT, 64)) {
#if !defined(ARCH_PORTDUINO) #ifndef ARCH_PORTDUINO
// FIXME(PORTDUINO): arduino lacks IPAddress::toString() // FIXME(PORTDUINO): arduino lacks IPAddress::toString()
LOG_DEBUG("UDP Listening on IP: %s", WiFi.localIP().toString().c_str()); LOG_DEBUG("UDP Listening on IP: %s", WiFi.localIP().toString().c_str());
#else #else
@ -59,7 +59,7 @@ class UdpMulticastThread : public concurrency::OSThread
if (!mp || !udp) { if (!mp || !udp) {
return false; return false;
} }
#if !defined(ARCH_PORTDUINO) #ifndef ARCH_PORTDUINO
if (WiFi.status() != WL_CONNECTED) { if (WiFi.status() != WL_CONNECTED) {
return false; return false;
} }