工具包引入

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

源码下载

解析字段说明

字段值 字段说明
sysType 系统类型标志
sysTypeTrans 系统类型标志含义
sysAddress 系统地址
sysDesc 系统状态
partType 部件类型
partTypeTrans 部件类型翻译
partAddress 部件地址
partDesc 部件状态
partExplain 部件说明
time 时间
aq 模拟量类型
aqNum 模拟量值
operateType 操作员标识
operatorNum 操作员编号
mainVersion 主版本号
minorVersion 次版本号
sysConfLen 系统配置说明长度
sysConfExplain 系统配置说明 内容
runningStatus 运行状态
transmittingConfLen 系统配置说明长度
transmittingConfExplain 系统配置说明 内容
msgData 信息对象
msgDataType 数据单元标识符-类型标志
msgDataTypeTrans 数据单元标识符-类型标志
msgDataNum 数据单元标识符-信息对象数目
flow 流水号
sourceAddress 源地址
targetAddress 目的地址
controlOrder 控制命令
data 应用数据单元
happenTime 时间

解析示例

代码示例

byte[] bytes = new byte[32];
bytes[0] = 0x40;
bytes[1] = 0x40;
bytes[2] = 0x76;
bytes[3] = 0x31;
bytes[4] = 0x1;
bytes[5] = 0x2;
bytes[6] = 0xc;
bytes[7] = 0xf;
bytes[8] = 0x0;
bytes[9] = 0xb;
bytes[10] = 0x7;
bytes[11] = 0x16;
bytes[12] = 0x50;
bytes[13] = 0x0;
bytes[14] = 0x0;
bytes[15] = 0x0;
bytes[16] = 0x0;
bytes[17] = 0x0;
bytes[18] = 0x3c;
bytes[19] = (byte) 0xce;
bytes[20] = (byte) 0xb5;
bytes[21] = 0x6a;
bytes[22] = 0x8;
bytes[23] = 0x0;
bytes[24] = 0x4;
bytes[25] = 0x0;
bytes[26] = 0x2;
bytes[27] = 0x19;
bytes[28] = 0x1;
bytes[29] = 0x1;
bytes[30] = 0x1;
bytes[31] = (byte) 0x90;
GB26875Mapper gb26875Mapper = new GB26875Mapper();
Map<String, Object> map = gb26875Mapper.readValue(bytes, Map.class);
map.forEach((k, v) -> {
    System.out.println(k + ":" + v);
});

结果示例

image-20230302092553966