| 接口 | 说明 |
|---|---|
| BinaryCodec<T> | |
| BinaryCodecs | |
| BinaryCodecs.Decoder |
解码器
|
| BinaryDecoder<T> | |
| BinaryEncoder<T> | |
| BinaryProtocolCodecBuilder | |
| BinaryProtocolCodecBuilder.PropertyMatchSpec | |
| BlockingDecoder | |
| 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();
|
| BlockingDecoderBuilder.BlockingDecoderDeclaration | |
| BlockingDecoderBuilder.EventMessageDecoderDeclaration | |
| BlockingDecoderBuilder.PropertyMessageDecoderDeclaration | |
| BlockingEncoder | |
| CodecPredicate |
| 类 | 说明 |
|---|---|
| BlockingDeviceMessageCodec |
| 枚举 | 说明 |
|---|---|
| Endian |
大小端
|
Copyright © 2019–2022. All rights reserved.