im-tomu / toboot

Bootloader for the EFM32HG Tomu Board
https://tomu.im/
GNU General Public License v3.0
72 stars 28 forks source link

Fix WebUSB / BOS descriptors #16

Closed xobs closed 6 years ago

xobs commented 6 years ago

The BOS descriptors are reporting issues on Chrome 68. These should be fixed.

devanlai commented 6 years ago

I'm not sure about the BOS descriptor - at a glance, the code looks fine. For WebUSB, the landing page URL descriptor is retrieved via a vendor request, not a standard GET_DESCRIPTOR request. It should look similar to the WinUSB handler, something like:

    case (WEBUSB_VENDOR_CODE << 8) | 0xC0:
        if (dev->dev_req.wIndex == WEBUSB_REQ_GET_URL)
        {
            if (dev->dev_req.wValue == 0x0001)
            {
                // Return the landing page URL descriptor
                data = (const uint8_t*)&landing_url_descriptor;
                datalen = LANDING_PAGE_DESCRIPTOR_SIZE;
                break;
            }
        }
        usb_lld_ctrl_error(dev);
        return;
xobs commented 6 years ago

Closed by #35