astuff / kvaser_interface

A Kvaser CAN interface ROS abstraction layer.
MIT License
83 stars 51 forks source link

Static Callback Proxy Precludes Multiple KvaserCan Objects #50

Closed JWhitleyWork closed 3 years ago

JWhitleyWork commented 4 years ago

Describe the bug Using the (static) KvaserReadCbProxy object to store the instance of the KvaserCan object which has the user-defined read callback means that only one user-defined read callback can be stored at a time.

To Reproduce Create two KvaserCan objects which read the same or different CAN channels and assign them different user-defined read callback functions.

Expected behavior When a message is received on the channel associated with KvaserCan instance 1, the user-defined read callback function should be called for KvaserCan instance 1. When a message is received on the channel associated with KvaserCan instance 2, the user-defined read callback function should be called for KvaserCan instance 2.

Current Behavior Whichever KvaserCan instance registered it's user-defined callback function last is the instance who's user-defined callback is always called.

Originally reported by @Daniel-Stanek.

JWhitleyWork commented 4 years ago
icolwell-as commented 3 years ago

Issue was fixed in linked PRs.