| 程序包 | 说明 |
|---|---|
| org.jetlinks.supports.protocol.codec | |
| org.jetlinks.supports.protocol.codec.defaults |
| 类和说明 |
|---|
| BinaryCodec |
| BinaryDecoder |
| BinaryEncoder |
| 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 |
| CodecPredicate |
| Endian
大小端
|
| 类和说明 |
|---|
| BinaryCodec |
| BinaryDecoder |
| BinaryEncoder |
Copyright © 2019–2023. All rights reserved.