@onekeyfe/hd-transport-lowlevel 1.2.0-alpha.2 → 1.2.0-alpha.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/__tests__/protocol-v2.test.js +21 -17
- package/package.json +4 -4
|
@@ -29,21 +29,25 @@ const protocolV1Schema = {
|
|
|
29
29
|
|
|
30
30
|
const protocolV2Schema = {
|
|
31
31
|
nested: {
|
|
32
|
-
|
|
32
|
+
ProtocolInfoRequest: {
|
|
33
33
|
fields: {},
|
|
34
34
|
},
|
|
35
|
-
|
|
35
|
+
ProtocolInfo: {
|
|
36
36
|
fields: {
|
|
37
|
-
|
|
37
|
+
version: {
|
|
38
38
|
type: 'uint32',
|
|
39
39
|
id: 1,
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
supported_messages: {
|
|
42
|
+
rule: 'repeated',
|
|
42
43
|
type: 'uint32',
|
|
43
44
|
id: 2,
|
|
45
|
+
options: {
|
|
46
|
+
packed: false,
|
|
47
|
+
},
|
|
44
48
|
},
|
|
45
|
-
|
|
46
|
-
type: '
|
|
49
|
+
protobuf_definition: {
|
|
50
|
+
type: 'string',
|
|
47
51
|
id: 3,
|
|
48
52
|
},
|
|
49
53
|
},
|
|
@@ -66,8 +70,8 @@ const protocolV2Schema = {
|
|
|
66
70
|
},
|
|
67
71
|
MessageType: {
|
|
68
72
|
values: {
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
MessageType_ProtocolInfoRequest: 60200,
|
|
74
|
+
MessageType_ProtocolInfo: 60201,
|
|
71
75
|
MessageType_Ping: 60206,
|
|
72
76
|
MessageType_Success: 60207,
|
|
73
77
|
},
|
|
@@ -162,11 +166,11 @@ describe('LowlevelTransport protocol framing', () => {
|
|
|
162
166
|
);
|
|
163
167
|
const callResponse = ProtocolV2.encodeFrame(
|
|
164
168
|
schemas,
|
|
165
|
-
'
|
|
169
|
+
'ProtocolInfo',
|
|
166
170
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
version: 1,
|
|
172
|
+
supported_messages: [60200, 60201, 60206, 60207],
|
|
173
|
+
protobuf_definition: 'onekey-protocol-v2',
|
|
170
174
|
},
|
|
171
175
|
{ router: PROTOCOL_V2_CHANNEL_BLE_UART }
|
|
172
176
|
);
|
|
@@ -183,12 +187,12 @@ describe('LowlevelTransport protocol framing', () => {
|
|
|
183
187
|
uuid: 'pro2-id',
|
|
184
188
|
protocolType: 'V2',
|
|
185
189
|
});
|
|
186
|
-
await expect(lowlevel.call('pro2-id', '
|
|
187
|
-
type: '
|
|
190
|
+
await expect(lowlevel.call('pro2-id', 'ProtocolInfoRequest', {})).resolves.toEqual({
|
|
191
|
+
type: 'ProtocolInfo',
|
|
188
192
|
message: {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
193
|
+
version: 1,
|
|
194
|
+
supported_messages: [60200, 60201, 60206, 60207],
|
|
195
|
+
protobuf_definition: 'onekey-protocol-v2',
|
|
192
196
|
},
|
|
193
197
|
});
|
|
194
198
|
expect(plugin.send).toHaveBeenCalled();
|
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.4",
|
|
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.4",
|
|
24
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.4"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "6f83d130f022a75003385bc4b2386cd0b2b539b5"
|
|
27
27
|
}
|