Node Information Frame

qq:380939960

在gateway上层应用程序中,可能我们会想知道某个节点支持哪些功能?例如是否支持user code?是否支持schedule?等等。通过Node Information Frame我们可以获得相关信息。

 

The Node InformationFrame (NIF) is used to inform other devices about node capabilities. The NIFcontains a structure with a protocol specific part that is handled by theZ-Wave protocol and an application specific part that is filled in by theapplication. The protocol specific part consists of a bit telling if the nodeis a continuously listening device, the Basic Device Class the device is basedon etc. The application specific part consists of the Generic and SpecificDevice Class and the Command Classes that are supported and/or controlled bythe device.

Zwave设备通过NIF来告知其他设备它自己所支持的功能。NIF中包含由Z-Wave协议栈来处理的protocol specific part,以及由上层应用处理的application specific part;protocol specific part中使用一个bit来说明zwave设备是否可以处于持续无线监听状态(通常都是AC供电的),这样的节点可以由于一直在线,所以可以实时控制,实时获取它的状态;同样它也给出这个设备属于哪个Basic Device Class;application specific part部分包含设备的Generic and Specific Device Class,以及这个设备自己可以支持或者控制的命令类。

A NIF will be sentto the controller when a node is to be included in the network, excluded fromthe network or upon request.

当设备被添加/删除/或者被主动请求NIF时,它会发送NIF给Z-Wave网络中的controller。

The figure belowshows the parameters hosted by NIF. 下图是NIF帧的具体描述

Byte descriptor \ bit number

7

6

5

4

3

2

1

0

Capability

Liste- ning

Z-Wave Protocol Specific Part

Security

Opt. Func.

Z-Wave Protocol Specific Part

Reserved

Z-Wave Protocol Specific Part

Basic *)

Basic Device Class (Z-Wave Protocol Specific Part)

Generic

Generic Device Class

Specific

Specific Device Class

NodeInfo[0]

Command Class 1

NodeInfo[n-1]

Command Class n

The Z-WaveProtocol in a controller saves all the Node Information except the supportedand controlled Command Classes when a node is included in the network. Thereserved field MUST be set to 0 by a sending node and MUST be ignored by areceiving node.

当一个节点被加入到Z-Wave网络中时,Controller中的Z-Wave协议栈部分会保存该节点的NIF,不过不包括它自己可以支持或者控制的命令类那部分信息。所以如果上层应用程序如果需要这些命令类信息的话,就需要自己保存。

Z-Wave ProtocolSpecific Part

The protocolspecific part of the NIF is handled by the Z-Wave protocol. This information isautomatically inserted in the packet by the protocol layer when transferringdata using the API.

NIF中的protocol specific part部分有Z-Wave协议栈来处理(sigma-design提供的sdk的code中会处理这部分功能),当使用SDK中的API发送数据时,Z-Wave协议栈会自动将这部分添加到数据包中,然后再发送出去,所以上层应用程序可以不用关心它。

Basic DeviceClass

The Basic DeviceClass field contains an identifier that identifies what Basic Device Class thisnode is based on and is set by the Z-Wave protocol. A detailed description ofall available Basic Device Classes is given in [1] for Z-Wave devices and [13]for Z-Wave Plus devices. The Z-Wave Plus devices have an additional parameterRole Type [10] defining device role in the network. The Role Type parameter isannounced via the Z-Wave Plus Info Command Class.

Note that the“Basic” field is only included when the NIF frame is sent by a controller.

Basic Device Class给出这个设备属于的基本类型,目前Z-Wave协议中定义的基本设备类如下

BASIC_TYPE_CONTROLLER         /*Node is a portable controller */

BASIC_TYPE_ROUTING_SLAVE      /*Node is a slave with routing capabilities*/

BASIC_TYPE_SLAVE               /*Nodeis a slave*/

BASIC_TYPE_STATIC_CONTROLLER   /*Node is a static controller*/

3.2.2 ApplicationSpecific Part

The applicationspecific part of the NIF is handled by the application. The information must bein accordance with the defined classes to obtain interoperability.

NIF中的application specific part部分由上层应用来处理,它必须遵循Z-Wave协议中定义的类,这样才能做到不同厂商的产品可以进行互通。

Listening Flag

The Listening flagis used to indicate that the node is always listening if set. An alwayslistening node must be powered continuously and reside on a fixed position inthe installation. An always listening node is included in the routing table toassist as repeater in the network. The routing table is static during normaloperation. In case the Listening flag is cleared the node is non-listening.This is typically used for battery operated nodes being asleep when theprotocol is idle to prolong battery lifetime. A battery operated node is notincluded in the routing table and is not used as a router in the network. Insome instances the node’s position in the network is still determined, andstored by the protocol.

通过Listeningflag来表示一个zwave设备是否可以一直处于监听状态的。持续监听状态的设备一般必须通过AC提供持续的电源供电,同时在安装时位置也是固定的(需要承担路由功能)。持续监听节点在加入到网络中时,会被包含进路由表中,在网络中充当repeater,来拓展整个zwave网络的覆盖范围(zwave本身是短距离通讯,如果没有repeater的话,通讯距离会比较近)。由于这些节点位置是固定的,所以在通常操作过程中,路由表都是稳定不变的。如果某个设备的NIF中Listening flag为0,那么这个设备就不能持续处于监听状态。这种节点通常都是通过电池功能的,为了延长电池的供电寿命,节点大部分时间都处于休眠状态,不能进行任何Z-Wave的信令交互。所以这种节点在添加到网络中时,都不会被包含在路由表中。

OptionalFunctionality Flag

The OptionalFunctionality flag is used to indicate that this node supports other commandclasses than the mandatory for the selected generic/specific device class andthat a controlling node needs to look at the supported command classes to fullycontrol this device.

这个标识符用来说明设备支持的命令类是否比协议中要求的必须支持的要多。当该flag被设置时,控制节点需要查看这个设备支持的所有命令类,以便完整地控制这个设备。

Generic DeviceClass

The Generic DeviceClass field contains an identifier that identifies what Generic Device Classthis node is part of and must be set by the application. For a detaileddescription of all available Generic Device Classes, refer to [1] for Z-Wavedevices and [13] for Z-Wave Plus devices.

Specific DeviceClass

The SpecificDevice Class field specifies what Specific Device Class this application ispart of and must be set by the application. For a detailed description of allavailable Specific Device Classes, refer to [1] for Z-Wave devices and [13] forZ-Wave Plus devices.

Command Class

The Command Classfield is used to advertise Command Classes implemented by the node. The fieldMUST NOT be longer than 35 bytes.

通过命令类列表来说明这个设备支持的所有命令类,也就是这个设备支持的所有功能;要求这部分不能大于35bytes,由于目前一个命令类是1个byte,所以一个设备也只能最多支持35个命令类。

The field MUSTadvertise the list of Command Classes that the node supports.

命令类列表中必须给出这个设备支持的所有命令类。

The field MAYadvertise the list of Command Classes that the node can control in other nodes.If present, the list of controlling Command Classes MUST be prepended by theCOMMAND_CLASS_MARK Command Class identifier.

The Basic CommandClass MUST NOT be advertised in the Node Information Frame.

另外可以在命令列表中给出该设备在其他节点中可以控制的命令类的列表(就是该节点可以发送某些控制命令给其他节点);如果某个设备支持这种类型的命令类,则这些命令类必须由COMMAND_CLASS_MARK命令类标识符开始,也就是跟在COMMAND_CLASS_MARK后面。Basic Command Class不能在节点信息帧中通告。

举例说明:

Philio 的PST02-A是一个PIR,door/windows,temperature,illumination的4合一sensor;它的NIF信息如下:

generic=0x07      GENERIC_TYPE_SENSOR_NOTIFICATION

specific=0x01     SPECIFIC_TYPE_NOTIFICATION_SENSOR

basic=0x04,generic=0x07, specific=0x01

cmdClasses =

0x5E  COMMAND_CLASS_ZWAVEPLUS_INFO_V2

0x80  COMMAND_CLASS_BATTERY

0x71  COMMAND_CLASS_ALARM_V2

0x85  COMMAND_CLASS_ASSOCIATION_V2

0x70  COMMAND_CLASS_CONFIGURATION_V2

0x72  COMMAND_CLASS_MANUFACTURER_SPECIFIC_V2

0x86  COMMAND_CLASS_VERSION_V2

0x30  COMMAND_CLASS_SENSOR_BINARY_V2

0x31  COMMAND_CLASS_SENSOR_MULTILEVEL

0x84  COMMAND_CLASS_WAKE_UP_V2

0x59  COMMAND_CLASS_ASSOCIATION_GRP_INFO

0x73  COMMAND_CLASS_POWERLEVEL

0x5A  COMMAND_CLASS_DEVICE_RESET_LOCALLY

0x8F  COMMAND_CLASS_MULTI_CMD

0x98  COMMAND_CLASS_SECURITY

0x7A  COMMAND_CLASS_FIRMWARE_UPDATE_MD

0xEF COMMAND_CLASS_MARK

0x20 COMMAND_CLASS_BASIC

在它的说明书中提到:

The Device support2 groups. The group 1 is for receiving the report message, like trigged event,temperature, illumination etc. The group 2 is for light control, the devicewill send the “Basic Set” command to this group, And each group support 8 nodesmaximum.

也就是说philio的PST02-A支持两个groups。Groups是lifeline,用于事件通报。例如PST02-A会通过group 1通报给controller门磁触发,PIR触发,温度数据,明度数据等;group 2主要用于灯光控制,PST02-A会通过group 2发送“Basic Set”到这个group,以便控制这个group中的其他设备。在PST02-2A的NIF中,我们可以看到COMMAND_CLASS_MARK后面跟着COMMAND_CLASS_BASIC命令,这个COMMAND_CLASS_BASIC是用来通过group 2发送“Basic Set”的。

If supported, theZ-Wave Plus Info Command Class MUST be the first Command Class in the list.

设备如果支持Z-Wave Plus的话,Z-Wave Plus Info Command Class必须位于命令类列表的第一个。

It has been foundthat legacy controllers MAY read as little as 6 lines from this list. Forbackwards compatibility, the list SHOULD advertise supported command classes inthe order indicated in Table 1 :

在Z-Wave产品实施中,我们发现有些老的controller只会从列表中读出6个命令类;因此为了向后兼容,命令类应该按照下表中的优先级进行排序。

Priority

Command Class

1 (First line)

COMMAND_CLASS_ZWAVEPLUS_INFO Applies only to Z-Wave Plus products

2 (if supported)

COMMAND_CLASS_SWITCH_MULTILEVEL or COMMAND_CLASS_SWITCH_BINARY

3 (if supported)

COMMAND_CLASS_SWITCH_ALL

4 (if supported)

COMMAND_CLASS_ASSOCIATION

5

All other command classes

Figure 3 shows thestructure of the Node Information frame:

下表给出NIF中命令类列表的具体构成信息。

Byte descriptor \ bit number

7

6

5

4

3

2

1

0

NodeInfo[0]

Command Class 1 (Support)

NodeInfo[x-1]

Command Class x (Support)

NodeInfo[x]

Command Class x+1 (COMMAND_CLASS_MARK)

NodeInfo[x+1]

Command Class x+2 (Control)

NodeInfo[n-1]

Command Class n (Control)

In case the devicehave no supported command classes and only can control other devices, the liststart with the identifier COMMAND_CLASS_MARK.

如果设备没有支持的命令类,只能够控制其他设备的话,则命令类的列表由COMMAND_CLASS_MARK开始。

通常controller会将它下面node的信息保存在某个文件中。因此在sigma design的SDK中我们可以使用int SupportsCmdClassFlags(BYTE nodeid, WORD class);这个函数来判断某个端点是否支持某个命令。

当然也可以自己主动发送ZW_RequestNodeInfo来获取某个节点支持的命令序列,然后判断是否支持某个命令。

例子:下面是Aeotec的doorbell支持的command class

rd_nif_request_notify, cmdLen(15)

0x04 0x10 0x05 0x5E 0x86 0x25 0x70 0x72 0x59 0x85 0x73 0x7A 0x5A 0xEF 0x82

其中前三个是device type

0x04

0x10

0x05

Basis=0x04; general=0x10; specific=0x05

Basic Device Class:    BASIC_TYPE_ROUTING_SLAVE

General Device class:  GENERIC_TYPE_SWITCH_BINARY

Specific Device class: SPECIFIC_TYPE_SIREN

从这里可以看出来,Aeotec将doorbell作为SIREN来实现的。

该产品的链接是http://aeotec.com/z-wave-doorbell

0x5E  COMMAND_CLASS_ZWAVEPLUS_INFO

0x86  COMMAND_CLASS_VERSION

0x25  COMMAND_CLASS_SWITCH_BINARY

0x70  COMMAND_CLASS_CONFIGURATION

0x72  COMMAND_CLASS_MANUFACTURER_SPECIFIC

0x59  COMMAND_CLASS_ASSOCIATION_GRP_INFO

0x85  COMMAND_CLASS_ASSOCIATION

0x73  COMMAND_CLASS_POWERLEVEL

0x7A  COMMAND_CLASS_FIRMWARE_UPDATE_MD

0x5A  COMMAND_CLASS_DEVICE_RESET_LOCALLY

0xEF  COMMAND_CLASS_MARK

0x82  COMMAND_CLASS_HAIL  say hello

该产品默认按门外的button时,不会发送notification给ZWAVE dongle的。需要使用COMMAND_CLASS_CONFIGURATION先配置一个参数,具体信息如下:

“Works with HomeSeer ISY994Zw VeraEdge Z-Wave Gateway Controller - Set up parameter 80 = 1 (1 bit dec) to receive notifications and create scenes including the doorbell”

在代码中是调用 ZWAVE_ConfigurationSet(nodeid,80,1,1);

配置完后,不管是在本地按门铃,还是通过APP控制门铃,它都会上报一个COMMAND_CLASS_HAIL给ZWAVE controller。

按照上面标准中的说明,COMMAND_CLASS_MARK后的命令都应该是用来控制其他设备的,这样的话这里的COMMAND_CLASS_HAIL是什么意思那? Doorbell广播COMMAND_CLASS_HAIL后,关联的设备都触发动作? 摄像头拍照录像 ?

ZWAVE Node Information Frame 实例相关推荐

  1. Node聊天程序实例04:chat_ui.js

    作者:vousiu 出处:http://www.cnblogs.com/vousiu 本实例参考自Mike Cantelon等人的<Node.js in Action>一书. 这个程序在客 ...

  2. ZWAVE Alarm Report Command

    老的ZWAVE客户端可能会通过alarm report command上报告警,这里通过一个实例解析这个命令. Alarm Report Command QQ:380939960 The Alarm ...

  3. Z-Wave Networking Basics ZWAVE网络基础

    Z-Wave Networking Basics qq:380939960 Z-Wave的网络层定义了一个由最多可以容纳231个设备组成的网络,适合大多数住宅和轻型商业应用.他们定义一个网状网络拓扑( ...

  4. Z-Wave技术与zipgateway源码剖析

    1 Z-Wave简介 1.1 什么是Z-Wave技术 Z-Wave是一种新兴的基于射频的.低成本.低功耗.高可靠.适于网络的短距离无线通信技术.工作频带为908.42MHz(美国)~868.42MHz ...

  5. Z-Wave Multi Channel Basics zwave多功能复合设备实现

    Z-Wave Multi Channel Basics qq:380939960 Z-Wave可以应用在很多监控和控制应用场景中.Sensor可以发送数据给网关,墙上的开关也可以直接报告"按 ...

  6. 从原型链看DOM--Node类型

    前言: 本系列从原型,原型链,属性类型等方面下手学习了DOM文档对象模型,旨在弄清我们在DOM中常用的每一个属性和方法都清楚它从哪里来要到哪里做什么事,这样对于理解代码有一定启发.全靠自己在总结中摸索 ...

  7. 双11特刊 | 全面云原生化,数据库实例独共享混部 最高降低30%成本

    简介:2021年双十一是阿里巴巴集团的核心应用全面云化的第二年.今年在保证稳定性的前提下,主要探索如何利用云原生的技术优势,降低成本,提升资源利用率.在今年大促中,针对核心集群采用独享共享实例混部,统 ...

  8. 【es】Node与NodeEnvironment的实例化

    1.概述 转载:[8]elasticsearch源码深入分析--Node与NodeEnvironment的实例化 2.Node概览 前不久的分析中说到了,Node是ElasticSearch启动的重中 ...

  9. vpp怎么写node

    VPP(Vector Packet Processing)是一个高性能的数据平面开源项目,用于构建网络功能虚拟化(NFV)和软件定义网络(SDN)解决方案.它由Cisco开发,并在Apache 2.0 ...

最新文章

  1. ASCII、GB2312、GBK、Unicode、UTF-8介绍和转换
  2. 关于Mysql的错误:No query specified
  3. ORACLE PL/SQL 实例精解之第二章 通用编程语言基础
  4. C# 抗变与协变的理解
  5. AI 开发者不容错过的 20 个机器学习和数据科学网站
  6. linux程序没有对日志文件写的权限_好程序员云计算培训分享Linux文件权限简单说明...
  7. php采集一言代码_用PHP制作api源码简单实现一言 / 随机一句功能
  8. 中国硬科技城市发展指数正式发布,西安跻身前十
  9. 操作系统随机密码,定时改密码
  10. 063 模块的四种形式
  11. Wind对接pytho总结
  12. B站视频怎么下载到本地【实用教程】
  13. 布加迪奇龙Blender雕刻、shading,并导入Three.js ,3DWEB模型【Three.js+Blender建模+web前端+可视化】
  14. Vue入门---实现汇率换算
  15. Mixamo动画导入Unity中常见问题
  16. DedeCMS快速建站
  17. win11任务栏无响应/卡死
  18. 代币标准--ERC721协议源码解析
  19. 台式计算机硬盘的安装位置,台式主机扩大存储,7步教你完美安装机械硬盘
  20. 像“毒液”一样的粘液机器人火了,能取出体内异物,穿过1.5mm细缝无压力!...

热门文章

  1. 第二次作业---红芯浏览器事件
  2. repeatation翻译_半导体专业术语英语及汉语翻译
  3. Python爬取高德地图各城市天气情况
  4. CSS边框应用 - 半透明边框
  5. 面积误差三种计算表达的比较
  6. JS面向过程+面向对象编程区别,原型的应用
  7. postfix空壳邮件服务
  8. 三极管之多谐振荡LED流水灯
  9. 基于C51的扩展系统结构的篮球记分器【包含IIC运用,DS1307,LCM12864】的课设作业
  10. pat1133 Splitting A Linked List