make setparameters work

Change-Id: Ide0d95eaaf70ee4deed8242377085d1192013333
This commit is contained in:
Eric Wild 2019-11-21 19:12:41 +01:00
parent cd8f989fee
commit 9a8b1a455d
2 changed files with 11 additions and 1 deletions

View File

@ -96,11 +96,20 @@ private function get_pdata_size(CCID_ProtocolData pd) return integer {
}
}
private function get_setparam_type(CCID_ProtocolData pd) return octetstring {
if (ischosen(pd.T0)) {
return '00'O;
} else {
return '01'O;
}
}
template (value) CCID_PDU ts_CCID_SetParameters(uint8_t slot, CCID_ProtocolData pd, uint8_t seq := 0) := {
hdr := ts_CCID_Header(PC_to_RDR_ResetParameters, get_pdata_size(pd), slot, seq),
hdr := ts_CCID_Header(PC_to_RDR_SetParameters, get_pdata_size(pd), slot, seq),
hdr_in := omit,
u := {
SetParameters := {
bProtocolNum := get_setparam_type(pd),
abRFU := '0000'O,
abProtocolData := pd
}

View File

@ -190,6 +190,7 @@ type union CCID_ProtocolData {
CCID_ProtocolData_T1 T1
};
type record CCID_PC_to_RDR_SetParameters {
OCT1 bProtocolNum,
OCT2 abRFU,
CCID_ProtocolData abProtocolData
};