@onekeyfe/hd-transport-react-native 0.0.3 → 0.0.4
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 -2
- package/package.json +3 -3
- package/src/index.ts +7 -16
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,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAEL,MAAM,EAEN,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,QAAQ,EAA4B,MAAM,kBAAkB,CAAC;AAItE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAqBjE,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,WAAW,SAAQ;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;gBAE5B,OAAO,EAAE,gBAAgB;IAIrC,IAAI;IAIJ,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IASA,SAAS;IA2DT,OAAO,CAAC,KAAK,EAAE,eAAe;;;IAiJpC,sBAAsB,CAAC,cAAc,EAAE,cAAc;IA8C/C,OAAO,CAAC,IAAI,EAAE,MAAM;IAepB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAEL,MAAM,EAEN,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,QAAQ,EAA4B,MAAM,kBAAkB,CAAC;AAItE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAqBjE,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,WAAW,SAAQ;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;gBAE5B,OAAO,EAAE,gBAAgB;IAIrC,IAAI;IAIJ,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IASA,SAAS;IA2DT,OAAO,CAAC,KAAK,EAAE,eAAe;;;IAiJpC,sBAAsB,CAAC,cAAc,EAAE,cAAc;IA8C/C,OAAO,CAAC,IAAI,EAAE,MAAM;IAepB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAmDpE,IAAI;CAGL"}
|
package/dist/index.js
CHANGED
|
@@ -405,7 +405,6 @@ class ReactNativeBleTransport {
|
|
|
405
405
|
}
|
|
406
406
|
if (buffer$1.length >= bufferLength) {
|
|
407
407
|
const value = buffer.Buffer.from(buffer$1);
|
|
408
|
-
console.log('[hd-transport-react-native] Received a complete packet of data, resolve Promise, this.runPromise: ', this.runPromise, 'buffer: ', value);
|
|
409
408
|
bufferLength = 0;
|
|
410
409
|
buffer$1 = [];
|
|
411
410
|
(_a = this.runPromise) === null || _a === void 0 ? void 0 : _a.resolve(value.toString('hex'));
|
|
@@ -449,7 +448,7 @@ class ReactNativeBleTransport {
|
|
|
449
448
|
}
|
|
450
449
|
this.runPromise = create();
|
|
451
450
|
const messages = this._messages;
|
|
452
|
-
console.log('transport-react-native', 'call-', '
|
|
451
|
+
console.log('transport-react-native', 'call-', ' name: ', name, ' data: ', data);
|
|
453
452
|
const buffers = buildBuffers(messages, name, data);
|
|
454
453
|
for (const o of buffers) {
|
|
455
454
|
const outData = o.toString('base64');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-transport": "^0.0.
|
|
23
|
+
"@onekeyfe/hd-transport": "^0.0.4",
|
|
24
24
|
"react-native-ble-manager": "^8.1.0",
|
|
25
25
|
"react-native-ble-plx": "^2.0.3"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "cabba10f92c55ebbe16c54a329c892d03a0c05fb"
|
|
28
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -297,12 +297,12 @@ export default class ReactNativeBleTransport {
|
|
|
297
297
|
|
|
298
298
|
if (buffer.length >= bufferLength) {
|
|
299
299
|
const value = Buffer.from(buffer);
|
|
300
|
-
console.log(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
);
|
|
300
|
+
// console.log(
|
|
301
|
+
// '[hd-transport-react-native] Received a complete packet of data, resolve Promise, this.runPromise: ',
|
|
302
|
+
// this.runPromise,
|
|
303
|
+
// 'buffer: ',
|
|
304
|
+
// value
|
|
305
|
+
// );
|
|
306
306
|
bufferLength = 0;
|
|
307
307
|
buffer = [];
|
|
308
308
|
this.runPromise?.resolve(value.toString('hex'));
|
|
@@ -354,16 +354,7 @@ export default class ReactNativeBleTransport {
|
|
|
354
354
|
|
|
355
355
|
this.runPromise = createDeferred();
|
|
356
356
|
const messages = this._messages;
|
|
357
|
-
console.log(
|
|
358
|
-
'transport-react-native',
|
|
359
|
-
'call-',
|
|
360
|
-
'messages: ',
|
|
361
|
-
messages,
|
|
362
|
-
' name: ',
|
|
363
|
-
name,
|
|
364
|
-
' data: ',
|
|
365
|
-
data
|
|
366
|
-
);
|
|
357
|
+
console.log('transport-react-native', 'call-', ' name: ', name, ' data: ', data);
|
|
367
358
|
const buffers = buildBuffers(messages, name, data);
|
|
368
359
|
for (const o of buffers) {
|
|
369
360
|
const outData = o.toString('base64');
|