Skip to content

Conversation

@btRooke
Copy link
Contributor

@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.

@zariiii9003 zariiii9003 merged commit 71e5e19 into hardbyte:main Feb 2, 2025
33 checks passed
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.

3 participants