CAN bus API
Posted: Thu Jun 14, 2018 12:34 pm
Why id type (extended / standard) is not handled the same way as frame type (RTR / not RTR)?
Instead of:
CAN.init(mode, extframe=False, prescaler=100, *, sjw=1, bs1=6, bs2=8, auto_restart=False)
CAN.send(data, id, *, timeout=0, rtr=False)
(id, RTR, FMI, DATA) = CAN.recv(fifo, list=None, *, timeout=5000)
we could have:
CAN.init(mode, prescaler=100, *, sjw=1, bs1=6, bs2=8, auto_restart=False)
CAN.send(data, id, ext=False, *, timeout=0, rtr=False)
(id, EXT, RTR, FMI, DATA) = CAN.recv(fifo, list=None, *, timeout=5000)
with EXT: a boolean that indicates if id is extended or not.
I guess this choice is to simplify somehow the API, but as a consequence you need to use the 2 CAN channels and 2 transceivers to communicate with a product that is using both extended and standard id frames.
Do I miss something? Do you think it would be relevant to propose such an evolution?
Instead of:
CAN.init(mode, extframe=False, prescaler=100, *, sjw=1, bs1=6, bs2=8, auto_restart=False)
CAN.send(data, id, *, timeout=0, rtr=False)
(id, RTR, FMI, DATA) = CAN.recv(fifo, list=None, *, timeout=5000)
we could have:
CAN.init(mode, prescaler=100, *, sjw=1, bs1=6, bs2=8, auto_restart=False)
CAN.send(data, id, ext=False, *, timeout=0, rtr=False)
(id, EXT, RTR, FMI, DATA) = CAN.recv(fifo, list=None, *, timeout=5000)
with EXT: a boolean that indicates if id is extended or not.
I guess this choice is to simplify somehow the API, but as a consequence you need to use the 2 CAN channels and 2 transceivers to communicate with a product that is using both extended and standard id frames.
Do I miss something? Do you think it would be relevant to propose such an evolution?