HSI88 can't read 13 as number
Bug #579676 reported by
ron&bram
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rocrail |
Fix Released
|
Medium
|
ron&bram |
Bug Description
The read routine of the HSI88 reads bytes one by one and breaks off and passes the bytes read to the rest of the routine when the byte contains a CR (0x0D). This leads to improper functioning when the HSI wants to report for instance that there are 13 modules connected (message 0x73 0x0d 0x0d) or the state of module 13, because Rocrail breaks off the reading since it considers the reported number as a caariage return. See forum topic http://
Changed in rocrail: | |
assignee: | nobody → ron&bram (ronaldestherbram) |
To post a comment you must log in.
A possible solution could be to have the read routine read the expected number of bytes, based upon the content of the first byte and keep on reading, regardless of the byte content, until this number has been read, when the last byte read contains a carriage return the message is valid. This would mean: first byte contains an "s" (0x73), expect 3 bytes; first byte contains an "i", expect (3 + next byte * 3) bytes; first byte contains a "v", expect 41 bytes.