Skip to content

Add Transparent Reader Support (TRS)#324

Open
sidcha wants to merge 1 commit into
masterfrom
trs_dev
Open

Add Transparent Reader Support (TRS)#324
sidcha wants to merge 1 commit into
masterfrom
trs_dev

Conversation

@sidcha

@sidcha sidcha commented Jul 12, 2026

Copy link
Copy Markdown
Member

TRS tunnels raw smart-card APDUs from the CP, through a PD acting as a transparent pipe, to a card in the reader (OSDP CMD_XWR/REPLY_XRD, capability SMART_CARD_SUPPORT). The control panel drives the card directly, so a compromised reader cannot forge a credential.

The CP runs the session as a library-driven state machine: it negotiates transparent mode, streams the app's APDUs, and tears the session down on osdp_cp_trs_stop(). Apps submit OSDP_CMD_XWR commands and receive card responses as OSDP_EVENT_TRS events.

The PD answers each APDU either synchronously, in the command callback, or deferred: it ACKs "working" and delivers the response on a later poll once a slow card responds. Deferral keeps a shared multi-drop bus non-blocking, so each PD's session makes progress independently.

Gated behind OPT_BUILD_OSDP_TRS (default off); wired into both build systems and covered by a CP<->PD APDU round-trip unit test.

Co-developed-by: Aaron Tulino (Aaronjamt) git@aaronjamt.com

TRS tunnels raw smart-card APDUs from the CP, through a PD acting as
a transparent pipe, to a card in the reader (OSDP CMD_XWR/REPLY_XRD,
capability SMART_CARD_SUPPORT). The control panel drives the card
directly, so a compromised reader cannot forge a credential.

The CP runs the session as a library-driven state machine: it
negotiates transparent mode, streams the app's APDUs, and tears the
session down on osdp_cp_trs_stop(). Apps submit OSDP_CMD_XWR commands
and receive card responses as OSDP_EVENT_TRS events.

The PD answers each APDU either synchronously, in the command
callback, or deferred: it ACKs "working" and delivers the response on
a later poll once a slow card responds. Deferral keeps a shared
multi-drop bus non-blocking, so each PD's session makes progress
independently.

Gated behind OPT_BUILD_OSDP_TRS (default off); wired into both build
systems and covered by a CP<->PD APDU round-trip unit test.

Co-developed-by: Aaron Tulino (Aaronjamt) <git@aaronjamt.com>
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
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