mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-18 14:28:33 +03:00
Pass ISO7816_GetChar return val to higher layers
The return value of ISO7816_GetChar is 0 in case of a timeout when trying to retrieve values, and status of US_CSR otherwise. Proper handling of this return value is not yet implemented though. With the naive approach of just not sending the ATR if it could not be read the simtrace firmware did not work together with pcsc_scan AT ALL.
This commit is contained in:
@@ -665,10 +665,16 @@ static void RDRtoPCDatablock_ATR( void )
|
||||
unsigned char i;
|
||||
unsigned char Atr[ATR_SIZE_MAX];
|
||||
unsigned char length;
|
||||
uint32_t status;
|
||||
|
||||
//TRACE_DEBUG(".");
|
||||
TRACE_DEBUG(".");
|
||||
|
||||
ISO7816_Datablock_ATR( Atr, &length );
|
||||
status = ISO7816_Datablock_ATR( Atr, &length );
|
||||
if (status == 0) {
|
||||
TRACE_DEBUG("Timeout occured while reading ATR");
|
||||
// FIXME: react properly to timeout..
|
||||
// return;
|
||||
}
|
||||
|
||||
if( length > 5 ) {
|
||||
ccidDriver.ProtocolDataStructure[1] = Atr[5]&0x0F; // TD(1)
|
||||
|
||||
Reference in New Issue
Block a user