ZWAVE Door Lock Logging Records

来源:互联网 发布:单片机的外部复位电路 编辑:程序博客网 时间:2024/06/01 20:52

Door Lock Logging Records

 QQ:380939960

对于ZWAVE门锁来说,它可以支持纪录一定数量的操作纪录,以供用户查阅。但是并不是所有的锁都支持纪录查询;因此ZWAVE定义了一系列对应的命令来支持相关的操作。

 

Door Lock Logging Records Supported Get Command

The Door Lock LoggingRecords Supported Get Command is used to request the number of records that theaudit trail supports.

7

6

5

4

3

2

1

0

Command Class = COMMAND_CLASS_DOOR_LOCK_LOGGING

Command = DOOR_LOCK_LOGGING_RECORDS_SUPPORTED_GET

首先,可以通过这个命令来查询一个锁是否支持历史操作纪录查询;在sigma design的SDK中对应的是ZWAVE_DoorLockLoggingRecordsSupportedGet这个函数;

 

Door Lock Logging Records Supported Report Command

The Door Lock LoggingRecords Supported Report Command is used to report the maximum number ofreports the audit trail supports. The Door Lock Logging Records SupportedReport Command can be requested by the Door Lock Logging Records Supported GetCommand.

7

6

5

4

3

2

1

0

Command Class = COMMAND_CLASS_DOOR_LOCK_LOGGING

Command = DOOR_LOCK_LOGGING_RECORDS_SUPPORTED_REPORT

Max records stored

当我们通过ZWAVE_DoorLockLoggingRecordsSupportedGet函数下发给doorlock命令DOOR_LOCK_LOGGING_RECORDS_SUPPORTED_GET后,door lock会回应DOOR_LOCK_LOGGING_RECORDS_SUPPORTED_REPORT; 在该命令中给出支持的最多可供查询的“历史操作纪录”;

 

门锁

最多可供查询的“历史操作纪录”数量

kwikset door lock

0

SCHLAGE door lock

0

Vision door lock

50

 

Door Lock Logging Record Get Command

The Door Lock LoggingRecord Get Command is used to request the audit trail.

7

6

5

4

3

2

1

0

Command Class = COMMAND_CLASS_DOOR_LOCK_LOGGING

Command = RECORD_GET

Record number

 

Record number (8bit)

The Record numberfield indicates the record to be requested.

A value 0 – Maxrecords stored is acceptable with a value of 0 being the most recent entry.When requesting with a value of 0, the report will contain the record number sothe latest record is known.

 

通过sigma Design SDK中的ZWAVE_RecordGet(BYTE nodeId,BYTErecordNumber)函数可以触发该命令。如果recordNumber为0,则表示获取最近的一次操作纪录;

 

Door lock record report

 

在ZWAVE协议中对于door lock record report的描述如下,当用户查询record纪录时,锁会通过这个命令返回对应的查询结果;

 

The Door LockLogging Record Report Command returns records from the audit trail. The DoorLock Logging Record Report Command can be send unsolicited or as a result ofreceiving a Door Lock Logging Record Get Command. To provide flexibility theuser associated with the record can be identified by one of two methods. Theuser identifier field or the user code entered MUST be filled into the reportwhen needed as dictated by the access status field.

7

6

5

4

3

2

1

0

Command Class = COMMAND_CLASS_DOOR_LOCK_LOGGING

Command = RECORD_REPORT

Record number

Timestamp - Year 1

Timestamp - Year 2

Timestamp – Month

Timestamp – Day

Record status

Timestamp - Hour Local Time

Timestamp - Minute Local Time

Timestamp - Second Local Time

Event Type

User Identifier

User Code Length

USER_CODE1

..

USER_CODEn

 

 

 

recordNumber = 36

year1 = 0x07

year2 = 0xe0

month = 10

day = 31

recordStatus = 0x01

hourLocalTime = 10

minuteLocalTime = 51

secondLocalTime = 12

eventType = 14

userIdentifier = 0

userCodeLength = 0

 

 

下面结合实例进行叙述

Record number (8bit)

Record numberrequested (1- 255).  在我们的例子中,这个record ID是36;

Timestamp - Year1..2 (16 bit)

Specify the year inthe usual Gregorian calendar. The first byte (Year 1) is the most significantbyte. 例子中0x07e0对应的十进制数是2016,也就是2016年;

Timestamp - Month(8 bit)

Specify the month ofthe year between 01 (January) and 12 (December). 例子中是10月;

Timestamp - Day (8bit)

Specify the day ofthe month between 01 and 31. 例子中是31日;

Record status(3-bits)

The record statusfield is used to indicate whether legal data is stored in the record.

Record State

Description

0

Requested record is empty.

1

Requested record holds legal data.

在我们的例子中该值为1,说明该纪录是有效的纪录;

 

Timestamp - HourLocal Time (8 bit)

Specify the number ofcomplete hours that have passed since midnight (00-23) in local time. 在例子中是10点

Timestamp - MinuteLocal Time (8 bit)

Specify the number ofcomplete minutes that have passed since the start of the hour (00-59) in localtime. 在例子中是51分;

Timestamp - SecondLocal Time (8 bit)

Specify the numberof complete seconds since the start of the minute (00-59) in local time. Thevalue 60 used to keep UTC from wandering away is not supported.在例子中是12秒

 

Event Type (8 bit)

Following Events aresupported:

Event type

Description

1

Lock Command: Keypad access code verified lock command

2

Unlock Command: Keypad access code verified unlock command

3

Lock Command: Keypad lock button pressed

4

Unlock command: Keypad unlock button pressed

5

Lock Command: Keypad access code out of schedule

6

Unlock Command: Keypad access code out of schedule

7

Keypad illegal access code entered

8

Key or latch operation locked (manual)

9

Key or latch operation unlocked (manual)

10

Auto lock operation

11

Auto unlock operation

12

Lock Command: Z-Wave access code verified

13

Unlock Command: Z-Wave access code verified

14

Lock Command: Z-Wave (no code)

15

Unlock Command: Z-Wave (no code)

16

Lock Command: Z-Wave access code out of schedule

17

Unlock Command Z-Wave access code out of schedule

18

Z-Wave illegal access code entered

19

Key or latch operation locked (manual)

20

Key or latch operation unlocked (manual)

21

Lock secured

22

Lock unsecured

23

User code added

24

User code deleted

25

All user codes deleted

26

Master code changed

27

User code changed

28

Lock reset

29

Configuration changed

30

Low battery

31

New Battery installed

 

在我们的例子中Event type是13,也就是“Lock Command: Z-Wave (no code)”

 

User Identifier (8bits)

The User Identifieris used to recognize the user identity. A valid User Identifier MUST be a valuestarting from 1 to the maximum number of users supported by the device; referto the User Code Command Class. A User Identifier of 0 is acceptable when therecord does not need to identify a user or if the User Code is provided in thisreport.

在我们的实例中,该值为0,所以没有用户ID的。由于触发这条纪录是通过APP下发一条“锁门”的命令,不对应任何用户的,所以user ID是空;

 

User Code Length(8 bit)

The User CodeLength field indicates the number of bytes used to hold the User Code. A lengthof 0 is acceptable

在我们的实例中,该值为0,所以没有用户ID的。由于触发这条纪录是通过APP下发一条“锁门”的命令,不对应任何用户的,所以user ID是空;

 

综上所述,lock返回给我们的第36条纪录,对应的时间是2016-10-31 10:51:12通过ZWAVE命令下发的一条Lock命令;这条命令没有给出“用户密码”,所以User ID和user code length都是0;

 

 

再看几条纪录的例子

 

 

recordNumber = 37

year1 = 0x07

year2 = 0xe0

month = 10

day = 31

recordStatus = 0x01

hourLocalTime = 11

minuteLocalTime = 28

secondLocalTime = 43

eventType = 7

userIdentifier = 0

userCodeLength = 0

userCode1 = 0x9B

userCode2 = 0x1F

userCode3 = 0x4B

userCode4 = 0xB9

userCode5 = 0x88

userCode6 = 0x00

userCode7 = 0x00

userCode8 = 0x88

userCode9 = 0x2B

userCode10 = 0x48

2016-10-31 11:28:43,有用户在门锁通过按键输入错误的开锁密码开锁。Keypad illegal access code entered

 

 

recordNumber = 38

year1 = 0x07

year2 = 0xe0

month = 10

day = 31

recordStatus = 0x01

hourLocalTime = 11

minuteLocalTime = 28

secondLocalTime = 50

eventType = 7

userIdentifier = 0

userCodeLength = 0

userCode1 = 0x73

userCode2 = 0xEA

userCode3 = 0xC2

userCode4 = 0x74

userCode5 = 0xF7

userCode6 = 0x00

userCode7 = 0x00

userCode8 = 0x88

userCode9 = 0x2B

userCode10 = 0x48

2016-10-31 11:28:50,有用户在门锁通过按键输入错误的开锁密码开锁。Keypad illegal access code entered

 

 

recordNumber = 39

year1 = 0x07

year2 = 0xe0

month = 10

day = 31

recordStatus = 0x01

hourLocalTime = 11

minuteLocalTime = 28

secondLocalTime = 59

eventType = 9

userIdentifier = 0

userCodeLength = 0

userCode1 = 0x7B

userCode2 = 0x39

userCode3 = 0x5C

userCode4 = 0x79

userCode5 = 0x1A

userCode6 = 0x00

userCode7 = 0x00

userCode8 = 0x88

userCode9 = 0x2B

userCode10 = 0x48

2016-10-31 11:28:59,有用户使用钥匙或者通过操作门锁上的旋钮开锁。Key or latch operation unlocked (manual); 实际上这次是通过旋转锁上的旋钮开锁的。

 

 

0 0
原创粉丝点击