Closed kjetilkjeka closed 4 years ago
Hello, how far is this? Would like to use it on a payload for the ISS? CANFD would be nice there. You are doing great work so far! Sincerely Kreolis
Thanks, @Kreolis484. I am supposed to have this finished soon, but there are only 24 hours in a day and my todo list for some reason is not getting shorter. I will get to this (and also the other urgent PR here) as soon as I can; per the roadmap, we are aiming to have this released by Q1 2020.
ISS
Could you share any details? Maybe even on the forum, perhaps? Thanks in advance!
As discussed with Kjetil in November, I am taking this over so I am going to close this PR and cherry-pick relevant things into my own branch.
Not all done, please leave initial feedback. Look at todo to see what you can refrain from commenting.
Design:
The design is based around adding a notion of protocol to the interface that will only affect the maximum data size of transmitted frames (output from libcanard).
The received frames (input to libcanard) has been changed to accept an array of variable size to allow receiving from all kinds of interfaces in all kinds of modes (to support bootloaders etc, ref prior discussion).
Convinient types (with data size corresponding to CAN 2B and CAN FD) for reception of CAN frames is provided in canard.h. This is not strictly necessary but avoids the hassle of making sure your type is compatible with the
CanardCANframe
type.Constraints:
Transmitted frames != received frames
Due to C being quite awfull I'm not allowed to create the following type
This forces me to unroll the fields of
CanardCANFrame
intoCanardTxItem
like the followingAfter reading the C specification on type compatibility i see no way to safely return a
CanardCANFrame*
from this type. Which unfortunately means that the wholeCanardTxItem
must be returned or data must be copied. I don't think this is great, but not terrible either (this being C). We are only returning const pointers of this block so messing up thenext
field should be considered misuse.Todos: