Closed amfern closed 4 years ago
It should have been like this from the beginning. Also: For serialization, have a look over here: https://github.com/wucke13/mavlink-msp-bridge/blob/master/src/msp.rs#L405 For deserialization, over there: https://github.com/wucke13/mavlink-msp-bridge/blob/master/src/msp.rs#L456 and here https://github.com/wucke13/mavlink-msp-bridge/blob/master/src/msp.rs#L230
The read macro could easily be adjusted to not use the Read trait but instead do some slicing operation, maybe with an offset?
IIUC you propose to use the get!
macro to avoid code duplication and use the size_of
instead of specifying the size manually.
I like this macro, makes the code more neat
I quite like my deser code, as it is also easy to convert to async
. The only thing missing is the xor for V1 messages. And porting from Read
/Write
to something no_std
friendly. Unfortunately I don't have the time to work on this soonish. For now your proposed change definitely goes into the right direction, so LGTM :smile:
This caused trouble when cross compiling to arm