Changeset 1138
- Timestamp:
- 01/09/10 11:50:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/pps.c
r1125 r1138 186 186 ATR_GetParameter (atr, ATR_PARAMETER_N, &(pps->parameters.n)); 187 187 ATR_GetProtocolType(atr,1,&(pps->parameters.t)); //get protocol from TD1 188 BYTE TA2; 189 bool SpecificMode = (ATR_GetInterfaceByte (atr, 2, ATR_INTERFACE_BYTE_TA, &TA2) == ATR_OK); //if TA2 present, specific mode, else negotiable mode 190 if (SpecificMode) { 191 pps->parameters.t = TA2 & 0x0F; 192 if ((TA2 & 0x10) != 0x10) { //bit 5 set to 0 means F and D explicitly defined in interface characters 193 BYTE TA1; 194 if (ATR_GetInterfaceByte (atr, 1 , ATR_INTERFACE_BYTE_TA, &TA1) == ATR_OK) { 195 pps->parameters.FI = TA1 >> 4; 196 ATR_GetParameter (atr, ATR_PARAMETER_D, &(pps->parameters.d)); 197 } 198 else { 199 pps->parameters.FI = ATR_DEFAULT_FI; 200 pps->parameters.d = ATR_DEFAULT_D; 201 } 202 } 203 else { 204 cs_log("Specific mode: speed 'implicitly defined', not sure how to proceed, assuming default values"); 205 pps->parameters.FI = ATR_DEFAULT_FI; 206 pps->parameters.d = ATR_DEFAULT_D; 207 } 208 cs_debug("Specific mode: T%i, F=%.0f, D=%.6f, N=%.0f\n", pps->parameters.t, (double) atr_f_table[pps->parameters.FI], pps->parameters.d, pps->parameters.n); 209 } 210 else { //negotiable mode 211 188 212 bool NeedsPTS = ((pps->parameters.t != 14) && (numprottype > 1 || (atr->ib[0][ATR_INTERFACE_BYTE_TA].present == TRUE && atr->ib[0][ATR_INTERFACE_BYTE_TA].value != 0x11) || pps->parameters.n == 255)); //needs PTS according to ISO 7816 , SCI gets stuck on our PTS 189 213 if (NeedsPTS) { … … 217 241 //FIXME Currently InitICC sets baudrate to 9600 for all T14 cards (=no switching); 218 242 //When for SCI, T14 protocol, TA1 is obeyed, this goes OK for mosts devices, but somehow on DM7025 Sky S02 card goes wrong when setting ETU (ok on DM800/DM8000) 219 //So either220 //a) for ALL T14 ETU should not be set, or221 //b) only for Irdeto T14 cards,222 //c) or all Irdeto cards223 //to be working on DM7025 and all other sci-devices ...224 //we choose option b) for now, can always expand it...225 //implemented it in InitICC226 243 if (!PPS_success) {//last PPS not succesfull 227 244 BYTE TA1; … … 246 263 cs_debug("No PTS %s, selected protocol 1: T%i, F=%.0f, D=%.6f, N=%.0f\n", NeedsPTS?"happened":"needed", pps->parameters.t, (double) atr_f_table[pps->parameters.FI], pps->parameters.d, pps->parameters.n); 247 264 } 265 }//end negotiable mode 248 266 }//end length<0 249 267
Note:
See TracChangeset
for help on using the changeset viewer.