public interface BlockingDecoderBuilder
BinaryMessageCodecBuilder.create()
.decode()
// 0x04 属性上报
.match(eq(int1(1), fixed((byte) 0x04)))
.deviceId(append(string("device-"), int1(0)))
.isReportProperty()
.property("humidity", hexFloat(Endian.BIG, 3))
.property("temperature", hexFloat(Endian.BIG, 5))
.next()
// 0x01 事件上报
.match(eq(int1(1), fixed((byte) 0x01)))
.deviceId(append(string("device-"), int1(0)))
.isEvent()
.eventId(fixed("fire_alarm"))
.data(map()
.add(fixed("temp"), hexFloat(Endian.BIG, 3))
.build())
.end()
.build();
BinaryCodecs| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
BlockingDecoderBuilder.BlockingDecoderDeclaration |
static interface |
BlockingDecoderBuilder.EventMessageDecoderDeclaration |
static interface |
BlockingDecoderBuilder.PropertyMessageDecoderDeclaration |
| 限定符和类型 | 方法和说明 |
|---|---|
BlockingDecoder |
build() |
static BlockingDecoderBuilder |
create() |
BlockingDecoderBuilder.BlockingDecoderDeclaration |
declare() |
static BlockingDecoderBuilder create()
BlockingDecoderBuilder.BlockingDecoderDeclaration declare()
BlockingDecoder build()
Copyright © 2019–2023. All rights reserved.