Show if Daylight Saving Time is enabled.

This commit is contained in:
Andrius Štikonas 2016-04-17 23:03:36 +01:00
parent 99b2ed9d58
commit 7278cba9c0
Signed by: andrius
GPG Key ID: C86115C8091792EC
3 changed files with 3 additions and 1 deletions

View File

@ -125,7 +125,7 @@ void ConsoleReader::listSockets()
for (std::vector<Socket*>::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;

View File

@ -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;

View File

@ -55,6 +55,7 @@ public:
QHostAddress ip;
QByteArray mac;
bool powered;
bool dst;
QByteArray socketName, remotePassword;
int8_t timezone;
uint16_t offTime;