Skip to content

Preserve CAN port on completed TP/ETP messages - #762

Merged
sujandumaru merged 1 commit into
mainfrom
sujan/tp-etp-completed-message-port
Oct 4, 2026
Merged

sujandumaru merged 1 commit into
mainfrom
sujan/tp-etp-completed-message-port

Conversation

@sujandumaru

Copy link
Copy Markdown
Member

Describe your changes

Fixes #761

Completed TP and ETP messages were created with a hard coded CAN port 0. So on port 1 or higher, destination specific multi-frame messages never reached the partner callbacks. For example a VT Get Versions response with one stored label is 9 bytes, so it goes over TP and was lost.

  • TransportProtocolManager and ExtendedTransportProtocolManager now use message.get_can_port_index() for the completed message.
  • Removed the tempMessage port hack and the TODO in CANNetworkManager. It stopped working after d2d47dd, and the port is now correct at the source.
  • The 9 byte Commanded Address message goes over TP too, so address claiming on port 1 or higher is fixed by this as well.
  • Added TransportProtocolTest.BroadcastMessageReceivingKeepsCANPort.

How has this been tested?

cmake -S . -B build -DBUILD_TESTING=ON -DCAN_DRIVER=SocketCAN
cmake --build build
./build/test/unit_tests --gtest_filter='TransportProtocolTest.*'

@sujandumaru sujandumaru added the bug Something isn't working label Oct 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

@sujandumaru
sujandumaru merged commit 9405919 into main Oct 4, 2026
11 checks passed
@sujandumaru
sujandumaru deleted the sujan/tp-etp-completed-message-port branch October 4, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TP/ETP completed messages always carry CAN port 0, so partnered callbacks on other channels never receive multi-frame messages

3 participants