@openmouse/protocol 0.51.1 → 0.52.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.
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a Logitech receiver says is paired on each of its slots.
|
|
3
|
+
*
|
|
4
|
+
* A receiver exposes the same VID/PID, name and HID++ collections whether a
|
|
5
|
+
* keyboard or a mouse is paired, so drivers cannot tell from the descriptors
|
|
6
|
+
* which one is behind it. The receiver itself can: its pairing table records
|
|
7
|
+
* each slot's device kind. Reading it is one HID++ 1.0 long-register read per
|
|
8
|
+
* slot, answered from the receiver's own memory, so it works while the paired
|
|
9
|
+
* device is asleep and never talks to the device.
|
|
10
|
+
*
|
|
11
|
+
* Register 0x2B5 (receiver info), read with sub-ID 0x83 on device 0xFF:
|
|
12
|
+
* - Unifying and LIGHTSPEED: sub-register 0x20 + slot - 1, kind in byte 7.
|
|
13
|
+
* - Bolt: sub-register 0x50 + slot, kind in byte 1.
|
|
14
|
+
* Bytes count from the echoed sub-register; the kind is the low nibble.
|
|
15
|
+
* Layout as Solaar reads it (lib/logitech_receiver/receiver.py).
|
|
16
|
+
*/
|
|
17
|
+
export type LogitechDeviceKind = "unknown" | "keyboard" | "mouse" | "numpad" | "presenter" | "remote" | "trackball" | "touchpad" | "tablet" | "gamepad" | "joystick" | "headset";
|
|
18
|
+
export interface LogitechReceiverPairing {
|
|
19
|
+
/** HID++ device index of the slot, 1..6. */
|
|
20
|
+
slot: number;
|
|
21
|
+
kind: LogitechDeviceKind;
|
|
22
|
+
}
|
|
23
|
+
export declare const RECEIVER_PAIRING_SLOTS: readonly [1, 2, 3, 4, 5, 6];
|
|
24
|
+
/** The receiver answers from its own memory; a missing answer means it never will. */
|
|
25
|
+
export declare const RECEIVER_PAIRING_TIMEOUT_MS = 500;
|
|
26
|
+
/** Sub-register holding one slot's pairing information. */
|
|
27
|
+
export declare function receiverPairingSubRegister(productId: number, slot: number): number;
|
|
28
|
+
/** The short request that reads one slot's pairing information (report 0x10 body). */
|
|
29
|
+
export declare function encodeReceiverPairingRequest(productId: number, slot: number): Uint8Array<ArrayBuffer>;
|
|
30
|
+
/** One slot's answer: its kind, an empty slot, or an error that says nothing. */
|
|
31
|
+
export type ReceiverPairingReply = LogitechDeviceKind | "empty" | "failed";
|
|
32
|
+
/**
|
|
33
|
+
* Decode a reply to `encodeReceiverPairingRequest`, given without its report
|
|
34
|
+
* id. Returns the slot's kind for a pairing reply, `"empty"` or `"failed"` for
|
|
35
|
+
* an HID++ 1.0 error on the register, and `undefined` for any other report.
|
|
36
|
+
*/
|
|
37
|
+
export declare function decodeReceiverPairingReply(productId: number, slot: number, reportId: number, report: Uint8Array): ReceiverPairingReply | undefined;
|
|
38
|
+
/** Kinds that are pointing devices the mouse drivers serve. */
|
|
39
|
+
export declare function isPointingKind(kind: LogitechDeviceKind): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Read every pairing slot of a Logitech receiver.
|
|
42
|
+
*
|
|
43
|
+
* `interfaces` are the authorized HID interfaces of one receiver (on Windows,
|
|
44
|
+
* WebHID returns the short and long HID++ collections as separate devices and
|
|
45
|
+
* the long reply arrives on the long one). Interfaces this call opened are
|
|
46
|
+
* closed again; one that was already open is left open.
|
|
47
|
+
*
|
|
48
|
+
* The result is all or nothing. It resolves `null`, so the caller keeps its
|
|
49
|
+
* descriptor-level guess, whenever the table cannot be read in full: a slot
|
|
50
|
+
* that does not answer in time, an error that does not mean "empty", a send
|
|
51
|
+
* that fails or hangs, a receiver that cannot be opened (an older Nano
|
|
52
|
+
* receiver), or one where every slot is empty, which looks the same as a
|
|
53
|
+
* receiver without the register. A list is never partial.
|
|
54
|
+
*/
|
|
55
|
+
export declare function readLogitechReceiverPairings(interfaces: readonly HIDDevice[], timeoutMs?: number): Promise<LogitechReceiverPairing[] | null>;
|
|
56
|
+
//# sourceMappingURL=receiver-pairing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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-0,0 +1,158 @@
|
|
|
1
|
+
import { isBoltReceiverProduct } from "@openmouse/protocol/logitech";
|
|
2
|
+
import { hasHidppLongCollection, hasHidppShortCollection } from "./bolt.js";
|
|
3
|
+
const DEVICE_KINDS = {
|
|
4
|
+
0x00: "unknown",
|
|
5
|
+
0x01: "keyboard",
|
|
6
|
+
0x02: "mouse",
|
|
7
|
+
0x03: "numpad",
|
|
8
|
+
0x04: "presenter",
|
|
9
|
+
0x07: "remote",
|
|
10
|
+
0x08: "trackball",
|
|
11
|
+
0x09: "touchpad",
|
|
12
|
+
0x0a: "tablet",
|
|
13
|
+
0x0b: "gamepad",
|
|
14
|
+
0x0c: "joystick",
|
|
15
|
+
0x0d: "headset",
|
|
16
|
+
};
|
|
17
|
+
export const RECEIVER_PAIRING_SLOTS = [1, 2, 3, 4, 5, 6];
|
|
18
|
+
const SHORT_REPORT_ID = 0x10;
|
|
19
|
+
const LONG_REPORT_ID = 0x11;
|
|
20
|
+
const RECEIVER_DEVICE_INDEX = 0xff;
|
|
21
|
+
const HIDPP1_GET_LONG_REGISTER = 0x83;
|
|
22
|
+
const HIDPP1_ERROR = 0x8f;
|
|
23
|
+
const RECEIVER_INFO_REGISTER = 0xb5;
|
|
24
|
+
const UNIFYING_PAIRING_INFO = 0x20;
|
|
25
|
+
const BOLT_PAIRING_INFO = 0x50;
|
|
26
|
+
/** The receiver answers from its own memory; a missing answer means it never will. */
|
|
27
|
+
export const RECEIVER_PAIRING_TIMEOUT_MS = 500;
|
|
28
|
+
/** Sub-register holding one slot's pairing information. */
|
|
29
|
+
export function receiverPairingSubRegister(productId, slot) {
|
|
30
|
+
return isBoltReceiverProduct(productId) ? BOLT_PAIRING_INFO + slot : UNIFYING_PAIRING_INFO + slot - 1;
|
|
31
|
+
}
|
|
32
|
+
/** The short request that reads one slot's pairing information (report 0x10 body). */
|
|
33
|
+
export function encodeReceiverPairingRequest(productId, slot) {
|
|
34
|
+
return new Uint8Array([
|
|
35
|
+
RECEIVER_DEVICE_INDEX,
|
|
36
|
+
HIDPP1_GET_LONG_REGISTER,
|
|
37
|
+
RECEIVER_INFO_REGISTER,
|
|
38
|
+
receiverPairingSubRegister(productId, slot),
|
|
39
|
+
0x00,
|
|
40
|
+
0x00,
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* HID++ 1.0 errors that mean "nothing on this slot": invalid address, invalid
|
|
45
|
+
* value and unknown device. Busy, resource and other errors leave the slot
|
|
46
|
+
* unknown, so an occupied slot is never reported empty by a passing error.
|
|
47
|
+
*/
|
|
48
|
+
const EMPTY_SLOT_ERRORS = new Set([0x02, 0x03, 0x08]);
|
|
49
|
+
/**
|
|
50
|
+
* Decode a reply to `encodeReceiverPairingRequest`, given without its report
|
|
51
|
+
* id. Returns the slot's kind for a pairing reply, `"empty"` or `"failed"` for
|
|
52
|
+
* an HID++ 1.0 error on the register, and `undefined` for any other report.
|
|
53
|
+
*/
|
|
54
|
+
export function decodeReceiverPairingReply(productId, slot, reportId, report) {
|
|
55
|
+
const subRegister = receiverPairingSubRegister(productId, slot);
|
|
56
|
+
if (report[0] !== RECEIVER_DEVICE_INDEX)
|
|
57
|
+
return undefined;
|
|
58
|
+
// An HID++ 1.0 error echoes the sub-ID and register, then the error code
|
|
59
|
+
// (`[0xFF, 0x8F, 0x83, 0xB5, code]`), but not the sub-register. Only one read
|
|
60
|
+
// is in flight at a time, and the reader stops at the first slot that does
|
|
61
|
+
// not answer, so a late error can never be taken for another slot's.
|
|
62
|
+
if (reportId === SHORT_REPORT_ID && report[1] === HIDPP1_ERROR
|
|
63
|
+
&& report[2] === HIDPP1_GET_LONG_REGISTER && report[3] === RECEIVER_INFO_REGISTER) {
|
|
64
|
+
return EMPTY_SLOT_ERRORS.has(report[4] ?? -1) ? "empty" : "failed";
|
|
65
|
+
}
|
|
66
|
+
if (reportId !== LONG_REPORT_ID || report[1] !== HIDPP1_GET_LONG_REGISTER
|
|
67
|
+
|| report[2] !== RECEIVER_INFO_REGISTER || report[3] !== subRegister) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
// `pairInfo[0]` is the echoed sub-register, as Solaar indexes it.
|
|
71
|
+
const pairInfo = report.subarray(3);
|
|
72
|
+
const kindByte = isBoltReceiverProduct(productId) ? pairInfo[1] : pairInfo[7];
|
|
73
|
+
if (kindByte === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
return DEVICE_KINDS[kindByte & 0x0f] ?? "unknown";
|
|
76
|
+
}
|
|
77
|
+
/** Kinds that are pointing devices the mouse drivers serve. */
|
|
78
|
+
export function isPointingKind(kind) {
|
|
79
|
+
return kind === "mouse" || kind === "trackball" || kind === "touchpad";
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Read every pairing slot of a Logitech receiver.
|
|
83
|
+
*
|
|
84
|
+
* `interfaces` are the authorized HID interfaces of one receiver (on Windows,
|
|
85
|
+
* WebHID returns the short and long HID++ collections as separate devices and
|
|
86
|
+
* the long reply arrives on the long one). Interfaces this call opened are
|
|
87
|
+
* closed again; one that was already open is left open.
|
|
88
|
+
*
|
|
89
|
+
* The result is all or nothing. It resolves `null`, so the caller keeps its
|
|
90
|
+
* descriptor-level guess, whenever the table cannot be read in full: a slot
|
|
91
|
+
* that does not answer in time, an error that does not mean "empty", a send
|
|
92
|
+
* that fails or hangs, a receiver that cannot be opened (an older Nano
|
|
93
|
+
* receiver), or one where every slot is empty, which looks the same as a
|
|
94
|
+
* receiver without the register. A list is never partial.
|
|
95
|
+
*/
|
|
96
|
+
export async function readLogitechReceiverPairings(interfaces, timeoutMs = RECEIVER_PAIRING_TIMEOUT_MS) {
|
|
97
|
+
const sender = interfaces.find(hasHidppShortCollection);
|
|
98
|
+
if (!sender)
|
|
99
|
+
return null;
|
|
100
|
+
const listeners = interfaces.filter((device) => hasHidppShortCollection(device) || hasHidppLongCollection(device));
|
|
101
|
+
const productId = sender.productId;
|
|
102
|
+
const opened = [];
|
|
103
|
+
let pending = null;
|
|
104
|
+
const onInputReport = (event) => {
|
|
105
|
+
if (!pending)
|
|
106
|
+
return;
|
|
107
|
+
const report = new Uint8Array(event.data.buffer, event.data.byteOffset, event.data.byteLength);
|
|
108
|
+
const reply = decodeReceiverPairingReply(productId, pending.slot, event.reportId, report);
|
|
109
|
+
if (reply === undefined)
|
|
110
|
+
return;
|
|
111
|
+
const { resolve } = pending;
|
|
112
|
+
pending = null;
|
|
113
|
+
resolve(reply);
|
|
114
|
+
};
|
|
115
|
+
try {
|
|
116
|
+
for (const device of listeners) {
|
|
117
|
+
if (!device.opened) {
|
|
118
|
+
await device.open();
|
|
119
|
+
opened.push(device);
|
|
120
|
+
}
|
|
121
|
+
device.addEventListener("inputreport", onInputReport);
|
|
122
|
+
}
|
|
123
|
+
const pairings = [];
|
|
124
|
+
for (const slot of RECEIVER_PAIRING_SLOTS) {
|
|
125
|
+
// One deadline covers both the send and the reply, so a send that never
|
|
126
|
+
// settles cannot hold the interfaces open.
|
|
127
|
+
let timer;
|
|
128
|
+
const reply = await new Promise((resolve) => {
|
|
129
|
+
timer = setTimeout(() => {
|
|
130
|
+
pending = null;
|
|
131
|
+
resolve(undefined);
|
|
132
|
+
}, timeoutMs);
|
|
133
|
+
pending = { slot, resolve };
|
|
134
|
+
sender.sendReport(SHORT_REPORT_ID, encodeReceiverPairingRequest(productId, slot)).catch(() => {
|
|
135
|
+
pending = null;
|
|
136
|
+
resolve("failed");
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
clearTimeout(timer);
|
|
140
|
+
if (reply === undefined || reply === "failed")
|
|
141
|
+
return null;
|
|
142
|
+
if (reply !== "empty")
|
|
143
|
+
pairings.push({ slot, kind: reply });
|
|
144
|
+
}
|
|
145
|
+
return pairings.length > 0 ? pairings : null;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
pending = null;
|
|
152
|
+
for (const device of listeners)
|
|
153
|
+
device.removeEventListener("inputreport", onInputReport);
|
|
154
|
+
for (const device of opened)
|
|
155
|
+
await device.close().catch(() => undefined);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=receiver-pairing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receiver-pairing.js","sourceRoot":"","sources":["../../../src/drivers/logitech/receiver-pairing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAiC5E,MAAM,YAAY,GAAiD;IACjE,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,SAAS;CAChB,CAAC;AAQF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAU,CAAC;AAElE,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,sBAAsB,GAAG,IAAI,CAAC;AACpC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAC/B,sFAAsF;AACtF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,2DAA2D;AAC3D,MAAM,UAAU,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