| | |
| | | package com.ruoyi.dataInterchange.util.jtt809.encoder; |
| | | |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.ByteArrayUtil; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.CRC16CCITT; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Constant; |
| | | import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util; |
| | |
| | | out.writeBytes(Jtt809Util.escape(escapeBytes)); |
| | | // 包尾标识 |
| | | out.writeByte(Jtt809Constant.PACKET_END_FLAG); |
| | | byte[] readableBytes = new byte[out.readableBytes()]; |
| | | out.readBytes(readableBytes); |
| | | log.info("下发数据包, packetLen : {}, packet : {}", readableBytes.length, ByteArrayUtil.bytes2HexStr(readableBytes)); |
| | | } |
| | | |
| | | } |