From 7278cba9c06f7b27dd325d9f6af1e98931d8de6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 17 Apr 2016 23:03:36 +0100 Subject: [PATCH] Show if Daylight Saving Time is enabled. --- consolereader.cpp | 2 +- socket.cpp | 1 + socket.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/consolereader.cpp b/consolereader.cpp index 8686200..7dd6362 100644 --- a/consolereader.cpp +++ b/consolereader.cpp @@ -125,7 +125,7 @@ void ConsoleReader::listSockets() for (std::vector::const_iterator i = sockets->begin() ; i != sockets->end(); ++i) { std::cout << "_____________________________________________________________________________\n" << std::endl; std::cout << "IP Address: " << (*i)->ip.toString().remove("::ffff:").toStdString() << "\t MAC Address: " << (*i)->mac.toHex().toStdString() << "\t Power: " << ((*i)->powered ? "On" : "Off") << std::endl; - std::cout << "Socket Name: " << (*i)->socketName.toStdString() << "\t Remote Password: " << (*i)->remotePassword.toStdString() << "\t Timezone: " << +(*i)->timezone << std::endl; + std::cout << "Socket Name: " << (*i)->socketName.toStdString() << "\t Remote Password: " << (*i)->remotePassword.toStdString() << "\t Timezone: " << +(*i)->timezone << ((*i)->dst ? " (DST)" : "") << std::endl; std::cout << "Off timer: " << (*i)->offTime << " " << ((*i)->offTimerEnabled ? "(enabled)" : "(disabled)") << "\t\t Time: " << (*i)->socketDateTime.toString().toStdString() << std::endl; } std::cout << "_____________________________________________________________________________\n" << std::endl; diff --git a/socket.cpp b/socket.cpp index 9e499d7..6d855ba 100644 --- a/socket.cpp +++ b/socket.cpp @@ -265,6 +265,7 @@ bool Socket::parseReply(QByteArray reply) localNetMask = reply.mid(index, 4); index += 4; DST_TimezoneOffset = reply.mid(index, 1); + dst = DST_TimezoneOffset == QByteArray::fromHex("00") || DST_TimezoneOffset == QByteArray::fromHex("02"); ++index; discoverable = reply.mid(index, 1); ++index; diff --git a/socket.h b/socket.h index 64d0a37..06217c3 100644 --- a/socket.h +++ b/socket.h @@ -55,6 +55,7 @@ public: QHostAddress ip; QByteArray mac; bool powered; + bool dst; QByteArray socketName, remotePassword; int8_t timezone; uint16_t offTime;