Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix is_rx for receive_own_messages for Kvaser #1908

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

btRooke
Copy link

@btRooke btRooke commented Jan 6, 2025

Context and changes

Most other interfaces set is_rx to False if a transmitted message is received when receive_own_messages is enabled.

This previously wasn't the case for Kvaser.

Enabling the LOCAL_TXACK flag allows us to determine this.

Testing

This can be manually tested with a simple script:

import can
import time

msg = can.Message(
    arbitration_id=0xC0FFEE, data=[0, 25, 0, 1, 3, 1, 4, 1],
    is_extended_id=True
)

with can.Bus(receive_own_messages=True) as bus:
    notifier = can.Notifier(bus, [can.Printer()])
    bus.send_periodic(msg, 0.5)
    time.sleep(3)

Before this change, transmitted messages will be printed as "Rx", after as "Tx".

Do let me know if there's some obvious way to check this in automated tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant