Description
I have a few question and possibly improvement suggestions for the CAN library
-
Is there a special reasons why the CAN frame trait contains constructors? How would those be used, and be better than more explicit custom constructors for the actual frame types inside libraries?
-
For device drivers, the transmit function already assumes a constructed frame, and for reception.. Wouldn't an API just expect the user to somehow take care of polling CAN frames and pass them to the driver? Maybe it would make more sense to have something like CanTx trait which only provided transmit functions, and possibly a specialized CanRx? I still think it is easier for device drivers to just assume the user takes care of polling CAN frames, and offer an API which consumes frames (probably re-using the CAN frame trait to remain generic)
-
Any reason not to provide a default implementation for
Frame::is_extended
?/// Returns true if this frame is an extended frame. fn is_extended(&self) -> bool { match self.id() { Id::Standard(_) => false, Id::Extended(_) => true, } }