@zwave-js/nvmedit 14.0.0-beta.4 → 14.0.0
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/build/cjs/lib/nvm3/files/ApplicationCCsFile.js +105 -58
- package/build/cjs/lib/nvm3/files/ApplicationCCsFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationDataFile.js +69 -22
- package/build/cjs/lib/nvm3/files/ApplicationDataFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationNameFile.js +71 -24
- package/build/cjs/lib/nvm3/files/ApplicationNameFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js +140 -93
- package/build/cjs/lib/nvm3/files/ApplicationRFConfigFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js +92 -45
- package/build/cjs/lib/nvm3/files/ApplicationTypeFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ControllerInfoFile.js +176 -129
- package/build/cjs/lib/nvm3/files/ControllerInfoFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/NVMFile.d.ts +3 -3
- package/build/cjs/lib/nvm3/files/NVMFile.js.map +1 -1
- package/build/cjs/lib/nvm3/files/NodeInfoFiles.js +186 -111
- package/build/cjs/lib/nvm3/files/NodeInfoFiles.js.map +2 -2
- package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js +243 -84
- package/build/cjs/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +2 -2
- package/build/cjs/lib/nvm3/files/RouteCacheFiles.js +143 -82
- package/build/cjs/lib/nvm3/files/RouteCacheFiles.js.map +2 -2
- package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js +134 -73
- package/build/cjs/lib/nvm3/files/SUCUpdateEntriesFile.js.map +2 -2
- package/build/cjs/lib/nvm3/files/VersionFiles.js +98 -23
- package/build/cjs/lib/nvm3/files/VersionFiles.js.map +2 -2
- package/build/esm/lib/nvm3/files/ApplicationCCsFile.js +106 -66
- package/build/esm/lib/nvm3/files/ApplicationCCsFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationDataFile.js +63 -23
- package/build/esm/lib/nvm3/files/ApplicationDataFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationNameFile.js +66 -26
- package/build/esm/lib/nvm3/files/ApplicationNameFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js +137 -97
- package/build/esm/lib/nvm3/files/ApplicationRFConfigFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ApplicationTypeFile.js +87 -47
- package/build/esm/lib/nvm3/files/ApplicationTypeFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/ControllerInfoFile.js +172 -132
- package/build/esm/lib/nvm3/files/ControllerInfoFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/NVMFile.d.ts +3 -3
- package/build/esm/lib/nvm3/files/NVMFile.d.ts.map +1 -1
- package/build/esm/lib/nvm3/files/NodeInfoFiles.js +191 -127
- package/build/esm/lib/nvm3/files/NodeInfoFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js +221 -85
- package/build/esm/lib/nvm3/files/ProtocolNodeMaskFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/RouteCacheFiles.js +143 -91
- package/build/esm/lib/nvm3/files/RouteCacheFiles.js.map +1 -1
- package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js +126 -74
- package/build/esm/lib/nvm3/files/SUCUpdateEntriesFile.js.map +1 -1
- package/build/esm/lib/nvm3/files/VersionFiles.js +87 -23
- package/build/esm/lib/nvm3/files/VersionFiles.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,114 +1,154 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
35
|
import { NodeIDType, RFRegion, ZWaveError, ZWaveErrorCodes, } from "@zwave-js/core/safe";
|
|
8
36
|
import { Bytes, getEnumMemberName, } from "@zwave-js/shared/safe";
|
|
9
37
|
import semver from "semver";
|
|
10
38
|
import { NVMFile, gotDeserializationOptions, nvmFileID, nvmSection, } from "./NVMFile.js";
|
|
11
39
|
export const ApplicationRFConfigFileID = 104;
|
|
12
|
-
let ApplicationRFConfigFile =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
let ApplicationRFConfigFile = (() => {
|
|
41
|
+
let _classDecorators = [nvmFileID(ApplicationRFConfigFileID), nvmSection("application")];
|
|
42
|
+
let _classDescriptor;
|
|
43
|
+
let _classExtraInitializers = [];
|
|
44
|
+
let _classThis;
|
|
45
|
+
let _classSuper = NVMFile;
|
|
46
|
+
var ApplicationRFConfigFile = class extends _classSuper {
|
|
47
|
+
static { _classThis = this; }
|
|
48
|
+
static {
|
|
49
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
50
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
51
|
+
ApplicationRFConfigFile = _classThis = _classDescriptor.value;
|
|
52
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
53
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
54
|
+
}
|
|
55
|
+
constructor(options) {
|
|
56
|
+
super(options);
|
|
57
|
+
if (gotDeserializationOptions(options)) {
|
|
58
|
+
if (this.payload.length === 3 || this.payload.length === 6) {
|
|
59
|
+
this.rfRegion = this.payload[0];
|
|
60
|
+
this.txPower = this.payload.readInt8(1) / 10;
|
|
61
|
+
this.measured0dBm = this.payload.readInt8(2) / 10;
|
|
62
|
+
if (this.payload.length === 6) {
|
|
63
|
+
this.enablePTI = this.payload[3];
|
|
64
|
+
this.maxTXPower = this.payload.readInt16LE(4) / 10;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (this.payload.length === 8) {
|
|
68
|
+
this.rfRegion = this.payload[0];
|
|
69
|
+
this.txPower = this.payload.readInt16LE(1) / 10;
|
|
70
|
+
this.measured0dBm = this.payload.readInt16LE(3) / 10;
|
|
71
|
+
this.enablePTI = this.payload[5];
|
|
72
|
+
this.maxTXPower = this.payload.readInt16LE(6) / 10;
|
|
23
73
|
}
|
|
74
|
+
else if (this.payload.length === 9) {
|
|
75
|
+
this.rfRegion = this.payload[0];
|
|
76
|
+
this.txPower = this.payload.readInt16LE(1) / 10;
|
|
77
|
+
this.measured0dBm = this.payload.readInt16LE(3) / 10;
|
|
78
|
+
this.enablePTI = this.payload[5];
|
|
79
|
+
this.maxTXPower = this.payload.readInt16LE(6) / 10;
|
|
80
|
+
this.nodeIdType = this.payload[8];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
throw new ZWaveError(`ApplicationRFConfigFile has unsupported length ${this.payload.length}`, ZWaveErrorCodes.NVM_NotSupported);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.rfRegion = options.rfRegion;
|
|
88
|
+
this.txPower = options.txPower;
|
|
89
|
+
this.measured0dBm = options.measured0dBm;
|
|
90
|
+
this.enablePTI = options.enablePTI;
|
|
91
|
+
this.maxTXPower = options.maxTXPower;
|
|
92
|
+
this.nodeIdType = options.nodeIdType;
|
|
24
93
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
94
|
+
}
|
|
95
|
+
rfRegion;
|
|
96
|
+
txPower;
|
|
97
|
+
measured0dBm;
|
|
98
|
+
enablePTI;
|
|
99
|
+
maxTXPower;
|
|
100
|
+
nodeIdType;
|
|
101
|
+
serialize() {
|
|
102
|
+
if (semver.lt(this.fileVersion, "7.18.1")) {
|
|
103
|
+
this.payload = new Bytes(semver.gte(this.fileVersion, "7.15.3") ? 6 : 3).fill(0);
|
|
104
|
+
this.payload[0] = this.rfRegion;
|
|
105
|
+
this.payload.writeIntLE(this.txPower * 10, 1, 1);
|
|
106
|
+
this.payload.writeIntLE(this.measured0dBm * 10, 2, 1);
|
|
107
|
+
if (semver.gte(this.fileVersion, "7.15.3")) {
|
|
108
|
+
this.payload[3] = this.enablePTI ?? 0;
|
|
109
|
+
this.payload.writeInt16LE((this.maxTXPower ?? 0) * 10, 4);
|
|
110
|
+
}
|
|
31
111
|
}
|
|
32
|
-
else if (this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
112
|
+
else if (semver.lt(this.fileVersion, "7.21.0")) {
|
|
113
|
+
this.payload = new Bytes(8).fill(0);
|
|
114
|
+
this.payload[0] = this.rfRegion;
|
|
115
|
+
this.payload.writeInt16LE(this.txPower * 10, 1);
|
|
116
|
+
this.payload.writeInt16LE(this.measured0dBm * 10, 3);
|
|
117
|
+
this.payload[5] = this.enablePTI ?? 0;
|
|
118
|
+
this.payload.writeInt16LE((this.maxTXPower ?? 0) * 10, 6);
|
|
39
119
|
}
|
|
40
120
|
else {
|
|
41
|
-
|
|
121
|
+
this.payload = new Bytes(9).fill(0);
|
|
122
|
+
this.payload[0] = this.rfRegion;
|
|
123
|
+
this.payload.writeInt16LE(this.txPower * 10, 1);
|
|
124
|
+
this.payload.writeInt16LE(this.measured0dBm * 10, 3);
|
|
125
|
+
this.payload[5] = this.enablePTI ?? 0;
|
|
126
|
+
this.payload.writeInt16LE((this.maxTXPower ?? 0) * 10, 6);
|
|
127
|
+
this.payload[8] = this.nodeIdType ?? NodeIDType.Short;
|
|
42
128
|
}
|
|
129
|
+
return super.serialize();
|
|
43
130
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
txPower;
|
|
55
|
-
measured0dBm;
|
|
56
|
-
enablePTI;
|
|
57
|
-
maxTXPower;
|
|
58
|
-
nodeIdType;
|
|
59
|
-
serialize() {
|
|
60
|
-
if (semver.lt(this.fileVersion, "7.18.1")) {
|
|
61
|
-
this.payload = new Bytes(semver.gte(this.fileVersion, "7.15.3") ? 6 : 3).fill(0);
|
|
62
|
-
this.payload[0] = this.rfRegion;
|
|
63
|
-
this.payload.writeIntLE(this.txPower * 10, 1, 1);
|
|
64
|
-
this.payload.writeIntLE(this.measured0dBm * 10, 2, 1);
|
|
65
|
-
if (semver.gte(this.fileVersion, "7.15.3")) {
|
|
66
|
-
this.payload[3] = this.enablePTI ?? 0;
|
|
67
|
-
this.payload.writeInt16LE((this.maxTXPower ?? 0) * 10, 4);
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
132
|
+
toJSON() {
|
|
133
|
+
const ret = {
|
|
134
|
+
...super.toJSON(),
|
|
135
|
+
"RF Region": getEnumMemberName(RFRegion, this.rfRegion),
|
|
136
|
+
"TX Power": `${this.txPower.toFixed(1)} dBm`,
|
|
137
|
+
"Power @ 0dBm": `${this.measured0dBm.toFixed(1)} dBm`,
|
|
138
|
+
};
|
|
139
|
+
if (this.enablePTI != undefined) {
|
|
140
|
+
ret["enable PTI"] = this.enablePTI;
|
|
68
141
|
}
|
|
142
|
+
if (this.maxTXPower != undefined) {
|
|
143
|
+
ret["max TX power"] = `${this.maxTXPower.toFixed(1)} dBm`;
|
|
144
|
+
}
|
|
145
|
+
if (this.nodeIdType != undefined) {
|
|
146
|
+
ret["node ID type"] = getEnumMemberName(NodeIDType, this.nodeIdType);
|
|
147
|
+
}
|
|
148
|
+
return ret;
|
|
69
149
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.payload.writeInt16LE(this.txPower * 10, 1);
|
|
74
|
-
this.payload.writeInt16LE(this.measured0dBm * 10, 3);
|
|
75
|
-
this.payload[5] = this.enablePTI ?? 0;
|
|
76
|
-
this.payload.writeInt16LE((this.maxTXPower ?? 0) * 10, 6);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.payload = new Bytes(9).fill(0);
|
|
80
|
-
this.payload[0] = this.rfRegion;
|
|
81
|
-
this.payload.writeInt16LE(this.txPower * 10, 1);
|
|
82
|
-
this.payload.writeInt16LE(this.measured0dBm * 10, 3);
|
|
83
|
-
this.payload[5] = this.enablePTI ?? 0;
|
|
84
|
-
this.payload.writeInt16LE((this.maxTXPower ?? 0) * 10, 6);
|
|
85
|
-
this.payload[8] = this.nodeIdType ?? NodeIDType.Short;
|
|
86
|
-
}
|
|
87
|
-
return super.serialize();
|
|
88
|
-
}
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
90
|
-
toJSON() {
|
|
91
|
-
const ret = {
|
|
92
|
-
...super.toJSON(),
|
|
93
|
-
"RF Region": getEnumMemberName(RFRegion, this.rfRegion),
|
|
94
|
-
"TX Power": `${this.txPower.toFixed(1)} dBm`,
|
|
95
|
-
"Power @ 0dBm": `${this.measured0dBm.toFixed(1)} dBm`,
|
|
96
|
-
};
|
|
97
|
-
if (this.enablePTI != undefined) {
|
|
98
|
-
ret["enable PTI"] = this.enablePTI;
|
|
99
|
-
}
|
|
100
|
-
if (this.maxTXPower != undefined) {
|
|
101
|
-
ret["max TX power"] = `${this.maxTXPower.toFixed(1)} dBm`;
|
|
102
|
-
}
|
|
103
|
-
if (this.nodeIdType != undefined) {
|
|
104
|
-
ret["node ID type"] = getEnumMemberName(NodeIDType, this.nodeIdType);
|
|
105
|
-
}
|
|
106
|
-
return ret;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
ApplicationRFConfigFile = __decorate([
|
|
110
|
-
nvmFileID(ApplicationRFConfigFileID),
|
|
111
|
-
nvmSection("application")
|
|
112
|
-
], ApplicationRFConfigFile);
|
|
150
|
+
};
|
|
151
|
+
return ApplicationRFConfigFile = _classThis;
|
|
152
|
+
})();
|
|
113
153
|
export { ApplicationRFConfigFile };
|
|
114
154
|
//# sourceMappingURL=ApplicationRFConfigFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationRFConfigFile.js","sourceRoot":"","sources":["../../../../../src/lib/nvm3/files/ApplicationRFConfigFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApplicationRFConfigFile.js","sourceRoot":"","sources":["../../../../../src/lib/nvm3/files/ApplicationRFConfigFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,eAAe,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,EACL,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EACN,OAAO,EAGP,yBAAyB,EACzB,SAAS,EACT,UAAU,GACV,MAAM,cAAc,CAAC;AAiBtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;IAIhC,uBAAuB;4BAFnC,SAAS,CAAC,yBAAyB,CAAC,EACpC,UAAU,CAAC,aAAa,CAAC;;;;sBACmB,OAAO;uCAAf,SAAQ,WAAO;;;;YAApD,6KAuGC;;;YAvGY,uDAAuB;;QACnC,YACC,OAAuE;YAEvE,KAAK,CAAC,OAAO,CAAC,CAAC;YACf,IAAI,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;gBACxC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAA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Y,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;aACrD,CAAC;YACF,IAAI,IAAI,CAAC,SAAS,IAAI,SAAS,EAAE,CAAC;gBACjC,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;YACpC,CAAC;YACD,IAAI,IAAI,CAAC,UAAU,IAAI,SAAS,EAAE,CAAC;gBAClC,GAAG,CAAC,cAAc,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3D,CAAC;YACD,IAAI,IAAI,CAAC,UAAU,IAAI,SAAS,EAAE,CAAC;gBAClC,GAAG,CAAC,cAAc,CAAC,GAAG,iBAAiB,CACtC,UAAU,EACV,IAAI,CAAC,UAAU,CACf,CAAC;YACH,CAAC;YACD,OAAO,GAAG,CAAC;QACZ,CAAC;;;;SAtGW,uBAAuB"}
|
|
@@ -1,55 +1,95 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
35
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
8
36
|
import { NVMFile, gotDeserializationOptions, nvmFileID, nvmSection, } from "./NVMFile.js";
|
|
9
37
|
export const ApplicationTypeFileID = 102;
|
|
10
|
-
let ApplicationTypeFile =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
38
|
+
let ApplicationTypeFile = (() => {
|
|
39
|
+
let _classDecorators = [nvmFileID(ApplicationTypeFileID), nvmSection("application")];
|
|
40
|
+
let _classDescriptor;
|
|
41
|
+
let _classExtraInitializers = [];
|
|
42
|
+
let _classThis;
|
|
43
|
+
let _classSuper = NVMFile;
|
|
44
|
+
var ApplicationTypeFile = class extends _classSuper {
|
|
45
|
+
static { _classThis = this; }
|
|
46
|
+
static {
|
|
47
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
48
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
49
|
+
ApplicationTypeFile = _classThis = _classDescriptor.value;
|
|
50
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
51
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
18
52
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
53
|
+
constructor(options) {
|
|
54
|
+
super(options);
|
|
55
|
+
if (gotDeserializationOptions(options)) {
|
|
56
|
+
this.isListening = !!(this.payload[0] & 0b1);
|
|
57
|
+
this.optionalFunctionality = !!(this.payload[0] & 0b10);
|
|
58
|
+
this.genericDeviceClass = this.payload[1];
|
|
59
|
+
this.specificDeviceClass = this.payload[2];
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.isListening = options.isListening;
|
|
63
|
+
this.optionalFunctionality = options.optionalFunctionality;
|
|
64
|
+
this.genericDeviceClass = options.genericDeviceClass;
|
|
65
|
+
this.specificDeviceClass = options.specificDeviceClass;
|
|
66
|
+
}
|
|
24
67
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
nvmFileID(ApplicationTypeFileID),
|
|
52
|
-
nvmSection("application")
|
|
53
|
-
], ApplicationTypeFile);
|
|
68
|
+
isListening;
|
|
69
|
+
optionalFunctionality;
|
|
70
|
+
genericDeviceClass;
|
|
71
|
+
specificDeviceClass;
|
|
72
|
+
serialize() {
|
|
73
|
+
this.payload = Bytes.from([
|
|
74
|
+
(this.isListening ? 0b1 : 0)
|
|
75
|
+
| (this.optionalFunctionality ? 0b10 : 0),
|
|
76
|
+
this.genericDeviceClass,
|
|
77
|
+
this.specificDeviceClass,
|
|
78
|
+
]);
|
|
79
|
+
return super.serialize();
|
|
80
|
+
}
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
82
|
+
toJSON() {
|
|
83
|
+
return {
|
|
84
|
+
...super.toJSON(),
|
|
85
|
+
listening: this.isListening,
|
|
86
|
+
"opt. functionality": this.optionalFunctionality,
|
|
87
|
+
genericDeviceClass: this.genericDeviceClass,
|
|
88
|
+
specificDeviceClass: this.specificDeviceClass,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
return ApplicationTypeFile = _classThis;
|
|
93
|
+
})();
|
|
54
94
|
export { ApplicationTypeFile };
|
|
55
95
|
//# sourceMappingURL=ApplicationTypeFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationTypeFile.js","sourceRoot":"","sources":["../../../../../src/lib/nvm3/files/ApplicationTypeFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApplicationTypeFile.js","sourceRoot":"","sources":["../../../../../src/lib/nvm3/files/ApplicationTypeFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EACN,OAAO,EAGP,yBAAyB,EACzB,SAAS,EACT,UAAU,GACV,MAAM,cAAc,CAAC;AAStB,MA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