lpcware

CDC SendNotification of CDC_NOTIFICATION_SERIAL_STATE not working

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by robert hulsebos on Thu Dec 10 14:44:38 MST 2015
Hi all,

I am using a LPC1769 device to set up a virtual COM port via USB CDC. I got this all working using the example code and the usbd_175x_6x_lib.a library that comes with LPCopen v2.10.
On my Windows PC I can connect with a terminal program (e.g. Termite, TeraTerm) to the virtual COM port of the device and exchange serial data, no problems there. All works fine.
However, now I want to emulate to the PC that the DSR signal of the virtual COM port has become active, using the SendNotification function of the CDC API.
So I issue this call:

ret = USBD_API->cdc->SendNotification(g_vCOM.hCdc, CDC_NOTIFICATION_SERIAL_STATE, CDC_SERIAL_STATE_TX_CARRIER);

This API call always returns with ERR_API_INVALID_PARAM2. I checked the hCdc handle. I also checked the constants in the call against the usbcdc11.pdf specification for CDC. All are correct.
I don't understand this return value, as the usbd_cdcuser.h header file clearly states that the CDC_NOTIFICATION_SERIAL_STATE notification is one of the three notification types that are supported by the CDC driver.

Is this a bug in the library or is the header file wrong?

Other details:

LPCXpresso 7.9.2
LPCopen 2.10

Outcomes