sources/common/libs/STM32Cube_F4/Middlewares/ST/STM32_USB_Device_Library/Class/CCID/Src/usbd_ccid_cmd.c
/**
  * @brief  RDR_to_PC_SlotStatus
  *         Provide the Slot status response to the host
  *          Response for PC_to_RDR_IccPowerOff
  *                PC_to_RDR_GetSlotStatus
  *                PC_to_RDR_IccClock
  *                PC_to_RDR_T0APDU
  *                PC_to_RDR_Mechanical
  *         Also the device sends this response message when it has completed
  *         aborting a slot after receiving both the Class Specific ABORT request
  *         and PC_to_RDR_Abort command message.
  * @param  errorCode: code to be returned to the host
  * @param  pdev: device instance
  * @retval None
  */
@brief  RDR_to_PC_SlotStatus
Provide the Slot status response to the host
Response for PC_to_RDR_IccPowerOff
PC_to_RDR_GetSlotStatus
PC_to_RDR_IccClock
PC_to_RDR_T0APDU
PC_to_RDR_Mechanical
Also the device sends this response message when it has completed
aborting a slot after receiving both the Class Specific ABORT request
and PC_to_RDR_Abort command message.
@param  errorCode: code to be returned to the host
@param  pdev: device instance
@retval None
@brief RDR_to_PC_SlotStatus Provide the Slot status response to the host Response for PC_to_RDR_IccPowerOff PC_to_RDR_GetSlotStatus PC_to_RDR_IccClock PC_to_RDR_T0APDU PC_to_RDR_Mechanical Also the device sends this response message when it has completed aborting a slot after receiving both the Class Specific ABORT request and PC_to_RDR_Abort command message . @param errorCode : code to be returned to the host @param pdev : device instance @retval None
void RDR_to_PC_SlotStatus(uint8_t  errorCode, USBD_HandleTypeDef *pdev)
{
  USBD_CCID_HandleTypeDef  *hccid = (USBD_CCID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
  uint16_t length = CCID_RESPONSE_HEADER_SIZE;
  hccid->UsbBlkInData.bMessageType = RDR_TO_PC_SLOTSTATUS;
  hccid->UsbBlkInData.dwLength = 0U;
  hccid->UsbBlkInData.bError = 0U;
  hccid->UsbBlkInData.bSpecific = 0U;    
  if (errorCode == SLOT_NO_ERROR)
  {
    length += (uint16_t)hccid->UsbBlkInData.dwLength;
  }
  (void)USBD_CCID_Transfer_Data_Request(pdev, (uint8_t *)(&hccid->UsbBlkInData), length);
}
void RDR_to_PC_SlotStatus ( uint8_t errorCode , USBD_HandleTypeDef * pdev ) { USBD_CCID_HandleTypeDef * hccid = ( USBD_CCID_HandleTypeDef * ) pdev -> pClassDataCmsit [ pdev -> classId ] ; uint16_t length = CCID_RESPONSE_HEADER_SIZE ; hccid -> UsbBlkInData . bMessageType = RDR_TO_PC_SLOTSTATUS ; hccid -> UsbBlkInData . dwLength = 0U ; hccid -> UsbBlkInData . bError = 0U ; hccid -> UsbBlkInData . bSpecific = 0U ; if ( errorCode == SLOT_NO_ERROR ) { length += ( uint16_t ) hccid -> UsbBlkInData . dwLength ; } ( void ) USBD_CCID_Transfer_Data_Request ( pdev , ( uint8_t * ) ( & hccid -> UsbBlkInData ) , length ) ; }
@brief  RDR_to_PC_SlotStatus
         Provide the Slot status response to the host
          Response for PC_to_RDR_IccPowerOff
                PC_to_RDR_GetSlotStatus
                PC_to_RDR_IccClock
                PC_to_RDR_T0APDU
                PC_to_RDR_Mechanical
         Also the device sends this response message when it has completed
         aborting a slot after receiving both the Class Specific ABORT request
         and PC_to_RDR_Abort command message.
@brief RDR_to_PC_SlotStatus Provide the Slot status response to the host Response for PC_to_RDR_IccPowerOff PC_to_RDR_GetSlotStatus PC_to_RDR_IccClock PC_to_RDR_T0APDU PC_to_RDR_Mechanical Also the device sends this response message when it has completed aborting a slot after receiving both the Class Specific ABORT request and PC_to_RDR_Abort command message .
/* bClockStatus = 00h Clock running
  01h Clock stopped in state L
  02h Clock stopped in state H
  03h Clock stopped in an unknown state */