From dda7bc7277bbfce5ad525a24ec212bab2450eb9b Mon Sep 17 00:00:00 2001 From: Gregor Baues Date: Tue, 10 Nov 2020 10:58:01 +0100 Subject: [PATCH] Minor fixes for the integrated/standalone version; Copyright fixes --- CommandStation-EX.ino | 24 +++++++++++++----------- EthernetSetup.cpp | 29 ++++++++++++++++------------- EthernetSetup.h | 28 +++++++++++++++------------- NetworkDiag.cpp | 28 +++++++++++++++------------- NetworkDiag.h | 28 +++++++++++++++------------- NetworkInterface.cpp | 28 +++++++++++++++------------- NetworkInterface.h | 28 +++++++++++++++------------- NetworkSetup.cpp | 29 +++++++++++++++-------------- NetworkSetup.h | 29 ++++++++++++++++------------- Transport.cpp | 33 +++++++++++++++++++-------------- Transport.h | 29 +++++++++++++++-------------- TransportProcessor.cpp | 28 +++++++++++++++------------- TransportProcessor.h | 33 ++++++++++++++++++--------------- WifiSetup.cpp | 37 ++++++++++++++++++++++--------------- WifiSetup.h | 28 +++++++++++++++------------- 15 files changed, 239 insertions(+), 200 deletions(-) diff --git a/CommandStation-EX.ino b/CommandStation-EX.ino index b7aea08..b717392 100644 --- a/CommandStation-EX.ino +++ b/CommandStation-EX.ino @@ -18,9 +18,8 @@ DCCEXParser serialParser; // (0) Declare NetworkInterfaces -// NetworkInterface wifi; -NetworkInterface eth1; -NetworkInterface eth2; +NetworkInterface nwi1; +NetworkInterface nwi2; // (0) Declared NetworkInterfaces // (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 // 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.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)); + // 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 - // eth2.setup(ETHERNET, TCP, 23); // ETHERNET, TCP on Port 23 for the CLI - // eth1.setup(ETHERNET, TCP, 8888); // ETHERNET, TCP on Port 8888 - // wifi.setup(WIFI, TCP); // WIFI on Port 2560 - // eth1.setHttpCallback(httpRequestHandler); // HTTP callback + + // nwi1.setup(ETHERNET, UDPR); // ETHERNET/UDP on Port 2560 + // nwi2.setup(ETHERNET, UDPR, 8888); // ETHERNET/UDP on Port 8888 + // nwi1.setup(ETHERNET, TCP); // ETHERNET/TCP on Port 2560 + nwi2.setup(ETHERNET, TCP, 23); // ETHERNET/TCP on Port 23 for the CLI + // 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("\nFree RAM after network init: [%d]\n"),freeMemory()); diff --git a/EthernetSetup.cpp b/EthernetSetup.cpp index 943384e..6c081c2 100644 --- a/EthernetSetup.cpp +++ b/EthernetSetup.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include + #include "NetworkDiag.h" #include "EthernetSetup.h" diff --git a/EthernetSetup.h b/EthernetSetup.h index c9f5aaf..d84a192 100644 --- a/EthernetSetup.h +++ b/EthernetSetup.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #ifndef EthernetSetup_h diff --git a/NetworkDiag.cpp b/NetworkDiag.cpp index 78364c6..4984b44 100644 --- a/NetworkDiag.cpp +++ b/NetworkDiag.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include diff --git a/NetworkDiag.h b/NetworkDiag.h index 76b5255..9102422 100644 --- a/NetworkDiag.h +++ b/NetworkDiag.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #ifndef NetworkDiag_h diff --git a/NetworkInterface.cpp b/NetworkInterface.cpp index c502869..d9dc552 100644 --- a/NetworkInterface.cpp +++ b/NetworkInterface.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include diff --git a/NetworkInterface.h b/NetworkInterface.h index 29c0d9b..87cdbaf 100644 --- a/NetworkInterface.h +++ b/NetworkInterface.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #ifndef NetworkInterface_h diff --git a/NetworkSetup.cpp b/NetworkSetup.cpp index 4c2da0f..0784efc 100644 --- a/NetworkSetup.cpp +++ b/NetworkSetup.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include -#include "DIAG.h" #include "NetworkSetup.h" NetworkSetup::NetworkSetup() {} diff --git a/NetworkSetup.h b/NetworkSetup.h index 2b55cff..784c610 100644 --- a/NetworkSetup.h +++ b/NetworkSetup.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ + #ifndef NetworkSetup_h #define NetworkSetup_h diff --git a/Transport.cpp b/Transport.cpp index 818b5f0..7d2ed48 100644 --- a/Transport.cpp +++ b/Transport.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include #include "NetworkDiag.h" #include "NetworkInterface.h" -#include "RingStream.h" #include "Transport.h" +#ifdef DCCEX_ENABLED +#include "RingStream.h" +#endif + extern bool diagNetwork; extern uint8_t diagNetworkClient; diff --git a/Transport.h b/Transport.h index 68bde4c..146d01e 100644 --- a/Transport.h +++ b/Transport.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #ifndef Transport_h diff --git a/TransportProcessor.cpp b/TransportProcessor.cpp index 8e42c49..290f5da 100644 --- a/TransportProcessor.cpp +++ b/TransportProcessor.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include diff --git a/TransportProcessor.h b/TransportProcessor.h index 2ff7c34..21550a1 100644 --- a/TransportProcessor.h +++ b/TransportProcessor.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #ifndef TransportProcessor_h @@ -23,11 +24,13 @@ #include #include -#include "RingStream.h" #include "Transport.h" #include "NetworkConfig.h" #include "NetworkInterface.h" +#ifdef DCCEX_ENABLED +#include "RingStream.h" +#endif class TransportProcessor { diff --git a/WifiSetup.cpp b/WifiSetup.cpp index 48c03f6..7fdef60 100644 --- a/WifiSetup.cpp +++ b/WifiSetup.cpp @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #include @@ -22,7 +24,11 @@ #include "WifiSetup.h" 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); maxConnections = MAX_WIFI_SOCK; @@ -39,9 +45,10 @@ bool WifiSetup::setup() { delay(1000); DBG(F(".")); } - // Setup the protocol handler + INFO(F("Network Protocol: [%s]"), protocol ? "UDP" : "TCP"); + // Setup the protocol handler switch (protocol) { case UDPR: diff --git a/WifiSetup.h b/WifiSetup.h index 552d294..489f9ab 100644 --- a/WifiSetup.h +++ b/WifiSetup.h @@ -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 - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * It is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with CommandStation. If not, see . + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * See the GNU General Public License for more details */ #ifndef WifiSetup_h