Changeset 1228 for branches/monitor-improvement/csctapi/protocol_t0.c
- Timestamp:
- 01/14/10 19:07:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/csctapi/protocol_t0.c
r1210 r1228 121 121 /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */ 122 122 double F = (double) atr_f_table[params->FI]; 123 t0->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ( t0->icc)) * 1000);123 t0->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ()) * 1000); 124 124 125 125 /* Set timings */ … … 132 132 133 133 #ifdef DEBUG_PROTOCOL 134 printf ("Protocol: T=0: WWT=%d, Clockrate=%lu\n", (int)(t0->wwt),ICC_Async_GetClockRate( t0->icc));134 printf ("Protocol: T=0: WWT=%d, Clockrate=%lu\n", (int)(t0->wwt),ICC_Async_GetClockRate()); 135 135 #endif 136 136 … … 157 157 /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */ 158 158 double F = (double) atr_f_table[params->FI]; 159 t14->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ( t14->icc)) * 1000);159 t14->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ()) * 1000); 160 160 t14->wwt >>= 1; 161 161 … … 827 827 return PROTOCOL_T0_ERROR; 828 828 829 /* Initialise transmission */830 if (ICC_Async_BeginTransmission (t0->icc) != ICC_ASYNC_OK)831 {832 (*rsp) = NULL;833 return PROTOCOL_T0_ICC_ERROR;834 }835 836 829 /* Send header bytes */ 837 830 if (ICC_Async_Transmit (t0->icc, 5, APDU_Cmd_Header (cmd)) != ICC_ASYNC_OK) 838 831 { 839 ICC_Async_EndTransmission (t0->icc);840 841 832 (*rsp) = NULL; 842 833 return PROTOCOL_T0_ICC_ERROR; … … 985 976 (*rsp) = NULL; 986 977 987 /* End of transmission */988 if (ICC_Async_EndTransmission (t0->icc) != ICC_ASYNC_OK)989 return PROTOCOL_T0_ICC_ERROR;990 991 978 return (ret); 992 979 } … … 1014 1001 return PROTOCOL_T14_ERROR; 1015 1002 1016 /* Initialise transmission */1017 if (ICC_Async_BeginTransmission (t14->icc) != ICC_ASYNC_OK)1018 {1019 (*rsp) = NULL;1020 return PROTOCOL_T14_ICC_ERROR;1021 }1022 1023 1003 if(t14->icc->ifd->io->reader_type!=R_INTERNAL) 1024 1004 { … … 1026 1006 if (ICC_Async_Transmit (t14->icc, 1, &b1) != ICC_ASYNC_OK) 1027 1007 { 1028 ICC_Async_EndTransmission (t14->icc);1029 1030 1008 (*rsp) = NULL; 1031 1009 return PROTOCOL_T14_ICC_ERROR; … … 1035 1013 if (ICC_Async_Transmit (t14->icc, cmd_len, cmd_raw) != ICC_ASYNC_OK) 1036 1014 { 1037 ICC_Async_EndTransmission (t14->icc);1038 1039 1015 (*rsp) = NULL; 1040 1016 return PROTOCOL_T14_ICC_ERROR; … … 1044 1020 if (ICC_Async_Transmit (t14->icc, 1, &ixor) != ICC_ASYNC_OK) 1045 1021 { 1046 ICC_Async_EndTransmission (t14->icc);1047 1048 1022 (*rsp) = NULL; 1049 1023 return PROTOCOL_T14_ICC_ERROR; … … 1059 1033 if (ICC_Async_Transmit (t14->icc, cmd_len+2, buffer) != ICC_ASYNC_OK) 1060 1034 { 1061 ICC_Async_EndTransmission (t14->icc);1062 1063 1035 (*rsp) = NULL; 1064 1036 return PROTOCOL_T14_ICC_ERROR; … … 1147 1119 } 1148 1120 1149 /* End of transmission */1150 if (ICC_Async_EndTransmission (t14->icc) != ICC_ASYNC_OK)1151 return PROTOCOL_T14_ICC_ERROR;1152 1153 1121 return (ret); 1154 1122 }
Note:
See TracChangeset
for help on using the changeset viewer.