Open bessman opened 2 weeks ago
A single notifier can handle multiple bus instances and multiple listeners:
notifier = can.Notifier([vbus1, vbus2], [NamedPrinter("A"), NamedPrinter("B")])
Yes, I know, but I still find this behavior surprising. Wouldn't it make sense to make note of it in the documentation, at least?
On a related note, is there any way to clean up orphaned notifiers? For example:
notifier = can.Notifier(vbus1, [NamedPrinter("A")])
notifier = can.Notifier(vbus1, [NamedPrinter("B")])
notifier.stop()
vbus0.send(msg)
# Output:
# Printer A
# Timestamp: 1730841762.033267 ID: 00000011 X Rx DL: 5 68 65 6c 6c 6f 'hello' Channel: vcan1
Take a look at #1890
Describe the bug
When there is more than one active
Notifier
, only one instance receives an incoming message. Which notifier gets the message seems random.To Reproduce
Expected behavior
I expected all notifiers to receive all incoming messages.
If multiple simultaneous notifiers on the same bus is not supported, the documentation should mention this. Ideally, a warning or error should be raised if an additional notifier is created on a bus with an already active notifier.
Additional context
OS and version: Ubuntu 20.04 Python version: 3.13.0 python-can version: 4.4.2 python-can interface/s (if applicable): socketcan