mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-25 01:38:33 +03:00
cciddriver.c: Fixed slot status bugs
The atmel lib takes the wrong values to signalize the current slot status to the PC.
This commit is contained in:
@@ -136,12 +136,18 @@ void CCIDDriver_Initialize( void )
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
static void RDRtoPCSlotStatus( void )
|
static void RDRtoPCSlotStatus( void )
|
||||||
{
|
{
|
||||||
TRACE_DEBUG(".");
|
|
||||||
|
|
||||||
// Header fields settings
|
// Header fields settings
|
||||||
ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS;
|
ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS;
|
||||||
ccidDriver.sCcidMessage.wLength = 0;
|
ccidDriver.sCcidMessage.wLength = 0;
|
||||||
ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus;
|
|
||||||
|
if (ccidDriver.SlotStatus == ICC_INSERTED_EVENT) {
|
||||||
|
ccidDriver.sCcidMessage.bStatus = 0; /* ICC present and active card */
|
||||||
|
} else if (ccidDriver.SlotStatus == ICC_NOT_PRESENT) {
|
||||||
|
ccidDriver.sCcidMessage.bStatus = 2; /* No ICC present*/
|
||||||
|
} else{
|
||||||
|
TRACE_ERROR("Strange bStatus");
|
||||||
|
ccidDriver.sCcidMessage.bStatus = 0;
|
||||||
|
}
|
||||||
ccidDriver.sCcidMessage.bError = 0;
|
ccidDriver.sCcidMessage.bError = 0;
|
||||||
// 00h Clock running
|
// 00h Clock running
|
||||||
// 01h Clock stopped in state L
|
// 01h Clock stopped in state L
|
||||||
|
|||||||
Reference in New Issue
Block a user