@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.
@@ -0,0 +1,2 @@
1
+ export const NOBLE_BLE_TARGETED_SCAN_TIMEOUT_MS = 5_000;
2
+ export const NOBLE_BLE_CONNECTION_TIMEOUT_MS = 10_000;
@@ -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;
@@ -11,6 +11,7 @@ export interface DeviceInfo extends OneKeyDeviceInfoBase {
11
11
  id: string;
12
12
  name: string;
13
13
  state: string;
14
+ mtu?: number;
14
15
  }
15
16
 
16
17
  // Characteristic pair interface