Parse domain server name.

This commit is contained in:
Andrius Štikonas 2015-02-15 15:26:37 +00:00
parent c414c091e8
commit e231388e95
3 changed files with 6 additions and 3 deletions

View File

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

View File

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

View File

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