Unsolved Converting Qbyte array to array and to double
-
@artwaw yes in my code I have
qDebug() << "this is data"<< myDatadouble; QString DatatoString =QString::number(myDatadouble);
just when i copying it i I was mistaken .
I update my topic :)
-
@dziko147
Hi,
you have checked only if (data.size()== 5) in first if,
Did you check in else that the data size is correct?
I think no -
@CP71 yes it return a size :8 byte
-
@dziko147
8! so doesn't you have a one spare byte in else as in float case? -
@CP71 said in Converting Qbyte array to array and to double:
8! so doesn't you have a one spare byte in else as in float case?
no I usually get frame started with FF .
I mean than in the case of a float I get "FF + 4Byte data"
In the case of a Double I get "FF +7Byte data "
and here I skip the first byte
quint8 byte; stream >> byte; // skip first byte
-
@dziko147 said in Converting Qbyte array to array and to double:
In the case of a Double I get "FF +7Byte data "
Sorry, but in double case I think you'd send 0xFF+8bytes, anyway I think your application tries read a double at 8 bytes
-
@CP71 you are right :D
-
@CP71 now how can make it readable .
For example I get " 3.13891e-43 " for a array "0xff000000e0" .
please -
@dziko147
It is wrong!https://www.binaryconvert.com/convert_double.html
As last time, I must go.
Sorry, bye -
@CP71 as u like bro good bye