@onekeyfe/hd-transport-electron 1.2.0-alpha.13 → 1.2.0-alpha.130
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/ble-ops.d.ts +6 -0
- package/dist/ble-ops.d.ts.map +1 -1
- package/dist/ble-packet-capacity.d.ts +2 -0
- package/dist/ble-packet-capacity.d.ts.map +1 -0
- package/dist/{index-55699e30.js → index-fe6d3919.js} +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{noble-ble-handler-16791965.js → noble-ble-handler-c88e98df.js} +456 -231
- package/dist/noble-ble-handler.d.ts +2 -0
- package/dist/noble-ble-handler.d.ts.map +1 -1
- package/dist/noble-ble-timeouts.d.ts +3 -0
- package/dist/noble-ble-timeouts.d.ts.map +1 -0
- package/dist/types/desktop-api.d.ts +10 -1
- package/dist/types/desktop-api.d.ts.map +1 -1
- package/dist/types/noble-extended.d.ts +1 -0
- package/dist/types/noble-extended.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/ble-ops.test.ts +21 -0
- package/src/__tests__/ble-packet-capacity.test.ts +13 -0
- package/src/__tests__/noble-ble-handler.test.ts +383 -0
- package/src/ble-ops.ts +40 -10
- package/src/ble-packet-capacity.ts +13 -0
- package/src/index.ts +1 -1
- package/src/noble-ble-handler.ts +518 -247
- package/src/noble-ble-timeouts.ts +2 -0
- package/src/types/desktop-api.ts +10 -2
- package/src/types/noble-extended.ts +1 -0
package/src/types/desktop-api.ts
CHANGED
|
@@ -4,15 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Noble BLE API interface - core BLE functionality
|
|
7
|
+
export interface NobleBleWriteOptions {
|
|
8
|
+
pacingDelayMs?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
export interface NobleBleAPI {
|
|
8
12
|
enumerate: () => Promise<{ id: string; name: string }[]>;
|
|
9
|
-
getDevice: (uuid: string) => Promise<{ id: string; name: string } | null>;
|
|
13
|
+
getDevice: (uuid: string) => Promise<{ id: string; name: string; mtu?: number } | null>;
|
|
10
14
|
connect: (uuid: string) => Promise<void>;
|
|
15
|
+
// Logical end-of-operation: link stays up, idle countdown starts. Optional —
|
|
16
|
+
// older hosts do not bridge it, so the transport feature-detects.
|
|
17
|
+
release?: (uuid: string, keepSession?: boolean) => Promise<void>;
|
|
11
18
|
disconnect: (uuid: string) => Promise<void>;
|
|
12
19
|
subscribe: (uuid: string) => Promise<void>;
|
|
13
20
|
unsubscribe: (uuid: string) => Promise<void>;
|
|
14
|
-
write: (uuid: string, data: string) => Promise<void>;
|
|
21
|
+
write: (uuid: string, data: string, options?: NobleBleWriteOptions) => Promise<void>;
|
|
15
22
|
onNotification: (callback: (deviceId: string, data: string) => void) => () => void;
|
|
23
|
+
onMtuChanged?: (callback: (device: { id: string; mtu: number }) => void) => () => void;
|
|
16
24
|
onDeviceDisconnected: (callback: (device: { id: string; name: string }) => void) => () => void;
|
|
17
25
|
checkAvailability: () => Promise<{
|
|
18
26
|
available: boolean;
|