tonton81 / FlexCAN_T4

FlexCAN (CAN 2.0 / CANFD) Library for Teensy 3.x and 4.0
https://forum.pjrc.com/threads/56035-FlexCAN_T4-FlexCAN-for-Teensy-4
MIT License
191 stars 63 forks source link

Allow isotp implementation per mailbox #59

Open david-res opened 1 year ago

david-res commented 1 year ago

Is there any way that I can assign an isotp callback to a mailbox filter? Similar to how I would assign a custom callback per mailbox? Could this capability be developed?

I am making requests to multiple nodes, and while two of them always have the same ID and can retain the same set of callbacks/response code, one of them (the ECU) varies with up to six different response parsing options and would be easier for me to manage if I can isolate the response logic into separate callbacks per node, as at the moment everything is in one isotp callback, and I need to copy the entire logic between each ECU variant which is prone to mistakes and is taking up memory

tonton81 commented 1 year ago

per mailbox? not in it's current form, the fixed buffer is a collector of all mailboxes. it would require a rewrite of most of the code to do this

david-res commented 1 year ago

Got it. So ideally a smaller user defined iso tp buffer per MB would be ideal for me. It just makes it easier code wise to reconfig the mb callback/buffer rather than having to maintain multiple versions of the isotp rx callback that contain handlers for multiple IDs