zigbee-herdsman 6.0.2 → 6.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/CHANGELOG.md +14 -0
- package/package.json +9 -3
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/dependabot.yml +0 -22
- package/.github/workflows/ci.yml +0 -69
- package/.github/workflows/release-please.yml +0 -18
- package/.github/workflows/stale.yml +0 -20
- package/.github/workflows/typedoc.yaml +0 -47
- package/.release-please-manifest.json +0 -3
- package/.vscode/extensions.json +0 -3
- package/.vscode/settings.json +0 -11
- package/biome.json +0 -98
- package/examples/join-and-log.js +0 -24
- package/release-please-config.json +0 -9
- package/src/adapter/adapter.ts +0 -189
- package/src/adapter/adapterDiscovery.ts +0 -666
- package/src/adapter/const.ts +0 -12
- package/src/adapter/deconz/adapter/deconzAdapter.ts +0 -877
- package/src/adapter/deconz/driver/constants.ts +0 -246
- package/src/adapter/deconz/driver/driver.ts +0 -1540
- package/src/adapter/deconz/driver/frame.ts +0 -11
- package/src/adapter/deconz/driver/frameParser.ts +0 -753
- package/src/adapter/deconz/driver/parser.ts +0 -45
- package/src/adapter/deconz/driver/writer.ts +0 -22
- package/src/adapter/deconz/types.d.ts +0 -13
- package/src/adapter/ember/adapter/emberAdapter.ts +0 -2265
- package/src/adapter/ember/adapter/endpoints.ts +0 -86
- package/src/adapter/ember/adapter/oneWaitress.ts +0 -324
- package/src/adapter/ember/adapter/tokensManager.ts +0 -782
- package/src/adapter/ember/consts.ts +0 -178
- package/src/adapter/ember/enums.ts +0 -1746
- package/src/adapter/ember/ezsp/buffalo.ts +0 -1392
- package/src/adapter/ember/ezsp/consts.ts +0 -148
- package/src/adapter/ember/ezsp/enums.ts +0 -1114
- package/src/adapter/ember/ezsp/ezsp.ts +0 -9061
- package/src/adapter/ember/ezspError.ts +0 -10
- package/src/adapter/ember/types.ts +0 -866
- package/src/adapter/ember/uart/ash.ts +0 -1960
- package/src/adapter/ember/uart/consts.ts +0 -109
- package/src/adapter/ember/uart/enums.ts +0 -192
- package/src/adapter/ember/uart/parser.ts +0 -48
- package/src/adapter/ember/uart/queues.ts +0 -247
- package/src/adapter/ember/uart/writer.ts +0 -53
- package/src/adapter/ember/utils/initters.ts +0 -58
- package/src/adapter/ember/utils/math.ts +0 -73
- package/src/adapter/events.ts +0 -21
- package/src/adapter/ezsp/adapter/backup.ts +0 -109
- package/src/adapter/ezsp/adapter/ezspAdapter.ts +0 -614
- package/src/adapter/ezsp/driver/commands.ts +0 -2497
- package/src/adapter/ezsp/driver/consts.ts +0 -11
- package/src/adapter/ezsp/driver/driver.ts +0 -1002
- package/src/adapter/ezsp/driver/ezsp.ts +0 -802
- package/src/adapter/ezsp/driver/frame.ts +0 -101
- package/src/adapter/ezsp/driver/index.ts +0 -4
- package/src/adapter/ezsp/driver/multicast.ts +0 -78
- package/src/adapter/ezsp/driver/parser.ts +0 -81
- package/src/adapter/ezsp/driver/types/basic.ts +0 -201
- package/src/adapter/ezsp/driver/types/index.ts +0 -239
- package/src/adapter/ezsp/driver/types/named.ts +0 -2330
- package/src/adapter/ezsp/driver/types/struct.ts +0 -844
- package/src/adapter/ezsp/driver/uart.ts +0 -460
- package/src/adapter/ezsp/driver/utils/crc16ccitt.ts +0 -44
- package/src/adapter/ezsp/driver/utils/index.ts +0 -32
- package/src/adapter/ezsp/driver/writer.ts +0 -64
- package/src/adapter/index.ts +0 -3
- package/src/adapter/serialPort.ts +0 -58
- package/src/adapter/socketPortUtils.ts +0 -16
- package/src/adapter/tstype.ts +0 -78
- package/src/adapter/z-stack/adapter/adapter-backup.ts +0 -519
- package/src/adapter/z-stack/adapter/adapter-nv-memory.ts +0 -457
- package/src/adapter/z-stack/adapter/endpoints.ts +0 -57
- package/src/adapter/z-stack/adapter/manager.ts +0 -543
- package/src/adapter/z-stack/adapter/tstype.ts +0 -6
- package/src/adapter/z-stack/adapter/zStackAdapter.ts +0 -1190
- package/src/adapter/z-stack/constants/af.ts +0 -27
- package/src/adapter/z-stack/constants/common.ts +0 -285
- package/src/adapter/z-stack/constants/dbg.ts +0 -23
- package/src/adapter/z-stack/constants/index.ts +0 -11
- package/src/adapter/z-stack/constants/mac.ts +0 -128
- package/src/adapter/z-stack/constants/sapi.ts +0 -25
- package/src/adapter/z-stack/constants/sys.ts +0 -72
- package/src/adapter/z-stack/constants/util.ts +0 -82
- package/src/adapter/z-stack/constants/utils.ts +0 -14
- package/src/adapter/z-stack/constants/zdo.ts +0 -103
- package/src/adapter/z-stack/models/startup-options.ts +0 -13
- package/src/adapter/z-stack/structs/entries/address-manager-entry.ts +0 -44
- package/src/adapter/z-stack/structs/entries/address-manager-table.ts +0 -19
- package/src/adapter/z-stack/structs/entries/aps-link-key-data-entry.ts +0 -12
- package/src/adapter/z-stack/structs/entries/aps-link-key-data-table.ts +0 -21
- package/src/adapter/z-stack/structs/entries/aps-tc-link-key-entry.ts +0 -19
- package/src/adapter/z-stack/structs/entries/aps-tc-link-key-table.ts +0 -21
- package/src/adapter/z-stack/structs/entries/channel-list.ts +0 -8
- package/src/adapter/z-stack/structs/entries/has-configured.ts +0 -16
- package/src/adapter/z-stack/structs/entries/index.ts +0 -16
- package/src/adapter/z-stack/structs/entries/nib.ts +0 -66
- package/src/adapter/z-stack/structs/entries/nwk-key-descriptor.ts +0 -15
- package/src/adapter/z-stack/structs/entries/nwk-key.ts +0 -13
- package/src/adapter/z-stack/structs/entries/nwk-pan-id.ts +0 -8
- package/src/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-entry.ts +0 -20
- package/src/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-table.ts +0 -19
- package/src/adapter/z-stack/structs/entries/security-manager-entry.ts +0 -33
- package/src/adapter/z-stack/structs/entries/security-manager-table.ts +0 -22
- package/src/adapter/z-stack/structs/index.ts +0 -4
- package/src/adapter/z-stack/structs/serializable-memory-object.ts +0 -14
- package/src/adapter/z-stack/structs/struct.ts +0 -367
- package/src/adapter/z-stack/structs/table.ts +0 -198
- package/src/adapter/z-stack/unpi/constants.ts +0 -33
- package/src/adapter/z-stack/unpi/frame.ts +0 -62
- package/src/adapter/z-stack/unpi/index.ts +0 -4
- package/src/adapter/z-stack/unpi/parser.ts +0 -56
- package/src/adapter/z-stack/unpi/writer.ts +0 -21
- package/src/adapter/z-stack/utils/channel-list.ts +0 -40
- package/src/adapter/z-stack/utils/index.ts +0 -2
- package/src/adapter/z-stack/utils/network-options.ts +0 -26
- package/src/adapter/z-stack/znp/buffaloZnp.ts +0 -175
- package/src/adapter/z-stack/znp/definition.ts +0 -2713
- package/src/adapter/z-stack/znp/index.ts +0 -2
- package/src/adapter/z-stack/znp/parameterType.ts +0 -22
- package/src/adapter/z-stack/znp/tstype.ts +0 -44
- package/src/adapter/z-stack/znp/utils.ts +0 -10
- package/src/adapter/z-stack/znp/znp.ts +0 -342
- package/src/adapter/z-stack/znp/zpiObject.ts +0 -148
- package/src/adapter/zboss/adapter/zbossAdapter.ts +0 -526
- package/src/adapter/zboss/commands.ts +0 -1184
- package/src/adapter/zboss/consts.ts +0 -9
- package/src/adapter/zboss/driver.ts +0 -422
- package/src/adapter/zboss/enums.ts +0 -360
- package/src/adapter/zboss/frame.ts +0 -227
- package/src/adapter/zboss/reader.ts +0 -65
- package/src/adapter/zboss/types.ts +0 -0
- package/src/adapter/zboss/uart.ts +0 -428
- package/src/adapter/zboss/utils.ts +0 -58
- package/src/adapter/zboss/writer.ts +0 -49
- package/src/adapter/zigate/adapter/patchZdoBuffaloBE.ts +0 -27
- package/src/adapter/zigate/adapter/zigateAdapter.ts +0 -618
- package/src/adapter/zigate/driver/LICENSE +0 -17
- package/src/adapter/zigate/driver/buffaloZiGate.ts +0 -212
- package/src/adapter/zigate/driver/commandType.ts +0 -418
- package/src/adapter/zigate/driver/constants.ts +0 -150
- package/src/adapter/zigate/driver/frame.ts +0 -197
- package/src/adapter/zigate/driver/messageType.ts +0 -287
- package/src/adapter/zigate/driver/parameterType.ts +0 -32
- package/src/adapter/zigate/driver/ziGateObject.ts +0 -146
- package/src/adapter/zigate/driver/zigate.ts +0 -423
- package/src/adapter/zoh/adapter/utils.ts +0 -27
- package/src/adapter/zoh/adapter/zohAdapter.ts +0 -838
- package/src/buffalo/buffalo.ts +0 -342
- package/src/buffalo/index.ts +0 -1
- package/src/controller/controller.ts +0 -1022
- package/src/controller/database.ts +0 -124
- package/src/controller/events.ts +0 -52
- package/src/controller/greenPower.ts +0 -603
- package/src/controller/helpers/index.ts +0 -1
- package/src/controller/helpers/installCodes.ts +0 -107
- package/src/controller/helpers/request.ts +0 -96
- package/src/controller/helpers/requestQueue.ts +0 -125
- package/src/controller/helpers/zclFrameConverter.ts +0 -47
- package/src/controller/helpers/zclTransactionSequenceNumber.ts +0 -19
- package/src/controller/index.ts +0 -6
- package/src/controller/model/device.ts +0 -1249
- package/src/controller/model/endpoint.ts +0 -1105
- package/src/controller/model/entity.ts +0 -23
- package/src/controller/model/group.ts +0 -424
- package/src/controller/model/index.ts +0 -5
- package/src/controller/model/zigbeeEntity.ts +0 -30
- package/src/controller/touchlink.ts +0 -189
- package/src/controller/tstype.ts +0 -274
- package/src/index.ts +0 -12
- package/src/models/backup-storage-legacy.ts +0 -48
- package/src/models/backup-storage-unified.ts +0 -47
- package/src/models/backup.ts +0 -37
- package/src/models/index.ts +0 -5
- package/src/models/network-options.ts +0 -11
- package/src/utils/backup.ts +0 -152
- package/src/utils/index.ts +0 -5
- package/src/utils/logger.ts +0 -20
- package/src/utils/patchBigIntSerialization.ts +0 -8
- package/src/utils/queue.ts +0 -76
- package/src/utils/types.d.ts +0 -3
- package/src/utils/utils.ts +0 -19
- package/src/utils/wait.ts +0 -5
- package/src/utils/waitress.ts +0 -96
- package/src/zspec/consts.ts +0 -84
- package/src/zspec/enums.ts +0 -22
- package/src/zspec/index.ts +0 -3
- package/src/zspec/tstypes.ts +0 -18
- package/src/zspec/utils.ts +0 -247
- package/src/zspec/zcl/buffaloZcl.ts +0 -1220
- package/src/zspec/zcl/definition/cluster.ts +0 -5915
- package/src/zspec/zcl/definition/clusters-typegen.ts +0 -588
- package/src/zspec/zcl/definition/clusters-types.ts +0 -7331
- package/src/zspec/zcl/definition/consts.ts +0 -24
- package/src/zspec/zcl/definition/enums.ts +0 -203
- package/src/zspec/zcl/definition/foundation.ts +0 -329
- package/src/zspec/zcl/definition/manufacturerCode.ts +0 -729
- package/src/zspec/zcl/definition/status.ts +0 -69
- package/src/zspec/zcl/definition/tstype.ts +0 -377
- package/src/zspec/zcl/index.ts +0 -11
- package/src/zspec/zcl/utils.ts +0 -321
- package/src/zspec/zcl/zclFrame.ts +0 -356
- package/src/zspec/zcl/zclHeader.ts +0 -102
- package/src/zspec/zcl/zclStatusError.ts +0 -10
- package/src/zspec/zdo/buffaloZdo.ts +0 -2336
- package/src/zspec/zdo/definition/clusters.ts +0 -722
- package/src/zspec/zdo/definition/consts.ts +0 -16
- package/src/zspec/zdo/definition/enums.ts +0 -99
- package/src/zspec/zdo/definition/status.ts +0 -105
- package/src/zspec/zdo/definition/tstypes.ts +0 -1062
- package/src/zspec/zdo/index.ts +0 -7
- package/src/zspec/zdo/utils.ts +0 -76
- package/src/zspec/zdo/zdoStatusError.ts +0 -10
- package/test/adapter/adapter.test.ts +0 -1062
- package/test/adapter/ember/ash.test.ts +0 -337
- package/test/adapter/ember/consts.ts +0 -131
- package/test/adapter/ember/emberAdapter.test.ts +0 -3449
- package/test/adapter/ember/ezsp.test.ts +0 -385
- package/test/adapter/ember/ezspBuffalo.test.ts +0 -93
- package/test/adapter/ember/ezspError.test.ts +0 -12
- package/test/adapter/ember/math.test.ts +0 -206
- package/test/adapter/ezsp/frame.test.ts +0 -30
- package/test/adapter/ezsp/uart.test.ts +0 -181
- package/test/adapter/z-stack/adapter.test.ts +0 -3984
- package/test/adapter/z-stack/constants.test.ts +0 -33
- package/test/adapter/z-stack/structs.test.ts +0 -115
- package/test/adapter/z-stack/unpi.test.ts +0 -213
- package/test/adapter/z-stack/znp.test.ts +0 -1284
- package/test/adapter/zboss/fixZdoResponse.test.ts +0 -179
- package/test/adapter/zigate/patchZdoBuffaloBE.test.ts +0 -81
- package/test/adapter/zigate/zdo.test.ts +0 -187
- package/test/adapter/zoh/utils.test.ts +0 -36
- package/test/adapter/zoh/zohAdapter.test.ts +0 -1307
- package/test/benchOptions.ts +0 -14
- package/test/buffalo.test.ts +0 -431
- package/test/controller.bench.ts +0 -214
- package/test/controller.test.ts +0 -8702
- package/test/greenpower.test.ts +0 -1408
- package/test/mockAdapters.ts +0 -65
- package/test/mockDevices.ts +0 -598
- package/test/requests.bench.ts +0 -229
- package/test/testUtils.ts +0 -20
- package/test/tsconfig.json +0 -9
- package/test/utils/math.ts +0 -19
- package/test/utils.test.ts +0 -279
- package/test/vitest.config.mts +0 -26
- package/test/zcl.test.ts +0 -2831
- package/test/zspec/utils.test.ts +0 -68
- package/test/zspec/zcl/buffalo.test.ts +0 -1374
- package/test/zspec/zcl/frame.test.ts +0 -960
- package/test/zspec/zcl/utils.test.ts +0 -273
- package/test/zspec/zdo/buffalo.test.ts +0 -1850
- package/test/zspec/zdo/utils.test.ts +0 -241
- package/tsconfig.json +0 -24
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import {describe, expect, it} from "vitest";
|
|
2
|
-
import {CommandId} from "../../../src/adapter/zboss/enums";
|
|
3
|
-
import {FrameType, readZBOSSFrame, type ZBOSSFrame} from "../../../src/adapter/zboss/frame";
|
|
4
|
-
import * as Zdo from "../../../src/zspec/zdo";
|
|
5
|
-
import type * as ZdoTypes from "../../../src/zspec/zdo/definition/tstypes";
|
|
6
|
-
|
|
7
|
-
describe("ZBOSS fix non-standard ZDO response payloads", () => {
|
|
8
|
-
it("No fix needed FrameType.RESPONSE", () => {
|
|
9
|
-
expect(readZBOSSFrame(Buffer.from("0001010211000088776655443322113412", "hex"))).toStrictEqual({
|
|
10
|
-
version: 0,
|
|
11
|
-
type: FrameType.RESPONSE,
|
|
12
|
-
commandId: CommandId.ZDO_NWK_ADDR_REQ,
|
|
13
|
-
tsn: 17,
|
|
14
|
-
payload: {
|
|
15
|
-
category: 0,
|
|
16
|
-
zdoClusterId: Zdo.ClusterId.NETWORK_ADDRESS_RESPONSE,
|
|
17
|
-
zdo: [
|
|
18
|
-
Zdo.Status.SUCCESS,
|
|
19
|
-
{
|
|
20
|
-
nwkAddress: 0x1234,
|
|
21
|
-
eui64: "0x1122334455667788",
|
|
22
|
-
startIndex: 0,
|
|
23
|
-
assocDevList: [],
|
|
24
|
-
} as ZdoTypes.NetworkAddressResponse,
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
} as ZBOSSFrame);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("No fix needed FrameType.INDICATION", () => {
|
|
31
|
-
expect(readZBOSSFrame(Buffer.from("00020c020cda603602602bd5b3708e", "hex"))).toStrictEqual({
|
|
32
|
-
version: 0,
|
|
33
|
-
type: FrameType.INDICATION,
|
|
34
|
-
commandId: CommandId.ZDO_DEV_ANNCE_IND,
|
|
35
|
-
tsn: 0,
|
|
36
|
-
payload: {
|
|
37
|
-
category: undefined,
|
|
38
|
-
zdoClusterId: Zdo.ClusterId.END_DEVICE_ANNOUNCE,
|
|
39
|
-
zdo: [
|
|
40
|
-
Zdo.Status.SUCCESS,
|
|
41
|
-
{
|
|
42
|
-
nwkAddress: 0xda0c,
|
|
43
|
-
eui64: "0x70b3d52b60023660",
|
|
44
|
-
capabilities: Zdo.Utils.getMacCapFlags(0x8e),
|
|
45
|
-
} as ZdoTypes.EndDeviceAnnounce,
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
} as ZBOSSFrame);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("NODE_DESCRIPTOR_RESPONSE", () => {
|
|
52
|
-
expect(readZBOSSFrame(Buffer.from("000104021100000000000000000000432c0000003412", "hex"))).toStrictEqual({
|
|
53
|
-
version: 0,
|
|
54
|
-
type: FrameType.RESPONSE,
|
|
55
|
-
commandId: CommandId.ZDO_NODE_DESC_REQ,
|
|
56
|
-
tsn: 17,
|
|
57
|
-
payload: {
|
|
58
|
-
category: 0,
|
|
59
|
-
zdoClusterId: Zdo.ClusterId.NODE_DESCRIPTOR_RESPONSE,
|
|
60
|
-
zdo: [
|
|
61
|
-
Zdo.Status.SUCCESS,
|
|
62
|
-
{
|
|
63
|
-
nwkAddress: 0x1234,
|
|
64
|
-
logicalType: 0,
|
|
65
|
-
fragmentationSupported: undefined,
|
|
66
|
-
apsFlags: 0,
|
|
67
|
-
frequencyBand: 0,
|
|
68
|
-
capabilities: {
|
|
69
|
-
alternatePANCoordinator: 0,
|
|
70
|
-
deviceType: 0,
|
|
71
|
-
powerSource: 0,
|
|
72
|
-
rxOnWhenIdle: 0,
|
|
73
|
-
reserved1: 0,
|
|
74
|
-
reserved2: 0,
|
|
75
|
-
securityCapability: 0,
|
|
76
|
-
allocateAddress: 0,
|
|
77
|
-
},
|
|
78
|
-
manufacturerCode: 0,
|
|
79
|
-
maxBufSize: 0,
|
|
80
|
-
maxIncTxSize: 0,
|
|
81
|
-
serverMask: Zdo.Utils.getServerMask(0x2c43),
|
|
82
|
-
maxOutTxSize: 0,
|
|
83
|
-
deprecated1: 0,
|
|
84
|
-
tlvs: [],
|
|
85
|
-
} as ZdoTypes.NodeDescriptorResponse,
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
} as ZBOSSFrame);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("POWER_DESCRIPTOR_RESPONSE", () => {
|
|
92
|
-
expect(readZBOSSFrame(Buffer.from("0001030211000001023412", "hex"))).toStrictEqual({
|
|
93
|
-
version: 0,
|
|
94
|
-
type: FrameType.RESPONSE,
|
|
95
|
-
commandId: CommandId.ZDO_POWER_DESC_REQ,
|
|
96
|
-
tsn: 17,
|
|
97
|
-
payload: {
|
|
98
|
-
category: 0,
|
|
99
|
-
zdoClusterId: Zdo.ClusterId.POWER_DESCRIPTOR_RESPONSE,
|
|
100
|
-
zdo: [
|
|
101
|
-
Zdo.Status.SUCCESS,
|
|
102
|
-
{
|
|
103
|
-
nwkAddress: 0x1234,
|
|
104
|
-
currentPowerMode: 1,
|
|
105
|
-
availPowerSources: 0,
|
|
106
|
-
currentPowerSource: 2,
|
|
107
|
-
currentPowerSourceLevel: 0,
|
|
108
|
-
} as ZdoTypes.PowerDescriptorResponse,
|
|
109
|
-
],
|
|
110
|
-
},
|
|
111
|
-
} as ZBOSSFrame);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it("MATCH_DESCRIPTORS_RESPONSE", () => {
|
|
115
|
-
expect(readZBOSSFrame(Buffer.from("0001070211000002f2013412", "hex"))).toStrictEqual({
|
|
116
|
-
version: 0,
|
|
117
|
-
type: FrameType.RESPONSE,
|
|
118
|
-
commandId: CommandId.ZDO_MATCH_DESC_REQ,
|
|
119
|
-
tsn: 17,
|
|
120
|
-
payload: {
|
|
121
|
-
category: 0,
|
|
122
|
-
zdoClusterId: Zdo.ClusterId.MATCH_DESCRIPTORS_RESPONSE,
|
|
123
|
-
zdo: [
|
|
124
|
-
Zdo.Status.SUCCESS,
|
|
125
|
-
{
|
|
126
|
-
nwkAddress: 0x1234,
|
|
127
|
-
endpointList: [242, 1],
|
|
128
|
-
} as ZdoTypes.MatchDescriptorsResponse,
|
|
129
|
-
],
|
|
130
|
-
},
|
|
131
|
-
} as ZBOSSFrame);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it("ACTIVE_ENDPOINTS_RESPONSE", () => {
|
|
135
|
-
expect(readZBOSSFrame(Buffer.from("0001060211000002f2013412", "hex"))).toStrictEqual({
|
|
136
|
-
version: 0,
|
|
137
|
-
type: FrameType.RESPONSE,
|
|
138
|
-
commandId: CommandId.ZDO_ACTIVE_EP_REQ,
|
|
139
|
-
tsn: 17,
|
|
140
|
-
payload: {
|
|
141
|
-
category: 0,
|
|
142
|
-
zdoClusterId: Zdo.ClusterId.ACTIVE_ENDPOINTS_RESPONSE,
|
|
143
|
-
zdo: [
|
|
144
|
-
Zdo.Status.SUCCESS,
|
|
145
|
-
{
|
|
146
|
-
nwkAddress: 0x1234,
|
|
147
|
-
endpointList: [242, 1],
|
|
148
|
-
} as ZdoTypes.ActiveEndpointsResponse,
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
} as ZBOSSFrame);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it("SIMPLE_DESCRIPTOR_RESPONSE", () => {
|
|
155
|
-
expect(readZBOSSFrame(Buffer.from("0001050211000001040100000301022c2ffefebcbc3412", "hex"))).toStrictEqual({
|
|
156
|
-
version: 0,
|
|
157
|
-
type: FrameType.RESPONSE,
|
|
158
|
-
commandId: CommandId.ZDO_SIMPLE_DESC_REQ,
|
|
159
|
-
tsn: 17,
|
|
160
|
-
payload: {
|
|
161
|
-
category: 0,
|
|
162
|
-
zdoClusterId: Zdo.ClusterId.SIMPLE_DESCRIPTOR_RESPONSE,
|
|
163
|
-
zdo: [
|
|
164
|
-
Zdo.Status.SUCCESS,
|
|
165
|
-
{
|
|
166
|
-
nwkAddress: 0x1234,
|
|
167
|
-
length: 14,
|
|
168
|
-
endpoint: 1,
|
|
169
|
-
profileId: 0x0104,
|
|
170
|
-
deviceId: 0x0000,
|
|
171
|
-
deviceVersion: 3,
|
|
172
|
-
inClusterList: [0x2f2c],
|
|
173
|
-
outClusterList: [0xfefe, 0xbcbc],
|
|
174
|
-
} as ZdoTypes.SimpleDescriptorResponse,
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
} as ZBOSSFrame);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {beforeAll, describe, expect, it, vi} from "vitest";
|
|
2
|
-
import * as Zdo from "../../../src/zspec/zdo";
|
|
3
|
-
|
|
4
|
-
describe("ZiGate Patch BuffaloZdo to use BE variants when writing", () => {
|
|
5
|
-
let BuffaloZdo: typeof Zdo.Buffalo;
|
|
6
|
-
|
|
7
|
-
beforeAll(async () => {
|
|
8
|
-
vi.resetModules();
|
|
9
|
-
|
|
10
|
-
const buf = await import("../../../src/zspec/zdo/buffaloZdo.js");
|
|
11
|
-
BuffaloZdo = buf.BuffaloZdo;
|
|
12
|
-
const {ZiGateAdapter} = await import("../../../src/adapter/zigate/adapter/zigateAdapter.js");
|
|
13
|
-
// @ts-expect-error bogus, just need to trigger constructor
|
|
14
|
-
new ZiGateAdapter({}, {}, "", {});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("writeUInt16", () => {
|
|
18
|
-
expect(BuffaloZdo.buildRequest(false, Zdo.ClusterId.IEEE_ADDRESS_REQUEST, 0x1234, false, 0)).toStrictEqual(
|
|
19
|
-
Buffer.from([0x12, 0x34, 0x00, 0x00]),
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
// ensure regular parsing OK
|
|
23
|
-
expect(Zdo.Buffalo.buildRequest(false, Zdo.ClusterId.IEEE_ADDRESS_REQUEST, 0x1234, false, 0)).toStrictEqual(
|
|
24
|
-
Buffer.from([0x34, 0x12, 0x00, 0x00]),
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("writeUInt32", () => {
|
|
29
|
-
expect(BuffaloZdo.buildRequest(false, Zdo.ClusterId.NWK_UPDATE_REQUEST, [15], 0xfe, undefined, undefined, undefined)).toStrictEqual(
|
|
30
|
-
Buffer.from([0x00, 0x00, 0x80, 0x00, 0xfe]),
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
// ensure regular parsing OK
|
|
34
|
-
expect(Zdo.Buffalo.buildRequest(false, Zdo.ClusterId.NWK_UPDATE_REQUEST, [15], 0xfe, undefined, undefined, undefined)).toStrictEqual(
|
|
35
|
-
Buffer.from([0x00, 0x80, 0x00, 0x00, 0xfe]),
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("readUInt16 + readUInt32 - LE", () => {
|
|
40
|
-
expect(
|
|
41
|
-
BuffaloZdo.readResponse(
|
|
42
|
-
true,
|
|
43
|
-
Zdo.ClusterId.NWK_UPDATE_RESPONSE,
|
|
44
|
-
Buffer.from([0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x12, 0x34, 0x00, 0x01, 0x01, 0x12]),
|
|
45
|
-
),
|
|
46
|
-
).toStrictEqual(
|
|
47
|
-
Zdo.Buffalo.readResponse(
|
|
48
|
-
true,
|
|
49
|
-
Zdo.ClusterId.NWK_UPDATE_RESPONSE,
|
|
50
|
-
Buffer.from([0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x12, 0x34, 0x00, 0x01, 0x01, 0x12]),
|
|
51
|
-
),
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("writeIeeeAddr", () => {
|
|
56
|
-
expect(BuffaloZdo.buildRequest(false, Zdo.ClusterId.NETWORK_ADDRESS_REQUEST, "0x1122334455667788", false, 0)).toStrictEqual(
|
|
57
|
-
Buffer.from([0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x00, 0x00]),
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
// ensure regular parsing OK
|
|
61
|
-
expect(Zdo.Buffalo.buildRequest(false, Zdo.ClusterId.NETWORK_ADDRESS_REQUEST, "0x1122334455667788", false, 0)).toStrictEqual(
|
|
62
|
-
Buffer.from([0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00, 0x00]),
|
|
63
|
-
);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("readIeeeAddr - LE", () => {
|
|
67
|
-
expect(
|
|
68
|
-
BuffaloZdo.readResponse(
|
|
69
|
-
true,
|
|
70
|
-
Zdo.ClusterId.IEEE_ADDRESS_RESPONSE,
|
|
71
|
-
Buffer.from([0x01, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x12, 0x34]),
|
|
72
|
-
),
|
|
73
|
-
).toStrictEqual(
|
|
74
|
-
Zdo.Buffalo.readResponse(
|
|
75
|
-
true,
|
|
76
|
-
Zdo.ClusterId.IEEE_ADDRESS_RESPONSE,
|
|
77
|
-
Buffer.from([0x01, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x12, 0x34]),
|
|
78
|
-
),
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import type {MockInstance} from "vitest";
|
|
2
|
-
import {beforeEach, describe, expect, it, vi} from "vitest";
|
|
3
|
-
import {ZiGateAdapter} from "../../../src/adapter/zigate/adapter/zigateAdapter";
|
|
4
|
-
import {BLANK_EUI64} from "../../../src/zspec";
|
|
5
|
-
import * as Zdo from "../../../src/zspec/zdo";
|
|
6
|
-
|
|
7
|
-
describe("ZiGate ZDO payloads", () => {
|
|
8
|
-
let adapter: ZiGateAdapter;
|
|
9
|
-
let requestZdoSpy: MockInstance;
|
|
10
|
-
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
adapter = new ZiGateAdapter({panID: 0, channelList: [11]}, {}, "tmp.db.backup", {disableLED: false});
|
|
13
|
-
requestZdoSpy = vi
|
|
14
|
-
.spyOn(
|
|
15
|
-
// @ts-expect-error private
|
|
16
|
-
adapter.driver,
|
|
17
|
-
"requestZdo",
|
|
18
|
-
)
|
|
19
|
-
.mockResolvedValue(true);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("ZiGateCommandCode.ManagementLQI", () => {
|
|
23
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.ManagementLQI, {
|
|
24
|
-
// targetAddress: 0x1122,
|
|
25
|
-
// startIndex: 0,
|
|
26
|
-
// });
|
|
27
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
28
|
-
// 112200
|
|
29
|
-
const clusterId = Zdo.ClusterId.LQI_TABLE_REQUEST;
|
|
30
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, 0);
|
|
31
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
32
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("112200", "hex"));
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("ZiGateCommandCode.LeaveRequest", () => {
|
|
36
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.LeaveRequest, {
|
|
37
|
-
// extendedAddress: '0x1122334455667788',
|
|
38
|
-
// rejoin: 0,
|
|
39
|
-
// removeChildren: 0,
|
|
40
|
-
// });
|
|
41
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
42
|
-
// 11223344556677880000
|
|
43
|
-
const clusterId = Zdo.ClusterId.LEAVE_REQUEST;
|
|
44
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, "0x1122334455667788", Zdo.LeaveRequestFlags.WITHOUT_REJOIN);
|
|
45
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
46
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("11223344556677880000", "hex"));
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("ZiGateCommandCode.PermitJoin", () => {
|
|
50
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.PermitJoin, {
|
|
51
|
-
// targetShortAddress: 0x1122,
|
|
52
|
-
// interval: 254,
|
|
53
|
-
// TCsignificance: 1,
|
|
54
|
-
// });
|
|
55
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
56
|
-
// 1122fe01
|
|
57
|
-
const clusterId = Zdo.ClusterId.PERMIT_JOINING_REQUEST;
|
|
58
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, 254, 1, []);
|
|
59
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
60
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("1122fe01", "hex"));
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it("ZiGateCommandCode.NodeDescriptor", () => {
|
|
64
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.NodeDescriptor, {
|
|
65
|
-
// targetShortAddress: 0x1122,
|
|
66
|
-
// });
|
|
67
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
68
|
-
// 1122
|
|
69
|
-
const clusterId = Zdo.ClusterId.NODE_DESCRIPTOR_REQUEST;
|
|
70
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, 0x1122);
|
|
71
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
72
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("1122", "hex"));
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("ZiGateCommandCode.ActiveEndpoint", () => {
|
|
76
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.ActiveEndpoint, {
|
|
77
|
-
// targetShortAddress: 0x1122,
|
|
78
|
-
// });
|
|
79
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
80
|
-
// 1122
|
|
81
|
-
const clusterId = Zdo.ClusterId.ACTIVE_ENDPOINTS_REQUEST;
|
|
82
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, 0x1122);
|
|
83
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
84
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("1122", "hex"));
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("ZiGateCommandCode.SimpleDescriptor", () => {
|
|
88
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.SimpleDescriptor, {
|
|
89
|
-
// targetShortAddress: 0x1122,
|
|
90
|
-
// endpoint: 3,
|
|
91
|
-
// });
|
|
92
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
93
|
-
// 112203
|
|
94
|
-
const clusterId = Zdo.ClusterId.SIMPLE_DESCRIPTOR_REQUEST;
|
|
95
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, 0x1122, 3);
|
|
96
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
97
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("112203", "hex"));
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("ZiGateCommandCode.Bind - UNICAST", () => {
|
|
101
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.Bind, {
|
|
102
|
-
// targetExtendedAddress: '0x1122334455667788',
|
|
103
|
-
// targetEndpoint: 5,
|
|
104
|
-
// clusterID: 0x4567,
|
|
105
|
-
// destinationAddressMode: Zdo.UNICAST_BINDING,
|
|
106
|
-
// destinationAddress: '0x9911882277336644',
|
|
107
|
-
// destinationEndpoint: 3,
|
|
108
|
-
// });
|
|
109
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
110
|
-
// 112233445566778805456703991188227733664403
|
|
111
|
-
const clusterId = Zdo.ClusterId.BIND_REQUEST;
|
|
112
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(
|
|
113
|
-
false,
|
|
114
|
-
clusterId,
|
|
115
|
-
"0x1122334455667788",
|
|
116
|
-
5,
|
|
117
|
-
0x4567,
|
|
118
|
-
Zdo.UNICAST_BINDING,
|
|
119
|
-
"0x9911882277336644",
|
|
120
|
-
0,
|
|
121
|
-
3,
|
|
122
|
-
);
|
|
123
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
124
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("112233445566778805456703991188227733664403", "hex"));
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it("ZiGateCommandCode.Bind - MULTICAST", () => {
|
|
128
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.Bind, {
|
|
129
|
-
// targetExtendedAddress: '0x1122334455667788',
|
|
130
|
-
// targetEndpoint: 5,
|
|
131
|
-
// clusterID: 0x4567,
|
|
132
|
-
// destinationAddressMode: Zdo.MULTICAST_BINDING,
|
|
133
|
-
// destinationAddress: 0x3456,
|
|
134
|
-
// destinationEndpoint: 0,
|
|
135
|
-
// });
|
|
136
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
137
|
-
// 112233445566778805456701345600
|
|
138
|
-
const clusterId = Zdo.ClusterId.BIND_REQUEST;
|
|
139
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, "0x1122334455667788", 5, 0x4567, Zdo.MULTICAST_BINDING, BLANK_EUI64, 0x3456, 0);
|
|
140
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
141
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("112233445566778805456701345600", "hex"));
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("ZiGateCommandCode.UnBind - UNICAST", () => {
|
|
145
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.UnBind, {
|
|
146
|
-
// targetExtendedAddress: '0x1122334455667788',
|
|
147
|
-
// targetEndpoint: 5,
|
|
148
|
-
// clusterID: 0x4567,
|
|
149
|
-
// destinationAddressMode: Zdo.UNICAST_BINDING,
|
|
150
|
-
// destinationAddress: '0x9911882277336644',
|
|
151
|
-
// destinationEndpoint: 3,
|
|
152
|
-
// });
|
|
153
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
154
|
-
// 112233445566778805456703991188227733664403
|
|
155
|
-
const clusterId = Zdo.ClusterId.UNBIND_REQUEST;
|
|
156
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(
|
|
157
|
-
false,
|
|
158
|
-
clusterId,
|
|
159
|
-
"0x1122334455667788",
|
|
160
|
-
5,
|
|
161
|
-
0x4567,
|
|
162
|
-
Zdo.UNICAST_BINDING,
|
|
163
|
-
"0x9911882277336644",
|
|
164
|
-
0,
|
|
165
|
-
3,
|
|
166
|
-
);
|
|
167
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
168
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("112233445566778805456703991188227733664403", "hex"));
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it("ZiGateCommandCode.UnBind - MULTICAST", () => {
|
|
172
|
-
// const ziPayload = ZiGateObject.createRequest(ZiGateCommandCode.UnBind, {
|
|
173
|
-
// targetExtendedAddress: '0x1122334455667788',
|
|
174
|
-
// targetEndpoint: 5,
|
|
175
|
-
// clusterID: 0x4567,
|
|
176
|
-
// destinationAddressMode: Zdo.MULTICAST_BINDING,
|
|
177
|
-
// destinationAddress: 0x3456,
|
|
178
|
-
// destinationEndpoint: 0,
|
|
179
|
-
// });
|
|
180
|
-
// console.log(ziPayload.toZiGateFrame().msgPayloadBytes.toString('hex'));
|
|
181
|
-
// 112233445566778805456701345600
|
|
182
|
-
const clusterId = Zdo.ClusterId.UNBIND_REQUEST;
|
|
183
|
-
const zdoPayload = Zdo.Buffalo.buildRequest(false, clusterId, "0x1122334455667788", 5, 0x4567, Zdo.MULTICAST_BINDING, BLANK_EUI64, 0x3456, 0);
|
|
184
|
-
adapter.sendZdo("0x1122334455667788", 0x1122, clusterId, zdoPayload, true);
|
|
185
|
-
expect(requestZdoSpy).toHaveBeenCalledWith(clusterId, Buffer.from("112233445566778805456701345600", "hex"));
|
|
186
|
-
});
|
|
187
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {describe, expect, it} from "vitest";
|
|
2
|
-
import {bigUInt64ToBufferBE, bigUInt64ToBufferLE, bigUInt64ToHexBE} from "../../../src/adapter/zoh/adapter/utils";
|
|
3
|
-
|
|
4
|
-
describe("ZoH Utils", () => {
|
|
5
|
-
it("handles bigint conversions", () => {
|
|
6
|
-
const v10x = "0x90395efffec7fd21";
|
|
7
|
-
const v1Buf = Buffer.from([0x21, 0xfd, 0xc7, 0xfe, 0xff, 0x5e, 0x39, 0x90]);
|
|
8
|
-
const v1BigInt = 10392442068718320929n;
|
|
9
|
-
|
|
10
|
-
const v20x = "0x9986ffbb4523acef";
|
|
11
|
-
const v2Buf = Buffer.from([0xef, 0xac, 0x23, 0x45, 0xbb, 0xff, 0x86, 0x99]);
|
|
12
|
-
const v2BigInt = 11062810714466135279n;
|
|
13
|
-
|
|
14
|
-
const v30x = "0x0322334455667788";
|
|
15
|
-
const v3Buf = Buffer.from([0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x03]);
|
|
16
|
-
const v3BigInt = 225799299905517448n;
|
|
17
|
-
|
|
18
|
-
expect(bigUInt64ToHexBE(v1BigInt)).toStrictEqual(v10x.slice(2));
|
|
19
|
-
expect(bigUInt64ToBufferLE(v1BigInt)).toStrictEqual(v1Buf);
|
|
20
|
-
expect(bigUInt64ToBufferBE(v1BigInt)).toStrictEqual(Buffer.from(v1Buf).reverse());
|
|
21
|
-
expect(BigInt(v10x)).toStrictEqual(v1BigInt);
|
|
22
|
-
expect(v1Buf.readBigUInt64LE(0)).toStrictEqual(v1BigInt);
|
|
23
|
-
|
|
24
|
-
expect(bigUInt64ToHexBE(v2BigInt)).toStrictEqual(v20x.slice(2));
|
|
25
|
-
expect(bigUInt64ToBufferLE(v2BigInt)).toStrictEqual(v2Buf);
|
|
26
|
-
expect(bigUInt64ToBufferBE(v2BigInt)).toStrictEqual(Buffer.from(v2Buf).reverse());
|
|
27
|
-
expect(BigInt(v20x)).toStrictEqual(v2BigInt);
|
|
28
|
-
expect(v2Buf.readBigUInt64LE(0)).toStrictEqual(v2BigInt);
|
|
29
|
-
|
|
30
|
-
expect(bigUInt64ToHexBE(v3BigInt)).toStrictEqual(v30x.slice(2));
|
|
31
|
-
expect(bigUInt64ToBufferLE(v3BigInt)).toStrictEqual(v3Buf);
|
|
32
|
-
expect(bigUInt64ToBufferBE(v3BigInt)).toStrictEqual(Buffer.from(v3Buf).reverse());
|
|
33
|
-
expect(BigInt(v30x)).toStrictEqual(v3BigInt);
|
|
34
|
-
expect(v3Buf.readBigUInt64LE(0)).toStrictEqual(v3BigInt);
|
|
35
|
-
});
|
|
36
|
-
});
|