mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-19 23:08:34 +03:00
ccid: Get card atr in init
This commit is contained in:
@@ -51,6 +51,10 @@
|
|||||||
|
|
||||||
/** ISO7816 pins */
|
/** ISO7816 pins */
|
||||||
static const Pin pinsISO7816[] = {PINS_ISO7816};
|
static const Pin pinsISO7816[] = {PINS_ISO7816};
|
||||||
|
/** Bus switch pins */
|
||||||
|
static const Pin pinsBus[] = {PINS_BUS_DEFAULT};
|
||||||
|
/* SIMcard power pin */
|
||||||
|
static const Pin pinsPower[] = {PWR_PINS};
|
||||||
/** ISO7816 RST pin */
|
/** ISO7816 RST pin */
|
||||||
static const Pin pinIso7816RstMC = PIN_ISO7816_RSTMC;
|
static const Pin pinIso7816RstMC = PIN_ISO7816_RSTMC;
|
||||||
static uint8_t sim_inserted = 0;
|
static uint8_t sim_inserted = 0;
|
||||||
@@ -129,18 +133,32 @@ static void ConfigureCardDetection( void )
|
|||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
* Initialization and run
|
* Initialization and run
|
||||||
*-----------------------------------------------------------------------------*/
|
*-----------------------------------------------------------------------------*/
|
||||||
extern const CCIDDriverConfigurationDescriptors *configDescCCID = &configurationDescriptorCCID;
|
static const CCIDDriverConfigurationDescriptors *configDescCCID;
|
||||||
|
extern CCIDDriverConfigurationDescriptors configurationDescriptorCCID;
|
||||||
|
|
||||||
void CCID_init( void )
|
void CCID_init( void )
|
||||||
{
|
{
|
||||||
// FIXME: do we want to print ATR?
|
uint8_t pAtr[MAX_ATR_SIZE];
|
||||||
|
uint8_t ucSize ;
|
||||||
|
|
||||||
|
configDescCCID = &configurationDescriptorCCID;
|
||||||
|
|
||||||
|
// FIXME: do we want to print ATR?
|
||||||
/* Initialize Atr buffer */
|
/* Initialize Atr buffer */
|
||||||
memset( pAtr, 0, sizeof( pAtr ) ) ;
|
memset( pAtr, 0, sizeof( pAtr ) ) ;
|
||||||
|
|
||||||
/* Configure IT on Smart Card */
|
/* Configure IT on Smart Card */
|
||||||
ConfigureCardDetection() ;
|
ConfigureCardDetection() ;
|
||||||
|
|
||||||
ISO7816_Init( pinIso7816RstMC ) ;
|
// Configure ISO7816 driver
|
||||||
|
PIO_Configure(pinsISO7816, PIO_LISTSIZE(pinsISO7816));
|
||||||
|
PIO_Configure(pinsBus, PIO_LISTSIZE(pinsBus));
|
||||||
|
PIO_Configure(pinsPower, PIO_LISTSIZE(pinsPower));
|
||||||
|
|
||||||
|
/* power up the card */
|
||||||
|
// PIO_Set(&pinsPower[0]);
|
||||||
|
|
||||||
|
ISO7816_Init( &pinIso7816RstMC ) ;
|
||||||
|
|
||||||
CCIDDriver_Initialize();
|
CCIDDriver_Initialize();
|
||||||
|
|
||||||
@@ -167,5 +185,8 @@ void CCID_run( void )
|
|||||||
uint8_t pAtr[MAX_ATR_SIZE] ;
|
uint8_t pAtr[MAX_ATR_SIZE] ;
|
||||||
uint8_t ucSize ;
|
uint8_t ucSize ;
|
||||||
|
|
||||||
|
|
||||||
|
//if (USBD_Read(INT, pBuffer, dLength, fCallback, pArgument);
|
||||||
|
|
||||||
CCID_SmartCardRequest();
|
CCID_SmartCardRequest();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user