Commit 818e8fe4c5b990051ed0cc87eac79832d301382d

Authored by xp.Huang
1 parent a481b5eb

revert: TCP数据上报HEX解析还原

@@ -17,8 +17,6 @@ import io.netty.channel.ChannelHandlerContext; @@ -17,8 +17,6 @@ import io.netty.channel.ChannelHandlerContext;
17 import io.netty.channel.ChannelInboundHandlerAdapter; 17 import io.netty.channel.ChannelInboundHandlerAdapter;
18 import io.netty.util.ReferenceCountUtil; 18 import io.netty.util.ReferenceCountUtil;
19 import java.net.InetSocketAddress; 19 import java.net.InetSocketAddress;
20 -import java.nio.ByteBuffer;  
21 -import java.nio.charset.StandardCharsets;  
22 import java.util.*; 20 import java.util.*;
23 21
24 import io.netty.util.concurrent.Future; 22 import io.netty.util.concurrent.Future;
@@ -81,7 +79,7 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements @@ -81,7 +79,7 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements
81 if (msg instanceof ByteBuf) { 79 if (msg instanceof ByteBuf) {
82 ByteBuf message = (ByteBuf) msg; 80 ByteBuf message = (ByteBuf) msg;
83 byte[] byteMsg = ByteBufUtils.buf2Bytes(message); 81 byte[] byteMsg = ByteBufUtils.buf2Bytes(message);
84 - String msgStr = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(byteMsg)).toString(); 82 + String msgStr = ByteUtils.bytesToStr(byteMsg);
85 log.debug( 83 log.debug(
86 "TCP服务【{}】收到设备【{}】来自【{}】数据【{}】", 84 "TCP服务【{}】收到设备【{}】来自【{}】数据【{}】",
87 sessionId, 85 sessionId,