Thank you @Gavin_Jia for the hint!
I successfully manage to update the host and reuse the callback logic using the following code:
void update_host(void) {
if (s_usbCdcAcmInfo.dtePresent) {
usb_device_cdc_acm_request_param_struct_t param = {
.setupValue = s_usbCdcAcmInfo.dteStatus,
.interfaceIndex = ((usb_device_cdc_acm_struct_t *)s_UsbInterface4XXXCicVcom.cdcAcmHandle)->interfaceNumber,
};
USB_DeviceInterface4XXXCicVcomCallback(s_UsbInterface4XXXCicVcom.cdcAcmHandle, kUSB_DeviceCdcEventSetControlLineState, ¶m);
}
}
Explanation for future reference:
1. The device can send serial state notifications at any time using the CIC vcom input endpoint.
2. The host can query status, this is triggered by kUSB_DeviceCdcEventSetControlLineState, as response (1) is sent.
3. kUSB_DeviceCdcEventSerialStateNotif is triggered after notification was sent.