Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make device_class an enum #2

Open
jacobrosenthal opened this issue Feb 9, 2020 · 5 comments
Open

make device_class an enum #2

jacobrosenthal opened this issue Feb 9, 2020 · 5 comments

Comments

@jacobrosenthal
Copy link
Contributor

We can provide comments then so people know they want the HID one for mice, keyboards joystics etc vs googling

@twitchyliquid64
Copy link
Owner

Sorry, I don't quite understand. What did you have in mind?

@jacobrosenthal
Copy link
Contributor Author

    unsafe {
        USB_HID = Some(HIDClass::new(&bus_allocator, MouseReport::desc(), 60));
        USB_BUS = Some(
            UsbDeviceBuilder::new(&bus_allocator, UsbVidPid(0x16c0, 0x27dd))
                .manufacturer("Fake company")
                .product("Twitchy Mousey")
                .serial_number("TEST")
                .device_class(0xEF) // <- MISC instead of 0xEF
                .build(),
        );
    }

@twitchyliquid64
Copy link
Owner

Ah, the device class in the USB Device descriptor.

I'm happy to add an enum for HID specific values, but shouldnt more generic ones like MISC be exposed in something like the usb-device crate?

@brainstorm
Copy link

brainstorm commented Sep 14, 2020

Yes but those that are HIDs like mouse, joystick and keyboard should be in this crate, right? Thanks for this crate! :)

@twitchyliquid64
Copy link
Owner

twitchyliquid64 commented Sep 14, 2020

Yeppers, I think it would be nice to have the really common descriptors ready to go in this crate (keyboard/mouse/joystick/etc). But i dont think we should try and be exhaustive.

From memory we already have a keyboard one (and maybe a mouse?), but feel free to send PRs for anything major missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants