0

I have a device that is sending data frames with bytes in one connection. First it sends Hello Frame, to which I respond by ACK, then it sends not fixed-length data frame. And there is a problem. That data frame sometimes is divided into two parts.

For example:

00 00 00 00 00 00 04 cf 08 09 (and next 234 bytes)

(994 bytes and last:) 09 00 00 ab 9b

The first 4 bytes in first part are "Preamble", next 4 bytes are Data Field Length, next one byte of "number of data", then are data bytes. In second part are data bytes too, followed by one byte of "number of data", and 4 bytes of CRC-16.

And this is one example. Another example is divided into two parts too, but in another place:

00 00 00 00 00 00 04 cf 08 09 (and next 1230 bytes)

00 ab 9b

This is the same frame, but divided in another place...

And my question is: How can I read full frame of data? What approach will be the best? I'm using xSocket

Nolias
  • 101
  • 1
  • 10

0 Answers0