Output timezone as a decimal number.

This commit is contained in:
Andrius Štikonas 2015-11-01 22:25:23 +00:00
parent bc4c6cfcaa
commit 4acb55c2e6
3 changed files with 11 additions and 12 deletions

View File

@ -122,7 +122,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().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.toHex().toStdString() << std::endl;
std::cout << "Socket Name: " << (*i)->socketName.toStdString() << "\t Remote Password: " << (*i)->remotePassword.toStdString() << "\t Timezone: " << +(*i)->timezone << std::endl;
std::cout << "Countdown: " << (*i)->countdown << " " << ((*i)->countdownEnabled ? "(enabled)" : "(disabled)") << "\t\t Time: " << (*i)->socketDateTime.toString().toStdString() << std::endl;
}
std::cout << "_____________________________________________________________________________\n" << std::endl;

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@ public:
QByteArray mac;
bool powered;
QByteArray socketName, remotePassword;
QByteArray timeZone;
int8_t timezone;
uint16_t countdown;
bool countdownEnabled;
QDateTime socketDateTime;
@ -81,7 +81,7 @@ private:
start();
}
void run();
void writeSocketData(QByteArray socketName, QByteArray remotePassword, QByteArray timeZone, uint16_t countdown);
void writeSocketData(QByteArray socketName, QByteArray remotePassword, int8_t timeZone, uint16_t countdown);
QByteArray intToHex(unsigned int value, unsigned int length, bool littleEndian = true);
int hexToInt(QByteArray value, bool littleEndian = true);