zwave-js 8.8.3 → 8.9.0-beta.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/CommandClass.js +1 -0
- package/build/CommandClass.js.map +1 -1
- package/build/Controller.d.ts +1 -0
- package/build/Controller.d.ts.map +1 -1
- package/build/Controller.js +4 -1
- package/build/Controller.js.map +1 -1
- package/build/Node.d.ts +1 -1
- package/build/Node.d.ts.map +1 -1
- package/build/Node.js.map +1 -1
- package/build/Utils.d.ts +1 -0
- package/build/Utils.d.ts.map +1 -1
- package/build/Utils.js +7 -1
- package/build/Utils.js.map +1 -1
- package/build/lib/commandclass/API.d.ts +17 -4
- package/build/lib/commandclass/API.d.ts.map +1 -1
- package/build/lib/commandclass/API.js +50 -0
- package/build/lib/commandclass/API.js.map +1 -1
- package/build/lib/commandclass/CommandClass.d.ts +0 -6
- package/build/lib/commandclass/CommandClass.d.ts.map +1 -1
- package/build/lib/commandclass/CommandClass.js +0 -12
- package/build/lib/commandclass/CommandClass.js.map +1 -1
- package/build/lib/commandclass/DoorLockLoggingCC.d.ts +91 -0
- package/build/lib/commandclass/DoorLockLoggingCC.d.ts.map +1 -0
- package/build/lib/commandclass/DoorLockLoggingCC.js +320 -0
- package/build/lib/commandclass/DoorLockLoggingCC.js.map +1 -0
- package/build/lib/commandclass/Security2CC.d.ts +1 -10
- package/build/lib/commandclass/Security2CC.d.ts.map +1 -1
- package/build/lib/commandclass/Security2CC.js +16 -49
- package/build/lib/commandclass/Security2CC.js.map +1 -1
- package/build/lib/commandclass/SecurityCC.d.ts +4 -9
- package/build/lib/commandclass/SecurityCC.d.ts.map +1 -1
- package/build/lib/commandclass/SecurityCC.js +39 -71
- package/build/lib/commandclass/SecurityCC.js.map +1 -1
- package/build/lib/commandclass/SupervisionCC.js +2 -2
- package/build/lib/commandclass/SupervisionCC.js.map +1 -1
- package/build/lib/commandclass/index.d.ts +1 -0
- package/build/lib/commandclass/index.d.ts.map +1 -1
- package/build/lib/commandclass/index.js +15 -7
- package/build/lib/commandclass/index.js.map +1 -1
- package/build/lib/controller/BridgeApplicationCommandRequest.d.ts +2 -6
- package/build/lib/controller/BridgeApplicationCommandRequest.d.ts.map +1 -1
- package/build/lib/controller/BridgeApplicationCommandRequest.js +9 -19
- package/build/lib/controller/BridgeApplicationCommandRequest.js.map +1 -1
- package/build/lib/controller/Controller.d.ts +12 -1
- package/build/lib/controller/Controller.d.ts.map +1 -1
- package/build/lib/controller/Controller.js +13 -6
- package/build/lib/controller/Controller.js.map +1 -1
- package/build/lib/controller/SendDataBridgeMessages.d.ts +5 -3
- package/build/lib/controller/SendDataBridgeMessages.d.ts.map +1 -1
- package/build/lib/controller/SendDataBridgeMessages.js +21 -8
- package/build/lib/controller/SendDataBridgeMessages.js.map +1 -1
- package/build/lib/controller/SendDataMessages.d.ts +5 -3
- package/build/lib/controller/SendDataMessages.d.ts.map +1 -1
- package/build/lib/controller/SendDataMessages.js +21 -9
- package/build/lib/controller/SendDataMessages.js.map +1 -1
- package/build/lib/controller/SendDataShared.d.ts +72 -2
- package/build/lib/controller/SendDataShared.d.ts.map +1 -1
- package/build/lib/controller/SendDataShared.js +195 -1
- package/build/lib/controller/SendDataShared.js.map +1 -1
- package/build/lib/driver/CommandQueueMachine.d.ts +7 -3
- package/build/lib/driver/CommandQueueMachine.d.ts.map +1 -1
- package/build/lib/driver/CommandQueueMachine.js +66 -29
- package/build/lib/driver/CommandQueueMachine.js.map +1 -1
- package/build/lib/driver/Driver.d.ts +15 -10
- package/build/lib/driver/Driver.d.ts.map +1 -1
- package/build/lib/driver/Driver.js +160 -125
- package/build/lib/driver/Driver.js.map +1 -1
- package/build/lib/driver/MessageGenerators.d.ts +26 -0
- package/build/lib/driver/MessageGenerators.d.ts.map +1 -0
- package/build/lib/driver/MessageGenerators.js +246 -0
- package/build/lib/driver/MessageGenerators.js.map +1 -0
- package/build/lib/driver/SendThreadMachine.d.ts +24 -53
- package/build/lib/driver/SendThreadMachine.d.ts.map +1 -1
- package/build/lib/driver/SendThreadMachine.js +161 -619
- package/build/lib/driver/SendThreadMachine.js.map +1 -1
- package/build/lib/driver/StateMachineShared.d.ts +2 -0
- package/build/lib/driver/StateMachineShared.d.ts.map +1 -1
- package/build/lib/driver/StateMachineShared.js +21 -10
- package/build/lib/driver/StateMachineShared.js.map +1 -1
- package/build/lib/driver/Transaction.d.ts +35 -3
- package/build/lib/driver/Transaction.d.ts.map +1 -1
- package/build/lib/driver/Transaction.js +20 -15
- package/build/lib/driver/Transaction.js.map +1 -1
- package/build/lib/driver/TransactionMachine.d.ts +30 -0
- package/build/lib/driver/TransactionMachine.d.ts.map +1 -0
- package/build/lib/driver/TransactionMachine.js +247 -0
- package/build/lib/driver/TransactionMachine.js.map +1 -0
- package/build/lib/driver/ZWaveOptions.d.ts +0 -2
- package/build/lib/driver/ZWaveOptions.d.ts.map +1 -1
- package/build/lib/message/Constants.d.ts +6 -6
- package/build/lib/message/Constants.d.ts.map +1 -1
- package/build/lib/message/Constants.js +12 -14
- package/build/lib/message/Constants.js.map +1 -1
- package/build/lib/message/Message.d.ts +5 -1
- package/build/lib/message/Message.d.ts.map +1 -1
- package/build/lib/message/Message.js +11 -0
- package/build/lib/message/Message.js.map +1 -1
- package/build/lib/node/HealthCheck.d.ts +8 -0
- package/build/lib/node/HealthCheck.d.ts.map +1 -0
- package/build/lib/node/HealthCheck.js +83 -0
- package/build/lib/node/HealthCheck.js.map +1 -0
- package/build/lib/node/Node.d.ts +10 -2
- package/build/lib/node/Node.d.ts.map +1 -1
- package/build/lib/node/Node.js +278 -6
- package/build/lib/node/Node.js.map +1 -1
- package/build/lib/node/Types.d.ts +125 -1
- package/build/lib/node/Types.d.ts.map +1 -1
- package/build/lib/node/Types.js.map +1 -1
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.d.ts +14 -0
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.d.ts.map +1 -0
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.js +46 -0
- package/build/lib/serialapi/misc/GetBackgroundRSSIMessages.js.map +1 -0
- package/package.json +15 -15
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Maybe, MessageOrCCLogEntry } from "@zwave-js/core";
|
|
3
|
+
import type { Driver } from "../driver/Driver";
|
|
4
|
+
import { PhysicalCCAPI } from "./API";
|
|
5
|
+
import { CCCommandOptions, CommandClass, CommandClassDeserializationOptions } from "./CommandClass";
|
|
6
|
+
export declare enum DoorLockLoggingCommand {
|
|
7
|
+
RecordsSupportedGet = 1,
|
|
8
|
+
RecordsSupportedReport = 2,
|
|
9
|
+
RecordGet = 3,
|
|
10
|
+
RecordReport = 4
|
|
11
|
+
}
|
|
12
|
+
export declare enum EventType {
|
|
13
|
+
LockCode = 1,
|
|
14
|
+
UnlockCode = 2,
|
|
15
|
+
LockButton = 3,
|
|
16
|
+
UnlockButton = 4,
|
|
17
|
+
LockCodeOutOfSchedule = 5,
|
|
18
|
+
UnlockCodeOutOfSchedule = 6,
|
|
19
|
+
IllegalCode = 7,
|
|
20
|
+
LockManual = 8,
|
|
21
|
+
UnlockManual = 9,
|
|
22
|
+
LockAuto = 10,
|
|
23
|
+
UnlockAuto = 11,
|
|
24
|
+
LockRemoteCode = 12,
|
|
25
|
+
UnlockRemoteCode = 13,
|
|
26
|
+
LockRemote = 14,
|
|
27
|
+
UnlockRemote = 15,
|
|
28
|
+
LockRemoteCodeOutOfSchedule = 16,
|
|
29
|
+
UnlockRemoteCodeOutOfSchedule = 17,
|
|
30
|
+
RemoteIllegalCode = 18,
|
|
31
|
+
LockManual2 = 19,
|
|
32
|
+
UnlockManual2 = 20,
|
|
33
|
+
LockSecured = 21,
|
|
34
|
+
LockUnsecured = 22,
|
|
35
|
+
UserCodeAdded = 23,
|
|
36
|
+
UserCodeDeleted = 24,
|
|
37
|
+
AllUserCodesDeleted = 25,
|
|
38
|
+
MasterCodeChanged = 26,
|
|
39
|
+
UserCodeChanged = 27,
|
|
40
|
+
LockReset = 28,
|
|
41
|
+
ConfigurationChanged = 29,
|
|
42
|
+
LowBattery = 30,
|
|
43
|
+
NewBattery = 31,
|
|
44
|
+
Unknown = 32
|
|
45
|
+
}
|
|
46
|
+
export interface DoorLockLoggingRecord {
|
|
47
|
+
timestamp: string;
|
|
48
|
+
eventType: EventType;
|
|
49
|
+
label: string;
|
|
50
|
+
userId?: number;
|
|
51
|
+
userCode?: string | Buffer;
|
|
52
|
+
}
|
|
53
|
+
export declare enum RecordStatus {
|
|
54
|
+
Empty = 0,
|
|
55
|
+
HoldsLegalData = 1
|
|
56
|
+
}
|
|
57
|
+
export declare class DoorLockLoggingCCAPI extends PhysicalCCAPI {
|
|
58
|
+
supportsCommand(cmd: DoorLockLoggingCommand): Maybe<boolean>;
|
|
59
|
+
getRecordsCount(): Promise<number | undefined>;
|
|
60
|
+
/** Retrieves the specified audit record. Defaults to the latest one. */
|
|
61
|
+
getRecord(recordNumber?: number): Promise<DoorLockLoggingRecord | undefined>;
|
|
62
|
+
}
|
|
63
|
+
export declare class DoorLockLoggingCC extends CommandClass {
|
|
64
|
+
ccCommand: DoorLockLoggingCommand;
|
|
65
|
+
interview(): Promise<void>;
|
|
66
|
+
refreshValues(): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export declare class DoorLockLoggingCCRecordsSupportedReport extends DoorLockLoggingCC {
|
|
69
|
+
constructor(driver: Driver, options: CommandClassDeserializationOptions);
|
|
70
|
+
readonly recordsCount: number;
|
|
71
|
+
toLogEntry(): MessageOrCCLogEntry;
|
|
72
|
+
}
|
|
73
|
+
export declare class DoorLockLoggingCCRecordsSupportedGet extends DoorLockLoggingCC {
|
|
74
|
+
}
|
|
75
|
+
export declare class DoorLockLoggingCCRecordReport extends DoorLockLoggingCC {
|
|
76
|
+
constructor(driver: Driver, options: CommandClassDeserializationOptions);
|
|
77
|
+
readonly recordNumber: number;
|
|
78
|
+
readonly record?: DoorLockLoggingRecord;
|
|
79
|
+
toLogEntry(): MessageOrCCLogEntry;
|
|
80
|
+
}
|
|
81
|
+
interface DoorLockLoggingCCRecordGetOptions extends CCCommandOptions {
|
|
82
|
+
recordNumber: number;
|
|
83
|
+
}
|
|
84
|
+
export declare class DoorLockLoggingCCRecordGet extends DoorLockLoggingCC {
|
|
85
|
+
constructor(driver: Driver, options: CommandClassDeserializationOptions | DoorLockLoggingCCRecordGetOptions);
|
|
86
|
+
recordNumber: number;
|
|
87
|
+
serialize(): Buffer;
|
|
88
|
+
toLogEntry(): MessageOrCCLogEntry;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=DoorLockLoggingCC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoorLockLoggingCC.d.ts","sourceRoot":"","sources":["../../../src/lib/commandclass/DoorLockLoggingCC.ts"],"names":[],"mappings":";AAAA,OAAO,EAEN,KAAK,EACL,mBAAmB,EAKnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAGN,gBAAgB,EAEhB,YAAY,EAEZ,kCAAkC,EAIlC,MAAM,gBAAgB,CAAC;AAuBxB,oBAAY,sBAAsB;IACjC,mBAAmB,IAAO;IAC1B,sBAAsB,IAAO;IAC7B,SAAS,IAAO;IAChB,YAAY,IAAO;CACnB;AAGD,oBAAY,SAAS;IACpB,QAAQ,IAAO;IACf,UAAU,IAAO;IACjB,UAAU,IAAO;IACjB,YAAY,IAAO;IACnB,qBAAqB,IAAO;IAC5B,uBAAuB,IAAO;IAC9B,WAAW,IAAO;IAClB,UAAU,IAAO;IACjB,YAAY,IAAO;IACnB,QAAQ,KAAO;IACf,UAAU,KAAO;IACjB,cAAc,KAAO;IACrB,gBAAgB,KAAO;IACvB,UAAU,KAAO;IACjB,YAAY,KAAO;IACnB,2BAA2B,KA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B,SAAQ,iBAAiB;gBAElE,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kCAAkC;IA+C5C,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAExC,UAAU,IAAI,mBAAmB;CA4BxC;AAED,UAAU,iCAAkC,SAAQ,gBAAgB;IACnE,YAAY,EAAE,MAAM,CAAC;CACrB;AAYD,qBAKa,0BAA2B,SAAQ,iBAAiB;gBAE/D,MAAM,EAAE,MAAM,EACd,OAAO,EACJ,kCAAkC,GAClC,iCAAiC;IAa9B,YAAY,EAAE,MAAM,CAAC;IAErB,SAAS,IAAI,MAAM;IAKnB,UAAU,IAAI,mBAAmB;CAMxC"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DoorLockLoggingCCRecordGet = exports.DoorLockLoggingCCRecordReport = exports.DoorLockLoggingCCRecordsSupportedGet = exports.DoorLockLoggingCCRecordsSupportedReport = exports.DoorLockLoggingCC = exports.DoorLockLoggingCCAPI = exports.RecordStatus = exports.EventType = exports.DoorLockLoggingCommand = void 0;
|
|
10
|
+
const core_1 = require("@zwave-js/core");
|
|
11
|
+
const shared_1 = require("@zwave-js/shared");
|
|
12
|
+
const Constants_1 = require("../message/Constants");
|
|
13
|
+
const API_1 = require("./API");
|
|
14
|
+
const CommandClass_1 = require("./CommandClass");
|
|
15
|
+
function segmentsToDate(segments) {
|
|
16
|
+
return new Date(segments.year, segments.month - 1, // JS months are 0-based.
|
|
17
|
+
segments.day, segments.hour, segments.minute, segments.second);
|
|
18
|
+
}
|
|
19
|
+
// All the supported commands
|
|
20
|
+
var DoorLockLoggingCommand;
|
|
21
|
+
(function (DoorLockLoggingCommand) {
|
|
22
|
+
DoorLockLoggingCommand[DoorLockLoggingCommand["RecordsSupportedGet"] = 1] = "RecordsSupportedGet";
|
|
23
|
+
DoorLockLoggingCommand[DoorLockLoggingCommand["RecordsSupportedReport"] = 2] = "RecordsSupportedReport";
|
|
24
|
+
DoorLockLoggingCommand[DoorLockLoggingCommand["RecordGet"] = 3] = "RecordGet";
|
|
25
|
+
DoorLockLoggingCommand[DoorLockLoggingCommand["RecordReport"] = 4] = "RecordReport";
|
|
26
|
+
})(DoorLockLoggingCommand = exports.DoorLockLoggingCommand || (exports.DoorLockLoggingCommand = {}));
|
|
27
|
+
// @publicAPI
|
|
28
|
+
var EventType;
|
|
29
|
+
(function (EventType) {
|
|
30
|
+
EventType[EventType["LockCode"] = 1] = "LockCode";
|
|
31
|
+
EventType[EventType["UnlockCode"] = 2] = "UnlockCode";
|
|
32
|
+
EventType[EventType["LockButton"] = 3] = "LockButton";
|
|
33
|
+
EventType[EventType["UnlockButton"] = 4] = "UnlockButton";
|
|
34
|
+
EventType[EventType["LockCodeOutOfSchedule"] = 5] = "LockCodeOutOfSchedule";
|
|
35
|
+
EventType[EventType["UnlockCodeOutOfSchedule"] = 6] = "UnlockCodeOutOfSchedule";
|
|
36
|
+
EventType[EventType["IllegalCode"] = 7] = "IllegalCode";
|
|
37
|
+
EventType[EventType["LockManual"] = 8] = "LockManual";
|
|
38
|
+
EventType[EventType["UnlockManual"] = 9] = "UnlockManual";
|
|
39
|
+
EventType[EventType["LockAuto"] = 10] = "LockAuto";
|
|
40
|
+
EventType[EventType["UnlockAuto"] = 11] = "UnlockAuto";
|
|
41
|
+
EventType[EventType["LockRemoteCode"] = 12] = "LockRemoteCode";
|
|
42
|
+
EventType[EventType["UnlockRemoteCode"] = 13] = "UnlockRemoteCode";
|
|
43
|
+
EventType[EventType["LockRemote"] = 14] = "LockRemote";
|
|
44
|
+
EventType[EventType["UnlockRemote"] = 15] = "UnlockRemote";
|
|
45
|
+
EventType[EventType["LockRemoteCodeOutOfSchedule"] = 16] = "LockRemoteCodeOutOfSchedule";
|
|
46
|
+
EventType[EventType["UnlockRemoteCodeOutOfSchedule"] = 17] = "UnlockRemoteCodeOutOfSchedule";
|
|
47
|
+
EventType[EventType["RemoteIllegalCode"] = 18] = "RemoteIllegalCode";
|
|
48
|
+
EventType[EventType["LockManual2"] = 19] = "LockManual2";
|
|
49
|
+
EventType[EventType["UnlockManual2"] = 20] = "UnlockManual2";
|
|
50
|
+
EventType[EventType["LockSecured"] = 21] = "LockSecured";
|
|
51
|
+
EventType[EventType["LockUnsecured"] = 22] = "LockUnsecured";
|
|
52
|
+
EventType[EventType["UserCodeAdded"] = 23] = "UserCodeAdded";
|
|
53
|
+
EventType[EventType["UserCodeDeleted"] = 24] = "UserCodeDeleted";
|
|
54
|
+
EventType[EventType["AllUserCodesDeleted"] = 25] = "AllUserCodesDeleted";
|
|
55
|
+
EventType[EventType["MasterCodeChanged"] = 26] = "MasterCodeChanged";
|
|
56
|
+
EventType[EventType["UserCodeChanged"] = 27] = "UserCodeChanged";
|
|
57
|
+
EventType[EventType["LockReset"] = 28] = "LockReset";
|
|
58
|
+
EventType[EventType["ConfigurationChanged"] = 29] = "ConfigurationChanged";
|
|
59
|
+
EventType[EventType["LowBattery"] = 30] = "LowBattery";
|
|
60
|
+
EventType[EventType["NewBattery"] = 31] = "NewBattery";
|
|
61
|
+
EventType[EventType["Unknown"] = 32] = "Unknown";
|
|
62
|
+
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
63
|
+
const eventTypeLabel = {
|
|
64
|
+
LockCode: "Locked via Access Code",
|
|
65
|
+
UnlockCode: "Unlocked via Access Code",
|
|
66
|
+
LockButton: "Locked via Lock Button",
|
|
67
|
+
UnlockButton: "Unlocked via Unlock Button",
|
|
68
|
+
LockCodeOutOfSchedule: "Out of Schedule Lock Attempt via Access Code",
|
|
69
|
+
UnlockCodeOutOfSchedule: "Out of Schedule Unlock Attempt via Access Code",
|
|
70
|
+
IllegalCode: "Illegal Access Code Entered",
|
|
71
|
+
LockManual: "Manually Locked",
|
|
72
|
+
UnlockManual: "Manually Unlocked",
|
|
73
|
+
LockAuto: "Auto Locked",
|
|
74
|
+
UnlockAuto: "Auto Unlocked",
|
|
75
|
+
LockRemoteCode: "Locked via Remote Access Code",
|
|
76
|
+
UnlockRemoteCode: "Unlocked via Remote Access Code",
|
|
77
|
+
LockRemote: "Locked via Remote",
|
|
78
|
+
UnlockRemote: "Unlocked via Remote",
|
|
79
|
+
LockRemoteCodeOutOfSchedule: "Out of Schedule Lock Attempt via Remote Access Code",
|
|
80
|
+
UnlockRemoteCodeOutOfSchedule: "Out of Schedule Unlock Attempt via Remote Access Code",
|
|
81
|
+
RemoteIllegalCode: "Illegal Remote Access Code",
|
|
82
|
+
LockManual2: "Manually Locked (2)",
|
|
83
|
+
UnlockManual2: "Manually Unlocked (2)",
|
|
84
|
+
LockSecured: "Lock Secured",
|
|
85
|
+
LockUnsecured: "Lock Unsecured",
|
|
86
|
+
UserCodeAdded: "User Code Added",
|
|
87
|
+
UserCodeDeleted: "User Code Deleted",
|
|
88
|
+
AllUserCodesDeleted: "All User Codes Deleted",
|
|
89
|
+
MasterCodeChanged: "Master Code Changed",
|
|
90
|
+
UserCodeChanged: "User Code Changed",
|
|
91
|
+
LockReset: "Lock Reset",
|
|
92
|
+
ConfigurationChanged: "Configuration Changed",
|
|
93
|
+
LowBattery: "Low Battery",
|
|
94
|
+
NewBattery: "New Battery Installed",
|
|
95
|
+
Unknown: "Unknown",
|
|
96
|
+
};
|
|
97
|
+
const LATEST_RECORD_NUMBER_KEY = 0;
|
|
98
|
+
// @publicAPI
|
|
99
|
+
var RecordStatus;
|
|
100
|
+
(function (RecordStatus) {
|
|
101
|
+
RecordStatus[RecordStatus["Empty"] = 0] = "Empty";
|
|
102
|
+
RecordStatus[RecordStatus["HoldsLegalData"] = 1] = "HoldsLegalData";
|
|
103
|
+
})(RecordStatus = exports.RecordStatus || (exports.RecordStatus = {}));
|
|
104
|
+
let DoorLockLoggingCCAPI = class DoorLockLoggingCCAPI extends API_1.PhysicalCCAPI {
|
|
105
|
+
supportsCommand(cmd) {
|
|
106
|
+
switch (cmd) {
|
|
107
|
+
case DoorLockLoggingCommand.RecordsSupportedGet:
|
|
108
|
+
case DoorLockLoggingCommand.RecordsSupportedReport:
|
|
109
|
+
case DoorLockLoggingCommand.RecordGet:
|
|
110
|
+
case DoorLockLoggingCommand.RecordReport:
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
return super.supportsCommand(cmd);
|
|
114
|
+
}
|
|
115
|
+
async getRecordsCount() {
|
|
116
|
+
this.assertSupportsCommand(DoorLockLoggingCommand, DoorLockLoggingCommand.RecordsSupportedGet);
|
|
117
|
+
const cc = new DoorLockLoggingCCRecordsSupportedGet(this.driver, {
|
|
118
|
+
nodeId: this.endpoint.nodeId,
|
|
119
|
+
endpoint: this.endpoint.index,
|
|
120
|
+
});
|
|
121
|
+
const response = await this.driver.sendCommand(cc, this.commandOptions);
|
|
122
|
+
return response === null || response === void 0 ? void 0 : response.recordsCount;
|
|
123
|
+
}
|
|
124
|
+
/** Retrieves the specified audit record. Defaults to the latest one. */
|
|
125
|
+
async getRecord(recordNumber = LATEST_RECORD_NUMBER_KEY) {
|
|
126
|
+
this.assertSupportsCommand(DoorLockLoggingCommand, DoorLockLoggingCommand.RecordGet);
|
|
127
|
+
const cc = new DoorLockLoggingCCRecordGet(this.driver, {
|
|
128
|
+
nodeId: this.endpoint.nodeId,
|
|
129
|
+
endpoint: this.endpoint.index,
|
|
130
|
+
recordNumber,
|
|
131
|
+
});
|
|
132
|
+
const response = await this.driver.sendCommand(cc, this.commandOptions);
|
|
133
|
+
return response === null || response === void 0 ? void 0 : response.record;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
DoorLockLoggingCCAPI = __decorate([
|
|
137
|
+
(0, CommandClass_1.API)(core_1.CommandClasses["Door Lock Logging"])
|
|
138
|
+
], DoorLockLoggingCCAPI);
|
|
139
|
+
exports.DoorLockLoggingCCAPI = DoorLockLoggingCCAPI;
|
|
140
|
+
let DoorLockLoggingCC = class DoorLockLoggingCC extends CommandClass_1.CommandClass {
|
|
141
|
+
async interview() {
|
|
142
|
+
const node = this.getNode();
|
|
143
|
+
this.driver.controllerLog.logNode(node.id, {
|
|
144
|
+
endpoint: this.endpointIndex,
|
|
145
|
+
message: `Interviewing ${this.ccName}...`,
|
|
146
|
+
direction: "none",
|
|
147
|
+
});
|
|
148
|
+
await this.refreshValues();
|
|
149
|
+
// Remember that the interview is complete
|
|
150
|
+
this.interviewComplete = true;
|
|
151
|
+
}
|
|
152
|
+
async refreshValues() {
|
|
153
|
+
const node = this.getNode();
|
|
154
|
+
const endpoint = this.getEndpoint();
|
|
155
|
+
const api = endpoint.commandClasses["Door Lock Logging"].withOptions({
|
|
156
|
+
priority: Constants_1.MessagePriority.NodeQuery,
|
|
157
|
+
});
|
|
158
|
+
this.driver.controllerLog.logNode(node.id, {
|
|
159
|
+
endpoint: this.endpointIndex,
|
|
160
|
+
message: "querying supported number of records...",
|
|
161
|
+
direction: "outbound",
|
|
162
|
+
});
|
|
163
|
+
const recordsCount = await api.getRecordsCount();
|
|
164
|
+
if (!recordsCount) {
|
|
165
|
+
this.driver.controllerLog.logNode(node.id, {
|
|
166
|
+
endpoint: this.endpointIndex,
|
|
167
|
+
message: "Door Lock Logging records count query timed out, skipping interview...",
|
|
168
|
+
level: "warn",
|
|
169
|
+
});
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const recordsCountLogMessage = `supports ${recordsCount} record${recordsCount === 1 ? "" : "s"}`;
|
|
173
|
+
this.driver.controllerLog.logNode(node.id, {
|
|
174
|
+
endpoint: this.endpointIndex,
|
|
175
|
+
message: recordsCountLogMessage,
|
|
176
|
+
direction: "inbound",
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
DoorLockLoggingCC = __decorate([
|
|
181
|
+
(0, CommandClass_1.commandClass)(core_1.CommandClasses["Door Lock Logging"]),
|
|
182
|
+
(0, CommandClass_1.implementedVersion)(1)
|
|
183
|
+
], DoorLockLoggingCC);
|
|
184
|
+
exports.DoorLockLoggingCC = DoorLockLoggingCC;
|
|
185
|
+
let DoorLockLoggingCCRecordsSupportedReport = class DoorLockLoggingCCRecordsSupportedReport extends DoorLockLoggingCC {
|
|
186
|
+
constructor(driver, options) {
|
|
187
|
+
super(driver, options);
|
|
188
|
+
(0, core_1.validatePayload)(this.payload.length >= 1);
|
|
189
|
+
this.recordsCount = this.payload[0];
|
|
190
|
+
this.persistValues();
|
|
191
|
+
}
|
|
192
|
+
toLogEntry() {
|
|
193
|
+
return {
|
|
194
|
+
...super.toLogEntry(),
|
|
195
|
+
message: {
|
|
196
|
+
"supported no. of records": this.recordsCount,
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, CommandClass_1.ccValue)({ internal: true })
|
|
203
|
+
], DoorLockLoggingCCRecordsSupportedReport.prototype, "recordsCount", void 0);
|
|
204
|
+
DoorLockLoggingCCRecordsSupportedReport = __decorate([
|
|
205
|
+
(0, CommandClass_1.CCCommand)(DoorLockLoggingCommand.RecordsSupportedReport)
|
|
206
|
+
], DoorLockLoggingCCRecordsSupportedReport);
|
|
207
|
+
exports.DoorLockLoggingCCRecordsSupportedReport = DoorLockLoggingCCRecordsSupportedReport;
|
|
208
|
+
function eventTypeToLabel(eventType) {
|
|
209
|
+
var _a;
|
|
210
|
+
return ((_a = eventTypeLabel[EventType[eventType]]) !== null && _a !== void 0 ? _a : `Unknown ${(0, shared_1.num2hex)(eventType)}`);
|
|
211
|
+
}
|
|
212
|
+
let DoorLockLoggingCCRecordsSupportedGet = class DoorLockLoggingCCRecordsSupportedGet extends DoorLockLoggingCC {
|
|
213
|
+
};
|
|
214
|
+
DoorLockLoggingCCRecordsSupportedGet = __decorate([
|
|
215
|
+
(0, CommandClass_1.CCCommand)(DoorLockLoggingCommand.RecordsSupportedGet),
|
|
216
|
+
(0, CommandClass_1.expectedCCResponse)(DoorLockLoggingCCRecordsSupportedReport)
|
|
217
|
+
], DoorLockLoggingCCRecordsSupportedGet);
|
|
218
|
+
exports.DoorLockLoggingCCRecordsSupportedGet = DoorLockLoggingCCRecordsSupportedGet;
|
|
219
|
+
let DoorLockLoggingCCRecordReport = class DoorLockLoggingCCRecordReport extends DoorLockLoggingCC {
|
|
220
|
+
constructor(driver, options) {
|
|
221
|
+
super(driver, options);
|
|
222
|
+
(0, core_1.validatePayload)(this.payload.length >= 11);
|
|
223
|
+
this.recordNumber = this.payload[0];
|
|
224
|
+
const recordStatus = this.payload[5] >>> 5;
|
|
225
|
+
if (recordStatus === RecordStatus.Empty) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
const dateSegments = {
|
|
230
|
+
year: this.payload.readUInt16BE(1),
|
|
231
|
+
month: this.payload[3],
|
|
232
|
+
day: this.payload[4],
|
|
233
|
+
hour: this.payload[5] & 0b11111,
|
|
234
|
+
minute: this.payload[6],
|
|
235
|
+
second: this.payload[7],
|
|
236
|
+
};
|
|
237
|
+
const eventType = this.payload[8];
|
|
238
|
+
const recordUserID = this.payload[9];
|
|
239
|
+
const userCodeLength = this.payload[10];
|
|
240
|
+
(0, core_1.validatePayload)(userCodeLength <= 10, this.payload.length >= 11 + userCodeLength);
|
|
241
|
+
const userCodeBuffer = this.payload.slice(11, 11 + userCodeLength);
|
|
242
|
+
// See User Code CC for a detailed description. We try to parse the code as ASCII if possible
|
|
243
|
+
// and fall back to a buffer otherwise.
|
|
244
|
+
const userCodeString = userCodeBuffer.toString("utf8");
|
|
245
|
+
const userCode = (0, shared_1.isPrintableASCII)(userCodeString)
|
|
246
|
+
? userCodeString
|
|
247
|
+
: userCodeBuffer;
|
|
248
|
+
this.record = {
|
|
249
|
+
eventType: eventType,
|
|
250
|
+
label: eventTypeToLabel(eventType),
|
|
251
|
+
timestamp: segmentsToDate(dateSegments).toISOString(),
|
|
252
|
+
userId: recordUserID,
|
|
253
|
+
userCode,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
toLogEntry() {
|
|
258
|
+
let message;
|
|
259
|
+
if (!this.record) {
|
|
260
|
+
message = {
|
|
261
|
+
"record #": `${this.recordNumber} (empty)`,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
message = {
|
|
266
|
+
"record #": `${this.recordNumber}`,
|
|
267
|
+
"event type": this.record.label,
|
|
268
|
+
timestamp: this.record.timestamp,
|
|
269
|
+
};
|
|
270
|
+
if (this.record.userId) {
|
|
271
|
+
message["user ID"] = this.record.userId;
|
|
272
|
+
}
|
|
273
|
+
if (this.record.userCode) {
|
|
274
|
+
message["user code"] =
|
|
275
|
+
typeof this.record.userCode === "string"
|
|
276
|
+
? this.record.userCode
|
|
277
|
+
: (0, shared_1.buffer2hex)(this.record.userCode);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
...super.toLogEntry(),
|
|
282
|
+
message,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
DoorLockLoggingCCRecordReport = __decorate([
|
|
287
|
+
(0, CommandClass_1.CCCommand)(DoorLockLoggingCommand.RecordReport)
|
|
288
|
+
], DoorLockLoggingCCRecordReport);
|
|
289
|
+
exports.DoorLockLoggingCCRecordReport = DoorLockLoggingCCRecordReport;
|
|
290
|
+
function testResponseForDoorLockLoggingRecordGet(sent, received) {
|
|
291
|
+
return (sent.recordNumber === LATEST_RECORD_NUMBER_KEY ||
|
|
292
|
+
sent.recordNumber === received.recordNumber);
|
|
293
|
+
}
|
|
294
|
+
let DoorLockLoggingCCRecordGet = class DoorLockLoggingCCRecordGet extends DoorLockLoggingCC {
|
|
295
|
+
constructor(driver, options) {
|
|
296
|
+
super(driver, options);
|
|
297
|
+
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
298
|
+
throw new core_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, core_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
this.recordNumber = options.recordNumber;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
serialize() {
|
|
305
|
+
this.payload = Buffer.from([this.recordNumber]);
|
|
306
|
+
return super.serialize();
|
|
307
|
+
}
|
|
308
|
+
toLogEntry() {
|
|
309
|
+
return {
|
|
310
|
+
...super.toLogEntry(),
|
|
311
|
+
message: { "record number": this.recordNumber },
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
DoorLockLoggingCCRecordGet = __decorate([
|
|
316
|
+
(0, CommandClass_1.CCCommand)(DoorLockLoggingCommand.RecordGet),
|
|
317
|
+
(0, CommandClass_1.expectedCCResponse)(DoorLockLoggingCCRecordReport, testResponseForDoorLockLoggingRecordGet)
|
|
318
|
+
], DoorLockLoggingCCRecordGet);
|
|
319
|
+
exports.DoorLockLoggingCCRecordGet = DoorLockLoggingCCRecordGet;
|
|
320
|
+
//# sourceMappingURL=DoorLockLoggingCC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoorLockLoggingCC.js","sourceRoot":"","sources":["../../../src/lib/commandclass/DoorLockLoggingCC.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAQwB;AACxB,6CAAyE;AAEzE,oDAAuD;AACvD,+BAAsC;AACtC,iDAWwB;AAWxB,SAAS,cAAc,CAA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AC;QAChD,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC;IAEM,UAAU;QAChB,OAAO;YACN,GAAG,KAAK,CAAC,UAAU,EAAE;YACrB,OAAO,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,YAAY,EAAE;SAC/C,CAAC;IACH,CAAC;CACD,CAAA;AA/BY,0BAA0B;IALtC,IAAA,wBAAS,EAAC,sBAAsB,CAAC,SAAS,CAAC;IAC3C,IAAA,iCAAkB,EAClB,6BAA6B,EAC7B,uCAAuC,CACvC;GACY,0BAA0B,CA+BtC;AA/BY,gEAA0B"}
|
|
@@ -29,10 +29,6 @@ export declare class Security2CCAPI extends CCAPI {
|
|
|
29
29
|
* The return value indicates whether a nonce was successfully sent
|
|
30
30
|
*/
|
|
31
31
|
sendNonce(): Promise<boolean>;
|
|
32
|
-
/**
|
|
33
|
-
* Requests a nonce from the target node
|
|
34
|
-
*/
|
|
35
|
-
requestNonce(): Promise<void>;
|
|
36
32
|
/**
|
|
37
33
|
* Queries the securely supported commands for the current security class
|
|
38
34
|
* @param securityClass Can be used to overwrite the security class to use. If this doesn't match the current one, new nonces will need to be exchanged.
|
|
@@ -83,16 +79,11 @@ export declare class Security2CCMessageEncapsulation extends Security2CC {
|
|
|
83
79
|
get sequenceNumber(): number;
|
|
84
80
|
encapsulated?: CommandClass;
|
|
85
81
|
extensions: Security2Extension[];
|
|
86
|
-
|
|
87
|
-
/** Indicates whether sending this command was retried after the target node failed to decode it */
|
|
88
|
-
get wasRetriedAfterDecodeFailure(): boolean;
|
|
89
|
-
prepareRetryAfterDecodeFailure(): void;
|
|
82
|
+
unsetSequenceNumber(): void;
|
|
90
83
|
private getDestinationIDTX;
|
|
91
84
|
private getDestinationIDRX;
|
|
92
85
|
/** Returns the Sender's Entropy Input if this command contains an SPAN extension */
|
|
93
86
|
private getSenderEI;
|
|
94
|
-
requiresPreTransmitHandshake(): boolean;
|
|
95
|
-
preTransmitHandshake(): Promise<void>;
|
|
96
87
|
serialize(): Buffer;
|
|
97
88
|
protected computeEncapsulationOverhead(): number;
|
|
98
89
|
toLogEntry(): MessageOrCCLogEntry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Security2CC.d.ts","sourceRoot":"","sources":["../../../src/lib/commandclass/Security2CC.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,cAAc,EAOd,KAAK,EACL,mBAAmB,EAKnB,aAAa,EAGb,gBAAgB,EAMhB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAGN,gBAAgB,EAChB,YAAY,EAEZ,kCAAkC,EAKlC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEN,kBAAkB,EAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAG3E,oBAAY,gBAAgB;IAC3B,QAAQ,IAAO;IACf,WAAW,IAAO;IAClB,oBAAoB,IAAO;IAC3B,MAAM,IAAO;IACb,SAAS,IAAO;IAChB,MAAM,IAAO;IACb,OAAO,IAAO;IACd,eAAe,IAAO;IACtB,aAAa,IAAO;IACpB,gBAAgB,KAAO;IACvB,gBAAgB,KAAO;IACvB,WAAW,KAAO;IAClB,oBAAoB,KAAO;IAC3B,uBAAuB,KAAO;CAC9B;AAqED,qBACa,cAAe,SAAQ,KAAK;IACjC,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC;IAK9D;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IA6D1C
|
|
1
|
+
{"version":3,"file":"Security2CC.d.ts","sourceRoot":"","sources":["../../../src/lib/commandclass/Security2CC.ts"],"names":[],"m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Y,EAAE,aAAa,CAAC;CAC5B;AAED,qBAEa,wBAAyB,SAAQ,WAAW;gBAEvD,MAAM,EAAE,MAAM,EACd,OAAO,EACJ,kCAAkC,GAClC,+BAA+B;IAW5B,YAAY,EAAE,aAAa,CAAC;IAE5B,SAAS,IAAI,MAAM;IAKnB,UAAU,IAAI,mBAAmB;CAWxC;AAED,qBACa,2BAA4B,SAAQ,WAAW;CAAG;AAE/D,UAAU,6BAA8B,SAAQ,gBAAgB;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;CAC5B;AAED,qBACa,sBAAuB,SAAQ,WAAW;gBAErD,MAAM,EAAE,MAAM,EACd,OAAO,EACJ,kCAAkC,GAClC,6BAA6B;IAa1B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAE5B,SAAS,IAAI,MAAM;IAOnB,UAAU,IAAI,mBAAmB;CASxC;AAED,qBACa,kCAAmC,SAAQ,WAAW;gBAEjE,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kCAAkC;IAY5C,SAAgB,YAAY,EAAE,cAAc,EAAE,CAAC;IAExC,UAAU,IAAI,mBAAmB;CAWxC;AAED,qBAEa,+BAAgC,SAAQ,WAAW;CAAG"}
|
|
@@ -109,7 +109,7 @@ let Security2CCAPI = class Security2CCAPI extends API_1.CCAPI {
|
|
|
109
109
|
await this.driver.sendMessage(msg, {
|
|
110
110
|
...this.commandOptions,
|
|
111
111
|
// Nonce requests must be handled immediately
|
|
112
|
-
priority: Constants_1.MessagePriority.
|
|
112
|
+
priority: Constants_1.MessagePriority.Nonce,
|
|
113
113
|
// We don't want failures causing us to treat the node as asleep or dead
|
|
114
114
|
changeNodeStatusOnMissingACK: false,
|
|
115
115
|
});
|
|
@@ -127,29 +127,6 @@ let Security2CCAPI = class Security2CCAPI extends API_1.CCAPI {
|
|
|
127
127
|
}
|
|
128
128
|
return true;
|
|
129
129
|
}
|
|
130
|
-
/**
|
|
131
|
-
* Requests a nonce from the target node
|
|
132
|
-
*/
|
|
133
|
-
async requestNonce() {
|
|
134
|
-
this.assertSupportsCommand(Security2Command, Security2Command.NonceGet);
|
|
135
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
136
|
-
if (!this.driver.securityManager2) {
|
|
137
|
-
throw new core_1.ZWaveError(`Nonces can only be sent if secure communication is set up!`, core_1.ZWaveErrorCodes.Driver_NoSecurity);
|
|
138
|
-
}
|
|
139
|
-
const cc = new Security2CCNonceGet(this.driver, {
|
|
140
|
-
nodeId: this.endpoint.nodeId,
|
|
141
|
-
endpoint: this.endpoint.index,
|
|
142
|
-
});
|
|
143
|
-
await this.driver.sendCommand(cc, {
|
|
144
|
-
...this.commandOptions,
|
|
145
|
-
priority: Constants_1.MessagePriority.PreTransmitHandshake,
|
|
146
|
-
// Only try getting a nonce once
|
|
147
|
-
maxSendAttempts: 1,
|
|
148
|
-
// We don't want failures causing us to treat the node as asleep or dead
|
|
149
|
-
// The "real" transaction will do that for us
|
|
150
|
-
changeNodeStatusOnMissingACK: false,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
130
|
/**
|
|
154
131
|
* Queries the securely supported commands for the current security class
|
|
155
132
|
* @param securityClass Can be used to overwrite the security class to use. If this doesn't match the current one, new nonces will need to be exchanged.
|
|
@@ -423,17 +400,28 @@ Security2CC = Security2CC_1 = __decorate([
|
|
|
423
400
|
(0, CommandClass_1.implementedVersion)(1)
|
|
424
401
|
], Security2CC);
|
|
425
402
|
exports.Security2CC = Security2CC;
|
|
403
|
+
// An S2 encapsulated command may result in a NonceReport to be sent by the node if it couldn't decrypt the message
|
|
426
404
|
function getCCResponseForMessageEncapsulation(sent) {
|
|
427
405
|
var _a;
|
|
428
406
|
if ((_a = sent.encapsulated) === null || _a === void 0 ? void 0 : _a.expectsCCResponse()) {
|
|
429
|
-
return
|
|
407
|
+
return [
|
|
408
|
+
Security2CCMessageEncapsulation,
|
|
409
|
+
Security2CCNonceReport,
|
|
410
|
+
];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function testCCResponseForMessageEncapsulation(sent, received) {
|
|
414
|
+
if (received instanceof Security2CCMessageEncapsulation) {
|
|
415
|
+
return "checkEncapsulated";
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
return received.SOS && !!received.receiverEI;
|
|
430
419
|
}
|
|
431
420
|
}
|
|
432
421
|
let Security2CCMessageEncapsulation = class Security2CCMessageEncapsulation extends Security2CC {
|
|
433
422
|
constructor(driver, options) {
|
|
434
423
|
var _a;
|
|
435
424
|
super(driver, options);
|
|
436
|
-
this._wasRetriedAfterDecodeFailure = false;
|
|
437
425
|
// Make sure that we can send/receive secure commands
|
|
438
426
|
assertSecurity.call(this, options);
|
|
439
427
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -603,15 +591,7 @@ let Security2CCMessageEncapsulation = class Security2CCMessageEncapsulation exte
|
|
|
603
591
|
}
|
|
604
592
|
return this._sequenceNumber;
|
|
605
593
|
}
|
|
606
|
-
|
|
607
|
-
get wasRetriedAfterDecodeFailure() {
|
|
608
|
-
return this._wasRetriedAfterDecodeFailure;
|
|
609
|
-
}
|
|
610
|
-
prepareRetryAfterDecodeFailure() {
|
|
611
|
-
if (this._wasRetriedAfterDecodeFailure) {
|
|
612
|
-
throw new core_1.ZWaveError(`S2 encapsulated messages may only be retried once after the target failed to decode them!`, core_1.ZWaveErrorCodes.Controller_MessageDropped);
|
|
613
|
-
}
|
|
614
|
-
this._wasRetriedAfterDecodeFailure = true;
|
|
594
|
+
unsetSequenceNumber() {
|
|
615
595
|
this._sequenceNumber = undefined;
|
|
616
596
|
}
|
|
617
597
|
getDestinationIDTX() {
|
|
@@ -633,19 +613,6 @@ let Security2CCMessageEncapsulation = class Security2CCMessageEncapsulation exte
|
|
|
633
613
|
const spanExtension = this.extensions.find((e) => e instanceof Extension_1.SPANExtension);
|
|
634
614
|
return spanExtension === null || spanExtension === void 0 ? void 0 : spanExtension.senderEI;
|
|
635
615
|
}
|
|
636
|
-
requiresPreTransmitHandshake() {
|
|
637
|
-
// We need the receiver's EI to be able to send an encrypted command
|
|
638
|
-
const secMan = this.driver.securityManager2;
|
|
639
|
-
const peerNodeId = this.nodeId;
|
|
640
|
-
const spanState = secMan.getSPANState(peerNodeId);
|
|
641
|
-
return (spanState.type === core_1.SPANState.None ||
|
|
642
|
-
spanState.type === core_1.SPANState.LocalEI);
|
|
643
|
-
}
|
|
644
|
-
async preTransmitHandshake() {
|
|
645
|
-
// Request a nonce
|
|
646
|
-
return this.getNode().commandClasses["Security 2"].requestNonce();
|
|
647
|
-
// Yeah, that's it :)
|
|
648
|
-
}
|
|
649
616
|
serialize() {
|
|
650
617
|
var _a, _b, _c;
|
|
651
618
|
// TODO: Support Multicast
|
|
@@ -747,7 +714,7 @@ let Security2CCMessageEncapsulation = class Security2CCMessageEncapsulation exte
|
|
|
747
714
|
};
|
|
748
715
|
Security2CCMessageEncapsulation = __decorate([
|
|
749
716
|
(0, CommandClass_1.CCCommand)(Security2Command.MessageEncapsulation),
|
|
750
|
-
(0, CommandClass_1.expectedCCResponse)(getCCResponseForMessageEncapsulation,
|
|
717
|
+
(0, CommandClass_1.expectedCCResponse)(getCCResponseForMessageEncapsulation, testCCResponseForMessageEncapsulation)
|
|
751
718
|
], Security2CCMessageEncapsulation);
|
|
752
719
|
exports.Security2CCMessageEncapsulation = Security2CCMessageEncapsulation;
|
|
753
720
|
let Security2CCNonceReport = class Security2CCNonceReport extends Security2CC {
|