Changeset 1964
- Timestamp:
- 04/06/10 09:47:17 (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/ifd_sc8in1.c
r1963 r1964 38 38 static int sc8in1_command(struct s_reader * reader, unsigned char * buff, unsigned short lenwrite, unsigned short lenread) 39 39 { 40 int res,i; 40 41 struct termios termio, termiobackup; 41 42 … … 57 58 } 58 59 cs_ddump_mask (D_DEVICE, buff, lenwrite, "IO: Sending: "); 59 60 if(!write(reader->handle, buff, lenwrite)) { 60 if(!write(reader->handle, buff, lenwrite)); { //dont use IO_Serial_Write since mcr commands dont echo back 61 61 cs_log("ERROR: SC8in1 Command write error"); 62 return ERROR; //dont use IO_Serial_Write since mcr commands dont echo back 63 } 64 62 return ERROR; 63 } 65 64 tcdrain(reader->handle); 66 65 if (IO_Serial_Read (reader, 1000, lenread, buff) == ERROR) { 67 cs_log(" SC8in1 Command read error");66 cs_log("ERROR: SC8in1 Command read error"); 68 67 return ERROR; 69 68 } … … 160 159 //init all stored termios to default comm settings after device init, before ATR 161 160 memcpy(&stored_termio[i],&termio,sizeof(termio)); 162 unsigned char buff[] = { 0x74 }; 163 sc8in1_command(reader, buff, 1, 1); 164 if (buff[0] == 4 || buff[0] == 8) { 165 is_mcr = (unsigned short) buff[0]; 166 cs_log("SC8in1: device MCR%i detected", is_mcr); 167 } 168 else 169 is_mcr = 0; 170 tcflush(reader->handle, TCIOFLUSH); // a non MCR reader might give longer answer 161 unsigned char buff[] = { 0x74 }; 162 sc8in1_command(reader, buff, 1, 1); 163 if (buff[0] == 4 || buff[0] == 8) { 164 is_mcr = (unsigned short) buff[0]; 165 cs_log("SC8in1: device MCR%i detected", is_mcr); 166 } 167 else 168 is_mcr = 0; 169 tcflush(reader->handle, TCIOFLUSH); // a non MCR reader might give longer answer 170 int fd = reader->handle; 171 for (i=0; i<CS_MAXREADER; i++) //copy handle to other slots, FIXME change this if multiple sc8in1 readers 172 if (reader[i].typ == R_SC8in1) 173 reader[i].handle = fd; 174 171 175 return OK; 172 176 } … … 239 243 sc8in1_clock[1] |= speed; 240 244 } 241 return OK; 242 } 245 } 246 -
trunk/oscam.c
r1956 r1964 552 552 reader[ridx].slot=(int)reader[ridx].device[pos+1] - 0x30;//FIXME test boundaries 553 553 reader[ridx].device[pos]= 0; //slot 1 reader now gets correct physicalname 554 if (reader[ridx].handle == 0) {554 if (reader[ridx].handle == 0) 555 555 reader_device_init(&reader[ridx]); 556 int fd = reader[ridx].handle;557 int i;558 for (i=0; i<CS_MAXREADER; i++) //copy handle to other slots, FIXME change this if multiple sc8in1 readers559 if (reader[i].typ == R_SC8in1)560 reader[i].handle = fd;561 }562 556 cs_log("creating thread for device %s slot %i with ridx %i=%i", reader[ridx].device, reader[ridx].slot, reader[ridx].ridx, ridx); 563 557 int rc;
Note:
See TracChangeset
for help on using the changeset viewer.