Changeset 487 for branches/merlin/csctapi/ifd_towitoko.c
- Timestamp:
- 11/02/09 19:05:56 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/merlin/csctapi/ifd_towitoko.c
r444 r487 151 151 { 152 152 IO_Serial_Properties props; 153 SR_Config sr_config;154 153 int ret; 155 154 … … 195 194 } 196 195 197 // set smartreader+ default values 198 // for Irdeto card, the Frequency is 6.00MHz and the F parameter need to be set to 558 199 // test have shown that an irdeto card still reply to an ATR at 9600 with a Freq of 3.5712 MHz 200 // we need to do more test to see if this work with irdeto cards so I'm reverting my changes 201 // to use the original default smartreader+ values 202 sr_config.F=372; 203 sr_config.D=1.0; 204 sr_config.fs=3571200; 205 sr_config.N=0; 206 sr_config.T=0; 207 sr_config.inv=0; 208 209 if (!IO_Serial_SetProperties(io, &props, &sr_config)) 196 if (!IO_Serial_SetProperties(io, &props)) 210 197 return IFD_TOWITOKO_IO_ERROR; 211 198 … … 270 257 { 271 258 IO_Serial_Properties props; 272 SR_Config sr_config; 273 259 274 260 if (ifd->io->reader_type == RTYP_SCI) { 275 261 return IFD_TOWITOKO_OK; … … 287 273 288 274 /* Get current settings */ 289 if (!IO_Serial_GetProperties(ifd->io, &props , &sr_config))275 if (!IO_Serial_GetProperties(ifd->io, &props)) 290 276 return IFD_TOWITOKO_IO_ERROR; 291 277 … … 297 283 props.input_bitrate = baudrate; 298 284 299 if (!IO_Serial_SetProperties(ifd->io, &props , &sr_config))285 if (!IO_Serial_SetProperties(ifd->io, &props)) 300 286 return IFD_TOWITOKO_IO_ERROR; 301 287 … … 306 292 { 307 293 IO_Serial_Properties props; 308 SR_Config sr_config; 309 294 310 295 if (ifd->io->reader_type == RTYP_SCI) { 311 296 return IFD_TOWITOKO_OK; … … 313 298 314 299 /* Get current settings */ 315 if (!IO_Serial_GetProperties(ifd->io, &props , &sr_config))300 if (!IO_Serial_GetProperties(ifd->io, &props)) 316 301 return IFD_TOWITOKO_IO_ERROR; 317 302 … … 324 309 { 325 310 IO_Serial_Properties props; 326 SR_Config sr_config; 327 311 328 312 if (ifd->io->reader_type == RTYP_SCI) { 329 313 return IFD_TOWITOKO_OK; … … 337 321 338 322 /* Get current settings */ 339 if (!IO_Serial_GetProperties(ifd->io, &props , &sr_config))323 if (!IO_Serial_GetProperties(ifd->io, &props)) 340 324 return IFD_TOWITOKO_IO_ERROR; 341 325 … … 343 327 props.parity = parity; 344 328 345 if (!IO_Serial_SetProperties(ifd->io, &props , &sr_config))329 if (!IO_Serial_SetProperties(ifd->io, &props)) 346 330 return IFD_TOWITOKO_IO_ERROR; 347 331 } … … 637 621 #endif 638 622 { 639 double tmp_param;640 BYTE tmp;641 642 623 int ret; 643 624 int parity; … … 720 701 IFD_Towitoko_SetParity(ifd, IFD_TOWITOKO_PARITY_NONE); 721 702 #endif 722 // if we get here we have a valid ATR and can init the IO->SmartReaderConf strcture.723 ATR_GetParameter((*atr), ATR_PARAMETER_F, &tmp_param);724 ((ifd->io)->SmartReaderConf)->F=(int)tmp_param;725 726 ATR_GetParameter((*atr), ATR_PARAMETER_D, &tmp_param);727 ((ifd->io)->SmartReaderConf)->D=(float)tmp_param;728 729 ((ifd->io)->SmartReaderConf)->fs = (ifd->io)->frequency;730 731 ATR_GetParameter((*atr), ATR_PARAMETER_N, &tmp_param);732 ((ifd->io)->SmartReaderConf)->N=(int)tmp_param;733 734 ATR_GetProtocolType((*atr), 2, &tmp);735 ((ifd->io)->SmartReaderConf)->T = (int)tmp_param && 0xFF;736 ATR_GetConvention((*atr), &((ifd->io)->SmartReaderConf)->inv);737 738 703 return ret; 739 704 }
Note:
See TracChangeset
for help on using the changeset viewer.