Changeset 4998 for trunk/csctapi/atr.c
- Timestamp:
- 04/14/11 02:41:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/atr.c
r4141 r4998 33 33 */ 34 34 35 const u nsigned longatr_fs_table[16] = {4000000L, 5000000L, 6000000L, 8000000L, 12000000L, 16000000L, 20000000L, 0, 0, 5000000L, 7500000L, 10000000L, 15000000L, 20000000L, 0, 0};36 37 static const u nsignedatr_num_ib_table[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};35 const uint32_t atr_fs_table[16] = {4000000L, 5000000L, 6000000L, 8000000L, 12000000L, 16000000L, 20000000L, 0, 0, 5000000L, 7500000L, 10000000L, 15000000L, 20000000L, 0, 0}; 36 37 static const uint32_t atr_num_ib_table[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; 38 38 39 39 /* … … 41 41 */ 42 42 43 const u nsignedatr_f_table[16] = {372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0};43 const uint32_t atr_f_table[16] = {372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0}; 44 44 45 45 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}; … … 47 47 //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}; 48 48 49 const u nsignedatr_i_table[4] = {25, 50, 100, 0};49 const uint32_t atr_i_table[4] = {25, 50, 100, 0}; 50 50 51 51 /* … … 53 53 */ 54 54 55 int ATR_InitFromArray (ATR * atr, BYTE atr_buffer[ATR_MAX_SIZE], unsignedlength)55 int32_t ATR_InitFromArray (ATR * atr, BYTE atr_buffer[ATR_MAX_SIZE], uint32_t length) 56 56 { 57 57 BYTE TDi; 58 58 BYTE buffer[ATR_MAX_SIZE]; 59 u nsignedpointer = 0, pn = 0;59 uint32_t pointer = 0, pn = 0; 60 60 61 61 /* Check size of buffer */ … … 203 203 } 204 204 205 int ATR_GetConvention (ATR * atr, int *convention)205 int32_t ATR_GetConvention (ATR * atr, int32_t *convention) 206 206 { 207 207 if (atr->TS == 0x3B) … … 215 215 } 216 216 217 int ATR_GetSize (ATR * atr, unsigned*size)217 int32_t ATR_GetSize (ATR * atr, uint32_t *size) 218 218 { 219 219 (*size) = atr->length; … … 221 221 } 222 222 223 int ATR_GetNumberOfProtocols (ATR * atr, unsigned*number_protocols)223 int32_t ATR_GetNumberOfProtocols (ATR * atr, uint32_t *number_protocols) 224 224 { 225 225 (*number_protocols) = atr->pn; … … 227 227 } 228 228 229 int ATR_GetProtocolType (ATR * atr, unsignednumber_protocol, BYTE *protocol_type)229 int32_t ATR_GetProtocolType (ATR * atr, uint32_t number_protocol, BYTE *protocol_type) 230 230 { 231 231 if ((number_protocol > atr->pn) || number_protocol < 1) … … 240 240 } 241 241 242 int ATR_GetInterfaceByte (ATR * atr, unsigned number, int character, BYTE * value)242 int32_t ATR_GetInterfaceByte (ATR * atr, uint32_t number, int32_t character, BYTE * value) 243 243 { 244 244 if (number > atr->pn || number < 1) … … 253 253 } 254 254 255 int ATR_GetIntegerValue (ATR * atr, int name, BYTE * value)256 { 257 int ret;255 int32_t ATR_GetIntegerValue (ATR * atr, int32_t name, BYTE * value) 256 { 257 int32_t ret; 258 258 259 259 if (name == ATR_INTEGER_VALUE_FI) … … 337 337 } 338 338 339 int ATR_GetParameter (ATR * atr, int name, double *parameter)339 int32_t ATR_GetParameter (ATR * atr, int32_t name, double *parameter) 340 340 { 341 341 BYTE FI, DI, II, PI1, PI2, N; … … 386 386 } 387 387 388 int ATR_GetHistoricalBytes (ATR * atr, BYTE hist[ATR_MAX_HISTORICAL], unsigned*length)388 int32_t ATR_GetHistoricalBytes (ATR * atr, BYTE hist[ATR_MAX_HISTORICAL], uint32_t *length) 389 389 { 390 390 if (atr->hbn == 0) … … 396 396 } 397 397 398 int ATR_GetRaw (ATR * atr, BYTE buffer[ATR_MAX_SIZE], unsigned*length)399 { 400 u nsignedi, j;398 int32_t ATR_GetRaw (ATR * atr, BYTE buffer[ATR_MAX_SIZE], uint32_t *length) 399 { 400 uint32_t i, j; 401 401 402 402 buffer[0] = atr->TS; … … 434 434 } 435 435 436 int ATR_GetCheckByte (ATR * atr, BYTE * check_byte)436 int32_t ATR_GetCheckByte (ATR * atr, BYTE * check_byte) 437 437 { 438 438 if (!((atr->TCK).present)) … … 443 443 } 444 444 445 int ATR_GetFsMax (ATR * atr, unsigned long*fsmax)445 int32_t ATR_GetFsMax (ATR * atr, uint32_t *fsmax) 446 446 { 447 447 BYTE FI;
Note:
See TracChangeset
for help on using the changeset viewer.