Skip to content

WebUSB implementation for usb-device.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

redpfire/usbd-webusb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usbd-webusb

WebUSB implementation for usb-device.

WebUSB is a proposed JavaScript API standard for securely providing access to USB devices from web pages.

License

Licensed under either of

at your option.

Example

A full example requires the use of a hardware driver, but the hardware independent part looks like that:

use usbd_webusb::*;

// Creates a WebUSB class instance with URL "https://google.com"
// You can also provide a custom URL with scheme url_scheme::CUSTOM
let wusb = WebUsb::new(&usb_bus, url_scheme::HTTPS, "google.com");
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
    .product("Test product")
    .build();

loop {
    if !usb_dev.poll(&mut [&mut wusb]) {
        continue;
    }
}

About

WebUSB implementation for usb-device.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages