Changeset 1133
- Timestamp:
- 01/09/10 08:29:23 (14 years ago)
- Location:
- trunk/csctapi
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/icc_async.c
r1125 r1133 73 73 74 74 /* Activate ICC */ 75 #ifdef SCI_DEV 75 76 if (IFD_Towitoko_ActivateICC (ifd) != IFD_TOWITOKO_OK) 76 77 return ICC_ASYNC_IFD_ERROR; 78 #endif 77 79 /* Reset ICC */ 78 80 if (IFD_Towitoko_ResetAsyncICC (ifd, &(icc->atr)) != IFD_TOWITOKO_OK) … … 210 212 } 211 213 214 #ifndef NO_PAR_SWITCH 212 215 int ICC_Async_BeginTransmission (ICC_Async * icc) 213 216 { 214 217 /* Setup parity for this ICC */ 215 #ifndef NO_PAR_SWITCH216 218 if (icc->convention == ATR_CONVENTION_INVERSE) 217 219 { … … 234 236 return ICC_ASYNC_IFD_ERROR; 235 237 */ 236 #endif 237 return ICC_ASYNC_OK; 238 } 238 return ICC_ASYNC_OK; 239 } 240 241 int ICC_Async_EndTransmission (ICC_Async * icc) 242 { 243 /* Restore parity */ 244 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK) 245 return ICC_ASYNC_IFD_ERROR; 246 247 return ICC_ASYNC_OK; 248 } 249 #endif 239 250 240 251 int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * data) … … 283 294 } 284 295 285 int ICC_Async_EndTransmission (ICC_Async * icc)286 {287 #ifndef NO_PAR_SWITCH288 /* Restore parity */289 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)290 return ICC_ASYNC_IFD_ERROR;291 #endif292 293 return ICC_ASYNC_OK;294 }295 296 296 ATR * ICC_Async_GetAtr (ICC_Async * icc) 297 297 { … … 307 307 { 308 308 /* Dectivate ICC */ 309 #ifdef SCI_DEV 309 310 if (IFD_Towitoko_DeactivateICC (icc->ifd) != IFD_TOWITOKO_OK) 310 311 return ICC_ASYNC_IFD_ERROR; 312 #endif 311 313 312 314 /* LED Off */ -
trunk/csctapi/icc_async.h
r8 r1133 85 85 86 86 /* Operations */ 87 #ifndef NO_PAR_SWITCH 87 88 extern int ICC_Async_BeginTransmission (ICC_Async * icc); 89 extern int ICC_Async_EndTransmission (ICC_Async * icc); 90 #endif 88 91 extern int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * buffer); 89 92 extern int ICC_Async_Receive (ICC_Async * icc, unsigned size, BYTE * buffer); 90 extern int ICC_Async_EndTransmission (ICC_Async * icc);91 93 92 94 #endif /* _ICC_ASYNC_ */ -
trunk/csctapi/ifd_towitoko.c
r1125 r1133 455 455 } 456 456 457 #ifdef SCI_DEV 457 458 int IFD_Towitoko_ActivateICC (IFD * ifd) 458 459 { … … 460 461 printf ("IFD: Activating card\n"); 461 462 #endif 462 #ifdef SCI_DEV463 463 if(ifd->io->com==RTYP_SCI) 464 464 { … … 486 486 } 487 487 else 488 #endif489 488 { 490 489 return IFD_TOWITOKO_OK; … … 498 497 #endif 499 498 500 #ifdef SCI_DEV501 499 if(ifd->io->com==RTYP_SCI) 502 500 { … … 518 516 519 517 } 520 #endif521 518 522 519 return IFD_TOWITOKO_OK; 523 520 } 521 #endif 524 522 525 523 //extern void print_hex_data(unsigned char *data, int len); -
trunk/csctapi/ifd_towitoko.h
r1125 r1133 137 137 138 138 /* General handling of ICC inserted in this IFD */ 139 #ifdef SCI_DEV 139 140 extern int IFD_Towitoko_ActivateICC (IFD * ifd); 140 141 extern int IFD_Towitoko_DeactivateICC (IFD * ifd); 142 #endif 141 143 142 144 /* Asynchronous ICC handling functions */ -
trunk/csctapi/protocol_t0.c
r868 r1133 826 826 827 827 /* Initialise transmission */ 828 #ifndef NO_PAR_SWITCH 828 829 if (ICC_Async_BeginTransmission (t0->icc) != ICC_ASYNC_OK) 829 830 { … … 831 832 return PROTOCOL_T0_ICC_ERROR; 832 833 } 834 #endif 833 835 834 836 /* Send header bytes */ 835 837 if (ICC_Async_Transmit (t0->icc, 5, APDU_Cmd_Header (cmd)) != ICC_ASYNC_OK) 836 838 { 839 #ifndef NO_PAR_SWITCH 837 840 ICC_Async_EndTransmission (t0->icc); 841 #endif 838 842 839 843 (*rsp) = NULL; … … 984 988 985 989 /* End of transmission */ 990 #ifndef NO_PAR_SWITCH 986 991 if (ICC_Async_EndTransmission (t0->icc) != ICC_ASYNC_OK) 987 992 return PROTOCOL_T0_ICC_ERROR; 993 #endif 988 994 989 995 return (ret); … … 1013 1019 1014 1020 /* Initialise transmission */ 1021 #ifndef NO_PAR_SWITCH 1015 1022 if (ICC_Async_BeginTransmission (t14->icc) != ICC_ASYNC_OK) 1016 1023 { … … 1018 1025 return PROTOCOL_T14_ICC_ERROR; 1019 1026 } 1027 #endif 1020 1028 1021 1029 if(t14->icc->ifd->io->com!=RTYP_SCI) … … 1024 1032 if (ICC_Async_Transmit (t14->icc, 1, &b1) != ICC_ASYNC_OK) 1025 1033 { 1034 #ifndef NO_PAR_SWITCH 1026 1035 ICC_Async_EndTransmission (t14->icc); 1036 #endif 1027 1037 1028 1038 (*rsp) = NULL; … … 1033 1043 if (ICC_Async_Transmit (t14->icc, cmd_len, cmd_raw) != ICC_ASYNC_OK) 1034 1044 { 1045 #ifndef NO_PAR_SWITCH 1035 1046 ICC_Async_EndTransmission (t14->icc); 1047 #endif 1036 1048 1037 1049 (*rsp) = NULL; … … 1042 1054 if (ICC_Async_Transmit (t14->icc, 1, &ixor) != ICC_ASYNC_OK) 1043 1055 { 1056 #ifndef NO_PAR_SWITCH 1044 1057 ICC_Async_EndTransmission (t14->icc); 1058 #endif 1045 1059 1046 1060 (*rsp) = NULL; … … 1057 1071 if (ICC_Async_Transmit (t14->icc, cmd_len+2, buffer) != ICC_ASYNC_OK) 1058 1072 { 1073 #ifndef NO_PAR_SWITCH 1059 1074 ICC_Async_EndTransmission (t14->icc); 1075 #endif 1060 1076 1061 1077 (*rsp) = NULL; … … 1146 1162 1147 1163 /* End of transmission */ 1164 #ifndef NO_PAR_SWITCH 1148 1165 if (ICC_Async_EndTransmission (t14->icc) != ICC_ASYNC_OK) 1149 1166 return PROTOCOL_T14_ICC_ERROR; 1167 #endif 1150 1168 1151 1169 return (ret); -
trunk/csctapi/protocol_t1.c
r1125 r1133 419 419 420 420 /* Setup transmission */ 421 #ifndef NO_PAR_SWITCH 421 422 if (ICC_Async_BeginTransmission (t1->icc) != ICC_ASYNC_OK) 422 423 ret = PROTOCOL_T1_ICC_ERROR; 423 424 424 425 else 426 #endif 425 427 { 426 428 /* Send T=1 block */ … … 430 432 if (ICC_Async_Transmit (t1->icc, length, buffer) != ICC_ASYNC_OK) 431 433 { 434 #ifndef NO_PAR_SWITCH 432 435 ICC_Async_EndTransmission (t1->icc); 436 #endif 433 437 ret = PROTOCOL_T1_ICC_ERROR; 434 438 } … … 486 490 487 491 /* End of transmission */ 492 #ifndef NO_PAR_SWITCH 488 493 if (ICC_Async_EndTransmission (t1->icc) != ICC_ASYNC_OK) 489 494 ret = PROTOCOL_T1_ICC_ERROR; 495 #endif 490 496 491 497 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.