diff --git a/UIPServer.cpp b/UIPServer.cpp index 21c7ef5..08ddecc 100644 --- a/UIPServer.cpp +++ b/UIPServer.cpp @@ -26,6 +26,12 @@ UIPServer::UIPServer(uint16_t port) : _port(htons(port)) { } +//added function to change port on the fly +void UIPServer::setport(uint16_t port) +{ + _port=htons(port); +} + UIPClient UIPServer::available() { UIPEthernetClass::tick(); diff --git a/UIPServer.h b/UIPServer.h index 0cc0619..5683e8a 100644 --- a/UIPServer.h +++ b/UIPServer.h @@ -32,6 +32,7 @@ class UIPServer : public Server { size_t write(uint8_t); size_t write(const uint8_t *buf, size_t size); using Print::write; + void setport(uint16_t _port); //added function to change port on the fly private: uint16_t _port;