Openzwave库中对Zwave产品配置文件的使用

在openzwave库中通过配置文件定义一些可配置参数,对于每一个zwave命令类来说,我们都可以通过配置文件定义这些参数;在openzwave中通过CommandClass::ReadXML从配置文件中将相关参数读取出来;

一、

首先manufacturer_specific.xml 这个文件给出了目前支持的所有产品,该文件的样例如下所示:

<Manufacturer id="0040" name="2B Electronics">

</Manufacturer>

<Manufacturer id="0098" name="2GIG Technologies">

<Product type="1e12" id="015c" name="CT30 Thermostat" config="2gig/ct30.xml"/>

<Product type="1e12" id="015e" name="CT30 Thermostat" config="2gig/ct30.xml"/>

<Product type="6401" id="0105" name="CT100 Thermostat" config="2gig/ct100.xml"/>

<Product type="6401" id="0107" name="CT100 Thermostat USA" config="2gig/ct100.xml"/>

<Product type="6501" id="000c" name="CT101 Thermostat (Iris)" config="2gig/ct101.xml"/>

</Manufacturer>

<Manufacturer id="002a" name="3e Technologies">

</Manufacturer>

<Manufacturer id="0022" name="A-1 Components">

</Manufacturer>

<Manufacturer id="0001" name="ACT">

<Product type="4349" id="3130" name="ZCS101 Serial Interface"/>

<Product type="4952" id="3030" name="ZIR000 PIR Motion Sensor" config="act/zir010.xml"/>

<Product type="4952" id="3330" name="ZIR010 PIR Motion Sensor" config="act/zir010.xml"/>

<Product type="4952" id="3130" name="ZIR010 PIR Motion Sensor" config="act/zir010.xml"/>

<Product type="4450" id="3030" name="ZDP100 Plugin Lamp Module"/>

<Product type="4457" id="3033" name="ZDW103 Wall Dimmer Module" config="act/zdw103.xml"/>

<Product type="4457" id="3330" name="ZDW230 Wall Dimmer Module"/>

<Product type="4457" id="3332" name="ZDW232 Wall Dimmer Module" config="act/zdw232.xml"/>

<Product type="444d" id="3330" name="ZDM230 Wall Dimmer Module" config="act/zdm230.xml"/>

<Product type="5250" id="3030" name="ZRP100 Plugin Appliance Module"/>

<Product type="5250" id="3130" name="ZRP110 Exterior Appliance Module" config="act/zrp110.xml"/>

<Product type="5257" id="3330" name="ZRW230 Wall Appliance Module"/>

<Product type="5246" id="3133" name="LFM-20 Relay Fixture Module" config="act/lfm20.xml"/>

<Product type="5257" id="3033" name="ZRW103 Wall Switch Module" config="act/zrw103.xml"/>

<Product type="524d" id="3330" name="ZRM230 Wall Appliance Module"/>

<Product type="5457" id="3330" name="ZTW230 Wall Transmitter Module"/>

<Product type="544d" id="3330" name="ZTM230 Wall Transmitter Module"/>

</Manufacturer>

<Manufacturerid="0098" name="2GIG Technologies">  给出了制造商的ID,以及制造商的名字;

<Producttype="1e12" id="015c" name="CT30 Thermostat"config="2gig/ct30.xml"/> 给出了产品的类型,产品ID,产品的名称,以及该产品相关参数对应的配置文件的名称和路径。在该配置文件中给出了这个产品可配置的一些参数描述。

某个产品的id和type可以在如下网站上查到:

https://products.z-wavealliance.org/products

例如对于OOMI的plug来说:

https://products.z-wavealliance.org/products/2619

Product Type ID: 0x1D03

Product ID: 0x0091

产品配置文件样例如下:

<!-- Configuration Parameters -->

<CommandClass id="112">

<Value type="byte" index="2" genre="config" label="2. Basic Set Level" min="0" max="255" value="255">

<Help>

Set the BASIC command value to turn on the light.

255: always turn on the light.

For dimmer equipment 1 to 100 means the light strength. 0 means turn off the light.

</Help>

</Value>

<Value type="byte" index="3" genre="config" label="3. PIR Sensitivity" min="0" max="99" value="80">

<Help>

PIR sensitivity settings.

0 means disable the PIR motion.

1 means the lowest sensitivity.

99 means the highest sensitivity.

High sensitivity means the sensor can detect over a long distance, but if there is more noise signal in the environment, it will re-trigger too frequently.

</Help>

</Value>

在openzwave中;ManufacturerSpecific::HandleMsg中

l  ManufacturerSpecific::SetProductDetails  -> ManufacturerSpecific::LoadProductXML 从配置文件manufacturer_specific.xml(该文件在openzwave库中启动后,只加载一次)中读出制造商的产品信息;

l  如果该产品在上一步中发现有给出相关参数的话,则进一步调用ManufacturerSpecific::LoadConfigXML 中打开配置文件;读取该产品的所有可配置参数。

l  CommandClass id="112" 对应的是COMMAND_CLASS_CONFIGURATION;也就是定义了厂商自定义的一些可配置参数列表,这部分参数没有在zwave标准中定义;这些具体可配置参数列表,可以在https://products.z-wavealliance.org/products找到;例如对于OMMI的plug产品,OMMI厂家定义的可配置参数列表在如下链接中可以看到

https://products.z-wavealliance.org/products/2619/configs

二、产品可配置参数文件

一)产品私有可配置参数

某一个可配置参数的描述:

对某一个value的描述通过<Value> </Value>来完成

l  “type”是value的类型,openzwave中定义的类型如下所示;对应到这里,推测可用的值应该是”bool”,”byte”,”decimal”,”int”,”list”,”schedule”,”short”,”string”,”button”,”raw”;

enum ValueType

{

ValueType_Bool= 0,                              /**<Boolean, true or false */

ValueType_Byte,                                                  /**<8-bit unsigned value */

ValueType_Decimal,                             /**< Representsa non-integer value as a string, to avoid floating point accuracy issues. */

ValueType_Int,                                                      /**<32-bit signed value */

ValueType_List,                                                     /**<List from which one item can be selected */

ValueType_Schedule,                                         /**<Complex type used with the Climate Control Schedule command class */

ValueType_Short,                                  /**<16-bit signed value */

ValueType_String,                                 /**< Textstring */

ValueType_Button,                                /**< Awrite-only value that is the equivalent of pressing a button to send a commandto a device */

ValueType_Raw,                                                   /**<A collection of bytes */

ValueType_Max= ValueType_Raw               /**< Thehighest-number type defined.  Not to beused as a type itself. */

};

l  “index”是参数的ID,用来唯一识别某个可配置参数;对应” https://products.z-wavealliance.org/products/2619/configs”中的”ParameterNumber”

l  “genre”对于可配置参数来说,应该固定为”config”; 应该对应于openzwave程序中的如下分类

/**

* Value Genres

* Theclassification of a value to enable low level system or configurationparameters to be filtered by the application.

* \seeGetGenre

*/

enum ValueGenre

{

ValueGenre_Basic= 0,            /**< The 'level' ascontrolled by basic commands.  Usuallyduplicated by another command class. */

ValueGenre_User,/**< Basic values an ordinary user would be interested in. */

ValueGenre_Config,/**< Device-specific configuration parameters.  These cannot be automatically discovered viaZ-Wave, and are usually described in the user manual instead. */

ValueGenre_System,              /**< Values of significanceonly to users who understand the Z-Wave protocol */

ValueGenre_Count     /**< A count of the number of genresdefined.  Not to be used as a genreitself. */

};

l  “label” 是对这个可配置参数的简要文字描述;

l  “min” 给出该可配置参数的最小值

l  “max” 给出该可配置参数的最大值

l  “value” 给出该可配置参数的默认值,从openzwave的程序逻辑看,该参数可以不用指定;

l  “size” 给出该可配置参数需要占用多少byte;例如size=1,表示该参数大小是一个byte;由于”byte”,”int”,”short”这些类型已经显而易见地给出了参数大小,所以通常他们不需要显式地给出size;

l  “Help” 给出一些帮助信息;

对于list类型的参数,还需要通过”Item”来描述每一个list项;例如:<Item label="Always off" value="2" />

对于<Item />中使用的项目描述如下

l  “label” 是对item的简要文字描述;

l  “value” 是某一个item对应的值;

一个实例如下:

<Value type="list" index="20" genre="config" label="output load status" min="0" max="2" value="0" size="1">

<Help>Configure the output load status after re-power on</Help>

<Item label="The last status before the power outage" value="0" />

<Item label="Always on" value="1" />

<Item label="Always off" value="2" />

</Value>

<Value type="short" index="243" genre="config" label="Pin code" min="0" max="65535" value="65535">

<Help>Pin code, the available range of the Pin code is 0 to 65535.</Help>

</Value>

<Value type="list" index="252" genre="config" label="Enable/disable Configuration Locked" min="0" max="1" value="0" size="1">

<Help>Enable/disable Configuration Locked.</Help>

<Item label="Disable" value="0" />

<Item label="Enable" value="1" />

</Value>

<Value type="int" index="255" genre="config" label="Reset the Plug" min="1" max="1431655765">

<Help>

Reset the Plug.

1: Reset all configuration parameters to default

1431655765(0x5555 5555): Reset the Plug to factory default

</Help>

</Value>

<Value type="int" index="82" genre="config" label="notification in group 3">

<Help>

Set the time of LED state when it is in Night light mode.

Value 1 (msb) time of ON state (hour)

Value 2 time of ON state (minute)

Value 3 time of OFF state (hour)

Value 4 (lsb) time of OFF state (minute)

0 to 59 time of OFF state (minute) 256 to 279 time of OFF state (hour)

65536 to 65595 time of ON state (minute) 16777216 to 16777239 time of ON state (hour)

</Help>

</Value>

二)COMMAND_CLASS_BASIC命令的一些配置参数

在该配置文件中,通过<CommandClass id="32" setasreport="true"/>这样的形式来定义COMMAND_CLASS_BASIC命令的一些配置参数;

l  “setasreport”: Received Basic set , treating it as a Basic report ornot. 如果是true的话,就把收到的basic set指令当成basic report处理;

l  “mapping”: COMMAND_CLASS_BASIC命令映射到那个类;

l  “ignoremapping”:是否不考虑COMMAND_CLASS_BASIC命令映射;

三)Z-Wave Association Capabilities的一些参数

在该配置文件中,通过<CommandClass id="133"> </CommandClass> 来定义COMMAND_CLASS_ASSOCIATION的一些可配置参数;

在如下网站上我们可以找到某款产品的COMMAND_CLASS_ASSOCIATION的可配置参数;

https://products.z-wavealliance.org/products

例如对于OOMI的plug来说,

<!-- Association Groups -->

<CommandClass id="133">

<Associations num_groups="2">

<Group index="1" max_associations="5" label="Z-Wave Plus Lifeline. The Hial CC and Basic Report CC (configured by parameter 80) can be sent to the associatd nodes in this group" />

<Group index="2" max_associations="5" label="Forward the Basic Set, Switch Binary Set to associated nodes in Group 2 when the Plug receives the Basic Set, Switch Binary Set commands from the main controller" />

</Associations>

</CommandClass>

l  max_associations="5" :最大可以association 5个节点;

Openzwave库中对Zwave产品配置文件的使用相关推荐

  1. GDC服务器主机与证书不匹配,调用web服务soap时,错误https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配...

    嘿,我想用SAAJ调用soap web服务 我用野蝇10 我试图将此系统属性添加到standalone.xml,但无法工作 20: 53:08208错误[stderr](默认任务-21),原因是:ja ...

  2. 实验二十二 SCVMM中的SQL Server配置文件

    实验二十二 SCVMM中的SQL Server配置文件 在VMM 2012中管理员可以使用 SQL Server 配置文件,在部署完成虚拟机之后,实现 SQL Server 数据库服务自动化部署并交付 ...

  3. mysql log 记录报错 sql语句_MySQL生产库中添加修改表字段引起主从崩溃的问题总结...

    上周末和开发人员对线上库中的部分表的在线DDL和update,这过程中出现了一些意料之外的问题,现将过程.分析和解决方案在这里总结一下 一. 需求背景: 要在如下表中添加字段(modified_at) ...

  4. 让微软企业库中的Email Trace Listener使用需要身份验证的SMTP服务器

    微软企业库中的日志记录模块中有个Email Trace Listener.对于将网站部署到异地的应用来讲,这是一个非常有效的功能.因为我们可以通过电子邮件查看日志,进而了解我们开发的程序错误出现在何处 ...

  5. 热门Ruby 库中存在严重的命令注入漏洞

     聚焦源代码安全,网罗国内外最新资讯! 编译:代码卫士 开发人员修复了用于解析和转换 AsciiDoc 文件的热门 Ruby库中存在一个命令注入漏洞. 命令注入漏洞可使攻击者在运行应用程序的服务器上执 ...

  6. 为什么写了value属性 jq赋值value值不显示_[Go基础]理解 Go 标准库中的 atomic.Value 类型

    转载声明 文章作者:喵叔 上次更新:2019-03-15 许可协议:CC BY-NC-ND 4.0(转载请注明出处) 原文链接:https://blog.betacat.io/post/golang- ...

  7. 【Pytorch神经网络理论篇】 39 Transformers库中的BERTology系列模型

    同学你好!本文章于2021年末编写,获得广泛的好评! 故在2022年末对本系列进行填充与更新,欢迎大家订阅最新的专栏,获取基于Pytorch1.10版本的理论代码(2023版)实现, Pytorch深 ...

  8. 怎么制作一个笔试题库?会计笔试题库中的题型分析?

    目前各个考试都会有对应的笔试题库供大家学习,因为现在笔试题库作为了一种产品,目前我国的笔试考试越来越多了,笔试题库也层出不穷.下面我就来介绍一下笔试题库,我们如何选择一个全面好用的笔试题库.福昕知翼有 ...

  9. 如何将AD类型的封装导成Allegro库中的封装

    1.首先使用的是LCSC下载的封装,以电容0201封装为例.下载下来格式如下: 2.中间需要使用PADS转一下格式,转成asc格式的.AD的不知道可不可以直接转,我也是之前在某个教程中学的,可能操作复 ...

最新文章

  1. playbook 实例
  2. bitmap xml大小 安卓_一张壁纸让安卓用户手机系统崩溃,包括三星、小米、一加等...
  3. visual studio 解决方案项目结构部署和配置
  4. urlrewrite 保持 posturl
  5. 计算机网络学习笔记-1.2.3第一章总结
  6. leetcode - 226. 翻转二叉树
  7. MongoDB之GridFS
  8. if else if语句格式_Python_if 语句
  9. “非常有用”的JavaScript 和 CSS 库插件推荐
  10. 重磅揭晓阿里 AliOS Things 3.0 革命性创新!
  11. Python 路径问题--No such file or directory
  12. 乐高机器人投篮编程_乐高 EV3 高级编程 - 第二课:Hello World
  13. 1183 连接字符串
  14. Java培训后如何找工作?
  15. 三千书源——愿成为整理最全的书源合集
  16. 免费服务器领取步骤(详细)
  17. 文科生的悲哀-斐波拉契数列
  18. 天然产物来源的新型除草剂研究取得进展
  19. mysql条件关键字查询有limt_MySQL使用Limit关键字限制查询结果的数量-Go语言中文社区...
  20. php 获取rsa 模数,使用Python从公钥获取RSA指数和模数

热门文章

  1. STM32F103ZET6+RA8875+Emwin显示和触摸移植
  2. 基于BP神经网络车牌识别系统的设计与实现
  3. 一级造价工程师(安装)- 计量笔记 - 第四章第三节消防工程
  4. smb测速工具_MyCloud samba3 的传输速度为啥是 nfs 性能的一倍?那里操作有问题?...
  5. C语言各数据类型所占字节数和取值范围
  6. 【考研每日一题29】吃糖果(C++)
  7. 瑜伽,驾驭心灵的节拍丨感受最真实的心灵秘语!
  8. Mac怎么清理缓存?这两种方法都非常好用哦
  9. 原生Mysql之 join和inst优化r
  10. 计算机网络 以太网