Your device has a different "endianess" from your PC for binary data? You also resize "bab" once and "buffer" twice, including after assigning bab.data() to it. Why?
Your device has a different "endianess" from your PC for binary data? You also resize "bab" once and "buffer" twice, including after assigning bab.data() to it. Why?
Thanks for reply
ths taillemessage is defined by socket.bytesavailable, i try to use buffers to stock data incoming.
can you give an element of response it seem working when i have one packet recieved but for other packets the data displayed is different to data that i have on wireshark.
It seem s work with first packet but when other packets becomes i compare. Packets displayed and data packets on wireshark and they are completly different
How do you store the data until you have reached the necessary amount for interpretation?
Or rather how do you plan on doing this, currently you seem to accumulate everything as text, which is likely not what you will end up using.
Cheers,
_
I just recieve data becoming from the equipement who send me response..
but response displayed doesnt match the data on the network.
The data stored in bytearray is simply displayed on textbrowser just to make sure that i have recieved the data that i expected to ricieve.
You wrote that "the first packet" works, but since TCP does not work with packets I assume you are referring to reponses.
What your code currently doesn't show how you separate responses, i.e. where you determine that one response has endded and the next one has started.
Cheers,
_
i dont have specific endword in my response from the controller that i m asking
but if i send instruction 0x0801 automatically the controller will send the respnse in three times
4 bytes 0X08010d01
32 bytes 0000..... (Only zeros)
237 bytes 000000010000000010101010101....01010000000000000.. .....
i know exactly 01 positions but i dont know how can i get those two other packets because i only recieve the first packet authentic.
The others are something like random packets .
How can i get this issu resolved??
Added after 8 minutes:
More explanations
If i recieve the first 4bytes packet i display it on my textbroxser widget . its ok
The second other packets i display theire sizes and what are containing
the size is fine but what contains is alrady something like efffff0000001111ddffffff00000
and sometime when i refresh i get the right packets
However the packets transmitted dont contains delimiter of end sending or something like that.
Last edited by IODR100; 6th March 2016 at 15:30.
Well, if you know that the response has a defined size, then it doesn't need any delimiter.
You can then check the number of received bytes to determine when the next response starts.
My suggestion would be to assmble each response completely before attempting to display it.
Cheers,
_
Bookmarks