File tree Expand file tree Collapse file tree 5 files changed +17
-4
lines changed
connect-examples/electron-example Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 2626 "electron-log" : " ^5.1.5" ,
2727 "electron-updater" : " ^6.2.1" ,
2828 "fs-extra" : " ^11.2.0" ,
29- "node-fetch" : " ^2.6.7"
29+ "node-fetch" : " ^2.6.7" ,
30+ "@onekeyfe/hd-transport-electron" : " 1.1.10-alpha.4"
3031 },
3132 "devDependencies" : {
3233 "@types/webpack" : " ^5.28.5" ,
Original file line number Diff line number Diff line change 2525 "electron-log" : " >=4.0.0"
2626 },
2727 "dependencies" : {
28+ "@onekeyfe/hd-core" : " 1.1.10-alpha.4" ,
29+ "@onekeyfe/hd-transport" : " 1.1.10-alpha.4" ,
2830 "@onekeyfe/hd-shared" : " 1.1.10-alpha.4" ,
2931 "@stoprocent/noble" : " 2.3.4"
3032 },
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ const BLUETOOTH_INIT_TIMEOUT = 10000; // 10 seconds for Bluetooth initialization
9494const DEVICE_SCAN_TIMEOUT = 5000 ; // 5 seconds for device scanning
9595const FAST_SCAN_TIMEOUT = 1500 ; // 1.5 seconds for fast targeted scanning
9696const DEVICE_CHECK_INTERVAL = 500 ; // 500ms interval for periodic device checks
97- const CONNECTION_TIMEOUT = 15000 ; // 15 seconds for device connection
97+ const CONNECTION_TIMEOUT = 3000 ; // 3 seconds for device connection
9898const CHUNK_WRITE_DELAY = 10 ; // 10ms delay between chunk writes
9999
100100// BLE packet size constants
Original file line number Diff line number Diff line change 44 */
55
66import type { Characteristic } from '@stoprocent/noble' ;
7+ import { DataManager } from '@onekeyfe/hd-core' ;
8+ import { parseConfigure , buildOne } from '@onekeyfe/hd-transport' ;
79import type { Logger } from '../types/noble-extended' ;
810
911export interface Step3Options {
@@ -12,8 +14,13 @@ export interface Step3Options {
1214 initDataHex ?: string ; // hex string to write; default OneKey init
1315}
1416
15- const DEFAULT_INIT_DATA =
16- '3f232300000000000882f4030088f403010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' ;
17+ // Get protobuf definitions
18+ const messages = DataManager . getProtobufMessages ( ) ;
19+ const messagesRoot = parseConfigure ( messages as any ) ;
20+
21+ // Dynamically build the Initialize message
22+ const initializeMessageBuffer = buildOne ( messagesRoot , 'Initialize' , { } ) ;
23+ const DEFAULT_INIT_DATA = initializeMessageBuffer . toString ( 'hex' ) ;
1724
1825export async function runPairingProbe (
1926 logger : Logger | null ,
Original file line number Diff line number Diff line change 1+ export * from './serialization/send' ;
2+ export * from './serialization/protobuf' ;
3+
14import * as protobuf from 'protobufjs/light' ;
25import * as Long from 'long' ;
36import {
You can’t perform that action at this time.
0 commit comments