sources/common/libs/STM32Cube_F4/Middlewares/ST/STM32_USB_Device_Library/Class/CCID/Src/usbd_ccid_cmd.c
/**
  * @brief  PC_to_RDR_ResetParameters
  *         Set the ICC parameters to the default
  *         Response to this command message is the RDR_to_PC_Parameters
  * @param  pdev: device instance
  * @retval status of the command execution
  */
@brief  PC_to_RDR_ResetParameters
Set the ICC parameters to the default
Response to this command message is the RDR_to_PC_Parameters
@param  pdev: device instance
@retval status of the command execution
@brief PC_to_RDR_ResetParameters Set the ICC parameters to the default Response to this command message is the RDR_to_PC_Parameters @param pdev : device instance @retval status of the command execution
uint8_t  PC_to_RDR_ResetParameters(USBD_HandleTypeDef *pdev)
{
  USBD_CCID_HandleTypeDef  *hccid = (USBD_CCID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
  uint8_t error;
  error = CCID_CheckCommandParams(pdev, CHK_PARAM_SLOT | CHK_PARAM_DWLENGTH |
                                  CHK_PARAM_CARD_PRESENT | CHK_PARAM_ABRFU3 |
                                  CHK_ACTIVE_STATE);
  if (error != 0U)
  {
    return error;
  }
  hccid->UsbBlkOutData.abData[0] = DEFAULT_FIDI;
  hccid->UsbBlkOutData.abData[1] = DEFAULT_T01CONVCHECKSUM;
  hccid->UsbBlkOutData.abData[2] = DEFAULT_EXTRA_GUARDTIME;
  hccid->UsbBlkOutData.abData[3] = DEFAULT_WAITINGINTEGER;
  hccid->UsbBlkOutData.abData[4] = DEFAULT_CLOCKSTOP;
  hccid->UsbBlkOutData.abData[5] = 0x00U;
  hccid->UsbBlkOutData.abData[6] = 0x00U;
  (void)USBD_memcpy(&ProtocolData, (void const *)(&hccid->UsbBlkOutData.abData[0]),
                    sizeof(ProtocolData));
  error = SC_Itf_SetParams(&ProtocolData, ProtocolNUM_OUT);
  if (error != SLOT_NO_ERROR)
  {
    CCID_UpdateCommandStatus(pdev, (BM_COMMAND_STATUS_FAILED), (BM_ICC_PRESENT_ACTIVE));
  }
  else
  {
    CCID_UpdateCommandStatus(pdev, (BM_COMMAND_STATUS_NO_ERROR), (BM_ICC_PRESENT_ACTIVE));
    error = SLOT_NO_ERROR;
  }
  return error;
}
uint8_t PC_to_RDR_ResetParameters ( USBD_HandleTypeDef * pdev ) { USBD_CCID_HandleTypeDef * hccid = ( USBD_CCID_HandleTypeDef * ) pdev -> pClassDataCmsit [ pdev -> classId ] ; uint8_t error ; error = CCID_CheckCommandParams ( pdev , CHK_PARAM_SLOT | CHK_PARAM_DWLENGTH | CHK_PARAM_CARD_PRESENT | CHK_PARAM_ABRFU3 | CHK_ACTIVE_STATE ) ; if ( error != 0U ) { return error ; } hccid -> UsbBlkOutData . abData [ 0 ] = DEFAULT_FIDI ; hccid -> UsbBlkOutData . abData [ 1 ] = DEFAULT_T01CONVCHECKSUM ; hccid -> UsbBlkOutData . abData [ 2 ] = DEFAULT_EXTRA_GUARDTIME ; hccid -> UsbBlkOutData . abData [ 3 ] = DEFAULT_WAITINGINTEGER ; hccid -> UsbBlkOutData . abData [ 4 ] = DEFAULT_CLOCKSTOP ; hccid -> UsbBlkOutData . abData [ 5 ] = 0x00U ; hccid -> UsbBlkOutData . abData [ 6 ] = 0x00U ; ( void ) USBD_memcpy ( & ProtocolData , ( void const * ) ( & hccid -> UsbBlkOutData . abData [ 0 ] ) , sizeof ( ProtocolData ) ) ; error = SC_Itf_SetParams ( & ProtocolData , ProtocolNUM_OUT ) ; if ( error != SLOT_NO_ERROR ) { CCID_UpdateCommandStatus ( pdev , ( BM_COMMAND_STATUS_FAILED ) , ( BM_ICC_PRESENT_ACTIVE ) ) ; } else { CCID_UpdateCommandStatus ( pdev , ( BM_COMMAND_STATUS_NO_ERROR ) , ( BM_ICC_PRESENT_ACTIVE ) ) ; error = SLOT_NO_ERROR ; } return error ; }
@brief  PC_to_RDR_ResetParameters
         Set the ICC parameters to the default
         Response to this command message is the RDR_to_PC_Parameters
 @param  pdev: device instance
 @retval status of the command execution
@brief PC_to_RDR_ResetParameters Set the ICC parameters to the default Response to this command message is the RDR_to_PC_Parameters @param pdev : device instance @retval status of the command execution
/* This command resets the slot parameters to their default values */