mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 08:36:14 +01:00
cleaning up
This commit is contained in:
parent
330bdf58a1
commit
1d881a4b43
|
@ -219,7 +219,6 @@ void WifiNINA::checkForNewClient() {
|
||||||
for (byte clientId=0; clientId<MAX_CLIENTS; clientId++){
|
for (byte clientId=0; clientId<MAX_CLIENTS; clientId++){
|
||||||
if (!clients[clientId]) {
|
if (!clients[clientId]) {
|
||||||
clients[clientId]= new WiFiClient(newClient); // use this slot
|
clients[clientId]= new WiFiClient(newClient); // use this slot
|
||||||
///clients[clientId]->flush(); // clear out the input buffer
|
|
||||||
DIAG(F("New client connected to slot %d"),clientId); //TJF: brought in for debugging.
|
DIAG(F("New client connected to slot %d"),clientId); //TJF: brought in for debugging.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -233,7 +232,6 @@ void WifiNINA::checkForLostClients() {
|
||||||
clients[clientId]->stop();
|
clients[clientId]->stop();
|
||||||
DIAG(F("Remove client %d"), clientId);
|
DIAG(F("Remove client %d"), clientId);
|
||||||
CommandDistributor::forget(clientId);
|
CommandDistributor::forget(clientId);
|
||||||
//delete c; //TJF: this causes a crash when client drops.. commenting out for now.
|
|
||||||
clients[clientId]=nullptr;
|
clients[clientId]=nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,12 +268,7 @@ void WifiNINA::checkForClientOutput() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// emit data to the client object
|
// emit data to the client object
|
||||||
// This should work in theory, the
|
|
||||||
//DIAG(F("send message")); //TJF: only for diag
|
|
||||||
//TJF: the old code had to add a 0x00 byte to the end to terminate the
|
|
||||||
//TJF: c string, before sending it. i take it this is not needed?
|
|
||||||
for (int i=0;i<replySize;i++) c->write(outboundRing->read());
|
for (int i=0;i<replySize;i++) c->write(outboundRing->read());
|
||||||
//c->write((byte)0x00);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WifiNINA::loop() {
|
void WifiNINA::loop() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user