diff --git a/CHANGELOG.md b/CHANGELOG.md index 89764d82..c13d369f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Start differentiating between models using the 0x1866 USB device +- Refactor how to send multizone over dbus ## [0.9.6] - 2020-22-05 ### Changed diff --git a/Cargo.lock b/Cargo.lock index 2bfb3baa..c070fae0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -549,6 +549,12 @@ dependencies = [ "libc", ] +[[package]] +name = "numtoa" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e521b6adefa0b2c1fa5d2abdf9a5216288686fe6146249215d884c0e5ab320b0" + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -690,6 +696,7 @@ dependencies = [ "rusb", "serde", "serde_derive", + "sysfs-class", "tokio", "toml", "uhid-virt", @@ -803,6 +810,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "sysfs-class" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1bbcf869732c45a77898f7f61ed6d411dfc37613517e444842f58d428856d1" +dependencies = [ + "numtoa", +] + [[package]] name = "take_mut" version = "0.2.2" diff --git a/README.md b/README.md index fcfa2500..7779e8bd 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,9 @@ sudo systemctl start rog-core.service sudo systemctl enable rog-core.service ``` -I can't guarantee stability of updating via PPA yet. +### Gentoo ebuild + +Thanks to @aspann you can grab it here [sys-power/rog-core](https://lab.retarded.farm/zappel/zGentoo/-/tree/master/sys-power/rog-core) ## Updating @@ -131,6 +133,12 @@ with the Aura keys will use the settings that were used via CLI. - GX502 (product 0x1866) (Tested on GX502GW) +**Partial/Inprogress:** +- GM501 +- G14 + +Both of these laptops appear to have the same USB device ID as the GX502, but with different features enabled. + **Please help test or provide info for:** - GL703(0x1869), GA502 (attempts to use same profile as GX502GW) diff --git a/aura/src/aura_dbus.rs b/aura/src/aura_dbus.rs index b771529b..7fad8112 100644 --- a/aura/src/aura_dbus.rs +++ b/aura/src/aura_dbus.rs @@ -82,6 +82,26 @@ impl AuraDbusWriter { Ok(()) } + #[inline] + pub fn write_multizone( + &mut self, + group: &[[u8; LED_MSG_LEN]; 4], + ) -> Result<(), Box> { + self.connection.process(Duration::from_micros(300))?; + + let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "LedWriteEffect")? + .append1(&group[0].to_vec()) + .append1(&group[1].to_vec()) + .append1(&group[2].to_vec()) + .append1(&group[3].to_vec()); + self.connection.send(msg).unwrap(); + thread::sleep(Duration::from_millis(self.block_time)); + if self.stop.load(Ordering::Relaxed) { + panic!("Go signal to stop!"); + } + Ok(()) + } + #[inline] pub fn write_bytes(&self, bytes: &[u8]) -> Result> { let msg = Message::new_method_call(DBUS_NAME, DBUS_PATH, DBUS_IFACE, "LedWriteBytes")? diff --git a/aura/src/builtins.rs b/aura/src/builtins.rs index 2213a7d2..c0f645c9 100644 --- a/aura/src/builtins.rs +++ b/aura/src/builtins.rs @@ -107,6 +107,7 @@ pub enum BuiltInModeByte { Pulse = 0x0a, ThinZoomy = 0x0b, WideZoomy = 0x0c, + MultiStatic, None, } impl Default for BuiltInModeByte { @@ -160,6 +161,7 @@ impl From for u8 { BuiltInModeByte::Pulse => 0x0a, BuiltInModeByte::ThinZoomy => 0x0b, BuiltInModeByte::WideZoomy => 0x0c, + BuiltInModeByte::MultiStatic => 0x00, BuiltInModeByte::None => 0xff, } } diff --git a/rog-core/Cargo.toml b/rog-core/Cargo.toml index 6c600f10..0e0d7965 100644 --- a/rog-core/Cargo.toml +++ b/rog-core/Cargo.toml @@ -37,7 +37,7 @@ serde_derive = "1.0" toml = "0.5" # Device control -# sysfs-class = "^0.1.2" # used for backlight control mostly +sysfs-class = "^0.1.2" # used for backlight control and baord ID # cpu power management intel-pstate = "^0.2.1" # virtualisation of HID, mainly for outputting consumer key codes diff --git a/rog-core/src/daemon.rs b/rog-core/src/daemon.rs index c7b29bcb..52a15d50 100644 --- a/rog-core/src/daemon.rs +++ b/rog-core/src/daemon.rs @@ -114,6 +114,7 @@ pub async fn start_daemon() -> Result<(), Box> { loop { connection.process_all(); + // Check if a key press issued a command let res = aura_command_recv.recv_timeout(Duration::from_micros(50)); if let Ok(command) = res { let mut config = config.lock().await; @@ -134,6 +135,7 @@ pub async fn start_daemon() -> Result<(), Box> { *effect = None; time_mark = Instant::now(); } else { + // Check if single mode if let Ok(mut lock) = input.try_lock() { if let Some(bytes) = lock.take() { if bytes.len() > 0 { @@ -157,10 +159,17 @@ pub async fn start_daemon() -> Result<(), Box> { if let Some(effect) = effect_lock.take() { if effect.len() == 11 { let mut config = config.lock().await; - led_writer - .do_command(AuraCommand::WriteEffect(effect), &mut config) - .await - .unwrap_or_else(|err| warn!("{:?}", err)); + if effect.len() > 4 { + led_writer + .do_command(AuraCommand::WriteEffect(effect), &mut config) + .await + .unwrap_or_else(|err| warn!("{:?}", err)); + } else { + led_writer + .do_command(AuraCommand::WriteMultizone(effect), &mut config) + .await + .unwrap_or_else(|err| warn!("{:?}", err)); + } time_mark = Instant::now(); } } @@ -207,6 +216,31 @@ fn dbus_create_ledmsg_method(msg: LedMsgType) -> Method { .inarg::, _>("bytearray") } +fn dbus_create_ledmultizone_method(effect: EffectType) -> Method { + let factory = Factory::new_sync::<()>(); + factory + // method for ledmessage + .method("LedWriteMultizone", (), { + move |m| { + if let Ok(mut lock) = effect.try_lock() { + let mut iter = m.msg.iter_init(); + let byte_array: Vec> = + vec![iter.read()?, iter.read()?, iter.read()?, iter.read()?]; + *lock = Some(byte_array); + let mret = m.msg.method_return().append1(&format!("Got effect part")); + Ok(vec![mret]) + } else { + Err(MethodErr::failed("Could not lock daemon for access")) + } + } + }) + .outarg::<&str, _>("reply") + .inarg::, _>("bytearray") + .inarg::, _>("bytearray") + .inarg::, _>("bytearray") + .inarg::, _>("bytearray") +} + fn dbus_create_ledeffect_method(effect: EffectType) -> Method { let factory = Factory::new_sync::<()>(); factory @@ -261,6 +295,7 @@ fn dbus_create_tree() -> (Tree, LedMsgType, EffectType, Arc LaptopBase { let device_desc = device.device_descriptor().unwrap(); if device_desc.vendor_id() == 0x0b05 { match device_desc.product_id() { - 0x1869 | 0x1866 => { - info!("Found GX502 or similar"); - return LaptopBase { - usb_vendor: 0x0B05, - usb_product: 0x1866, - report_filter_bytes: vec![0x5a, 0x02], - min_led_bright: 0x00, - max_led_bright: 0x03, - //from `lsusb -vd 0b05:1866` - led_endpoint: 0x04, - //from `lsusb -vd 0b05:1866` - key_endpoint: 0x83, - supported_modes: vec![ - BuiltInModeByte::Single, - BuiltInModeByte::Breathing, - BuiltInModeByte::Cycle, - BuiltInModeByte::Rainbow, - BuiltInModeByte::Rain, - BuiltInModeByte::Random, - BuiltInModeByte::Highlight, - BuiltInModeByte::Laser, - BuiltInModeByte::Ripple, - BuiltInModeByte::Pulse, - BuiltInModeByte::ThinZoomy, - BuiltInModeByte::WideZoomy, - ], - //backlight: Backlight::new("intel_backlight").unwrap(), - }; - } + 0x1869 | 0x1866 => return choose_1866_device(), 0x1854 => { info!("Found GL753 or similar"); return LaptopBase { @@ -65,6 +37,54 @@ pub(crate) fn match_laptop() -> LaptopBase { panic!("could not match laptop"); } +fn choose_1866_device() -> LaptopBase { + let dmi = sysfs_class::DmiId::default(); + let board_name = dmi.board_name().expect("Could not get board_name"); + let mut laptop = LaptopBase { + usb_vendor: 0x0B05, + usb_product: 0x1866, + report_filter_bytes: vec![0x5a, 0x02], + min_led_bright: 0x00, + max_led_bright: 0x03, + //from `lsusb -vd 0b05:1866` + led_endpoint: 0x04, + //from `lsusb -vd 0b05:1866` + key_endpoint: 0x83, + supported_modes: vec![], + //backlight: Backlight::new("intel_backlight").unwrap(), + }; + match &board_name.as_str()[..5] { + "GX502" | "GA502" => { + info!("Found GX502 or GA502 series"); + laptop.supported_modes = vec![ + BuiltInModeByte::Single, + BuiltInModeByte::Breathing, + BuiltInModeByte::Cycle, + BuiltInModeByte::Rainbow, + BuiltInModeByte::Rain, + BuiltInModeByte::Random, + BuiltInModeByte::Highlight, + BuiltInModeByte::Laser, + BuiltInModeByte::Ripple, + BuiltInModeByte::Pulse, + BuiltInModeByte::ThinZoomy, + BuiltInModeByte::WideZoomy, + ]; + } + "GM501" => { + info!("Found GM501 series"); + laptop.supported_modes = vec![ + BuiltInModeByte::Single, + BuiltInModeByte::Breathing, + BuiltInModeByte::Cycle, + BuiltInModeByte::Rainbow, + ]; + } + _ => panic!("Unsupported laptop: {}, please request support at https://github.com/flukejones/rog-core", board_name), + } + laptop +} + pub(super) struct LaptopBase { usb_vendor: u16, usb_product: u16, diff --git a/rog-core/src/led_control.rs b/rog-core/src/led_control.rs index 813aacfe..b2ff1537 100644 --- a/rog-core/src/led_control.rs +++ b/rog-core/src/led_control.rs @@ -24,6 +24,7 @@ pub enum AuraCommand { WriteBytes(Vec), WriteEffect(Vec>), ReloadLast, + WriteMultizone(Vec>), } /// UNSAFE: Must live as long as RogCore @@ -136,6 +137,7 @@ where } } AuraCommand::WriteBytes(bytes) => self.set_and_save(&bytes, config).await?, + AuraCommand::WriteMultizone(effect) => self.write_multizone(effect).await?, AuraCommand::WriteEffect(effect) => self.write_effect(effect).await?, AuraCommand::ReloadLast => self.reload_last_builtin(&config).await?, } @@ -188,6 +190,16 @@ where Ok(()) } + #[inline] + async fn write_multizone(&mut self, effect: Vec>) -> Result<(), AuraError> { + for row in effect.iter() { + self.write_bytes(row).await?; + } + self.write_bytes(&LED_SET).await?; + self.write_bytes(&LED_APPLY).await?; + Ok(()) + } + /// Used to set a builtin mode and save the settings for it #[inline] async fn set_and_save(&self, bytes: &[u8], config: &mut Config) -> Result<(), AuraError> { diff --git a/rog-core/src/main.rs b/rog-core/src/main.rs index c61a762f..42308656 100644 --- a/rog-core/src/main.rs +++ b/rog-core/src/main.rs @@ -55,7 +55,7 @@ pub async fn main() -> Result<(), Box> { println!("Version: {}", VERSION); } - let writer = AuraDbusWriter::new()?; + let mut writer = AuraDbusWriter::new()?; if let Some(Command::LedMode(mode)) = parsed.command { if let Some(command) = mode.command { @@ -63,12 +63,7 @@ pub async fn main() -> Result<(), Box> { match command { SetAuraBuiltin::MultiStatic(_) => { let byte_arr = <[[u8; LED_MSG_LEN]; 4]>::from(command); - for arr in byte_arr.iter() { - match writer.write_bytes(arr) { - Ok(msg) => println!("Response: {}", msg), - Err(err) => println!("Error: {}", err), - } - } + writer.write_multizone(&byte_arr)?; } _ => match writer.write_builtin_mode(&command) { Ok(msg) => println!("Response: {}", msg), diff --git a/wireshark_data/asus-fan-p1.patch b/wireshark_data/asus-fan-p1.patch new file mode 100644 index 00000000..cfde356e --- /dev/null +++ b/wireshark_data/asus-fan-p1.patch @@ -0,0 +1,220 @@ +--- + .../ABI/testing/sysfs-platform-asus-wmi | 10 ++ + drivers/platform/x86/asus-wmi.c | 113 ++++++++++++++++++ + include/linux/platform_data/x86/asus-wmi.h | 1 + + 3 files changed, 124 insertions(+) + +diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi +index 9e99f2909612..1efac0ddb417 100644 +--- a/Documentation/ABI/testing/sysfs-platform-asus-wmi ++++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi +@@ -46,3 +46,13 @@ Description: + * 0 - normal, + * 1 - overboost, + * 2 - silent ++ ++What: /sys/devices/platform//throttle_thermal_policy ++Date: Dec 2019 ++KernelVersion: 5.6 ++Contact: "Leonid Maksymchuk" ++Description: ++ Throttle thermal policy mode: ++ * 0 - default, ++ * 1 - overboost, ++ * 2 - silent +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c +index 821b08e01635..f10ec9d745e5 100644 +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -61,6 +61,7 @@ MODULE_LICENSE("GPL"); + #define NOTIFY_KBD_BRTDWN 0xc5 + #define NOTIFY_KBD_BRTTOGGLE 0xc7 + #define NOTIFY_KBD_FBM 0x99 ++#define NOTIFY_KBD_TTP 0xae + + #define ASUS_WMI_FNLOCK_BIOS_DISABLED BIT(0) + +@@ -81,6 +82,10 @@ MODULE_LICENSE("GPL"); + #define ASUS_FAN_BOOST_MODE_SILENT_MASK 0x02 + #define ASUS_FAN_BOOST_MODES_MASK 0x03 + ++#define ASUS_THROTTLE_THERMAL_POLICY_DEFAULT 0 ++#define ASUS_THROTTLE_THERMAL_POLICY_OVERBOOST 1 ++#define ASUS_THROTTLE_THERMAL_POLICY_SILENT 2 ++ + #define USB_INTEL_XUSB2PR 0xD0 + #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 + +@@ -198,6 +203,9 @@ struct asus_wmi { + u8 fan_boost_mode_mask; + u8 fan_boost_mode; + ++ bool throttle_thermal_policy_available; ++ u8 throttle_thermal_policy_mode; ++ + // The RSOC controls the maximum charging percentage. + bool battery_rsoc_available; + +@@ -1724,6 +1732,98 @@ static ssize_t fan_boost_mode_store(struct device *dev, + // Fan boost mode: 0 - normal, 1 - overboost, 2 - silent + static DEVICE_ATTR_RW(fan_boost_mode); + ++/* Throttle thermal policy ****************************************************/ ++ ++static int throttle_thermal_policy_check_present(struct asus_wmi *asus) ++{ ++ u32 result; ++ int err; ++ ++ asus->throttle_thermal_policy_available = false; ++ ++ err = asus_wmi_get_devstate(asus, ++ ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY, ++ &result); ++ if (err) { ++ if (err == -ENODEV) ++ return 0; ++ return err; ++ } ++ ++ if (result & ASUS_WMI_DSTS_PRESENCE_BIT) ++ asus->throttle_thermal_policy_available = true; ++ ++ return 0; ++} ++ ++static int throttle_thermal_policy_write(struct asus_wmi *asus) ++{ ++ int err; ++ u8 value; ++ u32 retval; ++ ++ value = asus->throttle_thermal_policy_mode; ++ ++ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY, ++ value, &retval); ++ if (err) { ++ pr_warn("Failed to set throttle thermal policy: %d\n", err); ++ return err; ++ } ++ ++ if (retval != 1) { ++ pr_warn("Failed to set throttle thermal policy (retval): 0x%x\n", ++ retval); ++ return -EIO; ++ } ++ ++ return 0; ++} ++ ++static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) ++{ ++ u8 new_mode = asus->throttle_thermal_policy_mode + 1; ++ ++ if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT) ++ new_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; ++ ++ asus->throttle_thermal_policy_mode = new_mode; ++ return throttle_thermal_policy_write(asus); ++} ++ ++static ssize_t throttle_thermal_policy_show(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ struct asus_wmi *asus = dev_get_drvdata(dev); ++ u8 mode = asus->throttle_thermal_policy_mode; ++ ++ return scnprintf(buf, PAGE_SIZE, "%d\n", mode); ++} ++ ++static ssize_t throttle_thermal_policy_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ int result; ++ u8 new_mode; ++ struct asus_wmi *asus = dev_get_drvdata(dev); ++ ++ result = kstrtou8(buf, 10, &new_mode); ++ if (result < 0) ++ return result; ++ ++ if (new_mode > ASUS_THROTTLE_THERMAL_POLICY_SILENT) ++ return -EINVAL; ++ ++ asus->throttle_thermal_policy_mode = new_mode; ++ throttle_thermal_policy_write(asus); ++ ++ return count; ++} ++ ++// Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent ++static DEVICE_ATTR_RW(throttle_thermal_policy); ++ + /* Backlight ******************************************************************/ + + static int read_backlight_power(struct asus_wmi *asus) +@@ -2005,6 +2105,11 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus) + return; + } + ++ if (asus->throttle_thermal_policy_available && code == NOTIFY_KBD_TTP) { ++ throttle_thermal_policy_switch_next(asus); ++ return; ++ } ++ + if (is_display_toggle(code) && asus->driver->quirks->no_display_toggle) + return; + +@@ -2155,6 +2260,7 @@ static struct attribute *platform_attributes[] = { + &dev_attr_lid_resume.attr, + &dev_attr_als_enable.attr, + &dev_attr_fan_boost_mode.attr, ++ &dev_attr_throttle_thermal_policy.attr, + NULL + }; + +@@ -2178,6 +2284,8 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, + devid = ASUS_WMI_DEVID_ALS_ENABLE; + else if (attr == &dev_attr_fan_boost_mode.attr) + ok = asus->fan_boost_mode_available; ++ else if (attr == &dev_attr_throttle_thermal_policy.attr) ++ ok = asus->throttle_thermal_policy_available; + + if (devid != -1) + ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0); +@@ -2437,6 +2545,10 @@ static int asus_wmi_add(struct platform_device *pdev) + if (err) + goto fail_fan_boost_mode; + ++ err = throttle_thermal_policy_check_present(asus); ++ if (err) ++ goto fail_throttle_thermal_policy; ++ + err = asus_wmi_sysfs_init(asus->platform_device); + if (err) + goto fail_sysfs; +@@ -2521,6 +2633,7 @@ static int asus_wmi_add(struct platform_device *pdev) + fail_input: + asus_wmi_sysfs_exit(asus->platform_device); + fail_sysfs: ++fail_throttle_thermal_policy: + fail_fan_boost_mode: + fail_platform: + kfree(asus); +diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h +index 60249e22e844..d39fc658c320 100644 +--- a/include/linux/platform_data/x86/asus-wmi.h ++++ b/include/linux/platform_data/x86/asus-wmi.h +@@ -58,6 +58,7 @@ + #define ASUS_WMI_DEVID_LIGHT_SENSOR 0x00050022 /* ?? */ + #define ASUS_WMI_DEVID_LIGHTBAR 0x00050025 + #define ASUS_WMI_DEVID_FAN_BOOST_MODE 0x00110018 ++#define ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY 0x00120075 + + /* Misc */ + #define ASUS_WMI_DEVID_CAMERA 0x00060013 +-- +2.24.0 + + \ No newline at end of file diff --git a/wireshark_data/asus-fan-p2.patch b/wireshark_data/asus-fan-p2.patch new file mode 100644 index 00000000..8e56240d --- /dev/null +++ b/wireshark_data/asus-fan-p2.patch @@ -0,0 +1,37 @@ +--- + drivers/platform/x86/asus-wmi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c +index f10ec9d745e5..469f1a852719 100644 +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -1780,6 +1780,15 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus) + return 0; + } + ++static int throttle_thermal_policy_set_default(struct asus_wmi *asus) ++{ ++ if (!asus->throttle_thermal_policy_available) ++ return 0; ++ ++ asus->throttle_thermal_policy_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT; ++ return throttle_thermal_policy_write(asus); ++} ++ + static int throttle_thermal_policy_switch_next(struct asus_wmi *asus) + { + u8 new_mode = asus->throttle_thermal_policy_mode + 1; +@@ -2548,6 +2557,8 @@ static int asus_wmi_add(struct platform_device *pdev) + err = throttle_thermal_policy_check_present(asus); + if (err) + goto fail_throttle_thermal_policy; ++ else ++ throttle_thermal_policy_set_default(asus); + + err = asus_wmi_sysfs_init(asus->platform_device); + if (err) +-- +2.24.0 + + \ No newline at end of file diff --git a/wireshark_data/gm501/lsusbinfo.sysclassname.txt b/wireshark_data/gm501/lsusbinfo.sysclassname.txt new file mode 100644 index 00000000..101864ba --- /dev/null +++ b/wireshark_data/gm501/lsusbinfo.sysclassname.txt @@ -0,0 +1,12 @@ +(base) will@zephyrusm:~$ lsusb | grep 0b05 +Bus 001 Device 003: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device +(base) will@zephyrusm:~$ + +(base) will@zephyrusm:~$ cat /sys/class/dmi/id/product_name +Zephyrus M GM501GM +(base) will@zephyrusm:~$ cat /sys/class/dmi/id/product_family +Zephyrus M +(base) will@zephyrusm:~$ cat /sys/class/dmi/id/board_name +GM501GM +(base) will@zephyrusm:~$ + diff --git a/wireshark_data/gm501/usb-hid-dump.txt b/wireshark_data/gm501/usb-hid-dump.txt new file mode 100644 index 00000000..e3c766a3 --- /dev/null +++ b/wireshark_data/gm501/usb-hid-dump.txt @@ -0,0 +1,27 @@ +001:003:002:DESCRIPTOR 1588963579.696552 + 06 31 FF 09 76 A1 01 85 5A 19 00 2A FF 00 15 00 + 26 FF 00 75 08 95 05 81 00 19 00 2A FF 00 15 00 + 26 FF 00 75 08 95 3F B1 00 C0 05 0C 09 01 A1 01 + 85 02 19 00 2A 3C 02 15 00 26 3C 02 75 10 95 02 + 81 00 C0 06 31 FF 09 79 A1 01 85 5D 19 00 2A FF + 00 15 00 26 FF 00 75 08 95 1F 81 00 19 00 2A FF + 00 15 00 26 FF 00 75 08 95 3F 91 00 19 00 2A FF + 00 15 00 26 FF 00 75 08 95 3F B1 00 C0 06 31 FF + 09 80 A1 01 85 5E 19 00 2A FF 00 15 00 26 FF 00 + 75 08 95 05 81 00 19 00 2A FF 00 15 00 26 FF 00 + 75 08 95 3F B1 00 C0 + +001:003:001:DESCRIPTOR 1588963579.697560 + 05 01 09 06 A1 01 85 09 75 01 95 08 05 07 19 E0 + 29 E7 15 00 25 01 81 02 95 08 75 01 81 03 95 05 + 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 03 + 95 F0 75 01 05 07 19 00 29 EF 15 00 25 01 81 02 + C0 + +001:003:000:DESCRIPTOR 1588963579.698493 + 05 01 09 06 A1 01 85 01 75 01 95 08 05 07 19 E0 + 29 E7 15 00 25 01 81 02 95 01 75 08 81 03 95 05 + 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 03 + 95 1E 75 08 15 00 26 FF 00 05 07 19 00 2A FF 00 + 81 00 C0 + diff --git a/wireshark_data/gm501/zephyrusgm501_info.txt b/wireshark_data/gm501/zephyrusgm501_info.txt new file mode 100644 index 00000000..b0d48ac6 --- /dev/null +++ b/wireshark_data/gm501/zephyrusgm501_info.txt @@ -0,0 +1,130 @@ + +Bus 001 Device 003: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device +Device Descriptor: + bLength 18 + bDescriptorType 1 + bcdUSB 2.00 + bDeviceClass 0 + bDeviceSubClass 0 + bDeviceProtocol 0 + bMaxPacketSize0 64 + idVendor 0x0b05 ASUSTek Computer, Inc. + idProduct 0x1866 + bcdDevice 0.02 + iManufacturer 1 ASUSTeK Computer Inc. + iProduct 2 N-KEY Device + iSerial 0 + bNumConfigurations 1 + Configuration Descriptor: + bLength 9 + bDescriptorType 2 + wTotalLength 0x005b + bNumInterfaces 3 + bConfigurationValue 1 + iConfiguration 0 + bmAttributes 0xe0 + Self Powered + Remote Wakeup + MaxPower 100mA + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 0 + bAlternateSetting 0 + bNumEndpoints 1 + bInterfaceClass 3 Human Interface Device + bInterfaceSubClass 1 Boot Interface Subclass + bInterfaceProtocol 1 Keyboard + iInterface 3 (error) + HID Device Descriptor: + bLength 9 + bDescriptorType 33 + bcdHID 1.10 + bCountryCode 0 Not supported + bNumDescriptors 1 + bDescriptorType 34 Report + wDescriptorLength 67 + Report Descriptors: + ** UNAVAILABLE ** + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x81 EP 1 IN + bmAttributes 3 + Transfer Type Interrupt + Synch Type None + Usage Type Data + wMaxPacketSize 0x0040 1x 64 bytes + bInterval 1 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 0 + bNumEndpoints 1 + bInterfaceClass 3 Human Interface Device + bInterfaceSubClass 1 Boot Interface Subclass + bInterfaceProtocol 1 Keyboard + iInterface 1 ASUSTeK Computer Inc. + HID Device Descriptor: + bLength 9 + bDescriptorType 33 + bcdHID 1.10 + bCountryCode 0 Not supported + bNumDescriptors 1 + bDescriptorType 34 Report + wDescriptorLength 65 + Report Descriptors: + ** UNAVAILABLE ** + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x82 EP 2 IN + bmAttributes 3 + Transfer Type Interrupt + Synch Type None + Usage Type Data + wMaxPacketSize 0x0040 1x 64 bytes + bInterval 1 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 2 + bAlternateSetting 0 + bNumEndpoints 2 + bInterfaceClass 3 Human Interface Device + bInterfaceSubClass 1 Boot Interface Subclass + bInterfaceProtocol 1 Keyboard + iInterface 1 ASUSTeK Computer Inc. + HID Device Descriptor: + bLength 9 + bDescriptorType 33 + bcdHID 1.10 + bCountryCode 0 Not supported + bNumDescriptors 1 + bDescriptorType 34 Report + wDescriptorLength 167 + Report Descriptors: + ** UNAVAILABLE ** + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x83 EP 3 IN + bmAttributes 3 + Transfer Type Interrupt + Synch Type None + Usage Type Data + wMaxPacketSize 0x0040 1x 64 bytes + bInterval 1 + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x04 EP 4 OUT + bmAttributes 3 + Transfer Type Interrupt + Synch Type None + Usage Type Data + wMaxPacketSize 0x0040 1x 64 bytes + bInterval 1 +Device Status: 0x0001 + Self Powered diff --git a/wireshark_data/gx502-other-kb-functions/airplane-mode-on-off-2.4.3.pcapng b/wireshark_data/gx501/gx502-other-kb-functions/airplane-mode-on-off-2.4.3.pcapng similarity index 100% rename from wireshark_data/gx502-other-kb-functions/airplane-mode-on-off-2.4.3.pcapng rename to wireshark_data/gx501/gx502-other-kb-functions/airplane-mode-on-off-2.4.3.pcapng diff --git a/wireshark_data/gx502-other-kb-functions/fan-button-2.4.3.pcapng b/wireshark_data/gx501/gx502-other-kb-functions/fan-button-2.4.3.pcapng similarity index 100% rename from wireshark_data/gx502-other-kb-functions/fan-button-2.4.3.pcapng rename to wireshark_data/gx501/gx502-other-kb-functions/fan-button-2.4.3.pcapng diff --git a/wireshark_data/gx502-other-kb-functions/screen-bright-2.4.3from.pcapng b/wireshark_data/gx501/gx502-other-kb-functions/screen-bright-2.4.3from.pcapng similarity index 100% rename from wireshark_data/gx502-other-kb-functions/screen-bright-2.4.3from.pcapng rename to wireshark_data/gx501/gx502-other-kb-functions/screen-bright-2.4.3from.pcapng diff --git a/wireshark_data/gx502-other-kb-functions/screen-off-on-button-2.4.3.pcapng b/wireshark_data/gx501/gx502-other-kb-functions/screen-off-on-button-2.4.3.pcapng similarity index 100% rename from wireshark_data/gx502-other-kb-functions/screen-off-on-button-2.4.3.pcapng rename to wireshark_data/gx501/gx502-other-kb-functions/screen-off-on-button-2.4.3.pcapng diff --git a/wireshark_data/gx502-other-kb-functions/screen-out-select-2.4.3-2.4.2.pcapng b/wireshark_data/gx501/gx502-other-kb-functions/screen-out-select-2.4.3-2.4.2.pcapng similarity index 100% rename from wireshark_data/gx502-other-kb-functions/screen-out-select-2.4.3-2.4.2.pcapng rename to wireshark_data/gx501/gx502-other-kb-functions/screen-out-select-2.4.3-2.4.2.pcapng diff --git a/wireshark_data/gx502-other-kb-functions/trackpad-off-on.pcapng b/wireshark_data/gx501/gx502-other-kb-functions/trackpad-off-on.pcapng similarity index 100% rename from wireshark_data/gx502-other-kb-functions/trackpad-off-on.pcapng rename to wireshark_data/gx501/gx502-other-kb-functions/trackpad-off-on.pcapng diff --git a/wireshark_data/gx502-rgb-selecting/gx502-rgb-black-red-orange-yellow-green-lblue-blue-mag-black.pcapng b/wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-black-red-orange-yellow-green-lblue-blue-mag-black.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-selecting/gx502-rgb-black-red-orange-yellow-green-lblue-blue-mag-black.pcapng rename to wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-black-red-orange-yellow-green-lblue-blue-mag-black.pcapng diff --git a/wireshark_data/gx502-rgb-selecting/gx502-rgb-dark-select-static-red.pcapng b/wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-dark-select-static-red.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-selecting/gx502-rgb-dark-select-static-red.pcapng rename to wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-dark-select-static-red.pcapng diff --git a/wireshark_data/gx502-rgb-selecting/gx502-rgb-open-crate.pcapng b/wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-open-crate.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-selecting/gx502-rgb-open-crate.pcapng rename to wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-open-crate.pcapng diff --git a/wireshark_data/gx502-rgb-selecting/gx502-rgb-select-breathing.pcapng b/wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-select-breathing.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-selecting/gx502-rgb-select-breathing.pcapng rename to wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-select-breathing.pcapng diff --git a/wireshark_data/gx502-rgb-selecting/gx502-rgb-select-rainbow.pcapng b/wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-select-rainbow.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-selecting/gx502-rgb-select-rainbow.pcapng rename to wireshark_data/gx501/gx502-rgb-selecting/gx502-rgb-select-rainbow.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-breathe-to-pulse.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-breathe-to-pulse.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-breathe-to-pulse.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-breathe-to-pulse.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-breathe.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-breathe.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-breathe.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-breathe.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-bright-1.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-bright-1.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-bright-1.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-bright-1.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-bright-2.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-bright-2.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-bright-2.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-bright-2.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-bright-3.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-bright-3.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-bright-3.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-bright-3.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-colour-cycle-to-rainbow.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-colour-cycle-to-rainbow.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-colour-cycle-to-rainbow.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-colour-cycle-to-rainbow.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-pulse-to-colour-cycle.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-pulse-to-colour-cycle.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-pulse-to-colour-cycle.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-pulse-to-colour-cycle.pcapng diff --git a/wireshark_data/gx502-rgb-wireshark/gx502-rgb-rainbow-to-static.pcapng b/wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-rainbow-to-static.pcapng similarity index 100% rename from wireshark_data/gx502-rgb-wireshark/gx502-rgb-rainbow-to-static.pcapng rename to wireshark_data/gx501/gx502-rgb-wireshark/gx502-rgb-rainbow-to-static.pcapng diff --git a/wireshark_data/per_key_raw_bytes b/wireshark_data/gx501/per_key_raw_bytes similarity index 100% rename from wireshark_data/per_key_raw_bytes rename to wireshark_data/gx501/per_key_raw_bytes diff --git a/wireshark_data/per_key_raw_bytes.ods b/wireshark_data/gx501/per_key_raw_bytes.ods similarity index 100% rename from wireshark_data/per_key_raw_bytes.ods rename to wireshark_data/gx501/per_key_raw_bytes.ods diff --git a/wireshark_data/rog-star-colour.pcapng b/wireshark_data/gx501/rog-star-colour.pcapng similarity index 100% rename from wireshark_data/rog-star-colour.pcapng rename to wireshark_data/gx501/rog-star-colour.pcapng diff --git a/wireshark_data/rog-star-random.pcapng b/wireshark_data/gx501/rog-star-random.pcapng similarity index 100% rename from wireshark_data/rog-star-random.pcapng rename to wireshark_data/gx501/rog-star-random.pcapng diff --git a/wireshark_data/rog_music_not_playing.pcapng b/wireshark_data/gx501/rog_music_not_playing.pcapng similarity index 100% rename from wireshark_data/rog_music_not_playing.pcapng rename to wireshark_data/gx501/rog_music_not_playing.pcapng diff --git a/wireshark_data/rog_starry_night.pcapng b/wireshark_data/gx501/rog_starry_night.pcapng similarity index 100% rename from wireshark_data/rog_starry_night.pcapng rename to wireshark_data/gx501/rog_starry_night.pcapng diff --git a/wireshark_data/rog_starry_night_brighter.pcapng b/wireshark_data/gx501/rog_starry_night_brighter.pcapng similarity index 100% rename from wireshark_data/rog_starry_night_brighter.pcapng rename to wireshark_data/gx501/rog_starry_night_brighter.pcapng diff --git a/wireshark_data/hut1_12v2.pdf b/wireshark_data/hut1_12v2.pdf new file mode 100644 index 00000000..d3fffdf6 Binary files /dev/null and b/wireshark_data/hut1_12v2.pdf differ