USBD_CDC_Notify

USBD_CDC_Notify

Description

Send communication interface class notification to the host.

Files

usbd_cdc.h/usbd_cdc.c

Prototype

CPU_BOOLEAN USBD_CDC_Notify (CPU_INT08U class_nbr, CPU_INT08U notification, CPU_INT16U value, CPU_INT08U *p_buf, CPU_INT16U data_len, USBD_ERR *p_err);

 

Arguments

class_nbr

CDC instance number.

notification

Notification code (see Note #2).

value

Notification value (see Note #2).

p_buf

Pointer to notification buffer (see Note #1).

data_len

Notification’s data section length.

p_err

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

USBD_ERR_NONE

USBD_ERR_INVALID_ARG

USBD_ERR_INVALID_CLASS_STATE

USBD_ERR_DEV_INVALID_NBR

USBD_ERR_DEV_INVALID_STATE

USBD_ERR_EP_INVALID_ADDR

USBD_ERR_EP_INVALID_STATE

USBD_ERR_EP_INVALID_TYPE

USBD_ERR_OS_TIMEOUT

USBD_ERR_OS_ABORT

USBD_ERR_OS_FAIL

Returned Value

None.

Callers

CDC Subclass drivers.

Notes / Warnings

  1. The notification buffer size must contain space for the notification header (8 bytes) and the variable-length data portion.

  2. The following table shows the relationship between CDC request and the parameters passed in the USBD_CDC_Notify() function. The bmRequestType and wIndex fields are calculated internally in the CDC module.

bmRequestType

bNotificationCode

wValue

wIndex

wLength

Data

bmRequestType

bNotificationCode

wValue

wIndex

wLength

Data

1010001b

notification

value

Interface

data_len

p_buf[7] to
p_buf[data_len -1]