@openmouse/protocol 0.42.3 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drivers/registry.d.ts +13 -1
- package/dist/drivers/registry.d.ts.map +1 -1
- package/dist/drivers/registry.js +24 -0
- package/dist/drivers/registry.js.map +1 -1
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.d.ts +65 -0
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.js +205 -0
- package/dist/drivers/steelseries/aerox-3-wireless-gen2-hid.js.map +1 -0
- package/dist/drivers/steelseries/prime-mini-hid.d.ts +59 -0
- package/dist/drivers/steelseries/prime-mini-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/prime-mini-hid.js +183 -0
- package/dist/drivers/steelseries/prime-mini-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-100-hid.d.ts +57 -0
- package/dist/drivers/steelseries/rival-100-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-100-hid.js +181 -0
- package/dist/drivers/steelseries/rival-100-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-110-hid.d.ts +78 -0
- package/dist/drivers/steelseries/rival-110-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-110-hid.js +206 -0
- package/dist/drivers/steelseries/rival-110-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.d.ts +59 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.js +183 -0
- package/dist/drivers/steelseries/rival-3-v2-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.d.ts +64 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.js +199 -0
- package/dist/drivers/steelseries/rival-3-wireless-v2-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-300-hid.d.ts +78 -0
- package/dist/drivers/steelseries/rival-300-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-300-hid.js +206 -0
- package/dist/drivers/steelseries/rival-300-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-5-hid.d.ts +55 -0
- package/dist/drivers/steelseries/rival-5-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-5-hid.js +177 -0
- package/dist/drivers/steelseries/rival-5-hid.js.map +1 -0
- package/dist/drivers/steelseries/rival-600-hid.d.ts +65 -0
- package/dist/drivers/steelseries/rival-600-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/rival-600-hid.js +184 -0
- package/dist/drivers/steelseries/rival-600-hid.js.map +1 -0
- package/dist/drivers/steelseries/sensei-310-hid.d.ts +54 -0
- package/dist/drivers/steelseries/sensei-310-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/sensei-310-hid.js +177 -0
- package/dist/drivers/steelseries/sensei-310-hid.js.map +1 -0
- package/dist/drivers/steelseries/sensei-raw-hid.d.ts +75 -0
- package/dist/drivers/steelseries/sensei-raw-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/sensei-raw-hid.js +199 -0
- package/dist/drivers/steelseries/sensei-raw-hid.js.map +1 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.d.ts +42 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.d.ts.map +1 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.js +132 -0
- package/dist/drivers/steelseries/sensei-rival-pro-hid.js.map +1 -0
- package/dist/steelseries/aerox-3-wireless-gen2.d.ts +204 -0
- package/dist/steelseries/aerox-3-wireless-gen2.d.ts.map +1 -0
- package/dist/steelseries/aerox-3-wireless-gen2.js +301 -0
- package/dist/steelseries/aerox-3-wireless-gen2.js.map +1 -0
- package/dist/steelseries/aerox3.d.ts +3 -3
- package/dist/steelseries/aerox3.js +3 -3
- package/dist/steelseries/devices.d.ts +31 -14
- package/dist/steelseries/devices.d.ts.map +1 -1
- package/dist/steelseries/devices.js +417 -13
- package/dist/steelseries/devices.js.map +1 -1
- package/dist/steelseries/index.d.ts +12 -0
- package/dist/steelseries/index.d.ts.map +1 -1
- package/dist/steelseries/index.js +12 -0
- package/dist/steelseries/index.js.map +1 -1
- package/dist/steelseries/prime-mini-wireless.d.ts +9 -14
- package/dist/steelseries/prime-mini-wireless.d.ts.map +1 -1
- package/dist/steelseries/prime-mini-wireless.js +9 -14
- package/dist/steelseries/prime-mini-wireless.js.map +1 -1
- package/dist/steelseries/prime-mini.d.ts +173 -0
- package/dist/steelseries/prime-mini.d.ts.map +1 -0
- package/dist/steelseries/prime-mini.js +273 -0
- package/dist/steelseries/prime-mini.js.map +1 -0
- package/dist/steelseries/prime-plus.d.ts +5 -4
- package/dist/steelseries/prime-plus.d.ts.map +1 -1
- package/dist/steelseries/prime-plus.js +5 -4
- package/dist/steelseries/prime-plus.js.map +1 -1
- package/dist/steelseries/rival-100.d.ts +134 -0
- package/dist/steelseries/rival-100.d.ts.map +1 -0
- package/dist/steelseries/rival-100.js +195 -0
- package/dist/steelseries/rival-100.js.map +1 -0
- package/dist/steelseries/rival-110.d.ts +134 -0
- package/dist/steelseries/rival-110.d.ts.map +1 -0
- package/dist/steelseries/rival-110.js +205 -0
- package/dist/steelseries/rival-110.js.map +1 -0
- package/dist/steelseries/rival-3-v2.d.ts +168 -0
- package/dist/steelseries/rival-3-v2.d.ts.map +1 -0
- package/dist/steelseries/rival-3-v2.js +242 -0
- package/dist/steelseries/rival-3-v2.js.map +1 -0
- package/dist/steelseries/rival-3-wireless-v2.d.ts +219 -0
- package/dist/steelseries/rival-3-wireless-v2.d.ts.map +1 -0
- package/dist/steelseries/rival-3-wireless-v2.js +270 -0
- package/dist/steelseries/rival-3-wireless-v2.js.map +1 -0
- package/dist/steelseries/rival-300.d.ts +163 -0
- package/dist/steelseries/rival-300.d.ts.map +1 -0
- package/dist/steelseries/rival-300.js +266 -0
- package/dist/steelseries/rival-300.js.map +1 -0
- package/dist/steelseries/rival-5.d.ts +165 -0
- package/dist/steelseries/rival-5.d.ts.map +1 -0
- package/dist/steelseries/rival-5.js +212 -0
- package/dist/steelseries/rival-5.js.map +1 -0
- package/dist/steelseries/rival-600.d.ts +194 -0
- package/dist/steelseries/rival-600.d.ts.map +1 -0
- package/dist/steelseries/rival-600.js +262 -0
- package/dist/steelseries/rival-600.js.map +1 -0
- package/dist/steelseries/sensei-310.d.ts +162 -0
- package/dist/steelseries/sensei-310.d.ts.map +1 -0
- package/dist/steelseries/sensei-310.js +250 -0
- package/dist/steelseries/sensei-310.js.map +1 -0
- package/dist/steelseries/sensei-raw.d.ts +169 -0
- package/dist/steelseries/sensei-raw.d.ts.map +1 -0
- package/dist/steelseries/sensei-raw.js +233 -0
- package/dist/steelseries/sensei-raw.js.map +1 -0
- package/dist/steelseries/sensei-rival-pro.d.ts +214 -0
- package/dist/steelseries/sensei-rival-pro.d.ts.map +1 -0
- package/dist/steelseries/sensei-rival-pro.js +298 -0
- package/dist/steelseries/sensei-rival-pro.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rival-5.js","sourceRoot":"","sources":["../../src/steelseries/rival-5.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,CAAC,IAAI,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,CAAC;IACnB,cAAc,EAAE,CAAC,IAAI,CAAC;CACd,CAAC;AAEX,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAI,CAA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AO,CAAC,CAAC,CAAC;gBACR,MAAM,IAAI,mBAAmB,CAAC,gDAAgD,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,cAAc,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SteelSeries Rival 600 configuration protocol — pure encode/decode helpers.
|
|
3
|
+
*
|
|
4
|
+
* Reconstructed from the vendor's own software, not from a third-party
|
|
5
|
+
* reimplementation: SteelSeries GG 121.0.0 ships `rival-600.lisp` (and
|
|
6
|
+
* `dota2-rival-600.lisp`, which includes it) under
|
|
7
|
+
* `apps/engine/install/deviceSpecifications/`, and this module transcribes
|
|
8
|
+
* it. Those files are OpenPGP-armored ("DESCRIPTOR" armor, SKESK/AES-128);
|
|
9
|
+
* the bytes below are the documented HID report payloads, not guesses.
|
|
10
|
+
* rivalcfg's `rival600.py` independently corroborates every command byte
|
|
11
|
+
* and the DPI range here (see below), so this family is dual-sourced.
|
|
12
|
+
*
|
|
13
|
+
* Despite the shared A3360/TrueMove3 sensor and the "600/650" naming, the
|
|
14
|
+
* Rival 600 does NOT share a command set with the Rival 650 Wireless
|
|
15
|
+
* (`./rival650.ts`, family `"rival650"`): sensitivity `0x03` (two per-level
|
|
16
|
+
* commands) vs. `0x15`, polling `0x04` vs. `0x17`, buttons `0x31` (feature
|
|
17
|
+
* report) vs. `0x19` (output), and a firmware query `0x10` the 650 lacks.
|
|
18
|
+
* The two vendor specification files confirm the split, so this is a
|
|
19
|
+
* separate family/module, not a reuse.
|
|
20
|
+
*
|
|
21
|
+
* Every command is an HID **output report** with report id 0x00 (33-byte
|
|
22
|
+
* reports — `HIDIO 33` throughout the specification — smaller than every
|
|
23
|
+
* other family's 65-byte reports), except the button-mapping command,
|
|
24
|
+
* which is an HID **feature** report (`0x31`, `HIDFEATURE`).
|
|
25
|
+
*
|
|
26
|
+
* DPI uses two per-level commands (`03 00 01`/`03 00 02`): a linear
|
|
27
|
+
* one-byte encoding, `byte = (dpi - 100) / 100`, range 0x00–0x77
|
|
28
|
+
* (100–12000 in 100 DPI steps), followed by the suffix `00 42` (the A3360
|
|
29
|
+
* sensor PID). The vendor file states the byte and suffix but no range;
|
|
30
|
+
* rivalcfg's `input_range [100, 12000, 100]` / `output_range [0x00, 0x77,
|
|
31
|
+
* 1]` supplies the mapping, and it is the same linear encoding Rival 310
|
|
32
|
+
* uses. Off-grid values are rejected rather than rounded.
|
|
33
|
+
*
|
|
34
|
+
* Polling (`04 00`, values 1000→0x01, 500→0x02, 250→0x03, 125→0x04) is
|
|
35
|
+
* write-only. Buttons are one 35-byte packet (7 slots × 5-byte fields) as
|
|
36
|
+
* a feature report, command `0x31`: `button7` has id `0x00`, colliding
|
|
37
|
+
* with the disable byte, so it is a valid remap *source* but not a valid
|
|
38
|
+
* *target* — see `steelseriesRival600EncodeButtonsMapping`.
|
|
39
|
+
*
|
|
40
|
+
* The proximity (lift-off) sensor command `0x96` carries `enable`, a low
|
|
41
|
+
* threshold, and a high threshold byte; the vendor file states no range
|
|
42
|
+
* for the two thresholds, so this codec passes them through.
|
|
43
|
+
*
|
|
44
|
+
* Known but deliberately not implemented — documented so nobody re-derives
|
|
45
|
+
* them, withheld until there is hardware evidence and a reason to ship
|
|
46
|
+
* them:
|
|
47
|
+
*
|
|
48
|
+
* - The 8-zone lighting path: the specification uses `direct_write` `0x27`
|
|
49
|
+
* (mask + 8 RGB triples) and `single_zone_direct_write` `0x07`, while
|
|
50
|
+
* rivalcfg's `rival600.py` instead uses a `05 00` feature-report
|
|
51
|
+
* rgbgradient path. The two sources disagree on the LED command, so
|
|
52
|
+
* lighting is left out until the difference is resolved on hardware.
|
|
53
|
+
* - `reset_all_illumination` `0x08`, `current_sensor` read `0x60`,
|
|
54
|
+
* `resolution_level` read `0x81`(read-op), macros, and factory restore.
|
|
55
|
+
* - Deceleration/acceleration (`MOUSEACCELDECEL`) and angle snapping
|
|
56
|
+
* (`MOUSESMOOTHING`): these are kernel-driver `SSE` settings, not HID
|
|
57
|
+
* commands, and are out of scope for this codec.
|
|
58
|
+
*
|
|
59
|
+
* `read resolution_level` (read-op) returns the active preset level; this
|
|
60
|
+
* module exposes it as `steelseriesRival600LevelQuery`, though the driver
|
|
61
|
+
* does not rely on it. Settings apply immediately; the save command
|
|
62
|
+
* (`09 00`) persists them to onboard flash. None of this has been verified
|
|
63
|
+
* on physical hardware by this project.
|
|
64
|
+
*/
|
|
65
|
+
export declare const RIVAL600_REPORT_ID = 0;
|
|
66
|
+
/** Command prefixes; the payload is the prefix plus its arguments. */
|
|
67
|
+
export declare const RIVAL600_COMMAND: {
|
|
68
|
+
readonly sensitivity1: readonly [3, 0, 1];
|
|
69
|
+
readonly sensitivity2: readonly [3, 0, 2];
|
|
70
|
+
readonly pollingRate: readonly [4, 0];
|
|
71
|
+
/** Read-op for the active preset level (`81 00`). */
|
|
72
|
+
readonly activeLevel: readonly [129, 0];
|
|
73
|
+
/** Feature report; 7×5-byte button table follows the selector. */
|
|
74
|
+
readonly buttonsMapping: readonly [49, 0];
|
|
75
|
+
readonly proximity: readonly [150, 0];
|
|
76
|
+
readonly save: readonly [9, 0];
|
|
77
|
+
readonly firmware: readonly [16, 0];
|
|
78
|
+
};
|
|
79
|
+
/** `09 00` — commit the current settings to onboard flash. */
|
|
80
|
+
export declare const RIVAL600_SAVE_COMMAND: readonly [9, 0];
|
|
81
|
+
/** The two sensitivity presets the specification defines (levels 1 and 2). */
|
|
82
|
+
export declare const RIVAL600_DPI_PRESET_COUNT = 2;
|
|
83
|
+
export declare const RIVAL600_FIRMWARE_RESPONSE_LENGTH = 2;
|
|
84
|
+
export declare const RIVAL600_POLLING_RATES: readonly [125, 250, 500, 1000];
|
|
85
|
+
export declare const RIVAL600_DPI_MIN = 100;
|
|
86
|
+
export declare const RIVAL600_DPI_MAX = 12000;
|
|
87
|
+
export declare const RIVAL600_DPI_STEP = 100;
|
|
88
|
+
/** rivalcfg `rival600.py` defaults for the two presets. */
|
|
89
|
+
export declare const RIVAL600_DEFAULT_DPI_PRESET_1 = 800;
|
|
90
|
+
export declare const RIVAL600_DEFAULT_DPI_PRESET_2 = 1600;
|
|
91
|
+
export declare const RIVAL600_DEFAULT_POLLING_RATE = 1000;
|
|
92
|
+
export declare class Rival600ProtocolError extends Error {
|
|
93
|
+
}
|
|
94
|
+
/** The 120 DPI values the linear encoding can express, ascending. */
|
|
95
|
+
export declare function steelseriesRival600DpiOptions(): number[];
|
|
96
|
+
/** `03 00 01 <byte> 00 42` — sensitivity preset 1. */
|
|
97
|
+
export declare function steelseriesRival600EncodeSensitivity1(dpi: number): Uint8Array;
|
|
98
|
+
/** `03 00 02 <byte> 00 42` — sensitivity preset 2. */
|
|
99
|
+
export declare function steelseriesRival600EncodeSensitivity2(dpi: number): Uint8Array;
|
|
100
|
+
/** `04 00 <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
|
|
101
|
+
export declare function steelseriesRival600EncodePollingRate(pollingRateHz: number): Uint8Array;
|
|
102
|
+
/** `09 00` — commit the current settings to onboard flash. */
|
|
103
|
+
export declare function steelseriesRival600SaveCommand(): Uint8Array;
|
|
104
|
+
/** `81 00` — read the active preset level. */
|
|
105
|
+
export declare function steelseriesRival600LevelQuery(): Uint8Array;
|
|
106
|
+
/** `10 00` — the device answers with minor then major firmware bytes. */
|
|
107
|
+
export declare function steelseriesRival600FirmwareQuery(): Uint8Array;
|
|
108
|
+
export interface SteelSeriesRival600Firmware {
|
|
109
|
+
/** The two raw response bytes, in the order the device sent them (minor, major). */
|
|
110
|
+
bytes: [number, number];
|
|
111
|
+
/** The version the two bytes describe, major first, e.g. "2.52". */
|
|
112
|
+
display: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Decode the two-byte firmware response. The specification's incoming
|
|
116
|
+
* struct orders the fields `fw_minor` then `fw_major`, so the display
|
|
117
|
+
* string puts them back in major.minor order.
|
|
118
|
+
*/
|
|
119
|
+
export declare function steelseriesRival600DecodeFirmware(payload: Uint8Array): SteelSeriesRival600Firmware;
|
|
120
|
+
/**
|
|
121
|
+
* `96 00 <enable> <low> <high>` — proximity (lift-off) sensor threshold.
|
|
122
|
+
* `low`/`high` have no stated range in the vendor file; they are passed
|
|
123
|
+
* through as bytes.
|
|
124
|
+
*/
|
|
125
|
+
export declare function steelseriesRival600EncodeProximity(enable: boolean, low: number, high: number): Uint8Array;
|
|
126
|
+
/** 7 button slots, 5-byte fields — the same layout as the Rival 650. */
|
|
127
|
+
export declare const RIVAL600_BUTTONS: {
|
|
128
|
+
readonly button1: {
|
|
129
|
+
readonly id: 1;
|
|
130
|
+
readonly offset: 0;
|
|
131
|
+
};
|
|
132
|
+
readonly button2: {
|
|
133
|
+
readonly id: 2;
|
|
134
|
+
readonly offset: 5;
|
|
135
|
+
};
|
|
136
|
+
readonly button3: {
|
|
137
|
+
readonly id: 3;
|
|
138
|
+
readonly offset: 10;
|
|
139
|
+
};
|
|
140
|
+
readonly button4: {
|
|
141
|
+
readonly id: 4;
|
|
142
|
+
readonly offset: 15;
|
|
143
|
+
};
|
|
144
|
+
readonly button5: {
|
|
145
|
+
readonly id: 5;
|
|
146
|
+
readonly offset: 20;
|
|
147
|
+
};
|
|
148
|
+
readonly button6: {
|
|
149
|
+
readonly id: 6;
|
|
150
|
+
readonly offset: 25;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* `"id": 0x00` in rivalcfg's `rival600.py` (and the vendor table's CPI
|
|
154
|
+
* button) — collides with `button_disable`, so this button cannot be a
|
|
155
|
+
* valid remap *target*. It still has its own `offset` and defaults to the
|
|
156
|
+
* `dpi` special action.
|
|
157
|
+
*/
|
|
158
|
+
readonly button7: {
|
|
159
|
+
readonly id: 0;
|
|
160
|
+
readonly offset: 30;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
export type Rival600ButtonName = keyof typeof RIVAL600_BUTTONS;
|
|
164
|
+
/**
|
|
165
|
+
* One button's target. `button7`'s `id` (`0x00`) collides with `disabled`,
|
|
166
|
+
* so — like `./rival650.ts` — it is a valid remap *source* but excluded
|
|
167
|
+
* from `"button"` as a remap *target*.
|
|
168
|
+
*/
|
|
169
|
+
export type Rival600ButtonAction = {
|
|
170
|
+
type: "button";
|
|
171
|
+
target: Exclude<Rival600ButtonName, "button7">;
|
|
172
|
+
} | {
|
|
173
|
+
type: "disabled";
|
|
174
|
+
} | {
|
|
175
|
+
type: "dpiSwitch";
|
|
176
|
+
} | {
|
|
177
|
+
type: "scrollUp";
|
|
178
|
+
} | {
|
|
179
|
+
type: "scrollDown";
|
|
180
|
+
} | {
|
|
181
|
+
type: "keyboard";
|
|
182
|
+
code: number;
|
|
183
|
+
} | {
|
|
184
|
+
type: "multimedia";
|
|
185
|
+
code: number;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* `31 00` (feature report) + one 35-byte packet (7 slots × 5-byte fields),
|
|
189
|
+
* zero-filled except where a mapping is given. Pass every button explicitly
|
|
190
|
+
* — unmapped buttons stay disabled, matching this package's
|
|
191
|
+
* no-silent-defaults policy.
|
|
192
|
+
*/
|
|
193
|
+
export declare function steelseriesRival600EncodeButtonsMapping(mapping: Partial<Record<Rival600ButtonName, Rival600ButtonAction>>): Uint8Array;
|
|
194
|
+
//# sourceMappingURL=rival-600.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rival-600.d.ts","sourceRoot":"","sources":["../../src/steelseries/rival-600.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,eAAO,MAAM,kBAAkB,IAAO,CAAC;AAEvC,sEAAsE;AACtE,eAAO,MAAM,gBAAgB;;;;IAI3B,qDAAqD;;IAErD,kEAAkE;;;;;CAK1D,CAAC;AAKX,8DAA8D;AAC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AG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAOzG;AAID,wEAAwE;AACxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;IAO3B;;;;;OAKG;;;;;CAE8D,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAU/D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AASzC;;;;;GAKG;AACH,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC,GACjE,UAAU,CAkDZ"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SteelSeries Rival 600 configuration protocol — pure encode/decode helpers.
|
|
3
|
+
*
|
|
4
|
+
* Reconstructed from the vendor's own software, not from a third-party
|
|
5
|
+
* reimplementation: SteelSeries GG 121.0.0 ships `rival-600.lisp` (and
|
|
6
|
+
* `dota2-rival-600.lisp`, which includes it) under
|
|
7
|
+
* `apps/engine/install/deviceSpecifications/`, and this module transcribes
|
|
8
|
+
* it. Those files are OpenPGP-armored ("DESCRIPTOR" armor, SKESK/AES-128);
|
|
9
|
+
* the bytes below are the documented HID report payloads, not guesses.
|
|
10
|
+
* rivalcfg's `rival600.py` independently corroborates every command byte
|
|
11
|
+
* and the DPI range here (see below), so this family is dual-sourced.
|
|
12
|
+
*
|
|
13
|
+
* Despite the shared A3360/TrueMove3 sensor and the "600/650" naming, the
|
|
14
|
+
* Rival 600 does NOT share a command set with the Rival 650 Wireless
|
|
15
|
+
* (`./rival650.ts`, family `"rival650"`): sensitivity `0x03` (two per-level
|
|
16
|
+
* commands) vs. `0x15`, polling `0x04` vs. `0x17`, buttons `0x31` (feature
|
|
17
|
+
* report) vs. `0x19` (output), and a firmware query `0x10` the 650 lacks.
|
|
18
|
+
* The two vendor specification files confirm the split, so this is a
|
|
19
|
+
* separate family/module, not a reuse.
|
|
20
|
+
*
|
|
21
|
+
* Every command is an HID **output report** with report id 0x00 (33-byte
|
|
22
|
+
* reports — `HIDIO 33` throughout the specification — smaller than every
|
|
23
|
+
* other family's 65-byte reports), except the button-mapping command,
|
|
24
|
+
* which is an HID **feature** report (`0x31`, `HIDFEATURE`).
|
|
25
|
+
*
|
|
26
|
+
* DPI uses two per-level commands (`03 00 01`/`03 00 02`): a linear
|
|
27
|
+
* one-byte encoding, `byte = (dpi - 100) / 100`, range 0x00–0x77
|
|
28
|
+
* (100–12000 in 100 DPI steps), followed by the suffix `00 42` (the A3360
|
|
29
|
+
* sensor PID). The vendor file states the byte and suffix but no range;
|
|
30
|
+
* rivalcfg's `input_range [100, 12000, 100]` / `output_range [0x00, 0x77,
|
|
31
|
+
* 1]` supplies the mapping, and it is the same linear encoding Rival 310
|
|
32
|
+
* uses. Off-grid values are rejected rather than rounded.
|
|
33
|
+
*
|
|
34
|
+
* Polling (`04 00`, values 1000→0x01, 500→0x02, 250→0x03, 125→0x04) is
|
|
35
|
+
* write-only. Buttons are one 35-byte packet (7 slots × 5-byte fields) as
|
|
36
|
+
* a feature report, command `0x31`: `button7` has id `0x00`, colliding
|
|
37
|
+
* with the disable byte, so it is a valid remap *source* but not a valid
|
|
38
|
+
* *target* — see `steelseriesRival600EncodeButtonsMapping`.
|
|
39
|
+
*
|
|
40
|
+
* The proximity (lift-off) sensor command `0x96` carries `enable`, a low
|
|
41
|
+
* threshold, and a high threshold byte; the vendor file states no range
|
|
42
|
+
* for the two thresholds, so this codec passes them through.
|
|
43
|
+
*
|
|
44
|
+
* Known but deliberately not implemented — documented so nobody re-derives
|
|
45
|
+
* them, withheld until there is hardware evidence and a reason to ship
|
|
46
|
+
* them:
|
|
47
|
+
*
|
|
48
|
+
* - The 8-zone lighting path: the specification uses `direct_write` `0x27`
|
|
49
|
+
* (mask + 8 RGB triples) and `single_zone_direct_write` `0x07`, while
|
|
50
|
+
* rivalcfg's `rival600.py` instead uses a `05 00` feature-report
|
|
51
|
+
* rgbgradient path. The two sources disagree on the LED command, so
|
|
52
|
+
* lighting is left out until the difference is resolved on hardware.
|
|
53
|
+
* - `reset_all_illumination` `0x08`, `current_sensor` read `0x60`,
|
|
54
|
+
* `resolution_level` read `0x81`(read-op), macros, and factory restore.
|
|
55
|
+
* - Deceleration/acceleration (`MOUSEACCELDECEL`) and angle snapping
|
|
56
|
+
* (`MOUSESMOOTHING`): these are kernel-driver `SSE` settings, not HID
|
|
57
|
+
* commands, and are out of scope for this codec.
|
|
58
|
+
*
|
|
59
|
+
* `read resolution_level` (read-op) returns the active preset level; this
|
|
60
|
+
* module exposes it as `steelseriesRival600LevelQuery`, though the driver
|
|
61
|
+
* does not rely on it. Settings apply immediately; the save command
|
|
62
|
+
* (`09 00`) persists them to onboard flash. None of this has been verified
|
|
63
|
+
* on physical hardware by this project.
|
|
64
|
+
*/
|
|
65
|
+
export const RIVAL600_REPORT_ID = 0x00;
|
|
66
|
+
/** Command prefixes; the payload is the prefix plus its arguments. */
|
|
67
|
+
export const RIVAL600_COMMAND = {
|
|
68
|
+
sensitivity1: [0x03, 0x00, 0x01],
|
|
69
|
+
sensitivity2: [0x03, 0x00, 0x02],
|
|
70
|
+
pollingRate: [0x04, 0x00],
|
|
71
|
+
/** Read-op for the active preset level (`81 00`). */
|
|
72
|
+
activeLevel: [0x81, 0x00],
|
|
73
|
+
/** Feature report; 7×5-byte button table follows the selector. */
|
|
74
|
+
buttonsMapping: [0x31, 0x00],
|
|
75
|
+
proximity: [0x96, 0x00],
|
|
76
|
+
save: [0x09, 0x00],
|
|
77
|
+
firmware: [0x10, 0x00],
|
|
78
|
+
};
|
|
79
|
+
/** `command_suffix` appended after the DPI byte for both sensitivity presets. */
|
|
80
|
+
const SENSITIVITY_SUFFIX = [0x00, 0x42];
|
|
81
|
+
/** `09 00` — commit the current settings to onboard flash. */
|
|
82
|
+
export const RIVAL600_SAVE_COMMAND = [0x09, 0x00];
|
|
83
|
+
/** The two sensitivity presets the specification defines (levels 1 and 2). */
|
|
84
|
+
export const RIVAL600_DPI_PRESET_COUNT = 2;
|
|
85
|
+
export const RIVAL600_FIRMWARE_RESPONSE_LENGTH = 2;
|
|
86
|
+
export const RIVAL600_POLLING_RATES = [125, 250, 500, 1000];
|
|
87
|
+
const POLLING_RATE_TO_BYTE = new Map([
|
|
88
|
+
[1000, 0x01],
|
|
89
|
+
[500, 0x02],
|
|
90
|
+
[250, 0x03],
|
|
91
|
+
[125, 0x04],
|
|
92
|
+
]);
|
|
93
|
+
export const RIVAL600_DPI_MIN = 100;
|
|
94
|
+
export const RIVAL600_DPI_MAX = 12000;
|
|
95
|
+
export const RIVAL600_DPI_STEP = 100;
|
|
96
|
+
/** rivalcfg `rival600.py` defaults for the two presets. */
|
|
97
|
+
export const RIVAL600_DEFAULT_DPI_PRESET_1 = 800;
|
|
98
|
+
export const RIVAL600_DEFAULT_DPI_PRESET_2 = 1600;
|
|
99
|
+
export const RIVAL600_DEFAULT_POLLING_RATE = 1000;
|
|
100
|
+
export class Rival600ProtocolError extends Error {
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* `input_range [100, 12000, 100]` -> `output_range [0x00, 0x77, 1]`: a
|
|
104
|
+
* plain linear one-byte encoding, `byte = (dpi - 100) / 100`, range
|
|
105
|
+
* 0x00–0x77 (119). Values must land exactly on a 100 DPI step; off-grid
|
|
106
|
+
* input is rejected, matching how the rest of this package validates DPI.
|
|
107
|
+
*/
|
|
108
|
+
function encodeDpiByte(dpi) {
|
|
109
|
+
if (!Number.isInteger(dpi) ||
|
|
110
|
+
dpi < RIVAL600_DPI_MIN ||
|
|
111
|
+
dpi > RIVAL600_DPI_MAX ||
|
|
112
|
+
(dpi - RIVAL600_DPI_MIN) % RIVAL600_DPI_STEP !== 0) {
|
|
113
|
+
throw new Rival600ProtocolError(`SteelSeries Rival 600 DPI must be ${RIVAL600_DPI_MIN}–${RIVAL600_DPI_MAX.toLocaleString("en-US")} in ${RIVAL600_DPI_STEP} DPI steps.`);
|
|
114
|
+
}
|
|
115
|
+
return (dpi - RIVAL600_DPI_MIN) / RIVAL600_DPI_STEP;
|
|
116
|
+
}
|
|
117
|
+
/** The 120 DPI values the linear encoding can express, ascending. */
|
|
118
|
+
export function steelseriesRival600DpiOptions() {
|
|
119
|
+
const options = [];
|
|
120
|
+
for (let dpi = RIVAL600_DPI_MIN; dpi <= RIVAL600_DPI_MAX; dpi += RIVAL600_DPI_STEP) {
|
|
121
|
+
options.push(dpi);
|
|
122
|
+
}
|
|
123
|
+
return options;
|
|
124
|
+
}
|
|
125
|
+
/** `03 00 01 <byte> 00 42` — sensitivity preset 1. */
|
|
126
|
+
export function steelseriesRival600EncodeSensitivity1(dpi) {
|
|
127
|
+
return new Uint8Array([...RIVAL600_COMMAND.sensitivity1, encodeDpiByte(dpi), ...SENSITIVITY_SUFFIX]);
|
|
128
|
+
}
|
|
129
|
+
/** `03 00 02 <byte> 00 42` — sensitivity preset 2. */
|
|
130
|
+
export function steelseriesRival600EncodeSensitivity2(dpi) {
|
|
131
|
+
return new Uint8Array([...RIVAL600_COMMAND.sensitivity2, encodeDpiByte(dpi), ...SENSITIVITY_SUFFIX]);
|
|
132
|
+
}
|
|
133
|
+
/** `04 00 <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
|
|
134
|
+
export function steelseriesRival600EncodePollingRate(pollingRateHz) {
|
|
135
|
+
const byte = POLLING_RATE_TO_BYTE.get(pollingRateHz);
|
|
136
|
+
if (byte === undefined) {
|
|
137
|
+
throw new Rival600ProtocolError("SteelSeries Rival 600 supports 125, 250, 500, or 1000 Hz polling.");
|
|
138
|
+
}
|
|
139
|
+
return new Uint8Array([...RIVAL600_COMMAND.pollingRate, byte]);
|
|
140
|
+
}
|
|
141
|
+
/** `09 00` — commit the current settings to onboard flash. */
|
|
142
|
+
export function steelseriesRival600SaveCommand() {
|
|
143
|
+
return new Uint8Array(RIVAL600_SAVE_COMMAND);
|
|
144
|
+
}
|
|
145
|
+
/** `81 00` — read the active preset level. */
|
|
146
|
+
export function steelseriesRival600LevelQuery() {
|
|
147
|
+
return new Uint8Array(RIVAL600_COMMAND.activeLevel);
|
|
148
|
+
}
|
|
149
|
+
/** `10 00` — the device answers with minor then major firmware bytes. */
|
|
150
|
+
export function steelseriesRival600FirmwareQuery() {
|
|
151
|
+
return new Uint8Array(RIVAL600_COMMAND.firmware);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Decode the two-byte firmware response. The specification's incoming
|
|
155
|
+
* struct orders the fields `fw_minor` then `fw_major`, so the display
|
|
156
|
+
* string puts them back in major.minor order.
|
|
157
|
+
*/
|
|
158
|
+
export function steelseriesRival600DecodeFirmware(payload) {
|
|
159
|
+
if (payload.length < RIVAL600_FIRMWARE_RESPONSE_LENGTH) {
|
|
160
|
+
throw new Rival600ProtocolError("SteelSeries Rival 600 firmware response is shorter than two bytes.");
|
|
161
|
+
}
|
|
162
|
+
const bytes = [payload[0], payload[1]];
|
|
163
|
+
return { bytes, display: `${bytes[1]}.${bytes[0]}` };
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* `96 00 <enable> <low> <high>` — proximity (lift-off) sensor threshold.
|
|
167
|
+
* `low`/`high` have no stated range in the vendor file; they are passed
|
|
168
|
+
* through as bytes.
|
|
169
|
+
*/
|
|
170
|
+
export function steelseriesRival600EncodeProximity(enable, low, high) {
|
|
171
|
+
for (const [value, name] of [[low, "Low"], [high, "High"]]) {
|
|
172
|
+
if (!Number.isInteger(value) || value < 0 || value > 255) {
|
|
173
|
+
throw new Rival600ProtocolError(`SteelSeries Rival 600 proximity ${name} threshold must be an integer 0–255.`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return new Uint8Array([...RIVAL600_COMMAND.proximity, enable ? 0x01 : 0x00, low, high]);
|
|
177
|
+
}
|
|
178
|
+
// -- Button mapping --------------------------------------------------------
|
|
179
|
+
/** 7 button slots, 5-byte fields — the same layout as the Rival 650. */
|
|
180
|
+
export const RIVAL600_BUTTONS = {
|
|
181
|
+
button1: { id: 0x01, offset: 0x00 },
|
|
182
|
+
button2: { id: 0x02, offset: 0x05 },
|
|
183
|
+
button3: { id: 0x03, offset: 0x0a },
|
|
184
|
+
button4: { id: 0x04, offset: 0x0f },
|
|
185
|
+
button5: { id: 0x05, offset: 0x14 },
|
|
186
|
+
button6: { id: 0x06, offset: 0x19 },
|
|
187
|
+
/**
|
|
188
|
+
* `"id": 0x00` in rivalcfg's `rival600.py` (and the vendor table's CPI
|
|
189
|
+
* button) — collides with `button_disable`, so this button cannot be a
|
|
190
|
+
* valid remap *target*. It still has its own `offset` and defaults to the
|
|
191
|
+
* `dpi` special action.
|
|
192
|
+
*/
|
|
193
|
+
button7: { id: 0x00, offset: 0x1e },
|
|
194
|
+
};
|
|
195
|
+
const RIVAL600_BUTTON_FIELD_LENGTH = 5;
|
|
196
|
+
const RIVAL600_BUTTON_DISABLE = 0x00;
|
|
197
|
+
const RIVAL600_BUTTON_DPI_SWITCH = 0x30;
|
|
198
|
+
const RIVAL600_BUTTON_SCROLL_UP = 0x31;
|
|
199
|
+
const RIVAL600_BUTTON_SCROLL_DOWN = 0x32;
|
|
200
|
+
const RIVAL600_BUTTON_KEYBOARD = 0x51;
|
|
201
|
+
const RIVAL600_BUTTON_MULTIMEDIA = 0x61;
|
|
202
|
+
function encodeKeyCode(code, kind) {
|
|
203
|
+
if (!Number.isInteger(code) || code < 0 || code > 255) {
|
|
204
|
+
throw new Rival600ProtocolError(`${kind} codes must be integers 0–255.`);
|
|
205
|
+
}
|
|
206
|
+
return code;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* `31 00` (feature report) + one 35-byte packet (7 slots × 5-byte fields),
|
|
210
|
+
* zero-filled except where a mapping is given. Pass every button explicitly
|
|
211
|
+
* — unmapped buttons stay disabled, matching this package's
|
|
212
|
+
* no-silent-defaults policy.
|
|
213
|
+
*/
|
|
214
|
+
export function steelseriesRival600EncodeButtonsMapping(mapping) {
|
|
215
|
+
for (const name of Object.keys(mapping)) {
|
|
216
|
+
if (!Object.hasOwn(RIVAL600_BUTTONS, name)) {
|
|
217
|
+
throw new Rival600ProtocolError(`Unknown SteelSeries Rival 600 button "${name}".`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const names = Object.keys(RIVAL600_BUTTONS);
|
|
221
|
+
const packet = new Array(names.length * RIVAL600_BUTTON_FIELD_LENGTH).fill(0x00);
|
|
222
|
+
for (const [name, action] of Object.entries(mapping)) {
|
|
223
|
+
const { offset } = RIVAL600_BUTTONS[name];
|
|
224
|
+
switch (action.type) {
|
|
225
|
+
case "button": {
|
|
226
|
+
packet[offset] = RIVAL600_BUTTONS[action.target].id;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
case "disabled": {
|
|
230
|
+
packet[offset] = RIVAL600_BUTTON_DISABLE;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
case "dpiSwitch": {
|
|
234
|
+
packet[offset] = RIVAL600_BUTTON_DPI_SWITCH;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
case "scrollUp": {
|
|
238
|
+
packet[offset] = RIVAL600_BUTTON_SCROLL_UP;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
case "scrollDown": {
|
|
242
|
+
packet[offset] = RIVAL600_BUTTON_SCROLL_DOWN;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
case "keyboard": {
|
|
246
|
+
packet[offset] = RIVAL600_BUTTON_KEYBOARD;
|
|
247
|
+
packet[offset + 1] = encodeKeyCode(action.code, "Keyboard scan");
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
case "multimedia": {
|
|
251
|
+
packet[offset] = RIVAL600_BUTTON_MULTIMEDIA;
|
|
252
|
+
packet[offset + 1] = encodeKeyCode(action.code, "Multimedia key");
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
default: {
|
|
256
|
+
throw new Rival600ProtocolError("Unsupported SteelSeries Rival 600 button action.");
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return new Uint8Array([...RIVAL600_COMMAND.buttonsMapping, ...packet]);
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=rival-600.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rival-600.js","sourceRoot":"","sources":["../../src/steelseries/rival-600.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAChC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAChC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACzB,qDAAqD;IACrD,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACzB,kEAAkE;IAClE,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IAC5B,SAAS,EAAE,CAAC,IAAI,EAAE,IA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,GAAG,yBAAyB,CAAC;gBAC3C,MAAM;YACR,CAAC;YACD,KAAK,YAAY,CAAC,CAAC,CAAC;gBAClB,MAAM,CAAC,MAAM,CAAC,GAAG,2BAA2B,CAAC;gBAC7C,MAAM;YACR,CAAC;YACD,KAAK,UAAU,CAAC,CAAC,CAAC;gBAChB,MAAM,CAAC,MAAM,CAAC,GAAG,wBAAwB,CAAC;gBAC1C,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;gBACjE,MAAM;YACR,CAAC;YACD,KAAK,YAAY,CAAC,CAAC,CAAC;gBAClB,MAAM,CAAC,MAAM,CAAC,GAAG,0BAA0B,CAAC;gBAC5C,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBAClE,MAAM;YACR,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,IAAI,qBAAqB,CAAC,kDAAkD,CAAC,CAAC;YACtF,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,gBAAgB,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SteelSeries Sensei 310 configuration protocol — pure encode/decode helpers.
|
|
3
|
+
*
|
|
4
|
+
* Reconstructed from public open-source implementations and the vendor's own
|
|
5
|
+
* software, not from vendor source code:
|
|
6
|
+
*
|
|
7
|
+
* - rivalcfg `rivalcfg/devices/sensei310.py` — same command set as
|
|
8
|
+
* `./rival310.ts`'s `rival310.py` (sensitivity `0x53`, polling `0x54`,
|
|
9
|
+
* buttons `0x31`, save `0x59`, firmware `0x90 00`), which is why this
|
|
10
|
+
* module mirrors that file's structure and constants.
|
|
11
|
+
* - The vendor's SteelSeries GG device specification (`sensei-310.lisp`,
|
|
12
|
+
* GG 121.0.0) is a one-page file: `(include "rival-310")` plus an
|
|
13
|
+
* 8-entry `button_mapping_data` override (`repeat 8` instead of Rival
|
|
14
|
+
* 310's 6) with the same `0x31` command. Everything except the button
|
|
15
|
+
* table is inherited byte-for-byte, so this module keeps the Rival 310
|
|
16
|
+
* command bytes, DPI encoding, polling values, RGB handling, save
|
|
17
|
+
* command, and firmware query identical, with Sensei 310 naming.
|
|
18
|
+
*
|
|
19
|
+
* Button 7/8 use ids `0x07`/`0x08` at offsets `0x1e`/`0x23`, continuing the
|
|
20
|
+
* sequential id/offset pattern and matching `./sensei-ten.ts`'s 8-button
|
|
21
|
+
* table. The vendor file states only the slot count, so those two ids are
|
|
22
|
+
* an inference from the shared convention, flagged here rather than
|
|
23
|
+
* asserted as observed.
|
|
24
|
+
*
|
|
25
|
+
* Like `./rival310.ts`, this module is rivalcfg-only corroboration: no
|
|
26
|
+
* libratbag or OpenRGB source was reachable for this device. Nothing here
|
|
27
|
+
* has been verified on physical Sensei 310 hardware by this project.
|
|
28
|
+
*
|
|
29
|
+
* Every command is an HID **output report** with report id 0x00 on the
|
|
30
|
+
* vendor configuration interface (`"endpoint": 0`, as in `rival310.py`),
|
|
31
|
+
* except the LED color commands, which are HID **feature** reports.
|
|
32
|
+
*
|
|
33
|
+
* **This device is write-only for settings**: no getter exists for DPI,
|
|
34
|
+
* polling, lighting, or buttons. The one readable value is the two-byte
|
|
35
|
+
* firmware version behind command `90 00`.
|
|
36
|
+
*
|
|
37
|
+
* Settings apply immediately; the save command (`59 00`) commits them to
|
|
38
|
+
* onboard flash.
|
|
39
|
+
*/
|
|
40
|
+
export declare const STEELSERIES_SENSEI310_REPORT_ID = 0;
|
|
41
|
+
/** Two-byte command prefixes; the payload is the prefix plus its arguments. */
|
|
42
|
+
export declare const SENSEI310_COMMAND: {
|
|
43
|
+
readonly sensitivity1: readonly [83, 0, 1];
|
|
44
|
+
readonly sensitivity2: readonly [83, 0, 2];
|
|
45
|
+
readonly pollingRate: readonly [84, 0];
|
|
46
|
+
readonly ledColor: readonly [91, 0];
|
|
47
|
+
readonly buttonsMapping: readonly [49, 0];
|
|
48
|
+
readonly save: readonly [89, 0];
|
|
49
|
+
readonly firmware: readonly [144, 0];
|
|
50
|
+
};
|
|
51
|
+
/** `59 00` — commit the current settings to onboard flash. */
|
|
52
|
+
export declare const SENSEI310_SAVE_COMMAND: readonly [89, 0];
|
|
53
|
+
export declare const SENSEI310_FIRMWARE_RESPONSE_LENGTH = 2;
|
|
54
|
+
export declare const SENSEI310_POLLING_RATES: readonly [125, 250, 500, 1000];
|
|
55
|
+
export declare const SENSEI310_DPI_MIN = 100;
|
|
56
|
+
export declare const SENSEI310_DPI_MAX = 12000;
|
|
57
|
+
export declare const SENSEI310_DPI_STEP = 100;
|
|
58
|
+
export declare class Sensei310ProtocolError extends Error {
|
|
59
|
+
}
|
|
60
|
+
/** The 120 DPI values the linear encoding can express, ascending. */
|
|
61
|
+
export declare function steelseriesSensei310DpiOptions(): number[];
|
|
62
|
+
/** `53 00 01 <byte> 00 42` — sensitivity preset 1. */
|
|
63
|
+
export declare function steelseriesSensei310EncodeSensitivity1(dpi: number): Uint8Array;
|
|
64
|
+
/** `53 00 02 <byte> 00 42` — sensitivity preset 2. */
|
|
65
|
+
export declare function steelseriesSensei310EncodeSensitivity2(dpi: number): Uint8Array;
|
|
66
|
+
/** `54 00 <v>` with 1000→0x01, 500→0x02, 250→0x03, 125→0x04. */
|
|
67
|
+
export declare function steelseriesSensei310EncodePollingRate(pollingRateHz: number): Uint8Array;
|
|
68
|
+
/** `59 00` — commit the current settings to onboard flash. */
|
|
69
|
+
export declare function steelseriesSensei310SaveCommand(): Uint8Array;
|
|
70
|
+
/** `90 00` — the device answers with a two-byte input report. */
|
|
71
|
+
export declare function steelseriesSensei310FirmwareQuery(): Uint8Array;
|
|
72
|
+
export interface SteelSeriesSensei310Firmware {
|
|
73
|
+
/** The two raw response bytes, in the order the device sent them. */
|
|
74
|
+
bytes: [number, number];
|
|
75
|
+
/** The bytes joined in read order, e.g. "37.0". */
|
|
76
|
+
display: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Decode the two-byte firmware response, following `./rival310.ts`'s
|
|
80
|
+
* read-order convention until hardware settles the byte order.
|
|
81
|
+
*/
|
|
82
|
+
export declare function steelseriesSensei310DecodeFirmware(payload: Uint8Array): SteelSeriesSensei310Firmware;
|
|
83
|
+
export type Sensei310Led = "logo" | "wheel";
|
|
84
|
+
/**
|
|
85
|
+
* `5B 00` (feature report) + 26-byte header + 7-byte body — sets one LED to
|
|
86
|
+
* a steady color. Same single-color path through rivalcfg's `rgbgradient`
|
|
87
|
+
* handler as `./rival310.ts`; multi-stop gradients are out of scope here
|
|
88
|
+
* too. This is a **feature** report, unlike every other command in this
|
|
89
|
+
* module.
|
|
90
|
+
*/
|
|
91
|
+
export declare function steelseriesSensei310EncodeLedColor(led: Sensei310Led, r: number, g: number, b: number): Uint8Array;
|
|
92
|
+
/**
|
|
93
|
+
* The vendor specification overrides Rival 310's 6-entry table with 8
|
|
94
|
+
* entries (`repeat 8`). Button 7/8 ids continue the sequential pattern;
|
|
95
|
+
* see the module doc comment for the disclosure.
|
|
96
|
+
*/
|
|
97
|
+
export declare const SENSEI310_BUTTONS: {
|
|
98
|
+
readonly button1: {
|
|
99
|
+
readonly id: 1;
|
|
100
|
+
readonly offset: 0;
|
|
101
|
+
};
|
|
102
|
+
readonly button2: {
|
|
103
|
+
readonly id: 2;
|
|
104
|
+
readonly offset: 5;
|
|
105
|
+
};
|
|
106
|
+
readonly button3: {
|
|
107
|
+
readonly id: 3;
|
|
108
|
+
readonly offset: 10;
|
|
109
|
+
};
|
|
110
|
+
readonly button4: {
|
|
111
|
+
readonly id: 4;
|
|
112
|
+
readonly offset: 15;
|
|
113
|
+
};
|
|
114
|
+
readonly button5: {
|
|
115
|
+
readonly id: 5;
|
|
116
|
+
readonly offset: 20;
|
|
117
|
+
};
|
|
118
|
+
readonly button6: {
|
|
119
|
+
readonly id: 6;
|
|
120
|
+
readonly offset: 25;
|
|
121
|
+
};
|
|
122
|
+
readonly button7: {
|
|
123
|
+
readonly id: 7;
|
|
124
|
+
readonly offset: 30;
|
|
125
|
+
};
|
|
126
|
+
readonly button8: {
|
|
127
|
+
readonly id: 8;
|
|
128
|
+
readonly offset: 35;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export type Sensei310ButtonName = keyof typeof SENSEI310_BUTTONS;
|
|
132
|
+
/**
|
|
133
|
+
* One button's target. Like `./rival310.ts`, there are no scroll-wheel
|
|
134
|
+
* button slots — scroll up/down are special *action* bytes any button can
|
|
135
|
+
* be assigned.
|
|
136
|
+
*/
|
|
137
|
+
export type Sensei310ButtonAction = {
|
|
138
|
+
type: "button";
|
|
139
|
+
target: Sensei310ButtonName;
|
|
140
|
+
} | {
|
|
141
|
+
type: "disabled";
|
|
142
|
+
} | {
|
|
143
|
+
type: "dpiSwitch";
|
|
144
|
+
} | {
|
|
145
|
+
type: "scrollUp";
|
|
146
|
+
} | {
|
|
147
|
+
type: "scrollDown";
|
|
148
|
+
} | {
|
|
149
|
+
type: "keyboard";
|
|
150
|
+
code: number;
|
|
151
|
+
} | {
|
|
152
|
+
type: "multimedia";
|
|
153
|
+
code: number;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* `31 00` + one 40-byte (`8 buttons × 5-byte field length`) packet,
|
|
157
|
+
* zero-filled except where a mapping is given. Pass every button
|
|
158
|
+
* explicitly — unmapped buttons stay disabled, matching this package's
|
|
159
|
+
* no-silent-defaults policy.
|
|
160
|
+
*/
|
|
161
|
+
export declare function steelseriesSensei310EncodeButtonsMapping(mapping: Partial<Record<Sensei310ButtonName, Sensei310ButtonAction>>): Uint8Array;
|
|
162
|
+
//# sourceMappingURL=sensei-310.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensei-310.d.ts","sourceRoot":"","sources":["../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