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

Bugfix STM32 MAX_SOCK_NUM set to 8 for now

This commit is contained in:
pmantoine 2024-07-22 10:22:25 +08:00
parent 04be72b2f9
commit a992035e10
3 changed files with 14 additions and 10 deletions

View File

@ -211,6 +211,8 @@ bool EthernetInterface::checkLink() {
}
mdns.begin(Ethernet.localIP(), WIFI_HOSTNAME); // hostname
mdns.addServiceRecord(WIFI_HOSTNAME "._withrottle", IP_PORT, MDNSServiceTCP);
// Not sure if we need to run it once, but just in case!
mdns.run();
// only create a outboundRing it none exists, this may happen if the cable
// gets disconnected and connected again
if(!outboundRing)
@ -244,10 +246,14 @@ bool EthernetInterface::checkLink() {
}
void EthernetInterface::loop2() {
if (!outboundRing) { // no idea to call loop2() if we can't handle outgoing data in it
if (Diag::ETHERNET) DIAG(F("No outboundRing"));
return;
}
if (!outboundRing) { // no idea to call loop2() if we can't handle outgoing data in it
if (Diag::ETHERNET) DIAG(F("No outboundRing"));
return;
}
// Always do this because we don't want traffic to intefere with being found!
mdns.run();
// get client from the server
#if defined (STM32_ETHERNET)
// STM32Ethernet doesn't use accept(), just available()
@ -323,8 +329,6 @@ void EthernetInterface::loop2() {
}
}
mdns.run();
WiThrottle::loop(outboundRing);
// handle at most 1 outbound transmission

View File

@ -43,7 +43,7 @@
#include <lwip/netif.h>
extern "C" struct netif gnetif;
#define STM32_ETHERNET
#define MAX_SOCK_NUM 10
#define MAX_SOCK_NUM 8
#else
#include "Ethernet.h"
// #define MAX_SOCK_NUM 4
@ -57,7 +57,6 @@
#define MAX_ETH_BUFFER 512
#define OUTBOUND_RING_SIZE 2048
class EthernetInterface {
public:
@ -76,7 +75,7 @@ class EthernetInterface {
struct {
EthernetClient client;
bool inUse;
} clients[MAX_CLIENT];
} clients[MAX_SOCK_NUM];
// accept up to MAX_SOCK_NUM client connections at the same time; This depends on the chipset used on the Shield
uint8_t buffer[MAX_ETH_BUFFER+1]; // buffer used by TCP for the recv

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h"
#define VERSION "5.3.13"
#define VERSION "5.3.14"
// 5.3.14 - Bugfix: MAX_SOCK_NUM on STM32 for now set to 8 which seems reliable - no doubt some setting in lwip needs tweaking for more
// 5.3.13 - Bugfix: refactored the Ethernet client handling code to use an inUse boolean for each client - now works!
// 5.2.60 - Bugfix: Opcode AFTEROVERLOAD does not have an argument that is a pin and needs to be initialized
// - Remove inrush throttle after half good time so that we go to mode overload if problem persists