Changeset 1654
- Timestamp:
- 02/22/10 15:31:34 (14 years ago)
- Location:
- branches/monitor-improvement/csctapi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/csctapi/icc_async.c
r1606 r1654 75 75 76 76 wr = 0; 77 if (reader[ridx].typ <= R_MOUSE)78 reader[ridx].handle = open (reader[ridx].device, O_RDWR | O_NOCTTY| O_NONBLOCK);79 if (reader[ridx].handle < 0) {80 cs_log("ERROR opening device %s",reader[ridx].device);81 return ERROR;82 }83 77 84 78 switch(reader[ridx].typ) { 85 79 case R_MOUSE: 80 reader[ridx].handle = open (reader[ridx].device, O_RDWR | O_NOCTTY| O_NONBLOCK); 81 if (reader[ridx].handle < 0) { 82 cs_log("ERROR opening device %s",reader[ridx].device); 83 return ERROR; 84 } 86 85 break; 87 86 #if defined(TUXBOX) && defined(PPC) 88 87 case R_DB2COM1: 89 88 case R_DB2COM2: 89 reader[ridx].handle = open (reader[ridx].device, O_RDWR | O_NOCTTY| O_SYNC); 90 if (reader[ridx].handle < 0) { 91 cs_log("ERROR opening device %s",reader[ridx].device); 92 return ERROR; 93 } 90 94 if ((fdmc = open(DEV_MULTICAM, O_RDWR)) < 0) { 91 95 close(reader[ridx].handle); … … 292 296 break; 293 297 case ATR_PROTOCOL_TYPE_T1: 294 call (Protocol_T1_Command (command, command_len, rsp)); 295 break; 298 { 299 int try = 1; 300 do { 301 if (Protocol_T1_Command (command, command_len, rsp) == OK) 302 break; 303 try++; 304 //try to resync 305 APDU_Rsp ** rsp; 306 unsigned char resync[] = { 0x21, 0xC0, 0x00, 0xE1 }; 307 Protocol_T1_Command (resync, sizeof(resync), rsp); 308 ifsc = DEFAULT_IFSC; 309 } while (try <= 3); 310 break; 311 } 296 312 case ATR_PROTOCOL_TYPE_T14: 297 313 call (Protocol_T14_ExchangeTPDU (command, command_len, rsp)); … … 761 777 762 778 // Towitoko does not allow IFSC > 251 //FIXME not sure whether this limitation still exists 763 //ifsc = MIN (ifsc, MAX_IFSC); 764 765 //FIXME workaround for Smargo until native mode works 766 if(reader[ridx].smargopatch == 1) 767 ifsc = MIN (ifsc, 28); 768 else 769 ifsc = MIN (ifsc, MAX_IFSC); 779 ifsc = MIN (ifsc, MAX_IFSC); 770 780 771 781 #ifndef PROTOCOL_T1_USE_DEFAULT_TIMINGS -
branches/monitor-improvement/csctapi/ifd_phoenix.c
r1624 r1654 111 111 int i; 112 112 int parity[3] = {PARITY_EVEN, PARITY_ODD, PARITY_NONE}; 113 113 call (Phoenix_SetBaudrate (DEFAULT_BAUDRATE)); 114 114 for(i=0; i<3; i++) { 115 cs_sleepms(200); // pause for 200ms as this might help with the PL2303 115 #ifndef OS_CYGWIN32 116 /* 117 * Pause for 200ms as this might help with the PL2303. 118 * Some users reporting that this breaks cygwin, so we exclude this. 119 */ 120 cs_sleepms(200); 121 #endif 116 122 IO_Serial_Flush(); 117 123 call (IO_Serial_SetParity (parity[i])); … … 126 132 #endif 127 133 IO_Serial_RTS_Set(); 128 cs_sleepms(200); // we went form 50 to 200 as this might help with the PL2303 134 #ifdef OS_CYGWIN32 135 /* 136 * Pause for 200ms as this might help with the PL2303. 137 * Some users reporting that this breaks cygwin, so we went back to 50ms. 138 */ 139 cs_sleepms(50); 140 #else 141 cs_sleepms(200); 142 #endif 143 129 144 #ifdef USE_GPIO //felix: set card reset hi (inactive) 130 145 if (gpio_detect) { … … 134 149 #endif 135 150 IO_Serial_RTS_Clr(); 136 cs_sleepms(200); // pause for 200ms as this might help with the PL2303 151 #ifndef OS_CYGWIN32 152 /* 153 * Pause for 200ms as this might help with the PL2303. 154 * Some users reporting that this breaks cygwin, so we exclude this. 155 */ 156 cs_sleepms(200); 157 #endif 137 158 IO_Serial_Ioctl_Lock(0); 138 159 if(ATR_InitFromStream (atr, ATR_TIMEOUT) == ATR_OK) … … 198 219 call (tcgetattr (reader[ridx].handle, &tio) != 0); 199 220 call (IO_Serial_SetBitrate (baudrate, &tio)); 200 cs_sleepms(200); // pause for 200ms as this might help with the PL2303 221 #ifndef OS_CYGWIN32 222 /* 223 * Pause for 200ms as this might help with the PL2303. 224 * Some users reporting that this breaks cygwin, so we exclude this. 225 */ 226 cs_sleepms(200); 227 #endif 201 228 call (IO_Serial_SetProperties(tio)); 202 cs_sleepms(200); // pause for 200ms as this might help with the PL2303 229 #ifndef OS_CYGWIN32 230 /* 231 * Pause for 200ms as this might help with the PL2303. 232 * Some users reporting that this breaks cygwin, so we exclude this. 233 */ 234 cs_sleepms(200); 235 #endif 203 236 } 204 237 current_baudrate = baudrate; //so if update fails, current_baudrate is not changed either -
branches/monitor-improvement/csctapi/ifd_smartreader.c
r1649 r1654 177 177 reader->sr_config.F=618; /// magic smartreader value 178 178 reader->sr_config.D=1; 179 // reader->sr_config.T=2; // will be set to T=1 in EnableSmartReader 180 reader->sr_config.T=1; 179 reader->sr_config.T=2; // will be set to T=1 in EnableSmartReader 181 180 reader->sr_config.irdeto=TRUE; 182 181 } … … 209 208 cs_ddump(data,ATR_MAX_SIZE*2,"IO:SR: "); 210 209 211 if(data[0]!=0x3B && data[0]!=0x03 && data[0]!=0x3F) 210 if(data[0]!=0x3B && data[0]!=0x03 && data[0]!=0x3F) { 211 reader->sr_config.irdeto=FALSE; 212 212 continue; // this is not a valid ATR. 213 } 213 214 214 215 if(data[0]==0x03) { … … 365 366 366 367 // command 4 , set parameter T 367 if(reader->sr_config.irdeto ) // special trick to get ATR for Irdeto card, we need T=1 at reset, after that oscam takes care of T1 protocol, so we need T=0368 if(reader->sr_config.irdeto && T==2) // special trick to get ATR for Irdeto card, we need T=1 at reset, after that oscam takes care of T1 protocol, so we need T=0 368 369 { 369 370 T=1;
Note:
See TracChangeset
for help on using the changeset viewer.