/* Sends a notification of Virtual COM Port statuses and line states. 
The function sends error and line status of the Virtual COM Port over the Interrupt endpoint. (SerialState notification is defined in usbcdc11.pdf, 6.3.5.) */
int32_t USBD_CDC_ACM_Notify(uint16_t stat)
/* Sends a notification of Virtual COM Port statuses and line states. 
The function sends error and line status of the Virtual COM Port over the Interrupt endpoint. (SerialState notification is defined in usbcdc11.pdf, 6.3.5.) */
int32_t USBD_CDC_ACM_Notify(uint16_t stat)
{
    if (USBD_Configuration) {
        USBD_CDC_ACM_NotifyBuf[0] = 0xA1;
        USBD_CDC_ACM_NotifyBuf[1] = CDC_NOTIFICATION_SERIAL_STATE;
        USBD_CDC_ACM_NotifyBuf[2] = 0x00;
        USBD_CDC_ACM_NotifyBuf[3] = 0x00;
        USBD_CDC_ACM_NotifyBuf[4] = 0x00;
        USBD_CDC_ACM_NotifyBuf[5] = 0x00;
        USBD_CDC_ACM_NotifyBuf[6] = 0x02;
        USBD_CDC_ACM_NotifyBuf[7] = 0x00;
        USBD_CDC_ACM_NotifyBuf[8] = stat >> 0;
        USBD_CDC_ACM_NotifyBuf[9] = stat >> 8;
        USBD_WriteEP(usbd_cdc_acm_ep_intin | 0x80, USBD_CDC_ACM_NotifyBuf, 10);
        return (1);
    }
    return (0);
}