Print countdown.
This commit is contained in:
parent
e22a8c6682
commit
e7c521bc10
|
@ -94,7 +94,9 @@ void ConsoleReader::listSockets()
|
|||
{
|
||||
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.toHex().toStdString()
|
||||
<< std::endl;
|
||||
std::cout << "Countdown: " << (*i)->countdown.toHex().toStdString() << std::endl;
|
||||
}
|
||||
std::cout << "_____________________________________________________________________________\n" << std::endl;
|
||||
std::cout << "d - update table data\nn - change socket name (max 16 characters)\np - toggle power state\nP - change remote password (max 12 characters)\n";
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include <QUdpSocket>
|
||||
#include <iostream>
|
||||
|
||||
#include "consolereader.h"
|
||||
#include "server.h"
|
||||
|
@ -91,6 +92,7 @@ void Server::readPendingDatagrams()
|
|||
}
|
||||
|
||||
}
|
||||
std::cout << "Packet not belonging to any socket: " << reply.toHex().toStdString() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,11 +39,12 @@ Socket::Socket ( QHostAddress IPaddress, QByteArray reply )
|
|||
commandID[SocketData] = commandID[TableData];
|
||||
commandID[TimingData] = commandID[TableData];
|
||||
commandID[WriteSocketData] = QByteArray::fromHex ( "74 6d" );
|
||||
QByteArray commandIDPower = QByteArray::fromHex ( "64 63" );
|
||||
|
||||
// 2 hex bytes are the total length of the message
|
||||
datagram[Subscribe] = commandID[Subscribe] + mac + twenties + rmac + twenties;
|
||||
datagram[PowerOn] = QByteArray::fromHex ( "64 63" ) + mac + twenties + zeros + one;
|
||||
datagram[PowerOff] = QByteArray::fromHex ( "64 63" ) + mac + twenties + zeros + zero;
|
||||
datagram[PowerOn] = commandIDPower + mac + twenties + zeros + one;
|
||||
datagram[PowerOff] = commandIDPower + mac + twenties + zeros + zero;
|
||||
datagram[TableData] = commandID[TableData] + mac + twenties + zeros + QByteArray::fromHex ( "01 00 00" ) + zeros;
|
||||
|
||||
udpSocket = new QUdpSocket();
|
||||
|
|
2
socket.h
2
socket.h
|
@ -51,6 +51,7 @@ public:
|
|||
bool powered;
|
||||
QByteArray socketName, remotePassword;
|
||||
QByteArray timeZone;
|
||||
QByteArray countdown;
|
||||
|
||||
private:
|
||||
enum Datagram {Subscribe, PowerOff, PowerOn, TableData, SocketData, TimingData, WriteSocketData, MaxCommands};
|
||||
|
@ -78,7 +79,6 @@ private:
|
|||
QByteArray dhcpNode;
|
||||
QByteArray discoverable;
|
||||
QByteArray timeZoneSet;
|
||||
QByteArray countdown;
|
||||
QByteArray socketTableNumber, socketTableVersion, timingTableNumber, timingTableVersion; // FIXME: not used yet
|
||||
|
||||
const QByteArray twenties = QByteArray::fromHex ( "20 20 20 20 20 20" ); // mac address padding, 6 spaces
|
||||
|
|
Loading…
Reference in New Issue