Changeset 7856
- Timestamp:
- 11/04/12 18:55:25 (11 years ago)
- Location:
- trunk/csctapi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/atr.c
r7780 r7856 39 39 const uint32_t atr_f_table[16] = {372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0}; 40 40 41 const double atr_d_table[16] = {0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.015625}; 41 const double atr_d_table[16] = {0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 0, 0, 0, 0, 0, 0}; 42 //const double atr_d_table[16] = {0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.015625}; 42 43 //old table has 0 for RFU: 43 44 //double atr_d_table[16] = {0, 1, 2, 4, 8, 16, 0, 0, 0, 0, 0.5, 0.25, 125, 0.0625, 0.03125, 0.015625}; … … 90 91 if (pointer + atr_num_ib_table[(0xF0 & TDi) >> 4] >= length){ 91 92 cs_debug_mask(D_ATR,"ATR is malformed, the %d interface bytes for protocol %d are missing", pointer + atr_num_ib_table[(0xF0 & TDi) >> 4], pn+1); 92 return ( ATR_MALFORMED);93 return (ERROR); 93 94 } 94 95 … … 135 136 TDi = atr->ib[pn][ATR_INTERFACE_BYTE_TD].value = buffer[pointer]; 136 137 atr->ib[pn][ATR_INTERFACE_BYTE_TD].present = 1; 137 (atr->TCK).present = ((TDi & 0x0F) != ATR_PROTOCOL_TYPE_T0 && (TDi & 0x0F) != ATR_PROTOCOL_TYPE_T14); // T14 has also no TCK byte present138 (atr->TCK).present = ((TDi & 0x0F) != ATR_PROTOCOL_TYPE_T0); 138 139 if (pn >= ATR_MAX_PROTOCOLS){ 139 140 cs_debug_mask(D_ATR,"ATR is malformed, this ATR reports %d protocols but the maximum value is %d", pn+1, ATR_MAX_PROTOCOLS+1); … … 340 341 } 341 342 342 int32_t ATR_GetParameter (ATR * atr, int32_t name, double*parameter)343 int32_t ATR_GetParameter (ATR * atr, int32_t name, uint32_t *parameter) 343 344 { 344 345 unsigned char FI, DI, II, PI1, PI2, N; -
trunk/csctapi/ifd_sci.c
r7820 r7856 187 187 TDi = buf[n]; 188 188 protocolnumber = TDi&0x0F; 189 if (protocolnumber == 0x00 || protocolnumber == 0x0E) tck = 0; // T0 and T14 protocol do not use tck byte (TCK = checksum byte!) 189 if (protocolnumber == 0x00) tck = 0; // T0 protocol do not use tck byte (TCK = checksum byte!) 190 if (protocolnumber == 0x0E) tck = 1; // T14 protocol tck byte should be present 190 191 if (protocolnumber == 0x01) tck = 1; // T1 protocol tck byte is mandatory, BTW: this code doesnt calculate if the TCK is valid jet... 191 192 rdr_debug_mask(reader, D_ATR, "Fetching global interface characters for protocol T%d:", (TDi&0x0F)); // lower nibble contains protocol number
Note:
See TracChangeset
for help on using the changeset viewer.