Receiving data packets from the serial port
-
wrote on 3 Jul 2016, 15:40 last edited by Basti46 7 Sept 2016, 18:00This post is deleted!
-
wrote on 3 Jul 2016, 17:26 last edited by
@Basti46 So what's your question?
-
@Basti46 So what's your question?
wrote on 3 Jul 2016, 17:55 last edited by@Wieland Sooo my question is, how can i interpret the data from my device. I know that i will receive a data paket with low and high bytes. But as you can see the charArray doen't contain any usefull values. (\x00\xFF\x13g\xDE\xF8\x13\b8@\xC0\xB8\xF9\x03\b\t\xFF\x03\xC8\tB\xFF) I know that withing this data paket there are some ASCII chars. but how can i get those. I don't even know where my problem is that's why i am not able to explain my question better. Sorry for that.
-
wrote on 3 Jul 2016, 18:03 last edited by
Okay. Wikipedia says:
A zero byte appears at the end of every packet to indicate end-of-packet to the data receiver. This packet delimiter byte does not correspond to a data byte; it is an additional byte that is appended to the encoded output.
So you need to scan the received data for zero bytes and break the input stream into single frames there.
Also the wikipedia article you provided features an example implementation of a COBS decoder in C, which you can copy and paste as a starting point.
-
Okay. Wikipedia says:
A zero byte appears at the end of every packet to indicate end-of-packet to the data receiver. This packet delimiter byte does not correspond to a data byte; it is an additional byte that is appended to the encoded output.
So you need to scan the received data for zero bytes and break the input stream into single frames there.
Also the wikipedia article you provided features an example implementation of a COBS decoder in C, which you can copy and paste as a starting point.
wrote on 4 Jul 2016, 10:55 last edited by@Wieland Well i found my problem, I chose the wrong baudrate. Now i have to adjust my code, but i think it will work sooner or later. Thanks again!
1/5