samples/subsys/usb/webusb/src/webusb.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 webusb_dev_status_cb(struct usb_cfg_data *cfg,
				 enum usb_dc_status_code status,
				 const u8_t *param)
{
	ARG_UNUSED(param);
	ARG_UNUSED(cfg);
	switch (status) {
	case USB_DC_ERROR:
		LOG_DBG("USB device error");
		break;
	case USB_DC_RESET:
		LOG_DBG("USB device reset detected");
		break;
	case USB_DC_CONNECTED:
		LOG_DBG("USB device connected");
		break;
	case USB_DC_CONFIGURED:
		LOG_DBG("USB device configured");
		webusb_read_cb(WEBUSB_ENDP_OUT, 0, NULL);
		break;
	case USB_DC_DISCONNECTED:
		LOG_DBG("USB device disconnected");
		break;
	case USB_DC_SUSPEND:
		LOG_DBG("USB device suspended");
		break;
	case USB_DC_RESUME:
		LOG_DBG("USB device resumed");
		break;
	case USB_DC_UNKNOWN:
	default:
		LOG_DBG("USB unknown state");
		break;
	}
}
static void webusb_dev_status_cb ( struct usb_cfg_data * cfg , enum usb_dc_status_code status , const u8_t * param ) { ARG_UNUSED ( param ) ; ARG_UNUSED ( cfg ) ; switch ( status ) { case USB_DC_ERROR : LOG_DBG ( " " ) ; break ; case USB_DC_RESET : LOG_DBG ( " " ) ; break ; case USB_DC_CONNECTED : LOG_DBG ( " " ) ; break ; case USB_DC_CONFIGURED : LOG_DBG ( " " ) ; webusb_read_cb ( WEBUSB_ENDP_OUT , 0 , NULL ) ; break ; case USB_DC_DISCONNECTED : LOG_DBG ( " " ) ; break ; case USB_DC_SUSPEND : LOG_DBG ( " " ) ; break ; case USB_DC_RESUME : LOG_DBG ( " " ) ; break ; case USB_DC_UNKNOWN : default : 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 */