View Single Post
 
Old 09-14-2013, 06:56 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,024
Default

Don't have time to test what String Builder does when appending bytes from a serial port, but I assume it isn't that useful.
The documentation indicates you will be getting messages made up of various number of bytes depending on the message id, so as a minimum you should be reading the serial data into a byte array, and then look for the framing bytes and when you have a complete message, framed by the SOF (AA hex, which would be 170 decimal) and EOF (AB hex, 171 decimal) and then byte offset 3 within the mesage would identify the packet ID, and 4 the length (so you would use the byte values directly as numbers, not as a character). You would then decode the rest of the bytes in the packet in accordance to the specification.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote