Wysota,
Thanks for your help. I believe it is the decoding part since in the GUI I can watch the last four digits after the decimal point change in real time. Also, if I uncomment the line: // temperature_string = "023.1234"; then the the GUI shows 23.1234 which is the format I'd like to see.
Here's the function which I am having trouble with:
double WeatherBalloon::temperature()
{
double temperature;
QString temperature_string; //("123.1234")
QByteArray sensogram(socketDevice.bytesAvailable());
QDataStream out(sensogram, IO_WriteOnly);
out.setVersion(1);
socketDevice.writeBlock(sensogram, sensogram.size(), 0x0A640005, 80);
// out << temperature; //out anything to 10.100.0.5
socketDevice.readBlock(sensogram.data(), sensogram.size());
QDataStream in(sensogram, IO_ReadOnly);
in.setVersion(1);
in >> temperature_string;
// temperature_string = "023.1234";
temperature = temperature_string.toDouble();
return temperature;
Bookmarks