Changeset 2021


Ignore:
Timestamp:
04/08/10 19:54:08 (12 years ago)
Author:
merek
Message:

Merge UMP r2009-2012

Location:
trunk/csctapi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/icc_async.c

    r1978 r2021  
    142142    }
    143143   
    144     if (reader->typ == R_SC8in1) {
    145         int i = -1; //Flag for GetStatus init
    146         Sc8in1_GetStatus(reader, &i); //Initialize cardstatus
    147     }
    148 
    149144    if (reader->typ <= R_MOUSE)
    150145        if (Phoenix_Init(reader)) {
  • trunk/csctapi/ifd_sc8in1.c

    r1969 r2021  
    3636static int sc8in1_command(struct s_reader * reader, unsigned char * buff, unsigned short lenwrite, unsigned short lenread)
    3737{
     38  int init_phase = (buff[0] == 0x63); //FIXME UGLY
    3839  struct termios termio, termiobackup;
    3940
     
    6566  }
    6667
    67   // switch SC8in1 to normal mode
    68   //cs_sleepms(10); FIXME do I need this?
    69   IO_Serial_DTR_Clr(reader);
    70 
    7168  // restore data
    7269  memcpy(&termio,&termiobackup,sizeof(termio));
     
    7572    return ERROR;
    7673  }
    77     return OK;
     74
     75  // switch SC8in1 to normal mode
     76  IO_Serial_DTR_Clr(reader);
     77  return OK;
    7878}
    7979
     
    135135    current_slot = slot;
    136136  tcdrain(reader->handle);
     137  // restore rs232 data
     138  memcpy(&termio, &stored_termio[reader->slot-1], sizeof(termio));
     139  if (tcsetattr(reader->handle,TCSANOW,&termio) < 0) {
     140    cs_log("ERROR: SC8in1 selectslot restore RS232 attributes\n");
     141    return ERROR;
     142  }
    137143  // switch SC8in1 to normal mode
    138144  IO_Serial_DTR_Clr(reader);
    139   // restore rs232 data
    140   memcpy(&termio, &stored_termio[reader->slot-1], sizeof(termio));
    141   if (tcsetattr(reader->handle,TCSANOW,&termio) < 0) {
    142     cs_log("ERROR: SC8in1 selectslot restore RS232 attributes\n");
    143     return ERROR;
    144   }
    145145    //cs_sleepms(10); //FIXME do I need this?
    146146  return OK;
     
    207207    }
    208208
     209    //IO_Serial_Flush(reader); //FIXME somehow ATR is generated and must be flushed
     210    i = -1; //Flag for GetStatus init
     211    Sc8in1_GetStatus(reader, &i); //Initialize cardstatus
     212
    209213    return OK;
    210214}
     
    234238        cardstatus = i;
    235239    }
    236     //cs_log("Status: %02X, reader[ridx].slot=%i, 1<<slot-1=%02X bool=%i",result,reader[ridx].slot,1<<(reader[ridx].slot-1), result & 1<<(reader[ridx].slot-1));
    237240    *in = (cardstatus & 1<<(reader->slot-1));
    238241    return OK;
  • trunk/csctapi/io_serial.c

    r1951 r2021  
    150150    if (ioctl(reader->handle, TIOCMSET, &msr)<0)
    151151        return ERROR;
    152     return OK;
    153 #endif
     152#endif
     153    cs_debug("IO: Setting %s=%i",dtr?"DTR":"RTS", set);
     154    return OK;
    154155}
    155156
Note: See TracChangeset for help on using the changeset viewer.