samples/subsys/usb/dfu/src/usb_dfu.c
/**
 * @brief Callback used to know the USB connection status
 *
 * @param status USB device status code.
 *
 * @return  N/A.
 */
@brief Callback used to know the USB connection status
@param status USB device status code.

@return  N/A.
@brief Callback used to know the USB connection status @param status USB device status code . @return N / A .
static void dfu_status_cb(enum usb_dc_status_code status)
{
	switch (status) {
	case USB_DC_ERROR:
		SYS_LOG_DBG("USB device error");
		break;
	case USB_DC_RESET:
		SYS_LOG_DBG("USB device reset detected, state %d", dfu_data.state);
		if (dfu_data.state == appDETACH) {
			dfu_data.state = dfuIDLE;
		}
		break;
	case USB_DC_CONNECTED:
		SYS_LOG_DBG("USB device connected");
		break;
	case USB_DC_CONFIGURED:
		SYS_LOG_DBG("USB device configured");
		break;
	case USB_DC_DISCONNECTED:
		SYS_LOG_DBG("USB device disconnected");
		break;
	case USB_DC_SUSPEND:
		SYS_LOG_DBG("USB device supended");
		break;
	case USB_DC_RESUME:
		SYS_LOG_DBG("USB device resumed");
		break;
	case USB_DC_UNKNOWN:
	default:
		SYS_LOG_DBG("USB unknown state");
		break;
	}
}
static void dfu_status_cb ( enum usb_dc_status_code status ) { switch ( status ) { case USB_DC_ERROR : SYS_LOG_DBG ( " " ) ; break ; case USB_DC_RESET : SYS_LOG_DBG ( " " , dfu_data . state ) ; if ( dfu_data . state == appDETACH ) { dfu_data . state = dfuIDLE ; } break ; case USB_DC_CONNECTED : SYS_LOG_DBG ( " " ) ; break ; case USB_DC_CONFIGURED : SYS_LOG_DBG ( " " ) ; break ; case USB_DC_DISCONNECTED : SYS_LOG_DBG ( " " ) ; break ; case USB_DC_SUSPEND : SYS_LOG_DBG ( " " ) ; break ; case USB_DC_RESUME : SYS_LOG_DBG ( " " ) ; break ; case USB_DC_UNKNOWN : default : SYS_LOG_DBG ( " " ) ; break ; } }
@brief Callback used to know the USB connection status
 @param status USB device status code.
@brief Callback used to know the USB connection status @param status USB device status code .
/* Check the USB status and do needed action if required */