samples/subsys/usb/webusb/src/main.c
/**
 * @brief Custom handler for standard requests in
 *        order to catch the request and return the
 *        WebUSB Platform Capability Descriptor.
 *
 * @param pSetup    Information about the request to execute.
 * @param len       Size of the buffer.
 * @param data      Buffer containing the request result.
 *
 * @return  0 on success, negative errno code on fail
 */
@brief Custom handler for standard requests in
order to catch the request and return the
WebUSB Platform Capability Descriptor.

@param pSetup    Information about the request to execute.
@param len       Size of the buffer.
@param data      Buffer containing the request result.

@return  0 on success, negative errno code on fail
@brief Custom handler for standard requests in order to catch the request and return the WebUSB Platform Capability Descriptor . @param pSetup Information about the request to execute . @param len Size of the buffer . @param data Buffer containing the request result . @return 0 on success negative errno code on fail
int custom_handle_req(struct usb_setup_packet *pSetup,
		s32_t *len, u8_t **data)
{
	if (GET_DESC_TYPE(pSetup->wValue) == DESCRIPTOR_TYPE_BOS) {
		*data = (u8_t *)(&webusb_bos_descriptor);
		*len = sizeof(webusb_bos_descriptor);
		return 0;
	}
	return -ENOTSUP;
}
int custom_handle_req ( struct usb_setup_packet * pSetup , s32_t * len , u8_t * * data ) { if ( GET_DESC_TYPE ( pSetup -> wValue ) == DESCRIPTOR_TYPE_BOS ) { * data = ( u8_t * ) ( & webusb_bos_descriptor ) ; * len = sizeof ( webusb_bos_descriptor ) ; return 0 ; } return - ENOTSUP ; }
@brief Custom handler for standard requests in
        order to catch the request and return the
        WebUSB Platform Capability Descriptor.
@brief Custom handler for standard requests in order to catch the request and return the WebUSB Platform Capability Descriptor .