From dc5d6f742ff4a7dbee1dd4124a8cc337c739ce08 Mon Sep 17 00:00:00 2001 From: Sathya Laufer Date: Mon, 4 Jul 2016 12:25:28 +0200 Subject: [PATCH 1/2] Added class UdpSocket --- src/PhysicalInterfaces/Insteon_Hub_X10.cpp | 4 ++-- src/PhysicalInterfaces/Insteon_Hub_X10.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PhysicalInterfaces/Insteon_Hub_X10.cpp b/src/PhysicalInterfaces/Insteon_Hub_X10.cpp index 4237f05..320f7a0 100644 --- a/src/PhysicalInterfaces/Insteon_Hub_X10.cpp +++ b/src/PhysicalInterfaces/Insteon_Hub_X10.cpp @@ -39,7 +39,7 @@ InsteonHubX10::InsteonHubX10(std::shared_ptrid + "\": "); signal(SIGPIPE, SIG_IGN); - _socket = std::unique_ptr(new BaseLib::SocketOperations(_bl)); + _socket = std::unique_ptr(new BaseLib::TcpSocket(_bl)); _lengthLookup[0x50] = 11; _lengthLookup[0x51] = 25; @@ -667,7 +667,7 @@ void InsteonHubX10::startListening() try { stopListening(); - _socket = std::unique_ptr(new BaseLib::SocketOperations(GD::bl, _settings->host, _settings->port)); + _socket = std::unique_ptr(new BaseLib::TcpSocket(GD::bl, _settings->host, _settings->port)); _socket->setReadTimeout(1000000); _out.printDebug("Connecting to Insteon Hub X10 with Hostname " + _settings->host + " on port " + _settings->port + "..."); _stopped = false; diff --git a/src/PhysicalInterfaces/Insteon_Hub_X10.h b/src/PhysicalInterfaces/Insteon_Hub_X10.h index de2b0f2..3425933 100644 --- a/src/PhysicalInterfaces/Insteon_Hub_X10.h +++ b/src/PhysicalInterfaces/Insteon_Hub_X10.h @@ -94,7 +94,7 @@ class InsteonHubX10 : public IInsteonInterface int64_t _lastAction = 0; std::string _hostname; std::string _port; - std::unique_ptr _socket; + std::unique_ptr _socket; std::mutex _requestMutex; std::shared_ptr _request; std::mutex _sendMutex; From c7a46648ec33fd35cafbbe799b3e1d65f0c4f85e Mon Sep 17 00:00:00 2001 From: Sathya Laufer Date: Mon, 4 Jul 2016 14:35:57 +0200 Subject: [PATCH 2/2] Fixed: Error in determination of last channel index in most device families on packet reception. --- src/InsteonPeer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InsteonPeer.cpp b/src/InsteonPeer.cpp index 53dfef8..2d143ef 100644 --- a/src/InsteonPeer.cpp +++ b/src/InsteonPeer.cpp @@ -635,7 +635,7 @@ void InsteonPeer::getValuesFromPacket(std::shared_ptr packet, std if(frame->channel == -2) { startChannel = 0; - endChannel = (_rpcDevice->functions.end()--)->first; + endChannel = _rpcDevice->functions.rbegin()->first; } else endChannel = startChannel; for(int32_t l = startChannel; l <= endChannel; l++)