Skip to content

Commit

Permalink
proto works
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Nov 10, 2024
1 parent 19f4869 commit 64a34b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions EthernetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
#include "CommandDistributor.h"
#include "WiThrottle.h"
#include "DCCTimer.h"
#if __has_include ( "MDNS_Generic.h")

#include "EXmDNS.h"
#define DO_MDNS
EthernetUDP udp;
MDNS mdns(udp);

#if 0 //#if __has_include ( "MDNS_Generic.h")
#include "MDNS_Generic.h"
#define DO_MDNS
EthernetUDP udp;
Expand Down Expand Up @@ -124,11 +130,9 @@ 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);
if (!mdns.begin(Ethernet.localIP(), WIFI_HOSTNAME))
DIAG("mdns.begin fail"); // hostname
mdns.addServiceRecord(WIFI_HOSTNAME, IP_PORT, MDNSServiceTCP);
// Not sure if we need to run it once, but just in case!
mdns.run();
#endif
Expand Down
4 changes: 2 additions & 2 deletions STM32lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE (10*1024)

// Could be better or worse, needs more tests
//#define MEM_LIBC_MALLOC 1
//#define MEMP_MEM_MALLOC 1
#define MEM_LIBC_MALLOC 1 // critical, fixes heap trashing
#define MEMP_MEM_MALLOC 1 // uses malloc which means no pools which means slower but not mean 32KB up front

/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
sends a lot of data out of ROM (or other static memory), this
Expand Down

0 comments on commit 64a34b3

Please sign in to comment.