|
SASC-NG
DVBSoftCAM
|
Inheritance diagram for cSmartCardSlotSRPlus:Public Member Functions | |
| cSmartCardSlotSRPlus (void) | |
Protected Member Functions | |
| virtual bool | DeviceOpen (const char *cfg) |
| virtual bool | DeviceSetMode (int mode, int baud) |
| virtual bool | DevicePTS (void) |
Definition at line 963 of file smartcard.c.
| cSmartCardSlotSRPlus::cSmartCardSlotSRPlus | ( | void | ) |
Definition at line 976 of file smartcard.c.
References cSmartCardSlot::localecho.
{
localecho=false;
}
| bool cSmartCardSlotSRPlus::DeviceOpen | ( | const char * | cfg | ) | [protected, virtual] |
Reimplemented from cSmartCardSlotSerial.
Definition at line 981 of file smartcard.c.
References cSmartCardSlot::clock, cSmartCardSlot::devName, cSmartCardSlotSerial::fd, ISO_FREQ, L_CORE_LOAD, L_CORE_SERIAL, L_GEN_ERROR, open(), PRINTF, cSmartCardSlotSerial::SetDtrRts(), and cSmartCardSlot::slotnum.
{
if(sscanf(cfg,"%255[^:]:%d",devName,&clock)>=1) {
if(clock<=0) clock=ISO_FREQ;
PRINTF(L_CORE_SERIAL,"%s: open serial port",devName);
fd=open(devName,O_RDWR|O_NONBLOCK|O_NOCTTY);
if(fd>=0) {
SetDtrRts();
PRINTF(L_CORE_SERIAL,"%s: init done",devName);
PRINTF(L_CORE_LOAD,"cardslot: added smartreader+ port %s as port %d (CLOCK %d)",
devName,slotnum,clock);
return true;
}
else PRINTF(L_GEN_ERROR,"%s: open failed: %s",devName,strerror(errno));
}
else PRINTF(L_GEN_ERROR,"bad parameter for cardslot type 'srplus'");
return false;
}
| bool cSmartCardSlotSRPlus::DevicePTS | ( | void | ) | [protected, virtual] |
Reimplemented from cSmartCardSlotSerial.
Definition at line 1008 of file smartcard.c.
References cSmartCardSlot::atr, cSmartCardSlot::clock, Atr::convention, Atr::D, cSmartCardSlot::devName, Atr::F, Atr::fs, ISO_FREQ, L_CORE_SERIAL, Atr::N, PRINTF, SM_INDIRECT, SM_INDIRECT_INV, and Atr::T.
{
// Configure SmartReader+ with work settings, ref ISO 7816 3.1.
int inv=0;
if(atr.convention==SM_INDIRECT) atr.convention=SM_INDIRECT_INV;
if(atr.convention==SM_INDIRECT_INV) inv=1;
// Use ISO work clock frequency unless a fixed frequency is specified.
int cl=(clock==ISO_FREQ) ? atr.fs:clock;
if(!SRConfig(atr.F,atr.D,cl,atr.N,atr.T,inv)) return false;
PRINTF(L_CORE_SERIAL,"%s: SmartReader+ mode %.4f MHz",devName,cl/1000000.0);
return true;
}
| bool cSmartCardSlotSRPlus::DeviceSetMode | ( | int | mode, |
| int | baud | ||
| ) | [protected, virtual] |
Reimplemented from cSmartCardSlotSerial.
Definition at line 1000 of file smartcard.c.
References cSmartCardSlot::clock, and ISO_BAUD.
{
// Configure SmartReader+ with initial settings, ref ISO 7816 3.1.
return baud==ISO_BAUD &&
cSmartCardSlotSerial::DeviceSetMode(mode,ISO_BAUD) &&
SRConfig(372,1.0,clock,0,0,0);
}