Skip to content

Use the Role of Sender of TP.Conn_Abort - #981

Open
gunicsba wants to merge 1 commit into
Open-Agriculture:mainfrom
gunicsba:fix/tp-abort-role-of-sender
Open

gunicsba wants to merge 1 commit into
Open-Agriculture:mainfrom
gunicsba:fix/tp-abort-role-of-sender

Conversation

@gunicsba

Copy link
Copy Markdown
Member

Fixes #957, reported by @sujandumaru.

ISO 11783-3:2026 5.9.4.5 added a "Role of Sender" to TP.Conn_Abort, in byte 3 bits 1 to 2. It says which of two TP connections to close when the same PGN goes both ways between the same two CFs:

  • 00: the abort comes from the originating CF, the one that sent the TP.CM_RTS
  • 01: the abort comes from the receiving CF, the one that sent the TP.CM_CTS
  • 11: not specified. The CF "shall terminate established TP connections for the indicated PG with the CFs that sent the TP.Conn_Abort message"

The standard also says "The 'Role of Sender' shall not be set to any value other than 00₂ or 01₂".

Receiving: process_abort() now reads the role.

  • 00 closes only the session the abort sender sends to us.
  • 01 closes only the session we send to it.
  • 11 and the reserved 10 close both, as before. A device built to an earlier edition sends this byte as FF, so nothing changes for it.

Sending: send_abort() takes the role, with bits 3 to 8 sent as 1.

  • abort_session() takes it from the session's direction.
  • A rejected RTS is sent as the receiver (FD).
  • The abort for a CTS of another PGN is sent as the originator (FC).

Before, byte 3 was always FF, which reads as 11. For devices built to earlier editions byte 3 is reserved, so they ignore the new value.

ETP isn't changed, because ETP.Conn_Abort still has bytes 3 to 5 reserved in the 2026 edition.

Tests:

  • AbortClosesOnlyTheSessionOfItsRoleOfSender sets up two sessions of the same PGN in opposite directions. It checks which one stays open for FC, FD, FE and FF.
  • The existing timeout, invalid-RTS, unexpected-CTS and out-of-resources tests now check the role byte of the aborts we send, instead of FF.

🤖 Generated with Claude Code

ISO 11783-3:2026 5.9.4.5 added the Role of Sender in byte 3 of
TP.Conn_Abort. A received abort now closes only the session of its
role, and both when the role is not specified. Our aborts send the role
instead of FF.

Fixes Open-Agriculture#957

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

TP connection abort ignores and never sends the "Role of Sender" (ISO 11783-3:2026)

1 participant