From a8bd530451d27d0cac91e9511d0fdf54360d1b7a Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sat, 13 Feb 2021 17:20:45 +0000 Subject: [PATCH] Reinstate IP_PORT Arrrrgh! --- CommandStation-EX.ino | 2 +- EthernetInterface.cpp | 4 ++-- EthernetInterface.h | 1 - config.example.h | 6 ++++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CommandStation-EX.ino b/CommandStation-EX.ino index dbce4e7..4872375 100644 --- a/CommandStation-EX.ino +++ b/CommandStation-EX.ino @@ -69,7 +69,7 @@ void setup() // Start the WiFi interface on a MEGA, Uno cannot currently handle WiFi #if WIFI_ON - WifiInterface::setup(WIFI_SERIAL_LINK_SPEED, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME), 2560); + WifiInterface::setup(WIFI_SERIAL_LINK_SPEED, F(WIFI_SSID), F(WIFI_PASSWORD), F(WIFI_HOSTNAME), IP_PORT); #endif // WIFI_ON #if ETHERNET_ON diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 2061aa6..38a0b24 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -83,11 +83,11 @@ EthernetInterface::EthernetInterface() IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address - server = new EthernetServer(LISTEN_PORT); // Ethernet Server listening on default port LISTEN_PORT + server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT server->begin(); LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); - LCD(5,F("Port:%d"), LISTEN_PORT); + LCD(5,F("Port:%d"), IP_PORT); outboundRing=new RingStream(OUTBOUND_RING_SIZE); } diff --git a/EthernetInterface.h b/EthernetInterface.h index 886fc52..87bb8b6 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -39,7 +39,6 @@ * */ -#define LISTEN_PORT 2560 // standard listen port for the server #define MAX_ETH_BUFFER 512 #define OUTBOUND_RING_SIZE 2048 diff --git a/config.example.h b/config.example.h index cdad05c..8c25ab9 100644 --- a/config.example.h +++ b/config.example.h @@ -26,6 +26,12 @@ The configuration file for DCC-EX Command Station // #define MOTOR_SHIELD_TYPE STANDARD_MOTOR_SHIELD +///////////////////////////////////////////////////////////////////////////////////// +// +// The IP port to talk to a WIFI or Ethernet shield. +// +#define IP_PORT 2560 + ///////////////////////////////////////////////////////////////////////////////////// // // NOTE: Only supported on Arduino Mega