the start and finish characters cannot be allowed in the data body of your message using your simplistic scheme ;
there are much simpler and more reliable methods
the start and finish characters cannot be allowed in the data body of your message using your simplistic scheme ;
there are much simpler and more reliable methods
Warning I'm not a teacher
The safest is to use ASCII characters for your numbers and not binary.
Of course this will need more characters to send but that way your delimiter will not mess with your data.
Or maybe you can have specific data length and then CRC check along with timeout.
Ioannis
I have a need to identify the to-from PICs, as well as data identification, and a confirmation code if it went OK (still thinking about how to handle Not OK).Originally Posted by Ioannis
I've practiced CRC many years ago, so I might still add that feature to make sure the data was not scrambled while still having valid delimiters.
I've been thinking a lot about how to delimit messages with characters that do not interfere with the message (or rather vice versa as Richard pointed out). The last character in the ASCII table is 126 $7E ~, in binary that's 01111110. Is anything stopping me from using %1xxxxxxx and up to act as delimiters?
Prefix delimiter:
- %11nnnnnn, PIC ID (64 combinations);
- %1nnnnnnn, Transaction ID (128 combinations).
Messaqe:
-bla bla bla
CRC:
- byte (can handle 255 byte message, or at worst, a word).
Suffix delimiter (seems it's limited to a single byte in PBP - "Receive string of n characters optionally ended in character c"):
- %111nnnnn, Confirmation code (32 combinations).
This would only cost me 3 bytes, offer plenty combinations and could be imbedded along with the message.
What simpler techniques did you have in mind?there are much simpler and more reliable methods
I also want to be able to easily add more PICs or Transactions IDs as the project grows (I'm considering an optional control panel). This first project will serve as a template for larger airplanes with many more controls (think Boeing 787).
Last edited by Demon; - 14th March 2025 at 23:24.
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Bookmarks