Support up to 32kB of payload using 2-byte length#31
Support up to 32kB of payload using 2-byte length#31bojanpotocnik wants to merge 1 commit intomin-protocol:masterfrom
Conversation
| #else | ||
| // MSB == LSB if value is 8-bit | ||
| self->rx_frame_state = RECEIVING_LENGTH_LSB; |
There was a problem hiding this comment.
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
| uint16_t rx_frame_length; // Length of frame | ||
| #else | ||
| uint8_t rx_frame_length; // Length of frame | ||
| #endif |
There was a problem hiding this comment.
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.