Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Description

Read metadata preamble. This function is blocking.

Files

usbd_phdc.h / usbd_phdc.c

Prototype

Arguments

class_nbr

PHDC instance number.

p_buf

Pointer to buffer that will contain data from metadata message preamble.

buf_len

Opaque data buffer length in octets.

p_nbr_xfer

Pointer to a variable that will contain the number of transfer the preamble will apply to. After this call, USBD_PHDC_Rd shall be called nbr_xfer times by the application.

timeout

Timeout in milliseconds.

p_err

Pointer to variable that will receive the return error code from this function.

USBD_ERR_NONE
USBD_ERR_INVALID_CLASS_STATE
USBD_ERR_INVALID_ARG
USBD_ERR_NULL_PTR
USBD_ERR_ALLOC
USBD_ERR_RX
USBD_ERR_DEV_INVALID_NBR
USBD_ERR_EP_INVALID_NBR
USBD_ERR_DEV_INVALID_STATE
USBD_ERR_EP_INVALID_TYPE
USBD_OS_ERR_TIMEOUT
USBD_OS_ERR_ABORT
USBD_OS_ERR_FAIL

Returned Value

Length of opaque data read from metadata preamble, if no error.

0, otherwise

Callers

Application.

Notes / Warnings

  1. USBD_PHDC_PreambleRd() should always be called before USBD_PHDC_Rd if metadata message preambles are enabled by the host. Application should then call USBD_PHDC_Rd p_nbr_xfer times.
  2. If host disable preamble while application is pending on this function, the call will immediately return with error ‘USBD_OS_ERR_ABORT’.
  • No labels