Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/drivers/razer/devices.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,6 +120,21 @@ test("the DeathAdder V3 Pro receiver writes polling on the legacy command", () =
}
});

test("the wired DeathAdder V3 writes polling on the extended command", () => {
// Reported on hardware: the legacy read `00/85` answered with status 0x05
// (not supported) and the extended read `00/c0` answered 8000/4, so the mouse
// was running at 2000 Hz while this row still capped the picker at 1000.
const wired = RAZER_PRODUCTS.get(0x00b2);
assert.equal(wired?.wireless, false);
assert.equal(wired?.highRatePolling, true);
// The rate the hardware was found at has to survive the round trip, or the
// picker offers a value the mouse is already sitting at and cannot be set to.
assert.ok(wired?.pollingRates.includes(2000));
for (const rate of wired?.pollingRates ?? []) {
assert.doesNotThrow(() => razerSetExtendedPollingCommand(rate));
}
});

test("no product asks for a rate its polling command cannot encode", () => {
// `highRatePolling` picks the encoding and `pollingRates` picks the values
// offered; they are set independently, so nothing stops a product asking for
Expand Down
15 changes: 12 additions & 3 deletions src/razer/devices.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -409,8 +409,18 @@ const PRODUCT_DEFINITIONS: ReadonlyArray<[number, Omit<RazerProduct, "transactio
// polling command cannot encode.
[0x0091, { model: "Viper 8KHz", ...STANDARD, maxDpi: DPI_FOCUS, pollingRates: RATES_8K, highRatePolling: true }],
[0x00a1, { model: "DeathAdder V2 Lite", ...STANDARD, maxDpi: 8500 }],
[0x00b2, { model: "DeathAdder V3", ...STANDARD, maxDpi: DPI_FOCUS_PRO }],

// Hardware report: the legacy read `00/85` comes back with status 0x05 (not
// supported) and the extended read `00/c0` answers 8000/4, so the mouse was
// already sitting at 2000 Hz while this row still offered a 1000 Hz ceiling.
// Wired, like the Viper 8KHz above, but HyperPolling is the point of the
// model and the legacy command cannot encode it.
[0x00b2, {
model: "DeathAdder V3",
...STANDARD,
maxDpi: DPI_FOCUS_PRO,
pollingRates: RATES_8K,
highRatePolling: true,
}],
// ---- index3: wired, control channel on USB interface 3 --------------------
[0x0096, { model: "Naga X", ...INDEX3, maxDpi: 18_000 }],
[0x0099, { model: "Basilisk V3", ...INDEX3, maxDpi: 26_000 }],
Expand DownExpand Up@@ -515,4 +525,3 @@ export const RAZER_PRODUCTS: ReadonlyMap<number, RazerProduct> = new Map(

/** Product ids for the WebHID picker filters in `../vendors.ts`. */
export const RAZER_PRODUCT_IDS: readonly number[] = [...RAZER_PRODUCTS.keys()];