From c5f0815f272b88e75e5a99ce98a838d9543ab5cd Mon Sep 17 00:00:00 2001 From: Aberto Panu Date: Tue, 12 May 2015 12:03:04 +0200 Subject: [PATCH] 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;