PLC4X-193 Support for little endian fields#141
Conversation
chrisdutz
left a comment
There was a problem hiding this comment.
I feel a little uncomfortable with having these changes in parallel with the BE/LE handling in the Read/WriteBuffers ... not that in case of a LE protocol, the LE marker would actually read BE ... perhaps some marker for "other endianness" would be better to mark where the endianess is different from the one specified by the protocol.
| ENDIANNESS_LITERAL | ||
| : 'big endian' | 'little endian' | ||
| ; | ||
|
|
There was a problem hiding this comment.
Could we make this "LE" or "BE"?
There was a problem hiding this comment.
Not sure if you want LE/BE instead of little endian and big endian, or next to i? I took longer notation as it is self descriptive. Making BE/LE option next to these isn't a problem as I extracted comparison to one place which works with antlr token regardless of its use context (type, field etc).
| @Override | ||
| public boolean isLittleEndian() { | ||
| return littleEndian; | ||
| } |
There was a problem hiding this comment.
We could consider removing the "@OverRide" and leaving the build-tools repo unchanged ...
Little endian type is a type which is read slightly different than big endian. Field reading and writing for integer types is reordered to match full bytes.
|
I'm closing this one since it is not required to get ADS handling. Basic fields which are assembled to bit, byte or int types can be mapped using a receiving order without need to swap byte positions. |
This is work in progress to support little endian numbers in the operations. Not sure what to do with byte sequences and reserved fields. Theoretically they should work.