/* Event handler for the CCID_PC_to_RDR_ABort message. This message is sent to the device whenever an application wants to abort the current operation. A previous CCID_ABORT control message has to be sent before this one in order to start the abort operation.  */
uint8_t CCID_Abort(uint8_t Slot, uint8_t Seq, uint8_t *const Error)
/* Event handler for the CCID_PC_to_RDR_ABort message. This message is sent to the device whenever an application wants to abort the current operation. A previous CCID_ABORT control message has to be sent before this one in order to start the abort operation.  */
uint8_t CCID_Abort(uint8_t Slot, uint8_t Seq, uint8_t *const Error)
{
	if (Aborted && Slot == 0 && AbortedSeq == Seq)
	{
		Aborted    = false;
		AbortedSeq = -1;
		*Error = CCID_ERROR_NO_ERROR;
		return CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_PRESENTANDACTIVE;
	}
	else if (!Aborted)
	{
		*Error = CCID_ERROR_CMD_NOT_ABORTED;
		return CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_PRESENTANDACTIVE;
	}
	else if (Slot != 0)
	{
		*Error = CCID_ERROR_SLOT_NOT_FOUND;
		return CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_NOICCPRESENT;
	}
	*Error = CCID_ERROR_NOT_SUPPORTED;
	return CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_NOICCPRESENT;
}