Add product code for GL703 0x1869

This commit is contained in:
Luke
2020-04-28 08:09:40 +12:00
parent c6fee63789
commit 9aa431f0d6
8 changed files with 39 additions and 21 deletions

View File

@@ -53,8 +53,13 @@ pub(crate) struct RogCore {
}
impl RogCore {
pub(crate) fn new(laptop: &dyn Laptop) -> Result<RogCore, AuraError> {
let mut dev_handle = RogCore::get_device(laptop.usb_vendor(), laptop.usb_product())?;
pub(crate) fn new(
vendor: u16,
product: u16,
led_endpoint: u8,
key_endpoint: u8,
) -> Result<RogCore, AuraError> {
let mut dev_handle = RogCore::get_device(vendor, product)?;
dev_handle.set_active_configuration(0).unwrap_or(());
let dev_config = dev_handle.device().config_descriptor(0).unwrap();
@@ -63,7 +68,7 @@ impl RogCore {
for iface in dev_config.interfaces() {
for desc in iface.descriptors() {
for endpoint in desc.endpoint_descriptors() {
if endpoint.address() == laptop.key_endpoint() {
if endpoint.address() == key_endpoint {
debug!("INTERVAL: {:?}", endpoint.interval());
debug!("MAX: {:?}", endpoint.max_packet_size());
debug!("SYNC: {:?}", endpoint.sync_type());
@@ -83,8 +88,8 @@ impl RogCore {
Ok(RogCore {
handle: dev_handle,
initialised: false,
led_endpoint: laptop.led_endpoint(),
keys_endpoint: laptop.key_endpoint(),
led_endpoint: led_endpoint,
keys_endpoint: key_endpoint,
config: Config::default().read(),
virt_keys: VirtKeys::new(),
})