Commit 833a39c6 authored by Emil Obalski's avatar Emil Obalski Committed by Carles Cufi
Browse files

usb: webusb: Use API structure instead of custom one


This patch cleans webusb class. WebUSB class were using custom
request handler structure which is not necessary. This one
is removed and API struct is used instead.
Signed-off-by: default avatarEmil Obalski <emil.obalski@nordicsemi.no>
parent 905e69cb
Showing with 7 additions and 22 deletions
+7 -22
......@@ -276,7 +276,7 @@ int vendor_handle_req(struct usb_setup_packet *pSetup,
}
/* Custom and Vendor request handlers */
static struct webusb_req_handlers req_handlers = {
static struct usb_request_handlers req_handlers = {
.custom_handler = custom_handle_req,
.vendor_handler = vendor_handle_req,
};
......
......@@ -33,7 +33,7 @@ LOG_MODULE_REGISTER(webusb);
#define WEBUSB_IN_EP_IDX 0
#define WEBUSB_OUT_EP_IDX 1
static struct webusb_req_handlers *req_handlers;
static struct usb_request_handlers *req_handlers;
uint8_t rx_buf[64];
......@@ -126,7 +126,7 @@ int webusb_vendor_handle_req(struct usb_setup_packet *pSetup,
*
* @return N/A
*/
void webusb_register_request_handlers(struct webusb_req_handlers *handlers)
void webusb_register_request_handlers(struct usb_request_handlers *handlers)
{
req_handlers = handlers;
}
......
......@@ -15,29 +15,14 @@
#define __WEBUSB_SERIAL_H__
/**
* WebUSB request handlers
*/
struct webusb_req_handlers {
/* Handler for WebUSB Vendor specific commands */
usb_request_handler vendor_handler;
/**
* The custom request handler gets a first chance at handling
* the request before it is handed over to the 'chapter 9' request
* handler
*/
usb_request_handler custom_handler;
};
/**
* @brief Register Custom and Vendor request callbacks
* @brief Register request callbacks
*
* Function to register Custom and Vendor request callbacks
* for handling requests.
* Function to register request callbacks for handling requests.
*
* @param [in] handlers Pointer to WebUSB request handlers structure
* @param [in] handlers Pointer request handlers structure
*
* @return N/A
*/
void webusb_register_request_handlers(struct webusb_req_handlers *handlers);
void webusb_register_request_handlers(struct usb_request_handlers *handlers);
#endif /* __WEBUSB_SERIAL_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment