summaryrefslogtreecommitdiffstats
path: root/rust/qmk-hid-com/src/cli.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-30 18:22:41 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-30 18:22:41 +0100
commitba9f12810f7dc4969ac175f6e959d5fe6407747d (patch)
treef4039e46985d56bac471bd8568f96b159a92b2ae /rust/qmk-hid-com/src/cli.rs
parentfeat(src): Make usable (diff)
downloadqmk_layout-ba9f12810f7dc4969ac175f6e959d5fe6407747d.zip
feat(treewide): Migrate the Unicode handling to a custom c program, that works via rawhid
Diffstat (limited to '')
-rw-r--r--rust/qmk-hid-com/src/cli.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/rust/qmk-hid-com/src/cli.rs b/rust/qmk-hid-com/src/cli.rs
new file mode 100644
index 0000000..afef1a9
--- /dev/null
+++ b/rust/qmk-hid-com/src/cli.rs
@@ -0,0 +1,40 @@
+use clap::{command, Parser, Subcommand};
+
+#[derive(Parser, Debug)]
+pub struct CliArgs {
+ #[clap(subcommand)]
+ pub command: Command,
+}
+#[derive(Clone, Debug, Subcommand)]
+pub enum Command {
+ /// List all devices, where the manufacturer string contains the search key
+ Search {
+ /// The part that must be contained in the manufacturer name
+ vendor_name: String,
+ },
+
+ /// Talk to the device specified by the [`vendor_id`] and [`product_id`].
+ Send {
+ usage_page: u16,
+ usage_id: u16,
+ message: u8,
+ },
+
+ /// Talk to the device specified by the [`vendor_id`] and [`product_id`].
+ Monitor { usage_page: u16, usage_id: u16 },
+
+ Inform {
+ #[command(subcommand)]
+ command: Inform,
+ },
+
+ ArrInform { values: Vec<u8> },
+}
+
+#[derive(Subcommand, Clone, Debug)]
+pub enum Inform {
+ Hex { val: String },
+ Dec { val: i64 },
+ Bin { val: String },
+ Char { val: char },
+}