1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-26 17:46:14 +01:00

Minor fixes for the integrated/standalone version; Copyright fixes

This commit is contained in:
Gregor Baues 2020-11-10 10:58:01 +01:00
parent edc38169dc
commit dda7bc7277
15 changed files with 239 additions and 200 deletions

View File

@ -18,9 +18,8 @@
DCCEXParser serialParser; DCCEXParser serialParser;
// (0) Declare NetworkInterfaces // (0) Declare NetworkInterfaces
// NetworkInterface wifi; NetworkInterface nwi1;
NetworkInterface eth1; NetworkInterface nwi2;
NetworkInterface eth2;
// (0) Declared NetworkInterfaces // (0) Declared NetworkInterfaces
// (1) Start NetworkInterface - HTTP callback // (1) Start NetworkInterface - HTTP callback
@ -77,15 +76,18 @@ void setup()
// New connection on known ssid / password combo / port can be added as a last parameter other wise the default of 2560 // New connection on known ssid / password combo / port can be added as a last parameter other wise the default of 2560
// will be used. If it passes the connection will be stored as permanent default. If fails will go into AP mode. // will be used. If it passes the connection will be stored as permanent default. If fails will go into AP mode.
// wifi.setup(WIFI, TCP, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME)); // wifi.init(WIFI, TCP, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME));
// wifi.setup(WIFI, TCP, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME, 2323) // wifi.init(WIFI, TCP, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME, 2323)
// wifi.init
eth1.setup(WIFI, UDPR); // ETHERNET, UDP on Port 2560
// eth1.setup(ETHERNET, TCP); // ETHERNET, UDP on Port 2560 // nwi1.setup(ETHERNET, UDPR); // ETHERNET/UDP on Port 2560
// eth2.setup(ETHERNET, TCP, 23); // ETHERNET, TCP on Port 23 for the CLI // nwi2.setup(ETHERNET, UDPR, 8888); // ETHERNET/UDP on Port 8888
// eth1.setup(ETHERNET, TCP, 8888); // ETHERNET, TCP on Port 8888 // nwi1.setup(ETHERNET, TCP); // ETHERNET/TCP on Port 2560
// wifi.setup(WIFI, TCP); // WIFI on Port 2560 nwi2.setup(ETHERNET, TCP, 23); // ETHERNET/TCP on Port 23 for the CLI
// eth1.setHttpCallback(httpRequestHandler); // HTTP callback // nwi1.setup(ETHERNET, TCP, 8888); // ETHERNET/TCP on Port 8888
// nwi2.setup(WIFI, TCP); // WIFI/TCP on Port 2560
// nwi1.setHttpCallback(httpRequestHandler); // HTTP callback
DIAG(F("\nNetwork Setup done ...\n")); DIAG(F("\nNetwork Setup done ...\n"));
DIAG(F("\nFree RAM after network init: [%d]\n"),freeMemory()); DIAG(F("\nFree RAM after network init: [%d]\n"),freeMemory());

View File

@ -1,21 +1,24 @@
/* /*
* © 2020 Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>
#include "NetworkDiag.h" #include "NetworkDiag.h"
#include "EthernetSetup.h" #include "EthernetSetup.h"

View File

@ -1,18 +1,20 @@
/* /*
* © 2020 Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef EthernetSetup_h #ifndef EthernetSetup_h

View File

@ -1,18 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>

View File

@ -1,18 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef NetworkDiag_h #ifndef NetworkDiag_h

View File

@ -1,18 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>

View File

@ -1,18 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef NetworkInterface_h #ifndef NetworkInterface_h

View File

@ -1,22 +1,23 @@
/* /*
* © 2020 Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>
#include "DIAG.h"
#include "NetworkSetup.h" #include "NetworkSetup.h"
NetworkSetup::NetworkSetup() {} NetworkSetup::NetworkSetup() {}

View File

@ -1,19 +1,22 @@
/* /*
* © 2020 Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef NetworkSetup_h #ifndef NetworkSetup_h
#define NetworkSetup_h #define NetworkSetup_h

View File

@ -1,27 +1,32 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>
#include "NetworkDiag.h" #include "NetworkDiag.h"
#include "NetworkInterface.h" #include "NetworkInterface.h"
#include "RingStream.h"
#include "Transport.h" #include "Transport.h"
#ifdef DCCEX_ENABLED
#include "RingStream.h"
#endif
extern bool diagNetwork; extern bool diagNetwork;
extern uint8_t diagNetworkClient; extern uint8_t diagNetworkClient;

View File

@ -1,19 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef Transport_h #ifndef Transport_h

View File

@ -1,18 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>

View File

@ -1,19 +1,20 @@
/* /*
* © 2020, Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef TransportProcessor_h #ifndef TransportProcessor_h
@ -23,11 +24,13 @@
#include <Ethernet.h> #include <Ethernet.h>
#include <WiFiEspAT.h> #include <WiFiEspAT.h>
#include "RingStream.h"
#include "Transport.h" #include "Transport.h"
#include "NetworkConfig.h" #include "NetworkConfig.h"
#include "NetworkInterface.h" #include "NetworkInterface.h"
#ifdef DCCEX_ENABLED
#include "RingStream.h"
#endif
class TransportProcessor class TransportProcessor
{ {

View File

@ -1,18 +1,20 @@
/* /*
* © 2020 Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#include <Arduino.h> #include <Arduino.h>
@ -22,7 +24,11 @@
#include "WifiSetup.h" #include "WifiSetup.h"
bool WifiSetup::setup() { bool WifiSetup::setup() {
Serial1.begin(AT_BAUD_RATE); /**
* @todo setup using SoftwareSerial or any other Hardware Serial port on the mega (i.e. 2 or 3);
*
*/
Serial1.begin(AT_BAUD_RATE);
WiFi.init(Serial1); WiFi.init(Serial1);
maxConnections = MAX_WIFI_SOCK; maxConnections = MAX_WIFI_SOCK;
@ -39,9 +45,10 @@ bool WifiSetup::setup() {
delay(1000); delay(1000);
DBG(F(".")); DBG(F("."));
} }
// Setup the protocol handler
INFO(F("Network Protocol: [%s]"), protocol ? "UDP" : "TCP"); INFO(F("Network Protocol: [%s]"), protocol ? "UDP" : "TCP");
// Setup the protocol handler
switch (protocol) switch (protocol)
{ {
case UDPR: case UDPR:

View File

@ -1,18 +1,20 @@
/* /*
* © 2020 Gregor Baues. All rights reserved. * © 2020 Gregor Baues. All rights reserved.
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the GNU General Public License as published by the
* the Free Software Foundation, either version 3 of the License, or * Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* It is distributed in the hope that it will be useful, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* but WITHOUT ANY WARRANTY; without even the implied warranty of * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* GNU General Public License for more details. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* You should have received a copy of the GNU General Public License * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* along with CommandStation. If not, see <https://www.gnu.org/licenses/>. * DEALINGS IN THE SOFTWARE.
*
* See the GNU General Public License for more details <https://www.gnu.org/licenses/>
*/ */
#ifndef WifiSetup_h #ifndef WifiSetup_h