java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息

工具包引入

<dependency>
  <groupId>cn.allbs</groupId>
  <artifactId>allbs-model</artifactId>
  <version>0.8.1</version>
</dependency>

源码下载

根据自己项目写的工具包,有需要可以下载后修改:https://github.com/chenqi92/allbs-model

解析字段说明

字段值 字段说明
machineNo 机器号
time 时间
version 版本号
order 命令-中文说明
preOrder 命令-原始值
code 代码
controller 控制器
message 信息类型-中文说明
preMessage 信息类型-原始值
circuit 回路
part 部位
disk 盘号
district 区号
boardNumber 板号
line 专线号
address 地址
type 部件类型-中文说明
preType 部件类型-原始值
status 状态
preStatus 状态
sensorChannel 传感器通道
alarmValue 报警值
accumulateSum 累加和
unit 单位

心跳报文解析

报文解析示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223133650040

示例代码

byte[] bytes = new byte[26];
bytes[0] = (byte0x82;
bytes[1] = (byte0x30;
bytes[2] = (byte0x30;
bytes[3] = (byte0x32;
bytes[4] = (byte0x34;
bytes[5] = (byte0x30;
bytes[6] = (byte0x30;
bytes[7] = (byte0x30;
bytes[8] = (byte0x30;
bytes[9] = (byte0x30;
bytes[10] = (byte0x30;
bytes[11] = (byte0x31;
bytes[12] = (byte0x31;
bytes[13] = (byte0x30;
bytes[14] = (byte0x35;
bytes[15] = (byte0x31;
bytes[16] = (byte0x38;
bytes[17] = (byte0x30;
bytes[18] = (byte0x3E;
bytes[19] = (byte0x30;
bytes[20] = (byte0x3F;
bytes[21] = (byte0x31;
bytes[22] = (byte0x31;
bytes[23] = (byte0x38;
bytes[24] = (byte0x30;
bytes[25] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果图

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223134717092

正常应答数据

报文解析示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223134824987

示例代码

byte[] bytes = new byte[26];
// 报文头
bytes[0] = (byte0x82;
// D1
bytes[1] = (byte0x30;
bytes[2] = (byte0x39;
// D2
bytes[3] = (byte0x30;
bytes[4] = (byte0x31;
// D3
bytes[5] = (byte0x30;
bytes[6] = (byte0x30;
// D4
bytes[7] = (byte0x30;
bytes[8] = (byte0x30;
// D5
bytes[9] = (byte0x30;
bytes[10] = (byte0x30;
// D6
bytes[11] = (byte0x30;
bytes[12] = (byte0x30;
// D7
bytes[13] = (byte0x30;
bytes[14] = (byte0x30;
// D8
bytes[15] = (byte0x30;
bytes[16] = (byte0x30;
// D9
bytes[17] = (byte0x30;
bytes[18] = (byte0x30;
// D10
bytes[19] = (byte0x30;
bytes[20] = (byte0x30;
// D11
bytes[21] = (byte0x30;
bytes[22] = (byte0x30;
// D12
bytes[23] = (byte0x30;
bytes[24] = (byte0x3A;
// 报文尾
bytes[25] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果图

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223140344647

火警数据报文解析

报文解析示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223140506381

代码示例

byte[] bytes = new byte[26];
// 报文头
bytes[0] = (byte0x82;
// D1
bytes[1] = (byte0x38;
bytes[2] = (byte0x30;
// D2
bytes[3] = (byte0x32;
bytes[4] = (byte0x34;
// D3
bytes[5] = (byte0x30;
bytes[6] = (byte0x38;
// D4
bytes[7] = (byte0x39;
bytes[8] = (byte0x3B;
// D5
bytes[9] = (byte0x30;
bytes[10] = (byte0x31;
// D6
bytes[11] = (byte0x31;
bytes[12] = (byte0x31;
// D7
bytes[13] = (byte0x30;
bytes[14] = (byte0x33;
// D8
bytes[15] = (byte0x30;
bytes[16] = (byte0x38;
// D9
bytes[17] = (byte0x31;
bytes[18] = (byte0x30;
// D10
bytes[19] = (byte0x30;
bytes[20] = (byte0x34;
// D11
bytes[21] = (byte0x30;
bytes[22] = (byte0x38;
// D12
bytes[23] = (byte0x38;
bytes[24] = (byte0x30;
// 报文尾
bytes[25] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223142712393

喷洒启动

报文解析示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223142751649

代码示例

byte[] bytes = new byte[26];
// 报文头
bytes[0] = (byte0x82;
// D1
bytes[1] = (byte0x3F;
bytes[2] = (byte0x3A;
// D2
bytes[3] = (byte0x30;
bytes[4] = (byte0x32;
// D3
bytes[5] = (byte0x30;
bytes[6] = (byte0x3B;
// D4
bytes[7] = (byte0x30;
bytes[8] = (byte0x32;
// D5
bytes[9] = (byte0x30;
bytes[10] = (byte0x32;
// D6
bytes[11] = (byte0x31;
bytes[12] = (byte0x31;
// D7
bytes[13] = (byte0x30;
bytes[14] = (byte0x33;
// D8
bytes[15] = (byte0x30;
bytes[16] = (byte0x39;
// D9
bytes[17] = (byte0x30;
bytes[18] = (byte0x3E;
// D10
bytes[19] = (byte0x30;
bytes[20] = (byte0x3D;
// D11
bytes[21] = (byte0x31;
bytes[22] = (byte0x3B;
// D12
bytes[23] = (byte0x35;
bytes[24] = (byte0x3E;
// 报文尾
bytes[25] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223143035932

单常开防火门故障

报文解析示例(文档累加和错误)

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223143208327

代码示例

byte[] bytes = new byte[26];
// 报文头
bytes[0] = (byte0x82;
// D1
bytes[1] = (byte0x3F;
bytes[2] = (byte0x3B;
// D2
bytes[3] = (byte0x32;
bytes[4] = (byte0x34;
// D3
bytes[5] = (byte0x30;
bytes[6] = (byte0x31;
// D4
bytes[7] = (byte0x3F;
bytes[8] = (byte0x3E;
// D5
bytes[9] = (byte0x31;
bytes[10] = (byte0x31;
// D6
bytes[11] = (byte0x31;
bytes[12] = (byte0x31;
// D7
bytes[13] = (byte0x30;
bytes[14] = (byte0x33;
// D8
bytes[15] = (byte0x31;
bytes[16] = (byte0x37;
// D9
bytes[17] = (byte0x30;
bytes[18] = (byte0x37;
// D10
bytes[19] = (byte0x30;
bytes[20] = (byte0x37;
// D11
bytes[21] = (byte0x31;
bytes[22] = (byte0x3F;
// D12
bytes[23] = (byte0x3A;
bytes[24] = (byte0x37;
// 报文尾
bytes[25] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230224092221631

剩余电流探测器故障

报文示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223144941391

代码示例

byte[] bytes = new byte[26];
// 报文头
bytes[0] = (byte0x82;
// D1
bytes[1] = (byte0x3F;
bytes[2] = (byte0x3C;
// D2
bytes[3] = (byte0x32;
bytes[4] = (byte0x34;
// D3
bytes[5] = (byte0x32;
bytes[6] = (byte0x30;
// D4
bytes[7] = (byte0x3C;
bytes[8] = (byte0x37;
// D5
bytes[9] = (byte0x32;
bytes[10] = (byte0x32;
// D6
bytes[11] = (byte0x31;
bytes[12] = (byte0x31;
// D7
bytes[13] = (byte0x30;
bytes[14] = (byte0x34;
// D8
bytes[15] = (byte0x31;
bytes[16] = (byte0x37;
// D9
bytes[17] = (byte0x30;
bytes[18] = (byte0x37;
// D10
bytes[19] = (byte0x30;
bytes[20] = (byte0x37;
// D11
bytes[21] = (byte0x31;
bytes[22] = (byte0x3F;
// D12
bytes[23] = (byte0x38;
bytes[24] = (byte0x32;
// 报文尾
bytes[25] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223145440566

温度探测器

报文示例(文档中报文crc校验值错误)

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223145507180

代码示例

byte[] bytes = new byte[36];
// 报文头
bytes[0] = (byte0x82;
// D1
bytes[1] = (byte0x3F;
bytes[2] = (byte0x3C;
// D2
bytes[3] = (byte0x30;
bytes[4] = (byte0x32;
// D3
bytes[5] = (byte0x30;
bytes[6] = (byte0x31;
// D4
bytes[7] = (byte0x34;
bytes[8] = (byte0x32;
// D5
bytes[9] = (byte0x3F;
bytes[10] = (byte0x3F;
// D6
bytes[11] = (byte0x31;
bytes[12] = (byte0x31;
// D7
bytes[13] = (byte0x30;
bytes[14] = (byte0x35;
// D8
bytes[15] = (byte0x31;
bytes[16] = (byte0x38;
// D9
bytes[17] = (byte0x30;
bytes[18] = (byte0x3F;
// D10
bytes[19] = (byte0x32;
bytes[20] = (byte0x3D;
// D11
bytes[21] = (byte0x30;
bytes[22] = (byte0x31;
// D12
bytes[23] = (byte0x3A;
bytes[24] = (byte0x3B;
// D13
bytes[25] = (byte0x31;
bytes[26] = (byte0x33;
// D14
bytes[27] = (byte0x30;
bytes[28] = (byte0x30;
// D15
bytes[29] = (byte0x35;
bytes[30] = (byte0x38;
// D16
bytes[31] = (byte0x30;
bytes[32] = (byte0x32;
// CRC
bytes[33] = (byte0x3E;
bytes[34] = (byte0x33;
// 报文尾
bytes[35] = (byte0x83;
JBF293KMapper jbf293KMapper = new JBF293KMapper();
System.out.println(jbf293KMapper.readValue(bytes, Map.class));

结果示例

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230223154854847

调试过程

设备接线

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息

配置设备网络地址和串口

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230302115017177
java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230302115127082

使用串口工具模拟发送报文

{% link 串口调试工具,nas,http://gofile.me/5lHRJ/Ji3BeVc1e %}

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230302115430323

启动java服务接收数据

java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息
image-20230302115538016


原文始发于微信公众号(询于刍荛):java中JBF293K协议报文解析,获取消防应急门状态、报警数据等信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/280953.html

(0)
Java朝阳的头像Java朝阳

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!