From 23f03cb6d39d9f7c4e0f0c8fdc607f4c92c0e9a4 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 27 Aug 2018 17:37:53 +0200 Subject: [PATCH] firmware: don't use WebUSB landing page for firmware, it's annoying --- firmware/usb.c | 2 +- webusb.c | 11 +++++++++++ webusb.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/firmware/usb.c b/firmware/usb.c index 228e28a8c..733a55b34 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -334,7 +334,7 @@ static usbd_device *usbd_dev; static uint8_t usbd_control_buffer[256] __attribute__ ((aligned (2))); static const struct usb_device_capability_descriptor* capabilities[] = { - (const struct usb_device_capability_descriptor*)&webusb_platform_capability_descriptor, + (const struct usb_device_capability_descriptor*)&webusb_platform_capability_descriptor_no_landing_page, }; static const struct usb_bos_descriptor bos_descriptor = { diff --git a/webusb.c b/webusb.c index beb909c08..710618781 100644 --- a/webusb.c +++ b/webusb.c @@ -33,6 +33,17 @@ const struct webusb_platform_descriptor webusb_platform_capability_descriptor = .iLandingPage = 1 }; +const struct webusb_platform_descriptor webusb_platform_capability_descriptor_no_landing_page = { + .bLength = WEBUSB_PLATFORM_DESCRIPTOR_SIZE, + .bDescriptorType = USB_DT_DEVICE_CAPABILITY, + .bDevCapabilityType = USB_DC_PLATFORM, + .bReserved = 0, + .platformCapabilityUUID = WEBUSB_UUID, + .bcdVersion = 0x0100, + .bVendorCode = WEBUSB_VENDOR_CODE, + .iLandingPage = 0 +}; + static const char* webusb_https_url; static int webusb_control_vendor_request(usbd_device *usbd_dev, diff --git a/webusb.h b/webusb.h index 342408f1f..c7f5dc78f 100644 --- a/webusb.h +++ b/webusb.h @@ -26,6 +26,8 @@ #define WEBUSB_VENDOR_CODE 0x01 extern const struct webusb_platform_descriptor webusb_platform_capability_descriptor; +extern const struct webusb_platform_descriptor webusb_platform_capability_descriptor_no_landing_page; + extern void webusb_setup(usbd_device* usbd_dev, const char* https_url); #endif