Final round of fixes for new version

This commit is contained in:
Luke
2020-06-09 20:46:14 +12:00
parent cb8032c7c2
commit 964c24f8fa
68 changed files with 220 additions and 176 deletions

View File

@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.11.0] - 2020-09-05
### BREAKING CHANGE
- Many of the RGB built-in modes have been renamed to match Armory-Crate names,
this means that the `/etc/rogcore.conf` needs to be removed so it can be
regenerated using the updated names.
### Changed
- Add better examples for AniMe display, and fix many small issues
- Don't halt app iff AniMe display not found when running on GA14/GA15 laptops
- Rename client crate to better suit
- Added a device reset for both keyboard and AniMe devices before configuring them
## [0.10.0] - 2020-23-05
### Changed
- Correctly set AMD boost

192
Cargo.lock generated
View File

@@ -37,9 +37,9 @@ dependencies = [
[[package]]
name = "bindgen"
version = "0.53.2"
version = "0.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bb26d6a69a335b8cb0e7c7e9775cd5666611dc50a37177c3f2cedcfc040e8c8"
checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5"
dependencies = [
"bitflags",
"cexpr",
@@ -61,18 +61,18 @@ dependencies = [
[[package]]
name = "bit-set"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80"
checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de"
dependencies = [
"bit-vec",
]
[[package]]
name = "bit-vec"
version = "0.5.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb"
checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3"
[[package]]
name = "bitflags"
@@ -88,9 +88,9 @@ checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1"
[[package]]
name = "cc"
version = "1.0.52"
version = "1.0.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d"
checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311"
[[package]]
name = "cexpr"
@@ -120,9 +120,9 @@ dependencies = [
[[package]]
name = "clap"
version = "2.33.0"
version = "2.33.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
dependencies = [
"ansi_term",
"atty",
@@ -144,9 +144,9 @@ dependencies = [
[[package]]
name = "dbus"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38f8875bb7afbc20dec12db09e18af3dcbd672b08592d2932950326a6437c616"
checksum = "26b17a12ffaff26515889b006fc029493a3e340366a137c13cec2cdd545ea3b8"
dependencies = [
"futures",
"libc",
@@ -213,9 +213,9 @@ dependencies = [
[[package]]
name = "filetime"
version = "0.2.9"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f59efc38004c988e4201d11d263b8171f49a2e7ec0bdbb71773433f271504a5e"
checksum = "affc17579b132fc2461adf7c575cc6e8b134ebca52c51f5411388965227dc695"
dependencies = [
"cfg-if",
"libc",
@@ -225,9 +225,9 @@ dependencies = [
[[package]]
name = "fnv"
version = "1.0.6"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "fuchsia-zircon"
@@ -247,9 +247,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "futures"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780"
checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
"futures-channel",
"futures-core",
@@ -262,9 +262,9 @@ dependencies = [
[[package]]
name = "futures-channel"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8"
checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
"futures-core",
"futures-sink",
@@ -272,15 +272,15 @@ dependencies = [
[[package]]
name = "futures-core"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a"
checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
[[package]]
name = "futures-executor"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba"
checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
"futures-core",
"futures-task",
@@ -289,15 +289,15 @@ dependencies = [
[[package]]
name = "futures-io"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6"
checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-macro"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7"
checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
"proc-macro-hack",
"proc-macro2",
@@ -307,21 +307,24 @@ dependencies = [
[[package]]
name = "futures-sink"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6"
checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
[[package]]
name = "futures-task"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27"
checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
dependencies = [
"once_cell",
]
[[package]]
name = "futures-util"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5"
checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
"futures-channel",
"futures-core",
@@ -330,6 +333,7 @@ dependencies = [
"futures-sink",
"futures-task",
"memchr",
"pin-project",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
@@ -364,9 +368,9 @@ dependencies = [
[[package]]
name = "hermit-abi"
version = "0.1.12"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4"
checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"
dependencies = [
"libc",
]
@@ -423,9 +427,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
[[package]]
name = "libc"
version = "0.2.69"
version = "0.2.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005"
checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49"
[[package]]
name = "libdbus-sys"
@@ -460,9 +464,9 @@ dependencies = [
[[package]]
name = "libusb1-sys"
version = "0.3.6"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0318f131edc8211a9a3e40133be6fc93f0b686e14f59c6115eab4e7bd794b34"
checksum = "71d9ddd446b6f233a79ef7e6f73de63a58f3a9047d60c46f15cda31452a8f86e"
dependencies = [
"cc",
"libc",
@@ -555,6 +559,12 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e521b6adefa0b2c1fa5d2abdf9a5216288686fe6146249215d884c0e5ab320b0"
[[package]]
name = "once_cell"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
[[package]]
name = "peeking_take_while"
version = "0.1.2"
@@ -562,10 +572,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "pin-project-lite"
version = "0.1.4"
name = "pin-project"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae"
checksum = "e75373ff9037d112bb19bc61333a06a159eaeb217660dcfbea7d88e1db823919"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10b4b44893d3c370407a1d6a5cfde7c41ae0478e31c516c85f67eb3adc51be6d"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "pin-project-lite"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
[[package]]
name = "pin-utils"
@@ -607,21 +637,21 @@ dependencies = [
[[package]]
name = "proc-macro-hack"
version = "0.5.15"
version = "0.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63"
checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4"
[[package]]
name = "proc-macro-nested"
version = "0.1.4"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694"
checksum = "0afe1bd463b9e9ed51d0e0f0b50b6b146aec855c56fd182bb242388710a9b6de"
[[package]]
name = "proc-macro2"
version = "1.0.12"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319"
checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"
dependencies = [
"unicode-xid",
]
@@ -634,9 +664,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quote"
version = "1.0.4"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7"
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [
"proc-macro2",
]
@@ -649,9 +679,9 @@ checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
[[package]]
name = "regex"
version = "1.3.7"
version = "1.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692"
checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
dependencies = [
"aho-corasick",
"memchr",
@@ -661,9 +691,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.17"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
[[package]]
name = "rle-decode-fast"
@@ -672,8 +702,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac"
[[package]]
name = "rog-aura"
version = "0.10.0"
name = "rog-client"
version = "0.11.0"
dependencies = [
"dbus",
"gumdrop",
@@ -686,7 +716,7 @@ dependencies = [
[[package]]
name = "rog-daemon"
version = "0.10.0"
version = "0.11.0"
dependencies = [
"dbus",
"dbus-tokio",
@@ -694,7 +724,7 @@ dependencies = [
"gumdrop",
"intel-pstate",
"log",
"rog-aura",
"rog-client",
"rusb",
"serde",
"serde_derive",
@@ -735,15 +765,15 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.106"
version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
checksum = "c9124df5b40cbd380080b2cc6ab894c040a3070d995f5c9dc77e18c34a8ae37d"
[[package]]
name = "serde_derive"
version = "1.0.106"
version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
checksum = "3f2c3ac8e6ca1e9c80b8be1023940162bf81ae3cffbb1809474152f2ce1eb250"
dependencies = [
"proc-macro2",
"quote",
@@ -781,9 +811,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "syn"
version = "1.0.18"
version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213"
checksum = "93a56fabc59dce20fe48b6c832cc249c713e7ed88fa28b0ee0a3bfcaae5fe4e2"
dependencies = [
"proc-macro2",
"quote",
@@ -803,9 +833,9 @@ dependencies = [
[[package]]
name = "synstructure"
version = "0.12.3"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545"
checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
dependencies = [
"proc-macro2",
"quote",
@@ -830,9 +860,9 @@ checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
[[package]]
name = "tar"
version = "0.4.26"
version = "0.4.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3"
checksum = "5c058ad0bd6ccb84faa24cc44d4fc99bee8a5d7ba9ff33aa4d993122d1aeeac2"
dependencies = [
"filetime",
"libc",
@@ -860,18 +890,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.16"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d12a1dae4add0f0d568eebc7bf142f145ba1aa2544cafb195c76f0f409091b60"
checksum = "b13f926965ad00595dd129fa12823b04bbf866e9085ab0a5f2b05b850fbfc344"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.16"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f34e0c1caaa462fd840ec6b768946ea1e7842620d94fe29d5b847138f521269"
checksum = "893582086c2f98cde18f906265a65b5030a074b1046c674ae898be6519a7f479"
dependencies = [
"proc-macro2",
"quote",
@@ -898,9 +928,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "0.2.20"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05c1d570eb1a36f0345a5ce9c6c6e665b70b73d11236912c0b477616aeec47b1"
checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58"
dependencies = [
"bytes",
"fnv",
@@ -967,21 +997,21 @@ checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
[[package]]
name = "vcpkg"
version = "0.2.8"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168"
checksum = "55d1e41d56121e07f1e223db0a4def204e45c85425f6a16d462fd07c8d10d74c"
[[package]]
name = "vec_map"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "version_check"
version = "0.9.1"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce"
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
[[package]]
name = "which"

View File

@@ -1,5 +1,5 @@
[workspace]
members = ["rog-core", "aura"]
members = ["rog-core", "rog-client"]
[profile.release]
lto = true
@@ -9,11 +9,9 @@ panic = "abort"
[profile.dev]
debug = false
opt-level = 2
#panic = "abort"
opt-level = 1
[profile.bench]
lto = true
debug = false
opt-level = 3
#panic = "abort"
opt-level = 3

View File

@@ -33,17 +33,16 @@ I'm now looking at the kernel source to see if I can add the inputs correctly so
+ [X] Aura control by Aura keys
+ [X] Volume + media controls work
- [X] Logging - required for journalctl
- [X] AniMatrix display on G14 models (Functional. Needs testing)
- [X] AniMatrix display on G14 models that include it
## Other Laptops
**Supported:**
## SUPPORTED LAPTOPS
- GX502 (product 0x1866) (Tested on GX502GW)
- GA14 *is* supported, including the AniMe display. You will need kernel [patches](https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/-/tree/master/kernel_patches).
**Partial/Inprogress:**
- GA15 appears to have most things working
- GM501 (multizone needs testing)
- G14 (no Lid LED support, all other functions appear to work)
Both of these laptops appear to have the same USB device ID as the GX502, but with different features enabled.

View File

@@ -0,0 +1,6 @@
$ cat /sys/class/dmi/id/product_name
ROG Zephyrus G14 GA401IV_GA401IV
$ cat /sys/class/dmi/id/product_family
ROG Zephyrus G14
$ cat /sys/class/dmi/id/board_name
GA401IV

View File

@@ -1,6 +1,6 @@
[package]
name = "rog-aura"
version = "0.10.0"
name = "rog-client"
version = "0.11.0"
license = "MPL-2.0"
readme = "README.md"
authors = ["Luke <luke@ljones.dev>"]

View File

@@ -1,4 +1,4 @@
use rog_aura::{AniMeDbusWriter, AniMeMatrix, AniMePacketType, HEIGHT, WIDTH};
use rog_client::{AniMeDbusWriter, AniMeMatrix, AniMePacketType, HEIGHT, WIDTH};
use tinybmp::{Bmp, Pixel};
fn main() {

View File

@@ -1,4 +1,4 @@
use rog_aura::{AuraDbusWriter, GX502Layout, Key, KeyColourArray, KeyLayout};
use rog_client::{AuraDbusWriter, GX502Layout, Key, KeyColourArray, KeyLayout};
use std::collections::LinkedList;
#[derive(Debug, Clone)]

View File

@@ -1,4 +1,4 @@
use rog_aura::{AuraDbusWriter, GX502Layout, KeyColourArray, KeyLayout};
use rog_client::{AuraDbusWriter, GX502Layout, KeyColourArray, KeyLayout};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut writer = AuraDbusWriter::new()?;

View File

@@ -1,4 +1,4 @@
use rog_aura::{AuraDbusWriter, GX502Layout, Key, KeyColourArray, KeyLayout};
use rog_client::{AuraDbusWriter, GX502Layout, Key, KeyColourArray, KeyLayout};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut writer = AuraDbusWriter::new()?;

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,4 +1,4 @@
use rog_aura::{AuraDbusWriter, Key, KeyColourArray};
use rog_client::{AuraDbusWriter, Key, KeyColourArray};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut writer = AuraDbusWriter::new()?;

View File

@@ -1,4 +1,4 @@
use rog_aura::{AuraDbusWriter, GX502Layout, KeyColourArray, KeyLayout};
use rog_client::{AuraDbusWriter, GX502Layout, KeyColourArray, KeyLayout};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut writer = AuraDbusWriter::new()?;

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -8,16 +8,16 @@ use serde_derive::{Deserialize, Serialize};
pub struct BuiltInModeBytes {
pub stable: [u8; LED_MSG_LEN],
pub breathe: [u8; LED_MSG_LEN],
pub cycle: [u8; LED_MSG_LEN],
pub strobe: [u8; LED_MSG_LEN],
pub rainbow: [u8; LED_MSG_LEN],
pub star: [u8; LED_MSG_LEN],
pub rain: [u8; LED_MSG_LEN],
pub random: [u8; LED_MSG_LEN],
pub highlight: [u8; LED_MSG_LEN],
pub laser: [u8; LED_MSG_LEN],
pub ripple: [u8; LED_MSG_LEN],
pub pulse: [u8; LED_MSG_LEN],
pub thinzoomy: [u8; LED_MSG_LEN],
pub widezoomy: [u8; LED_MSG_LEN],
pub comet: [u8; LED_MSG_LEN],
pub flash: [u8; LED_MSG_LEN],
pub multi_static: [[u8; LED_MSG_LEN]; 4],
}
impl BuiltInModeBytes {
@@ -28,16 +28,16 @@ impl BuiltInModeBytes {
match b {
BuiltInModeByte::Single => self.stable.copy_from_slice(bytes),
BuiltInModeByte::Breathing => self.breathe.copy_from_slice(bytes),
BuiltInModeByte::Cycle => self.cycle.copy_from_slice(bytes),
BuiltInModeByte::Strobe => self.strobe.copy_from_slice(bytes),
BuiltInModeByte::Rainbow => self.rainbow.copy_from_slice(bytes),
BuiltInModeByte::Star => self.star.copy_from_slice(bytes),
BuiltInModeByte::Rain => self.rain.copy_from_slice(bytes),
BuiltInModeByte::Random => self.random.copy_from_slice(bytes),
BuiltInModeByte::Highlight => self.highlight.copy_from_slice(bytes),
BuiltInModeByte::Laser => self.laser.copy_from_slice(bytes),
BuiltInModeByte::Ripple => self.ripple.copy_from_slice(bytes),
BuiltInModeByte::Pulse => self.pulse.copy_from_slice(bytes),
BuiltInModeByte::ThinZoomy => self.thinzoomy.copy_from_slice(bytes),
BuiltInModeByte::WideZoomy => self.widezoomy.copy_from_slice(bytes),
BuiltInModeByte::Comet => self.comet.copy_from_slice(bytes),
BuiltInModeByte::Flash => self.flash.copy_from_slice(bytes),
_ => {}
}
}
@@ -48,16 +48,16 @@ impl BuiltInModeBytes {
let bytes = match BuiltInModeByte::from(byte) {
BuiltInModeByte::Single => &self.stable,
BuiltInModeByte::Breathing => &self.breathe,
BuiltInModeByte::Cycle => &self.cycle,
BuiltInModeByte::Strobe => &self.strobe,
BuiltInModeByte::Rainbow => &self.rainbow,
BuiltInModeByte::Star => &self.star,
BuiltInModeByte::Rain => &self.rain,
BuiltInModeByte::Random => &self.random,
BuiltInModeByte::Highlight => &self.highlight,
BuiltInModeByte::Laser => &self.laser,
BuiltInModeByte::Ripple => &self.ripple,
BuiltInModeByte::Pulse => &self.pulse,
BuiltInModeByte::ThinZoomy => &self.thinzoomy,
BuiltInModeByte::WideZoomy => &self.widezoomy,
BuiltInModeByte::Comet => &self.comet,
BuiltInModeByte::Flash => &self.flash,
_ => return None,
};
Some(bytes)
@@ -68,24 +68,20 @@ impl Default for BuiltInModeBytes {
BuiltInModeBytes {
stable: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Stable(SingleColour::default())),
breathe: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Breathe(TwoColourSpeed::default())),
cycle: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Cycle(SingleSpeed::default())),
strobe: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Strobe(SingleSpeed::default())),
rainbow: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Rainbow(
SingleSpeedDirection::default(),
)),
rain: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Rain(TwoColourSpeed::default())),
random: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Disco(SingleSpeed::default())),
star: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Star(TwoColourSpeed::default())),
rain: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Rain(SingleSpeed::default())),
highlight: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Highlight(
SingleColourSpeed::default(),
)),
laser: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Laser(SingleColourSpeed::default())),
ripple: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Ripple(SingleColourSpeed::default())),
pulse: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Pulse(SingleColour::default())),
thinzoomy: <[u8; LED_MSG_LEN]>::from(
SetAuraBuiltin::ThinZoomy(SingleColour::default()),
),
widezoomy: <[u8; LED_MSG_LEN]>::from(
SetAuraBuiltin::WideZoomy(SingleColour::default()),
),
comet: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Comet(SingleColour::default())),
flash: <[u8; LED_MSG_LEN]>::from(SetAuraBuiltin::Flash(SingleColour::default())),
multi_static: <[[u8; LED_MSG_LEN]; 4]>::from(SetAuraBuiltin::MultiStatic(
MultiColour::default(),
)),
@@ -97,16 +93,16 @@ impl Default for BuiltInModeBytes {
pub enum BuiltInModeByte {
Single = 0x00,
Breathing = 0x01,
Cycle = 0x02,
Strobe = 0x02,
Rainbow = 0x03,
Rain = 0x04,
Random = 0x05,
Star = 0x04,
Rain = 0x05,
Highlight = 0x06,
Laser = 0x07,
Ripple = 0x08,
Pulse = 0x0a,
ThinZoomy = 0x0b,
WideZoomy = 0x0c,
Comet = 0x0b,
Flash = 0x0c,
MultiStatic,
None,
}
@@ -123,16 +119,16 @@ impl From<u8> for BuiltInModeByte {
match byte {
0x00 => Self::Single,
0x01 => Self::Breathing,
0x02 => Self::Cycle,
0x02 => Self::Strobe,
0x03 => Self::Rainbow,
0x04 => Self::Rain,
0x05 => Self::Random,
0x04 => Self::Star,
0x05 => Self::Rain,
0x06 => Self::Highlight,
0x07 => Self::Laser,
0x08 => Self::Ripple,
0x0a => Self::Pulse,
0x0b => Self::ThinZoomy,
0x0c => Self::WideZoomy,
0x0b => Self::Comet,
0x0c => Self::Flash,
_ => Self::None,
}
}
@@ -151,16 +147,16 @@ impl From<BuiltInModeByte> for u8 {
match byte {
BuiltInModeByte::Single => 0x00,
BuiltInModeByte::Breathing => 0x01,
BuiltInModeByte::Cycle => 0x02,
BuiltInModeByte::Strobe => 0x02,
BuiltInModeByte::Rainbow => 0x03,
BuiltInModeByte::Rain => 0x04,
BuiltInModeByte::Random => 0x05,
BuiltInModeByte::Star => 0x04,
BuiltInModeByte::Rain => 0x05,
BuiltInModeByte::Highlight => 0x06,
BuiltInModeByte::Laser => 0x07,
BuiltInModeByte::Ripple => 0x08,
BuiltInModeByte::Pulse => 0x0a,
BuiltInModeByte::ThinZoomy => 0x0b,
BuiltInModeByte::WideZoomy => 0x0c,
BuiltInModeByte::Comet => 0x0b,
BuiltInModeByte::Flash => 0x0c,
BuiltInModeByte::MultiStatic => 0x00,
BuiltInModeByte::None => 0xff,
}

View File

@@ -181,14 +181,14 @@ pub enum SetAuraBuiltin {
Stable(SingleColour),
#[options(help = "pulse between one or two colours")]
Breathe(TwoColourSpeed),
#[options(help = "cycle through all colours")]
Cycle(SingleSpeed),
#[options(help = "strobe through all colours")]
Strobe(SingleSpeed),
#[options(help = "rainbow cycling in one of four directions")]
Rainbow(SingleSpeedDirection),
#[options(help = "random pattern mimicking raindrops")]
Rain(TwoColourSpeed),
#[options(help = "random pattern of three preset colours")]
Disco(SingleSpeed),
#[options(help = "rain pattern mimicking raindrops")]
Star(TwoColourSpeed),
#[options(help = "rain pattern of three preset colours")]
Rain(SingleSpeed),
#[options(help = "pressed keys are highlighted to fade")]
Highlight(SingleColourSpeed),
#[options(help = "pressed keys generate horizontal laser")]
@@ -198,9 +198,9 @@ pub enum SetAuraBuiltin {
#[options(help = "set a rapid pulse")]
Pulse(SingleColour),
#[options(help = "set a vertical line zooming from left")]
ThinZoomy(SingleColour),
Comet(SingleColour),
#[options(help = "set a wide vertical line zooming from left")]
WideZoomy(SingleColour),
Flash(SingleColour),
#[options(help = "4-zone multi-colour")]
MultiStatic(MultiColour),
}

View File

@@ -74,10 +74,10 @@ pub fn aura_brightness_bytes(brightness: u8) -> [u8; 17] {
/// Byte 3 sets the mode type:
/// - 00 = static
/// - 01 = breathe (can set two colours)
/// - 02 = cycle (through all colours)
/// - 02 = strobe (through all colours)
/// - 03 = rainbow
/// - 04 = rain (byte 9 sets random colour)
/// - 05 = random keys, red, white, turquoise
/// - 04 = star (byte 9 sets rain colour)
/// - 05 = rain keys, red, white, turquoise
/// - 06 = pressed keys light up and fade
/// - 07 = pressed key emits laser
/// - 08 = pressed key emits water ripple
@@ -141,16 +141,16 @@ impl From<&SetAuraBuiltin> for [u8; LED_MSG_LEN] {
match mode {
SetAuraBuiltin::Stable(_) => msg[3] = 0x00,
SetAuraBuiltin::Breathe(_) => msg[3] = 0x01,
SetAuraBuiltin::Cycle(_) => msg[3] = 0x02,
SetAuraBuiltin::Strobe(_) => msg[3] = 0x02,
SetAuraBuiltin::Rainbow(_) => msg[3] = 0x03,
SetAuraBuiltin::Rain(_) => msg[3] = 0x04,
SetAuraBuiltin::Disco(_) => msg[3] = 0x05,
SetAuraBuiltin::Star(_) => msg[3] = 0x04,
SetAuraBuiltin::Rain(_) => msg[3] = 0x05,
SetAuraBuiltin::Highlight(_) => msg[3] = 0x06,
SetAuraBuiltin::Laser(_) => msg[3] = 0x07,
SetAuraBuiltin::Ripple(_) => msg[3] = 0x08,
SetAuraBuiltin::Pulse(_) => msg[3] = 0x0a,
SetAuraBuiltin::ThinZoomy(_) => msg[3] = 0x0b,
SetAuraBuiltin::WideZoomy(_) => msg[3] = 0x0c,
SetAuraBuiltin::Comet(_) => msg[3] = 0x0b,
SetAuraBuiltin::Flash(_) => msg[3] = 0x0c,
_ => panic!("Mode not convertable to array"),
}
@@ -159,7 +159,7 @@ impl From<&SetAuraBuiltin> for [u8; LED_MSG_LEN] {
msg[7] = settings.speed as u8;
msg[8] = settings.direction as u8;
}
SetAuraBuiltin::Rain(settings) => {
SetAuraBuiltin::Star(settings) => {
msg[4] = settings.colour.0;
msg[5] = settings.colour.1;
msg[6] = settings.colour.2;
@@ -175,7 +175,7 @@ impl From<&SetAuraBuiltin> for [u8; LED_MSG_LEN] {
msg[11] = settings.colour2.1;
msg[12] = settings.colour2.2;
}
SetAuraBuiltin::Cycle(settings) | SetAuraBuiltin::Disco(settings) => {
SetAuraBuiltin::Strobe(settings) | SetAuraBuiltin::Rain(settings) => {
msg[7] = settings.speed as u8;
}
SetAuraBuiltin::Highlight(settings)
@@ -188,8 +188,8 @@ impl From<&SetAuraBuiltin> for [u8; LED_MSG_LEN] {
}
SetAuraBuiltin::Stable(settings)
| SetAuraBuiltin::Pulse(settings)
| SetAuraBuiltin::ThinZoomy(settings)
| SetAuraBuiltin::WideZoomy(settings) => {
| SetAuraBuiltin::Comet(settings)
| SetAuraBuiltin::Flash(settings) => {
msg[4] = settings.colour.0;
msg[5] = settings.colour.1;
msg[6] = settings.colour.2;

View File

@@ -1,6 +1,6 @@
[package]
name = "rog-daemon"
version = "0.10.0"
version = "0.11.0"
license = "MPL-2.0"
readme = "README.md"
authors = ["Luke <luke@ljones.dev>"]
@@ -18,7 +18,7 @@ name = "rog-core"
path = "src/main.rs"
[dependencies]
rog-aura = { path = "../aura" }
rog-client = { path = "../rog-client" }
rusb = "^0.5.5"
# cli and logging

View File

@@ -9,12 +9,13 @@ const INIT: u8 = 0xc2;
const APPLY: u8 = 0xc3;
const SET: u8 = 0xc4;
use log::error;
use rog_aura::error::AuraError;
use log::{error, warn};
use rog_client::error::AuraError;
use rusb::DeviceHandle;
use std::error::Error;
use std::time::Duration;
#[allow(dead_code)]
#[derive(Debug)]
pub enum AnimatrixCommand {
Apply,
@@ -33,9 +34,10 @@ impl AniMeWriter {
pub fn new() -> Result<AniMeWriter, Box<dyn Error>> {
// We don't expect this ID to ever change
let mut dev_handle = AniMeWriter::get_device(0x0b05, 0x193b).map_err(|err| {
error!("Could not get AniMe display handle: {:?}", err);
warn!("Could not get AniMe display handle: {:?}", err);
err
})?;
dev_handle.reset()?;
// This config seems to be the required device config for writing
dev_handle.set_active_configuration(1).unwrap_or(());

View File

@@ -1,4 +1,4 @@
use rog_aura::BuiltInModeBytes;
use rog_client::BuiltInModeBytes;
use serde_derive::{Deserialize, Serialize};
use std::fs::{File, OpenOptions};
use std::io::{Read, Write};

View File

@@ -11,7 +11,7 @@ use dbus::{channel::Sender, nonblock::Process};
use dbus_tokio::connection;
use log::{error, info, warn};
use rog_aura::{DBUS_IFACE, DBUS_PATH};
use rog_client::{DBUS_IFACE, DBUS_PATH};
use std::error::Error;
use std::sync::{mpsc, Arc};
use std::time::{Duration, Instant};

View File

@@ -1,5 +1,5 @@
use crate::{config::Config, led_control::AuraCommand, rogcore::RogCore};
use rog_aura::{error::AuraError, BuiltInModeByte};
use rog_client::{error::AuraError, BuiltInModeByte};
//use keycode::{KeyMap, KeyMappingId, KeyState, KeyboardState};
use crate::virt_device::ConsumerKeys;
use log::{info, warn};
@@ -25,7 +25,7 @@ pub(crate) fn match_laptop() -> LaptopBase {
supported_modes: vec![
BuiltInModeByte::Single,
BuiltInModeByte::Breathing,
BuiltInModeByte::Cycle,
BuiltInModeByte::Strobe,
],
support_animatrix: false,
// backlight: Backlight::new("intel_backlight").unwrap(),
@@ -61,16 +61,16 @@ fn choose_1866_device(prod: u16) -> LaptopBase {
laptop.supported_modes = vec![
BuiltInModeByte::Single,
BuiltInModeByte::Breathing,
BuiltInModeByte::Cycle,
BuiltInModeByte::Strobe,
BuiltInModeByte::Rainbow,
BuiltInModeByte::Star,
BuiltInModeByte::Rain,
BuiltInModeByte::Random,
BuiltInModeByte::Highlight,
BuiltInModeByte::Laser,
BuiltInModeByte::Ripple,
BuiltInModeByte::Pulse,
BuiltInModeByte::ThinZoomy,
BuiltInModeByte::WideZoomy,
BuiltInModeByte::Comet,
BuiltInModeByte::Flash,
];
}
"GM501" => {
@@ -78,7 +78,7 @@ fn choose_1866_device(prod: u16) -> LaptopBase {
laptop.supported_modes = vec![
BuiltInModeByte::Single,
BuiltInModeByte::Breathing,
BuiltInModeByte::Cycle,
BuiltInModeByte::Strobe,
BuiltInModeByte::Rainbow,
];
}

View File

@@ -10,7 +10,7 @@ static LED_SET: [u8; 17] = [0x5d, 0xb5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
use crate::config::Config;
use log::{error, info, warn};
use rog_aura::{aura_brightness_bytes, error::AuraError, BuiltInModeByte};
use rog_client::{aura_brightness_bytes, error::AuraError, BuiltInModeByte};
use rusb::DeviceHandle;
use std::marker::PhantomData;
use std::ptr::NonNull;

View File

@@ -3,12 +3,12 @@ use daemon::rogcore::FanLevel;
use env_logger::{Builder, Target};
use gumdrop::Options;
use log::LevelFilter;
use rog_aura::{
use rog_client::{
cli_options::{LedBrightness, SetAuraBuiltin},
AuraDbusWriter, LED_MSG_LEN,
};
static VERSION: &str = "0.10.0";
static VERSION: &str = "0.11.0";
#[derive(Debug, Options)]
struct CLIStart {

View File

@@ -1,7 +1,7 @@
use crate::daemon::{FanModeType, LedMsgType, NestedVecType};
use crate::rogcore::FanLevel;
use dbus::tree::{Factory, MTSync, Method, MethodErr, Signal, Tree};
use rog_aura::{DBUS_IFACE, DBUS_PATH};
use rog_client::{DBUS_IFACE, DBUS_PATH};
use std::sync::Arc;
use tokio::sync::Mutex;

View File

@@ -35,13 +35,14 @@ pub struct RogCore {
impl RogCore {
pub fn new(vendor: u16, product: u16, led_endpoint: u8) -> Result<RogCore, Box<dyn Error>> {
let mut dev_handle = RogCore::get_device(vendor, product).map_err(|err| {
error!("Could not get device handle: {:?}", err);
error!("Could not get keyboard device handle: {:?}", err);
err
})?;
dev_handle.reset()?;
dev_handle.set_active_configuration(0).unwrap_or(());
let dev_config = dev_handle.device().config_descriptor(0).map_err(|err| {
error!("Could not get device config: {:?}", err);
error!("Could not get keyboard device config: {:?}", err);
err
})?;
// Interface with outputs
@@ -69,7 +70,7 @@ impl RogCore {
err
})?;
dev_handle.claim_interface(interface).map_err(|err| {
error!("Could not claim device interface: {:?}", err);
error!("Could not claim keyboard device interface: {:?}", err);
err
})?;