Hi Karthik,
I understand what you need now. You intend to bypass the logic for MSC and just use the BULK endpoint to send and receive data right?
Let explain how the USB stack works when it tries to send and receive data with its endpoints.
When USB device receives either IN or OUT token from USB host, it will call USB_DeviceNotification() inside usb_device_dci.c file. At the end of that function, you will see the following code which calls registered endpoint callback function.
/* Call endpoint callback */
error = handle->endpointCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].callbackFn(
handle, &endpointCallbackMessage,
handle->endpointCallback[(uint8_t)((uint32_t)endpoint << 1U) | direction].callbackParam);
The prototype of this endpoint callback is inside usb_device.h
typedef usb_status_t (*usb_device_endpoint_callback_t)(usb_device_handle handle,
usb_device_endpoint_callback_message_struct_t *message,
void *callbackParam);
For the MSD disk demo, you will see USB_DeviceMscEndpointsInit function called inside USB_DeviceCallback function once USB passed enumeration and received kUSB_DeviceEventSetConfiguration event. Inside USB_DeviceMscEndpointsInit function, it registered both USB_DeviceMscBulkIn and USB_DeviceMscBulkOut as BULK IN and OUT endpoint callback function. The prototype is the same as the endpoint callback function. Here you can redefine what you need to send and receive data on BULK endpoints.
Hao