1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 12:51:24 +01:00

multicast receive tests

This commit is contained in:
Harald Barth 2024-11-09 12:57:49 +01:00
parent bcdf9cb1c5
commit 19f4869401
2 changed files with 17 additions and 2 deletions

View File

@ -36,9 +36,17 @@
#define DO_MDNS
EthernetUDP udp;
MDNS mdns(udp);
void serviceFound(const char* type, MDNSServiceProtocol /*proto*/, const char* name, IPAddress ip,
unsigned short port, const char* txtContent)
{
if (name == NULL) {
DIAG("End service discovery of %s", type);
return;
}
DIAG("Got %s of type %s", name, type);
}
#endif
//extern void looptimer(unsigned long timeout, const FSH* message);
#define looptimer(a,b)
@ -117,7 +125,10 @@ void EthernetInterface::setup()
outboundRing=new RingStream(OUTBOUND_RING_SIZE);
#ifdef DO_MDNS
mdns.begin(Ethernet.localIP(), WIFI_HOSTNAME); // hostname
udp.begin(IPAddress(224, 0, 0, 251), 5353, true);
mdns.addServiceRecord(WIFI_HOSTNAME "._withrottle", IP_PORT, MDNSServiceTCP);
// mdns.setServiceFoundCallback(serviceFound);
// mdns.startDiscoveringService("_withrottle", MDNSServiceTCP, 0);
// Not sure if we need to run it once, but just in case!
mdns.run();
#endif

View File

@ -252,8 +252,12 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums
* an operating system. */
//#define ETH_INPUT_USE_IT 1
#define LWIP_MDNS_RESPONDER 1
// We don't need this as we do not need to respond - we only announce
//#define LWIP_MDNS_RESPONDER 1
//#define LWIP_NUM_NETIF_CLIENT_DATA 1 // MDNS needs at least one
#define LWIP_IGMP 1
#define SO_REUSE 1
#define SO_REUSE_RXTOALL 1
#warning testing this
#endif /* __STM32LWIPOPTS_H__ */