From c5f0815f272b88e75e5a99ce98a838d9543ab5cd Mon Sep 17 00:00:00 2001 From: Aberto Panu Date: Tue, 12 May 2015 12:03:04 +0200 Subject: [PATCH 1/2] Add EthernetClient getSocketNumber() function --- libraries/Ethernet/src/EthernetClient.cpp | 4 ++++ libraries/Ethernet/src/EthernetClient.h | 1 + 2 files changed, 5 insertions(+) diff --git a/libraries/Ethernet/src/EthernetClient.cpp b/libraries/Ethernet/src/EthernetClient.cpp index 1feed4c42..a4950a155 100644 --- a/libraries/Ethernet/src/EthernetClient.cpp +++ b/libraries/Ethernet/src/EthernetClient.cpp @@ -171,3 +171,7 @@ EthernetClient::operator bool() { bool EthernetClient::operator==(const EthernetClient& rhs) { return _sock == rhs._sock && _sock != MAX_SOCK_NUM && rhs._sock != MAX_SOCK_NUM; } + ++uint8_t EthernetClient::getSocketNumber () { ++ return _sock; ++} diff --git a/libraries/Ethernet/src/EthernetClient.h b/libraries/Ethernet/src/EthernetClient.h index 16e2500bc..52a3b8f42 100644 --- a/libraries/Ethernet/src/EthernetClient.h +++ b/libraries/Ethernet/src/EthernetClient.h @@ -28,6 +28,7 @@ public: virtual bool operator!=(const bool value) { return bool() != value; } virtual bool operator==(const EthernetClient&); virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); }; + uint8_t getSocketNumber(); friend class EthernetServer; From e75d029c811cf99efc08c27b33b13acfae61677f Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 9 Jul 2015 15:40:50 +0200 Subject: [PATCH 2/2] Ethernet: add getSocketNumber to keywords --- libraries/Ethernet/keywords.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/Ethernet/keywords.txt b/libraries/Ethernet/keywords.txt index 7b162a54b..6963f8064 100644 --- a/libraries/Ethernet/keywords.txt +++ b/libraries/Ethernet/keywords.txt @@ -30,6 +30,7 @@ endPacket KEYWORD2 parsePacket KEYWORD2 remoteIP KEYWORD2 remotePort KEYWORD2 +getSocketNumber KEYWORD2 ####################################### # Constants (LITERAL1)