feat(hid): add msos descriptor
Some checks failed
Code quality / check (pull_request) Failing after 1m42s
Some checks failed
Code quality / check (pull_request) Failing after 1m42s
This commit is contained in:
parent
2a01cd732a
commit
02e45bfc9d
1 changed files with 14 additions and 0 deletions
|
@ -17,6 +17,8 @@ use embassy_time::{Duration, Instant, Timer};
|
|||
use embassy_usb::{
|
||||
class::hid::{HidReaderWriter, ReportId, RequestHandler, State},
|
||||
control::OutResponse,
|
||||
msos::{self, windows_version},
|
||||
types::InterfaceNumber,
|
||||
Builder, Handler,
|
||||
};
|
||||
use libm::powf;
|
||||
|
@ -36,6 +38,9 @@ pub static MUTEX_INPUT_CONSISTENCY_MODE: Mutex<
|
|||
Option<InputConsistencyMode>,
|
||||
> = Mutex::new(None);
|
||||
|
||||
// This is a randomly generated GUID to allow clients on Windows to find our device
|
||||
const DEVICE_INTERFACE_GUID: &str = "{ecceff35-146c-4ff3-acd9-8f992d09acdd}";
|
||||
|
||||
#[rustfmt::skip]
|
||||
pub const GCC_REPORT_DESCRIPTOR: &[u8] = &[
|
||||
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
|
||||
|
@ -334,6 +339,15 @@ pub async fn usb_transfer_task(raw_serial: [u8; 8], driver: Driver<'static, USB>
|
|||
&mut control_buf,
|
||||
);
|
||||
|
||||
builder.msos_descriptor(windows_version::WIN8_1, 2);
|
||||
|
||||
let msos_writer = builder.msos_writer();
|
||||
msos_writer.device_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
|
||||
msos_writer.device_feature(msos::RegistryPropertyFeatureDescriptor::new(
|
||||
"DeviceInterfaceGUID",
|
||||
msos::PropertyData::Sz(DEVICE_INTERFACE_GUID),
|
||||
));
|
||||
|
||||
builder.handler(&mut device_handler);
|
||||
|
||||
let hid_config = embassy_usb::class::hid::Config {
|
||||
|
|
Loading…
Reference in a new issue