Skip to content

Commit

Permalink
multicast receive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Nov 9, 2024
1 parent bcdf9cb commit 19f4869
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion EthernetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion STM32lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */
Expand Down

0 comments on commit 19f4869

Please sign in to comment.