sources/common/libs/STM32Cube_F4/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c
/**
  * @brief  USBD_StdDevReq
  *         Handle standard usb device requests
  * @param  pdev: device instance
  * @param  req: usb request
  * @retval status
  */
@brief  USBD_StdDevReq
Handle standard usb device requests
@param  pdev: device instance
@param  req: usb request
@retval status
@brief USBD_StdDevReq Handle standard usb device requests @param pdev : device instance @param req : usb request @retval status
USBD_StatusTypeDef USBD_StdDevReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
{
  USBD_StatusTypeDef ret = USBD_OK;
  switch (req->bmRequest & USB_REQ_TYPE_MASK)
  {
    case USB_REQ_TYPE_CLASS:
    case USB_REQ_TYPE_VENDOR:
      ret = (USBD_StatusTypeDef)pdev->pClass[pdev->classId]->Setup(pdev, req);
      break;
    case USB_REQ_TYPE_STANDARD:
      switch (req->bRequest)
      {
        case USB_REQ_GET_DESCRIPTOR:
          USBD_GetDescriptor(pdev, req);
          break;
        case USB_REQ_SET_ADDRESS:
          USBD_SetAddress(pdev, req);
          break;
        case USB_REQ_SET_CONFIGURATION:
          ret = USBD_SetConfig(pdev, req);
          break;
        case USB_REQ_GET_CONFIGURATION:
          USBD_GetConfig(pdev, req);
          break;
        case USB_REQ_GET_STATUS:
          USBD_GetStatus(pdev, req);
          break;
        case USB_REQ_SET_FEATURE:
          USBD_SetFeature(pdev, req);
          break;
        case USB_REQ_CLEAR_FEATURE:
          USBD_ClrFeature(pdev, req);
          break;
        default:
          USBD_CtlError(pdev, req);
          break;
      }
      break;
    default:
      USBD_CtlError(pdev, req);
      break;
  }
  return ret;
}
USBD_StatusTypeDef USBD_StdDevReq ( USBD_HandleTypeDef * pdev , USBD_SetupReqTypedef * req ) { USBD_StatusTypeDef ret = USBD_OK ; switch ( req -> bmRequest & USB_REQ_TYPE_MASK ) { case USB_REQ_TYPE_CLASS : case USB_REQ_TYPE_VENDOR : ret = ( USBD_StatusTypeDef ) pdev -> pClass [ pdev -> classId ] -> Setup ( pdev , req ) ; break ; case USB_REQ_TYPE_STANDARD : switch ( req -> bRequest ) { case USB_REQ_GET_DESCRIPTOR : USBD_GetDescriptor ( pdev , req ) ; break ; case USB_REQ_SET_ADDRESS : USBD_SetAddress ( pdev , req ) ; break ; case USB_REQ_SET_CONFIGURATION : ret = USBD_SetConfig ( pdev , req ) ; break ; case USB_REQ_GET_CONFIGURATION : USBD_GetConfig ( pdev , req ) ; break ; case USB_REQ_GET_STATUS : USBD_GetStatus ( pdev , req ) ; break ; case USB_REQ_SET_FEATURE : USBD_SetFeature ( pdev , req ) ; break ; case USB_REQ_CLEAR_FEATURE : USBD_ClrFeature ( pdev , req ) ; break ; default : USBD_CtlError ( pdev , req ) ; break ; } break ; default : USBD_CtlError ( pdev , req ) ; break ; } return ret ; }
@brief  USBD_StdDevReq
         Handle standard usb device requests
 @param  pdev: device instance
 @param  req: usb request
 @retval status
@brief USBD_StdDevReq Handle standard usb device requests @param pdev : device instance @param req : usb request @retval status