New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support up to 32kB of payload using 2-byte length #31
base: master
Are you sure you want to change the base?
Conversation
target/min.c
Outdated
#else | ||
// MSB == LSB if value is 8-bit | ||
self->rx_frame_state = RECEIVING_LENGTH_LSB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required at all, but maybe useful for debugging purposes (so the state variable always represents the actual state).
target/min.h
Outdated
uint8_t rx_frame_length; // Length of frame | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause 1-3 B of struct padding on >8-bit processors... I like the fact that the order of context variables is the same as reception order, but anyway... shall I move rx_frame_seqrx_frame_seq
below this?
Control byte `rx_control` is only used to save the original payload length as received in the reader, that is why it is renamed to `rx_length`. `rx_frame_length` is assigned to the same value at the beginning, but it is used as a payload data counter and decreased for every byte of received payload. Maximum size is limited to 0x7FFF instead of 0xFFFF to avoid changing offset variables from uint16_t to uint32_t but still prevent overflows when incrementing them.
905aa63
to
70b509e
Compare
I need to look at this in a bit more detail: the goal with MIN was this is a way of talking to a lowly 8-bit microcontroller. Then transport features were added on top, which pushes out the buffering from a few bytes to a couple of hundred bytes. I don't want to lose this working on smaller devices. |
If |
No description provided.