@onekeyfe/hd-transport-lowlevel 1.2.0-alpha.11 → 1.2.0-alpha.13
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/index.d.ts.map +1 -1
- package/dist/index.js +1 -8
- package/package.json +4 -4
- package/src/index.ts +1 -18
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,SAWN,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,cAAc,EACd,6BAA6B,EAC7B,YAAY,EACZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAqBpD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,WAAW,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAErE,UAAU,UAAS;IAEnB,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,MAAM,EAAE,6BAA6B,CAAuC;IAE5E,OAAO,CAAC,cAAc,CAAwC;IAE9D,OAAO,CAAC,mBAAmB,CAAwC;IAEnE,OAAO,CAAC,oBAAoB,CAAoD;IAEhF,OAAO,CAAC,qBAAqB,CAAkC;IAE/D,OAAO,CAAC,gBAAgB,CAA0B;IAElD,OAAO,CAAC,eAAe,CA6BpB;IAEH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIvD,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,6BAA6B;IAO9E,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,mBAAmB,CAAC,UAAU,EAAE,GAAG;IAOnC,MAAM;IAIA,SAAS;IAWT,OAAO,CAAC,KAAK,EAAE,oBAAoB;;;;IA6BnC,OAAO,CAAC,IAAI,EAAE,MAAM;IAgBpB,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,oBAAoB;YAsBlB,cAAc;IAoC5B,OAAO,CAAC,0BAA0B;IAOlC,OAAO,CAAC,2BAA2B;IAOnC,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,kBAAkB;YAMZ,cAAc;YAsDd,yBAAyB;YAiCzB,eAAe;YAgBf,eAAe;YA6Bf,UAAU;YAUV,qBAAqB;YAmBrB,mBAAmB;YAqBnB,oBAAoB;YAOpB,cAAc;IA6B5B,OAAO,CAAC,uBAAuB;IAkC/B,OAAO,CAAC,2BAA2B;IAMnC,MAAM;CAGP"}
|
package/dist/index.js
CHANGED
|
@@ -174,12 +174,7 @@ class LowlevelTransport {
|
|
|
174
174
|
if (!protocol) {
|
|
175
175
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Device protocol has not been detected for ${uuid}`);
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
this.Log.debug('lowlevel-transport', 'call-', ' name: ', name, ' protocol: ', protocol);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
this.Log.debug('lowlevel-transport', 'call-', ' name: ', name, ' data: ', data, ' protocol: ', protocol);
|
|
182
|
-
}
|
|
177
|
+
this.Log.debug('transport call', { name, protocol });
|
|
183
178
|
if (protocol === 'V2') {
|
|
184
179
|
return this.callProtocolV2(uuid, name, data, options);
|
|
185
180
|
}
|
|
@@ -195,7 +190,6 @@ class LowlevelTransport {
|
|
|
195
190
|
const buffers = ProtocolV1.encodeTransportPackets(messages, name, data);
|
|
196
191
|
for (const o of buffers) {
|
|
197
192
|
const outData = o.toString('hex');
|
|
198
|
-
this.Log.debug('send hex strting: ', outData);
|
|
199
193
|
try {
|
|
200
194
|
yield this.plugin.send(uuid, outData);
|
|
201
195
|
}
|
|
@@ -206,7 +200,6 @@ class LowlevelTransport {
|
|
|
206
200
|
}
|
|
207
201
|
try {
|
|
208
202
|
const response = yield this.readProtocolV1Message(uuid, options === null || options === void 0 ? void 0 : options.timeoutMs);
|
|
209
|
-
this.Log.debug('receive data: ', response);
|
|
210
203
|
const jsonData = ProtocolV1.decodeMessage(messages, response);
|
|
211
204
|
return check.call(jsonData);
|
|
212
205
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-lowlevel",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.13",
|
|
4
4
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
24
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
23
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.13",
|
|
24
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.13"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "a907a7ec140123107f6188b37550a7143f1e0d91"
|
|
27
27
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
2
2
|
import transport, {
|
|
3
|
-
LogBlockCommand,
|
|
4
3
|
PROTOCOL_V1_MESSAGE_HEADER_SIZE,
|
|
5
4
|
PROTOCOL_V2_BLE_FRAME_MAX_BYTES,
|
|
6
5
|
PROTOCOL_V2_CHANNEL_BLE_UART,
|
|
@@ -196,20 +195,7 @@ export default class LowlevelTransport {
|
|
|
196
195
|
`Device protocol has not been detected for ${uuid}`
|
|
197
196
|
);
|
|
198
197
|
}
|
|
199
|
-
|
|
200
|
-
this.Log.debug('lowlevel-transport', 'call-', ' name: ', name, ' protocol: ', protocol);
|
|
201
|
-
} else {
|
|
202
|
-
this.Log.debug(
|
|
203
|
-
'lowlevel-transport',
|
|
204
|
-
'call-',
|
|
205
|
-
' name: ',
|
|
206
|
-
name,
|
|
207
|
-
' data: ',
|
|
208
|
-
data,
|
|
209
|
-
' protocol: ',
|
|
210
|
-
protocol
|
|
211
|
-
);
|
|
212
|
-
}
|
|
198
|
+
this.Log.debug('transport call', { name, protocol });
|
|
213
199
|
|
|
214
200
|
if (protocol === 'V2') {
|
|
215
201
|
return this.callProtocolV2(uuid, name, data, options);
|
|
@@ -232,8 +218,6 @@ export default class LowlevelTransport {
|
|
|
232
218
|
const buffers = ProtocolV1.encodeTransportPackets(messages, name, data);
|
|
233
219
|
for (const o of buffers) {
|
|
234
220
|
const outData = o.toString('hex');
|
|
235
|
-
// Upload resources on low-end phones may OOM
|
|
236
|
-
this.Log.debug('send hex strting: ', outData);
|
|
237
221
|
try {
|
|
238
222
|
await this.plugin.send(uuid, outData);
|
|
239
223
|
} catch (e) {
|
|
@@ -244,7 +228,6 @@ export default class LowlevelTransport {
|
|
|
244
228
|
|
|
245
229
|
try {
|
|
246
230
|
const response = await this.readProtocolV1Message(uuid, options?.timeoutMs);
|
|
247
|
-
this.Log.debug('receive data: ', response);
|
|
248
231
|
const jsonData = ProtocolV1.decodeMessage(messages, response);
|
|
249
232
|
return check.call(jsonData);
|
|
250
233
|
} catch (e) {
|