diff --git a/consolereader.cpp b/consolereader.cpp index ece4412..6941166 100644 --- a/consolereader.cpp +++ b/consolereader.cpp @@ -99,5 +99,5 @@ void ConsoleReader::listSockets() 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"; std::cout << "q - quit\ns - pick another socket (default is 1)\nt - change timezone" << std::endl; - std::cout << "Enter command: " << std::flush; + std::cout << "Enter command: " << std::endl; } diff --git a/socket.cpp b/socket.cpp index f54053b..817d14d 100644 --- a/socket.cpp +++ b/socket.cpp @@ -122,7 +122,7 @@ void Socket::changeTimezone ( int8_t newTimezone ) void Socket::writeSocketData(QByteArray name, QByteArray password, QByteArray timezone) { - QByteArray record = QByteArray::fromHex ( "01:00" ) /* record number = 1*/ + versionID + mac + twenties + rmac + twenties + password + name + icon + hardwareVersion + firmwareVersion + wifiFirmwareVersion + port + staticServerIP + port + QStringLiteral("vicenter.orvibo.com ").toLatin1() + twenties + twenties + twenties + localIP + localGatewayIP + localNetMask + dhcpNode + discoverable + timeZoneSet + timezone + QByteArray::fromHex ( "00:ff" ) + countdown; + QByteArray record = QByteArray::fromHex ( "01:00" ) /* record number = 1*/ + versionID + mac + twenties + rmac + twenties + password + name + icon + hardwareVersion + firmwareVersion + wifiFirmwareVersion + port + staticServerIP + port + domainServerName + localIP + localGatewayIP + localNetMask + dhcpNode + discoverable + timeZoneSet + timezone + QByteArray::fromHex ( "00:ff" ) + countdown; QByteArray recordLength; QDataStream stream(&recordLength, QIODevice::WriteOnly); @@ -212,7 +212,9 @@ bool Socket::parseReply ( QByteArray reply ) wifiFirmwareVersion = reply.mid ( index, 4 ); index += 6; staticServerIP = reply.mid ( index, 4 ); // 42.121.111.208 is used - index += 46; + index += 6; + domainServerName = reply.mid ( index, 40); + index += 40; localIP = reply.mid ( index, 4 ); index += 4; localGatewayIP = reply.mid ( index, 4 ); diff --git a/socket.h b/socket.h index c84b507..1275744 100644 --- a/socket.h +++ b/socket.h @@ -71,6 +71,7 @@ private: QByteArray wifiFirmwareVersion; // CC3000 firmware version QByteArray staticServerIP; QByteArray port = QByteArray::fromHex ( "10:27" ); // 10000 in hex (little endian) + QByteArray domainServerName; QByteArray localIP; // same as QHostAddress ip but in QByteArray, maybe fix later... QByteArray localGatewayIP; QByteArray localNetMask;