# 设备云管家协议脚本配置指南 | 作者 | 时间 | 版本 | 描述 | | ------ | ------------- | ---- | ------------------------------------ | | 黄杰添 | 2022年6月20日 | V1.0 | 初始版本 | | 黄杰添 | 2022年7月8日 | V1.1 | 水文协议增加下行指令脚本配置 | | 黄杰添 | 2022年7月20日 | V1.2 | 平台模型微调同步 | | 黄杰添 | 2022年10月8日 | V2.0 | 增加预警广播协议配置以及水文配置优化 | ​ ​ 该文档为**设备云管家平台研发人员以及运营人员**描述了设备云管家的协议脚本如何进行配置。通过下载平台的协议脚本文件包进行编辑修改后上传,建立相应的设备并使用协议后,即可使用协议赋予设备的属性和能力,后文统一称 “**物模型**”。 ​ 协议脚本本身为数据报的解析提供了依据,并作为设备模板监测要素配置的蓝本,因而协议脚本实际上解决了如何将设备上报的数据报文解析成设备监测要素,建立了平台监测要素与报文的对应映射关系。同时,协议脚本也作为下行指令的蓝本,固定了下行指令的参数及其格式,在调用指令时,将依据指令的脚本配置生成对应的下行报文。 ![image-20221008111543946](.\image-20221008111543946.png) > 设备云管家物模型 > > - 监测要素:设备的采集数据,由设备自行上报的报文解析而成。 > - 下行指令:设备的控制指令,协议决定了一个设备可以使用什么控制指令,依据协议的不同通过脚本实现自定义或固定。 ​ 此外,由于不同的物联网协议之间差异巨大,因而其脚本也各不相同。这个不同体现在方方面面,例如有的协议平台不支持脚本下载,例如GNSS,实际上这是通过三方解析平台完成解析,设备云管家进行数据读取和存储的一个协议。又比如有的协议支持监测要素和下行指令的自定义,例如水文协议,预警广播协议。上述的三个协议是平台目前已支持的,又例如以后可能支持的环保协议,它可能是一个仅支持下行指令自定义的协议,因为其报文结构决定了其监测要素的读取不需要经由脚本自定义,而可以直接使用平台的监测要素属性完成自定义。总而言之,协议的差异性导致了脚本的不同,换言之脚本是为了消除不同协议之间差异的一种技术手段。下面按照可自定义程度列举平台目前支持的协议。 | 协议 | 脚本配置要素 | 脚本配置下行指令 | 是否支持远程配置 | 是否支持远程升级 | | ---------------- | ------------ | ---------------- | ---------------- | ---------------- | | 水文协议 | 支持 | 支持 | 否 | 否 | | 四信预警广播协议 | 不支持 | 支持 | 是 | 否 | | GNSS-CSV协议 | 不支持 | 不支持 | 否 | 否 | | 四信远程配置协议 | 不支持 | 不支持 | 是 | 是 | > 远程配置和远程升级即设备的运维管理(查看平台的设备运维管理页面),有的协议支持使用远程配置和远程升级等功能。 ## 1. 设备云管家设备物模型 ​ 如上文所述,平台的物模型分为监测要素和下行指令。下面对此进行说明。 ### 1.1 设备云管家监测要素 ​ 监测要素是设备采集的数据经由设备云管家中的过滤,格式转换后的数据,假设设备是一台智能空调,那么监测要素可以是 `当前室内温度,当前室内湿度,工作温度,工作湿度,风速,工作模式,电源电压`等。其中当前室内温度,当前室内湿度是采集数据,工作温度,工作湿度,风速,工作模式,电源电压等是工况数据,它们(不同的要素分组)共同组成了智能空调设备的监测要素。 ​ 设备云管家监测要素基本属性如下表所示 | 属性 | 属性名称 | 属性描述 | 数据格式限定 | | ---------- | ------------ | ---------------------------------------------------- | --------------------------------------------------------- | | identifier | 要素标识符 | 作为单个协议内要素的唯一标识符 | 数据格式限定为 英文字母+数字,不可以数字开头,长度限定20 | | code | 要素编码 | 作为要素的描述性补充编码 | 不限定具体数据格式,长度限定50 | | name | 要素名称 | 作为要素的描述性简称 | 不限定具体数据格式,长度限定20 | | unit | 要素计量单位 | 作为要素的计量单位描述简称 | 不限定具体数据格式,长度限定20 | | data_type | 要素数据类型 | 作为要素的数据格式描述 | 枚举类 number 数字 char 字符 | | accuracy | 要素精度 | 当要素数据类型为number时作为要素数据类型的小数位限定 | 数据格式限定为0-9的正整数 | | length | 要素长度 | 当要素数据类型为char是作为要素数据类型的长度限定 | 数据格式限定为正整数 | | group | 要素分组 | 要素的分组,仅在展示时进行分组 | 当前仅工况信息和实时监测信息两个分组 | 效果如图所示 ![图1 设备云管家监测要素](.\image-20221008092334350.png) ![image-20221008102734622](.\image-20221008102734622.png) ### 1.2 设备云管家下行指令 ​ 下行指令是平台对设备发送的控制讯号。用户可以通过下行指令对设备发出命令,以控制设备完成指定的工作。同上例,设备是一台智能空调,那么下行指令可以有`开关机,设置模型,设置风速,设置工作温度,设置工作湿度`等,实际上的指令可能是上述指令的复合体,这通常由底层的协议决定。 ​ 设备云管家的下行指令基本属性如下表所示 | 属性 | 属性名称 | 属性描述 | 数据格式限定 | | ----------- | ------------ | ------------------------------------ | ------------- | | name | 指令名称 | 指令的描述性标识 | 字符格式 | | code | 指令编码 | 指令的唯一标识 | 字符格式 | | explanation | 指令说明 | 指令的补充性描述 | 字符格式 | | quick | 是否常用指令 | 常用指令将用于远程配置的常用指令列表 | true \| false | | paramNum | 参数个数 | 参数的数量 | 限定正整数 | | params | 参数 | 参数的JSON格式 | JSON数组 | 效果如图所示 ![image-20221008105447358](.\image-20221008105447358.png) ## 2. 协议脚本配置说明 ​ 如表所示,下面说明水文协议和四信预警广播协议的脚本配置。 | 协议 | 脚本配置要素 | 脚本配置下行指令 | | ---------------- | ------------ | ---------------- | | 水文协议 | 支持 | 支持 | | 四信预警广播协议 | 不支持 | 支持 | ### 2.1 水文协议脚本配置说明 > 参考文档: > > 1. 水文监测数据通信规约.pdf > 2. VE值解析表达式.pdf ​ 配置水文协议脚本前,最好能够先行阅读参考文档,以便于理解。 ​ 水文协议脚本为.json文件,脚本内容需要符合JSON文件的基本数据格式。主体分为 functions 和 factors 两段结构。functions为json数组,配置了该水文协议的功能及该功能的上下行结构,包括了自报报文的配置和下行报文的配置。factors为json数组,配置了该水文协议的所有功能码中将使用到的要素。 ```json { "functions" : [], "factors" : [] } ``` #### 2.1.1 水文协议脚本 JSON格式说明 - functions `功能集合定义,功能根据inboundOnly被解析为下行指令的报文生成依据或上报报文的解析依据` - functionCode `功能码,2位HEX字符` - functionName `功能名称` - inboundOnly `true 或 false,是否只上报, 只上报时该功能码不支持下发,反之该功能将被解析为一个下行指令以支持下发` - inboundMessages `上报消息定义,json数组` - nodeKey `节点标识,非空字符` - nodeName `节点名称,非空字符` - type `节点类型,['serial', 'value','factor', 'factors']` - explain `节点解释,根据节点类型格式不同` - type=serial `表示该节点为一个序列节点,explain应为VE值表达式,参考VE值解析表达式.pdf` - type=value `表示该节点为一个值节点,explain应为VE值表达式,参考VE值解析表达式.pdf` - type=factor `表示该节点为一个要素节点,explain应为一个要素表示` - `字符格式` `可以表示为一个要素的引导符` - `对象格式` `可以直接表示为一个要素的JSON对象,参考factors` - notes `节点的字符描述` - outboundMessages `下行或应答消息定义,json数组` - paramKey `参数标识, 非空字符` - paramName `参数名称, 非空字符` - type `参数类型, ['serial','timestamp', 'param'] ` - pattern `参数解释,根据参数类型格式不同` - type=serial `表示该参数为一个序列参数,序列参数将由程序自动生成,pattern应表示为一个正整数,表示自动生成多少位的序列` - type=timestamp `表示该参数为一个时间戳参数, 时间戳参数将由程序自动生成当前时间的字符表示, pattern应表示为一个时间格式, 例如yyMMddHHmmss, 表示时间搓以何种格式下发,注意该时间格式仅能使用yYMmHhds等时间格式字母组成` - type=param `表示该参数为一个值参数, 值参数仅在该功能inboundOnly=false时设置有效,功能作为下行指令时需要传递该参数` - notes `参数的字符描述` - factors `要素定义集合,要素被解释为平台的监测要素模板` - guideCode `通常为一个字节的Hex码, 对于定长的要素,可以使用FF为起始字节附加一个字节的Hex码作为引导符` - prefixLength `引导符之后要跳过的字符长度,限定大于0的偶数,参考后文 水文协议要素解析结构` - expression `值表达式,参考VE值解析表达式.pdf` - suffixLength `引导符之后要跳过的字符长度,限定大于0的偶数,参考后文 水文协议要素解析结构` - selfParseable `true或false,要素是否具有自解析的能力,通常 N(数值) 类型的要素具有自解析的能力` - identifier `标识符,对应平台监测要素` - name `名称,对应平台监测要素` - unit `单位,对应平台监测要素` #### 2.1.2 水文协议要素解析结构 ![image-20220620204106203](.\image-20220620204106203.png) 要素引导符应遵守上图中关于引导符扩展的定义。即 FF01两字节Hex码引导符的定义,要素的解析将不遵守标准水文协议中关于HEX/BCD编码标识符结构的规定,完全取决于valueExpression的定义,参考附录A。 ```json 基本结构 = guideCode + prefixLength + value + suffixLength eg 01 18 00016116 + '' eg解析 1byte(2size) 1byte(2size) 4byte(8size) 0byte(0size) 配置: { "guideCode":"01", "prefixLength":2, "valueExpression":"N(4,2)", "suffixLength": 0, "selfParseable": false, "identifier":"vt", "name":"电源电压", "unit":"伏特" } 解析结果: 161.16伏特 ``` #### 2.1.3 水文协议支持的VE值表达式 | 表达式 | 基本格式 | 描述 | | -------------- | -------- | ---------------------------- | | Arrays | A() | 数组表达式 | | Bytes | B() | 字节数组表达式 | | Combined | C() | 组合表达式 | | Enums | E() | 枚举表达式 | | HexFloat | HF() | Hex-浮点数表达式 | | HexNumber | HN() | Hex数值表达式 | | HexString | HS() | Hex字符表达式 | | Number | N() | 数值表达式 | | String | S() | 字符表达式 | | Timestamp | T() | 时间戳表达式 | | TimestampPoint | TP() | 时间点表达式(采集时间表达式) | T() 表达式作为 VE表达式的时间戳解析表达式用于解析时间戳要素,水文协议在此基础上增加 TP() 表达式, 其他内容与 T() 时间戳表达式一致, 当 inboundMessages 中的节点在任何类型下以任何形式使用了 TP() 表达式时,则解析完成后的数据将作为该报文的采集时间。例如配置为一个要素 ```json { "selfParseable": false, "expression": "TP(10,yyMMddHHmm,yyyy-MM-dd HH:mm)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "tt", "name": "观测时间", "guideCode": "F0" } ``` #### 2.1.4 水文协议默认脚本内容 ```json { "functions": [ { "functionCode": "2F", "functionName": "链路维持报", "inboundOnly": true, "inboundMessages": [ { "nodeKey": "serialNumber", "nodeName": "流水号", "type": "serial", "explain": "S(4)" }, { "nodeKey": "sendTime", "nodeName": "发报时间", "type": "value", "explain": "T(12,yyMMddHHmmss)" } ] }, { "functionCode": "30,32,34,35", "functionName": "测试报,定时报,加报报,小时报", "inboundOnly": true, "inboundMessages": [ { "nodeKey": "serialNumber", "nodeName": "流水号", "type": "serial", "explain": "S(4)" }, { "nodeKey": "sendTime", "nodeName": "发报时间", "type": "value", "explain": "T(12,yyMMddHHmmss)" }, { "nodeKey": "clientAddress", "nodeName": "遥测站地址", "type": "factor", "explain": "f1" }, { "nodeKey": "clientClassficationCode", "nodeName": "遥测站分类码", "type": "value", "explain": "S(2)" }, { "nodeKey": "observerTime", "nodeName": "观测时间", "type": "factor", "explain": "f0" }, { "nodeKey": "dynamicFactorSet", "nodeName": "动态要素集合", "type": "factors" } ], "outboundMessages": [ { "paramKey": "serial", "paramName": "流水号", "type": "serial", "pattern" : "4", "notes": "自动生成的四位流水号,使用serial函数" }, { "paramKey": "sendTime", "paramName": "发报时间", "type": "timestamp", "pattern" : "yyMMddHHmmss", "notes": "自动生成的yyMMddHHmmss格式的10位字符,使用timestamp函数" } ] }, { "functionCode": "51", "functionName": "中心站查询遥测站时钟", "inboundOnly": false, "inboundMessages": [ { "nodeKey": "serialNumber", "nodeName": "流水号", "type": "serial", "explain": "S(4)" }, { "nodeKey": "sendTime", "nodeName": "发报时间", "type": "value", "explain": "T(12,yyMMddHHmmss)" }, { "nodeKey": "clientAddress", "nodeName": "遥测站地址", "type": "factor", "explain": "f1" } ], "outboundMessages": [ { "paramKey": "serial", "paramName": "流水号", "type": "serial", "pattern" : "4", "notes": "自动生成的四位流水号,使用serial函数" }, { "paramKey": "sendTime", "paramName": "发报时间", "type": "timestamp", "pattern" : "yyMMddHHmmss", "notes": "自动生成的yyMMddHHmmss格式的10位字符,使用timestamp函数" } ] }, { "functionCode": "37", "functionName": "中心站查询遥测站实时数据", "inboundOnly": false, "inboundMessages": [ { "nodeKey": "serialNumber", "nodeName": "流水号", "type": "serial", "explain": "S(4)" }, { "nodeKey": "sendTime", "nodeName": "发报时间", "type": "value", "explain": "T(12,yyMMddHHmmss)" }, { "nodeKey": "clientAddress", "nodeName": "遥测站地址", "type": "factor", "explain": "f1" }, { "nodeKey": "clientClassficationCode", "nodeName": "遥测站分类码", "type": "value", "explain": "S(2)" }, { "nodeKey": "observerTime", "nodeName": "观测时间", "type": "factor", "explain": "f0" }, { "nodeKey": "dynamicFactorSet", "nodeName": "动态要素集合", "type": "factors" } ], "outboundMessages": [ { "paramKey": "serial", "paramName": "流水号", "type": "serial", "pattern" : "4", "notes": "自动生成的四位流水号,使用serial函数" }, { "paramKey": "sendTime", "paramName": "发报时间", "type": "timestamp", "pattern" : "yyMMddHHmmss", "notes": "自动生成的yyMMddHHmmss格式的10位字符,使用timestamp函数" } ] }, { "functionCode": "46", "functionName": "中心站查询遥测站状态信息", "inboundOnly": false, "inboundMessages": [ { "nodeKey": "serialNumber", "nodeName": "流水号", "type": "serial", "explain": "S(4)" }, { "nodeKey": "sendTime", "nodeName": "发报时间", "type": "value", "explain": "T(12,yyMMddHHmmss)" }, { "nodeKey": "clientAddress", "nodeName": "遥测站地址", "type": "factor", "explain": "f1" }, { "nodeKey": "clientStatusAndAlarm", "nodeName": "遥测站状态及报警", "type": "value", "explain": "S(8)", "notes": "结果应转换为二进制后对照水文监测数据通信规约表58" } ], "outboundMessages": [ { "paramKey": "serial", "paramName": "流水号", "type": "serial", "pattern" : "4", "notes": "自动生成的四位流水号,使用serial函数" }, { "paramKey": "sendTime", "paramName": "发报时间", "type": "timestamp", "pattern" : "yyMMddHHmmss", "notes": "自动生成的yyMMddHHmmss格式的10位字符,使用timestamp函数" } ] }, { "functionCode": "49", "functionName": "中心站修改遥测站传输密码", "inboundOnly": false, "inboundMessages": [ { "nodeKey": "serialNumber", "nodeName": "流水号", "type": "serial", "explain": "S(4)" }, { "nodeKey": "sendTime", "nodeName": "发报时间", "type": "value", "explain": "T(12,yyMMddHHmmss)" }, { "nodeKey": "clientAddress", "nodeName": "遥测站地址", "type": "factor", "explain": "f1" }, { "nodeKey": "newPasswd", "nodeName": "新密码", "type": "factor", "explain": { "identifier": "passwd", "guideCode": "03", "prefixLength": 0, "expression": "S(4)", "suffixLength": 0 } } ], "outboundMessages": [ { "paramKey": "serial", "paramName": "流水号", "type": "serial", "pattern" : "4", "notes": "自动生成的四位流水号,使用serial函数" }, { "paramKey": "sendTime", "paramName": "发报时间", "type": "timestamp", "pattern" : "yyMMddHHmmss", "notes": "自动生成的yyMMddHHmmss格式的10位字符,使用timestamp函数" }, { "paramKey": "oldPasswd", "paramName": "旧密码", "type" : "param", "pattern": "03{0}", "notes": "4位HEX字符" }, { "paramKey": "newPasswd", "paramName": "新密码", "type" : "param", "pattern": "03{0}", "notes": "4位HEX字符" } ] } ], "factors": [ { "selfParseable": false, "expression": "TP(10,yyMMddHHmm,yyyy-MM-dd HH:mm)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "tt", "name": "观测时间", "guideCode": "F0" }, { "selfParseable": false, "expression": "S(10)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "st", "name": "遥测站地址", "guideCode": "F1" }, { "selfParseable": false, "expression": "A(HN(2),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.1mm", "identifier": "drp", "name": "1小时内每5分钟时段雨量", "guideCode": "F4" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz1", "name": "1小时内5分钟间隔相对水位1", "guideCode": "F5" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz2", "name": "1小时内5分钟间隔相对水位2", "guideCode": "F6" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz3", "name": "1小时内5分钟间隔相对水位3", "guideCode": "F7" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz4", "name": "1小时内5分钟间隔相对水位4", "guideCode": "F8" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz5", "name": "1小时内5分钟间隔相对水位5", "guideCode": "F9" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz6", "name": "1小时内5分钟间隔相对水位6", "guideCode": "FA" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz7", "name": "1小时内5分钟间隔相对水位7", "guideCode": "FB" }, { "selfParseable": false, "expression": "A(HN(4),12)", "prefixLength": 0, "suffixLength": 0, "unit": "0.01m", "identifier": "drz8", "name": "1小时内5分钟间隔相对水位8", "guideCode": "FC" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m²", "identifier": "ac", "name": "断面面积", "guideCode": "01" }, { "selfParseable": true, "expression": "N(6,1)", "prefixLength": 2, "suffixLength": 0, "unit": "℃", "identifier": "ai", "name": "瞬时气温", "guideCode": "02" }, { "selfParseable": true, "expression": "N(6,1)", "prefixLength": 2, "suffixLength": 0, "unit": "℃", "identifier": "c", "name": "瞬时水温", "guideCode": "03" }, { "selfParseable": true, "expression": "N(6)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "drxnn", "name": "时间步长码", "guideCode": "04" }, { "selfParseable": true, "expression": "S(2.1)", "prefixLength": 0, "suffixLength": 0, "unit": "h.m", "identifier": "dt", "name": "时段长,降水、引排水、抽水历时", "guideCode": "05" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "ed", "name": "日蒸发量", "guideCode": "06" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "ej", "name": "当前蒸发", "guideCode": "07" }, { "selfParseable": true, "expression": "N(10)", "prefixLength": 2, "suffixLength": 0, "unit": "hPa", "identifier": "fl", "name": "气压", "guideCode": "08" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "gh", "name": "闸坝、水库闸门开启高度", "guideCode": "09" }, { "selfParseable": true, "expression": "N(6)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "gn", "name": "输水设备、闸门(组)编号", "guideCode": "0A" }, { "selfParseable": true, "expression": "S(2)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "gs", "name": "输水设备类别", "guideCode": "0B" }, { "selfParseable": true, "expression": "N(6)", "prefixLength": 2, "suffixLength": 0, "unit": "孔", "identifier": "gt", "name": "水库、闸坝闸门开启孔数", "guideCode": "0C" }, { "selfParseable": true, "expression": "N(6,1)", "prefixLength": 2, "suffixLength": 0, "unit": "℃", "identifier": "gtp", "name": "地温 ", "guideCode": "0D" }, { "selfParseable": true, "expression": "N(12,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "h", "name": "地下水瞬时埋深 ", "guideCode": "0E" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "hw", "name": "波浪高度 ", "guideCode": "0F" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m10", "name": "10cm处土壤含水量", "guideCode": "10" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m20", "name": "20cm处土壤含水量", "guideCode": "11" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m30", "name": "30cm处土壤含水量", "guideCode": "12" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m40", "name": "40cm处土壤含水量", "guideCode": "13" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m50", "name": "50cm处土壤含水量", "guideCode": "14" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m60", "name": "60cm处土壤含水量", "guideCode": "15" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m80", "name": "80cm处土壤含水量", "guideCode": "16" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "m100", "name": "100cm处土壤含水量", "guideCode": "17" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "%", "identifier": "mst", "name": "湿度", "guideCode": "18" }, { "selfParseable": true, "expression": "N(4)", "prefixLength": 2, "suffixLength": 0, "unit": "台", "identifier": "ns", "name": "开机台数", "guideCode": "19" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "p1", "name": "1小时时段降水量", "guideCode": "1A" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "p2", "name": "2小时时段降水量", "guideCode": "1B" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "p3", "name": "3小时时段降水量", "guideCode": "1C" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "p6", "name": "6小时时段降水量", "guideCode": "1D" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "p12", "name": "12小时时段降水量", "guideCode": "1E" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pd", "name": "日降水量", "guideCode": "1F" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pj", "name": "当前降水量", "guideCode": "20" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pn01", "name": "1分钟时段降水量", "guideCode": "21" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pn05", "name": "5分钟时段降水量", "guideCode": "22" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pn10", "name": "10分钟时段降水量", "guideCode": "23" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pn30", "name": "30分钟时段降水量", "guideCode": "24" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pr", "name": "暴雨量", "guideCode": "25" }, { "selfParseable": true, "expression": "N(12,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mm", "identifier": "pt", "name": "降水量累计值 ", "guideCode": "26" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q", "name": "瞬时流量、抽水流量", "guideCode": "27" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q1", "name": "取(排)水口流量1", "guideCode": "28" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q2", "name": "取(排)水口流量2", "guideCode": "29" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q3", "name": "取(排)水口流量3", "guideCode": "2A" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q4", "name": "取(排)水口流量4", "guideCode": "2B" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q5", "name": "取(排)水口流量5", "guideCode": "2C" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q6", "name": "取(排)水口流量6", "guideCode": "2D" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q7", "name": "取(排)水口流量7", "guideCode": "2E" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "q8", "name": "取(排)水口流量8", "guideCode": "2F" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "qa", "name": "总出库流量、过闸总流量", "guideCode": "30" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/s", "identifier": "qz", "name": "输水设备流量、过闸(组)流量", "guideCode": "31" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "万吨", "identifier": "sw", "name": "输沙量", "guideCode": "32" }, { "selfParseable": true, "expression": "S(4)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "uc", "name": "风向", "guideCode": "33" }, { "selfParseable": true, "expression": "S(4)", "prefixLength": 2, "suffixLength": 0, "unit": "级", "identifier": "ue", "name": "风力", "guideCode": "34" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "length": 8, "unit": "m/s", "identifier": "us", "name": "风速", "guideCode": "35" }, { "selfParseable": true, "expression": "N(10,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m/s", "identifier": "va", "name": "断面平均流速", "guideCode": "36" }, { "selfParseable": true, "expression": "N(10,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m/s", "identifier": "vj", "name": "当前瞬时流速", "guideCode": "37" }, { "selfParseable": true, "expression": "N(8,2)", "prefixLength": 2, "suffixLength": 0, "unit": "V", "identifier": "vt", "name": "电源电压", "isWorkInfoFactor": true, "guideCode": "38" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z", "name": "瞬时河道水位、潮位", "guideCode": "39" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "zb", "name": "库(闸、站)下水位", "guideCode": "3A" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "zu", "name": "库(闸、站)上水位", "guideCode": "3B" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z1", "name": "取(排)水口水位1", "guideCode": "3C" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z2", "name": "取(排)水口水位2", "guideCode": "3D" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z3", "name": "取(排)水口水位3", "guideCode": "3E" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z4", "name": "取(排)水口水位4", "guideCode": "3F" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z5", "name": "取(排)水口水位5", "guideCode": "40" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z6", "name": "取(排)水口水位6", "guideCode": "41" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z7", "name": "取(排)水口水位7", "guideCode": "42" }, { "selfParseable": true, "expression": "N(14,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m", "identifier": "z8", "name": "取(排)水口水位8", "guideCode": "43" }, { "selfParseable": true, "expression": "N(18,3)", "prefixLength": 2, "suffixLength": 0, "unit": "千克/m³", "identifier": "sq", "name": "含沙量", "guideCode": "44" }, { "selfParseable": true, "expression": "N(8,2)", "prefixLength": 2, "suffixLength": 0, "unit": "", "identifier": "ph", "name": "pH值", "isWorkInfoFactor": true, "guideCode": "46" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "do", "name": "溶解氧", "guideCode": "47" }, { "selfParseable": true, "expression": "N(10)", "prefixLength": 2, "suffixLength": 0, "unit": "us/cm", "identifier": "cond", "name": "电导率", "guideCode": "48" }, { "selfParseable": true, "expression": "N(6)", "prefixLength": 2, "suffixLength": 0, "unit": "度", "identifier": "turb", "name": "浊度", "guideCode": "49" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "codmn", "name": "高锰酸盐指数", "guideCode": "4A" }, { "selfParseable": true, "expression": "N(10,1)", "prefixLength": 2, "suffixLength": 0, "unit": "mV", "identifier": "redox", "name": "氧化还原电位", "guideCode": "4B" }, { "selfParseable": true, "expression": "N(12,2)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "nh4n", "name": "氨氮", "guideCode": "4C" }, { "selfParseable": true, "expression": "N(10,3)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "tp", "name": "总磷", "guideCode": "4D" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "tn", "name": "总氮", "guideCode": "4E" }, { "selfParseable": true, "expression": "N(8,2)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "toc", "name": "总有机碳", "guideCode": "4F" }, { "selfParseable": true, "expression": "N(14,4)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "cu", "name": "铜", "guideCode": "50" }, { "selfParseable": true, "expression": "N(12,4)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "zn", "name": "锌", "guideCode": "51" }, { "selfParseable": true, "expression": "N(14,5)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "se", "name": "硒", "guideCode": "52" }, { "selfParseable": true, "expression": "N(14,5)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "as", "name": "砷", "guideCode": "53" }, { "selfParseable": true, "expression": "N(14,5)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "thg", "name": "总汞", "guideCode": "54" }, { "selfParseable": true, "expression": "N(14,5)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "cd", "name": "镉", "guideCode": "55" }, { "selfParseable": true, "expression": "N(14,5)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "pb", "name": "铅", "guideCode": "56" }, { "selfParseable": true, "expression": "N(8,2)", "prefixLength": 2, "suffixLength": 0, "unit": "mg/L", "identifier": "chla", "name": "叶绿素a", "guideCode": "57" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp1", "name": "水压1", "guideCode": "58" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp2", "name": "水压2", "guideCode": "59" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp3", "name": "水压3", "guideCode": "5A" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp4", "name": "水压4", "guideCode": "5B" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp5", "name": "水压5", "guideCode": "5C" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp6", "name": "水压6", "guideCode": "5D" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp7", "name": "水压7", "guideCode": "5E" }, { "selfParseable": true, "expression": "N(10,2)", "prefixLength": 2, "suffixLength": 0, "unit": "kPa", "identifier": "wp8", "name": "水压8", "guideCode": "5F" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl1", "name": "水表1剩余水量", "guideCode": "60" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl2", "name": "水表2剩余水量", "guideCode": "61" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl3", "name": "水表3剩余水量", "guideCode": "62" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl4", "name": "水表4剩余水量", "guideCode": "63" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl5", "name": "水表5剩余水量", "guideCode": "64" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl6", "name": "水表6剩余水量", "guideCode": "65" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl7", "name": "水表7剩余水量", "guideCode": "66" }, { "selfParseable": true, "expression": "N(22,3)", "prefixLength": 2, "suffixLength": 0, "unit": "m³", "identifier": "syl8", "name": "水表8剩余水量", "guideCode": "67" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl1", "name": "水表1每小时水量 ", "guideCode": "68" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl2", "name": "水表2每小时水量 ", "guideCode": "69" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl3", "name": "水表3每小时水量 ", "guideCode": "6A" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl4", "name": "水表4每小时水量 ", "guideCode": "6B" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl5", "name": "水表5每小时水量 ", "guideCode": "6C" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl6", "name": "水表6每小时水量 ", "guideCode": "6D" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl7", "name": "水表7每小时水量 ", "guideCode": "6E" }, { "selfParseable": true, "expression": "N(20,2)", "prefixLength": 2, "suffixLength": 0, "unit": "m³/h", "identifier": "sbl8", "name": "水表8每小时水量 ", "guideCode": "6F" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "V", "identifier": "vta", "name": "交流A相电压 ", "guideCode": "70" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "V", "identifier": "vtb", "name": "交流B相电压 ", "guideCode": "71" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "V", "identifier": "vtc", "name": "交流C相电压 ", "guideCode": "72" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "A", "identifier": "via", "name": "交流A相电流 ", "guideCode": "73" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "A", "identifier": "vib", "name": "交流B相电流 ", "guideCode": "74" }, { "selfParseable": true, "expression": "N(8,1)", "prefixLength": 2, "suffixLength": 0, "unit": "A", "identifier": "vic", "name": "交流C相电流 ", "guideCode": "75" } ] } ``` ### 2.2 四信预警广播协议脚本配置说明 > 参考文档: > > 1. 四信预警终端网络通讯协议V1.16.doc > 2. VE值解析表达式.pdf ​ 四信配置预警广播协议脚本前,最好能够先行阅读参考文档,以便于理解。 ​ 四信预警广播协议脚本为.json文件,脚本内容需要符合JSON文件的基本数据格式。预警广播协议为无采集要素的协议,因而只支持配置下行指令。主体分为 collectMessages, configureMessages 和 atParams 三部分,collectMessages 作为下行指令的配置内容,configureMessages作为远程配置的常用指令的配置内容,atParams作为at指令的解析依据。 ```json { "versionName": "预警广播协议", "versionHighBit" : "11", "versionLowBit" : "01", "collectMessages" : [], "configureMessages " : [], "atParams":[] } ``` #### 2.2.1 四信预警广播协议脚本 JSON格式说明 - versionName `版本名称, 非空字符, 无实意, 仅作为描述性字符` - versionHighBit `两位数字组成的版本高字节` - versionLowBit `两位数字组成的版本低字节` - collectMessages `采集消息配置,该配置内容将解析为平台的下行指令列表, json数组` - name `报文的名称,非空字符` - outCode `下行唯一编码,对应预警广播协议` - outBody1 `下行正文结构1定义, json数组, 通常为空` - argCode `参数编码,字符` - argName `参数名称,字符` - argCharset `参数编码格式,例如GBK,UTF-8等` - argNotes `参数的字符描述内容` - outBody2 `下行正文结构2定义, json数组` - argCode `参数编码,字符` - argName `参数名称,字符` - argCharset `参数编码格式,例如GBK,UTF-8等` - argNotes `参数的字符描述内容` - inCode `上行唯一编码, 对应预警广播协议` - inBody1 `上行正文结构1定义, json数组, 通常为空` - valueCode `值编码,长度限定50` - valueName `值名称,长度限定20` - valueExpression `VE值表达式, ,参考VE值解析表达式.pdf` - inBody2 `上行正文结构2定义, json数组` - valueCode `值编码,长度限定50` - valueName `值名称,长度限定20` - valueExpression `VE值表达式, ,参考VE值解析表达式.pdf` - configureMessages `配置消息配置,该配置内容将解析为远程配置的常用指令, json数组` - name `报文的名称,非空字符` - outCode `下行唯一编码,对应预警广播协议` - inCode `上行唯一编码, 对应预警广播协议` - inBody1 `上行正文结构1定义, json数组, 通常为空` - valueCode `值编码,长度限定50` - valueName `值名称,长度限定20` - valueExpression `VE值表达式, ,参考VE值解析表达式.pdf` - inBody2 `上行正文结构2定义, json数组` - valueCode `值编码,长度限定50` - valueName `值名称,长度限定20` - valueExpression `VE值表达式, ,参考VE值解析表达式.pdf` - atParams `at参数的配置内容, json数组` - paramCode `参数编码, 0-f的十六进制组成的4位字符,不区分大小写` - paramName `参数名称, 字符` - paramType `参数类型,[UNSIGNED_SHORT,UNSIGNED_INT,UNSIGNED_LONG,CHAR]` - paramCharset `参数编码格式, HEX或其他常用编码格式, 例如GBK,UTF-8等` - atCommandCode `对应的AT命令编码, 无实意, 仅作为提示性字符` #### 2.2.2 四信预警广播协议-两段式正文 ​ 四信预警广播协议无论上行还是下行报文,正文部分都是由两段式组成,如下所示 | ID号 | 命令字节 | 数据长度1 | 数据1 | 数据长度2 | 数据2 | | ------- | -------- | --------- | -------- | --------- | -------- | | 4个字节 | 2 | 2 | 数据内容 | 2 | 数据内容 | ​ 因而在预警广播协议的脚本中,无论是collectMessages或者configureMessages中都出现了 body1 和 body2 类似的结构,实际上都是对应了协议本身的两段式正文而设计的。在配置时可以进行参考。 #### 2.2.3 四信预警广播协议支持的VE值表达式 | 表达式 | 基本格式 | 描述 | | --------- | -------- | ---------------- | | Enums | E() | 枚举表达式 | | HexFloat | HF() | Hex-浮点数表达式 | | HexNumber | HN() | Hex数值表达式 | | HexString | HS() | Hex字符表达式 | | Number | N() | 数值表达式 | | String | S() | 字符表达式 | | Timestamp | T() | 时间戳表达式 | #### 2.2.4 四信预警广播协议默认脚本内容 ```json { "versionName" : "预警广播协议", "versionHighBit" : "11", "versionLowBit" : "01", "collectMessages" : [ { "name" : "山洪预警", "outCode" : "8001", "outBody1" : [], "outBody2" : [ { "argCode" : "broadcastText", "argName" : "广播文本", "argCharset" : "GBK", "argNotes" : "广播文本" } ], "inCode" : "0001", "inBody1" : [], "inBody2" : [ { "valueCode" : "isSuccess", "valueName" : "是否成功", "valueExpression" : "E(2,01-成功,00-失败)" } ] }, { "name" : "播放MP3", "outCode" : "8101", "outBody1" : [], "outBody2" : [ { "argCode" : "songName", "argName" : "歌曲名称", "argCharset" : "GBK", "argNotes" : "5位数值歌曲名称,例如00001" } ], "inCode" : "0101", "inBody1" : [], "inBody2" : [ { "valueCode" : "isSuccess", "valueName" : "是否成功", "valueExpression" : "E(2,01-成功,00-失败)" } ] }, { "name" : "停止播放MP3", "outCode" : "8102", "outBody1" : [], "outBody2" : [], "inCode" : "0102", "inBody1" : [], "inBody2" : [ { "valueCode" : "isSuccess", "valueName" : "是否成功", "valueExpression" : "E(2,01-成功,00-失败)" } ] } ], "configureMessages" : [ { "name" : "重启设备", "outCode" : "81A0", "outBody1" : [], "outBody2" : [], "inCode" : "01A0", "inBody1" : [], "inBody2" : [] }, { "name" : "查询设备版本", "outCode" : "8201", "outBody1" : [], "outBody2" : [], "inCode" : "0201", "inBody1" : [], "inBody2" : [ { "valueCode" : "appVersion", "valueName" : "APP版本", "valueExpression" : "HS(80)" }, { "valueCode" : "bootVersion", "valueName" : "BOOT版本", "valueExpression" : "HS(80)" } ] }, { "name" : "中心下发配置查询", "outCode" : "8224", "outBody1" : [], "outBody2" : [], "inCode" : "0224", "inBody1" : [], "inBody2" : [ { "valueCode" : "paramNumber", "valueName" : "参数个数", "valueExpression" : "HN(2)" }, { "valueCode" : "configParam", "valueName" : "配置参数", "valueExpression" : "AT-P()" } ] } ], "atParams" : [ { "paramCode" : "0001", "paramName" : "预置内容1", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+LRMSETTXT1" }, { "paramCode" : "0002", "paramName" : "预置内容2", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+LRMSETTXT2" }, { "paramCode" : "0003", "paramName" : "预置内容3", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+LRMSETTXT3" }, { "paramCode" : "0004", "paramName" : "电话预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMPHNPRIO" }, { "paramCode" : "0005", "paramName" : "短信预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSMSPRIO" }, { "paramCode" : "0006", "paramName" : "GPRS数据预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMGPRSPRIO" }, { "paramCode" : "0007", "paramName" : "本地麦克风预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMMICPRIO" }, { "paramCode" : "0008", "paramName" : "对讲机预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMINPHNPRIO" }, { "paramCode" : "0009", "paramName" : "FM调频预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMFMPRIO" }, { "paramCode" : "000A", "paramName" : "MP3预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMMP3PRIO" }, { "paramCode" : "000B", "paramName" : "预置内容预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMLCLLRMPRIO" }, { "paramCode" : "000C", "paramName" : "Line in输入预警优先级", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMLINEPRIO" }, { "paramCode" : "000D", "paramName" : "短信预警播报次数", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSMSPLYNUM" }, { "paramCode" : "000E", "paramName" : "GPRS预警播放次数", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMGPRSPLYNUM" }, { "paramCode" : "000F", "paramName" : "本地预警播报次数", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMLCLLRMPLYNUM" }, { "paramCode" : "0010", "paramName" : "数据中心数目", "paramType" : "unsigned int", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+SVRCNT" }, { "paramCode" : "0011", "paramName" : "GPRS主中心地址", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+IPAD" }, { "paramCode" : "0012", "paramName" : "GPRS主中心端口", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+PORT" }, { "paramCode" : "0013", "paramName" : "GPRS备份中心地址", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+IPSEC" }, { "paramCode" : "0014", "paramName" : "GPRS备份中心端口", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+PTSEC" }, { "paramCode" : "0015", "paramName" : "主中心DNS服务器IP", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+DNSSVR" }, { "paramCode" : "0016", "paramName" : "备份中心DNS服务器IP", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+DNSSV2" }, { "paramCode" : "0017", "paramName" : "调试等级", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+DEBUG" }, { "paramCode" : "0018", "paramName" : "是否自动返回主中心", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+RETMAIN" }, { "paramCode" : "0019", "paramName" : "设备ID号码", "paramType" : "unsigned long", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+IDNT" }, { "paramCode" : "001A", "paramName" : "设备SIM号码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+PHON" }, { "paramCode" : "001B", "paramName" : "重连时尝试次数", "paramType" : "unsigned short", "paramCharset" : "Hex", "atCommandCode" : "atCommandCode+RETRY" }, { "paramCode" : "001C", "paramName" : "重连任务之间的间隔", "paramType" : "unsigned short", "paramCharset" : "Hex", "atCommandCode" : "atCommandCode+RDLWT" }, { "paramCode" : "001D", "paramName" : "无线网络APN", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+APN" }, { "paramCode" : "001E", "paramName" : "APN用户名", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+USERNAME" }, { "paramCode" : "001F", "paramName" : "APN密码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+PASSWORD" }, { "paramCode" : "0020", "paramName" : "APN拨号中心号码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+CENT" }, { "paramCode" : "0021", "paramName" : "短信中心号码(+86)", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+SMSC" }, { "paramCode" : "0022", "paramName" : "心跳包时间", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+POLLTIME" }, { "paramCode" : "0023", "paramName" : "PIN码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+SETPASSWORD" }, { "paramCode" : "0024", "paramName" : "是否开启录音", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMRECORD" }, { "paramCode" : "0025", "paramName" : "录音码率(KPS)", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMRECORDCODERatCommandCodeE" }, { "paramCode" : "0026", "paramName" : "是否短信回执", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSMSRSP" }, { "paramCode" : "0027", "paramName" : "是否短信预警备份", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSMSBK" }, { "paramCode" : "0028", "paramName" : "状态短信发送时间间隔(分钟)", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSTatCommandCodeESMSTIME" }, { "paramCode" : "0029", "paramName" : "FM接收频率(MHz)", "paramType" : "unsigned short", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMFMFREQ" }, { "paramCode" : "002A", "paramName" : "FM接收信噪比", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMFMSNR" }, { "paramCode" : "002B", "paramName" : "FM音量", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMFMVOICE" }, { "paramCode" : "002C", "paramName" : "是否启用FM接收", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMFMRECEN" }, { "paramCode" : "002D", "paramName" : "MP3播放模式", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMMP3PLYMODE" }, { "paramCode" : "002E", "paramName" : "MP3播放音量", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMMP3LVL" }, { "paramCode" : "002F", "paramName" : "TTS语音模式", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMTTSVOICE" }, { "paramCode" : "0030", "paramName" : "TTS播放音量", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMTTSLVL" }, { "paramCode" : "0031", "paramName" : "TTS播放语速", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMTTSSPEED" }, { "paramCode" : "0032", "paramName" : "TTS播放语调", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMTTSTONE" }, { "paramCode" : "0033", "paramName" : "是否带通讯模块", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMMCUFUN" }, { "paramCode" : "0034", "paramName" : "是否开启对讲机模块", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSETINPHNOPEN" }, { "paramCode" : "0035", "paramName" : "是否开启拾音器", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMAUDIOFUNOPEN" }, { "paramCode" : "0036", "paramName" : "管理号码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+LRMADDADMINNO" }, { "paramCode" : "0037", "paramName" : "授权号码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+LRMADDLRMNO" }, { "paramCode" : "0038", "paramName" : "备份号码", "paramType" : "char", "paramCharset" : "GBK", "atCommandCode" : "atCommandCode+LRMADDBKNO" }, { "paramCode" : "0039", "paramName" : "喇叭防盗报警是否发送到备份号码池中的号码", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMLDSSMS" }, { "paramCode" : "0040", "paramName" : "预警设备防盗报警是否发送备份号码池中的号码", "paramType" : "char", "paramCharset" : "HEX", "atCommandCode" : "atCommandCode+LRMSAFESMS" } ] } ```