Skip to content

PLC4X-193 Support for little endian fields#141

Closed
splatch wants to merge 3 commits into
apache:developfrom
ConnectorIO:PLC4X-193
Closed

PLC4X-193 Support for little endian fields#141
splatch wants to merge 3 commits into
apache:developfrom
ConnectorIO:PLC4X-193

Conversation

@splatch

@splatch splatch commented Apr 11, 2020

Copy link
Copy Markdown
Contributor

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.

@chrisdutz chrisdutz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +155 to +158
ENDIANNESS_LITERAL
: 'big endian' | 'little endian'
;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this "LE" or "BE"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +33 to 36
@Override
public boolean isLittleEndian() {
return littleEndian;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@splatch

splatch commented May 5, 2020

Copy link
Copy Markdown
Contributor Author

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.

@splatch splatch closed this May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants