Loading...
Searching...
No Matches
osim_apdu_cmd_hdr Struct Reference

APDU/TPDU command header. More...

`#include <sim.h>`

## Data Fields

uint8_t | cla
| CLASS byte.
uint8_t | ins
| INSTRUCTION byte.
uint8_t | p1
| Parameter 1 byte.
uint8_t | p2
| Parameter 2 byte.
uint8_t | p3
| Parameter 3 byte, used for TPDU by T=0.

## Detailed Description

APDU/TPDU command header.

This structure encode an APDU/TPDU command header, as specified in ISO/IEC 7816-3:2006(E) §12.2 and §12.3. The APDU (application layer) can be encoded as different TPDUs (transport layer), depending on the transport protocol used. The TPDU encoding by T=1 of the APDU command header is identical to the APDU. The TPDU encoding by T=0 of the APDU command header adds a Parameter 3 field, generally used instead of Lc/Le.

Todo:
  have different structures for APDU, TPDU by T=0, and TPDU by T=1.

## Field Documentation

## cla

uint8_t osim_apdu_cmd_hdr::cla

CLASS byte.

Referenced by osim_new_apdumsg().

## ins

uint8_t osim_apdu_cmd_hdr::ins

INSTRUCTION byte.

Referenced by osim_new_apdumsg(), and transceive_apdu_t0().

## p1

uint8_t osim_apdu_cmd_hdr::p1

Parameter 1 byte.

Referenced by osim_new_apdumsg(), and transceive_apdu_t0().

## p2

uint8_t osim_apdu_cmd_hdr::p2

Parameter 2 byte.

Referenced by osim_new_apdumsg(), and transceive_apdu_t0().

## p3

uint8_t osim_apdu_cmd_hdr::p3

Parameter 3 byte, used for TPDU by T=0.

Referenced by transceive_apdu_t0().

The documentation for this struct was generated from the following file:

- include/osmocom/sim/sim.h