...
|
...
|
@@ -40,10 +40,9 @@ import org.thingsboard.server.common.data.DeviceProfile; |
40
|
40
|
import org.thingsboard.server.common.data.DeviceTransportType;
|
41
|
41
|
import org.thingsboard.server.common.data.device.profile.TkTcpDeviceProfileTransportConfiguration;
|
42
|
42
|
import org.thingsboard.server.common.data.id.DeviceId;
|
43
|
|
-import org.thingsboard.server.common.data.id.OtaPackageId;
|
44
|
|
-import org.thingsboard.server.common.data.ota.OtaPackageType;
|
45
|
43
|
import org.thingsboard.server.common.data.rpc.RpcStatus;
|
46
|
44
|
import org.thingsboard.server.common.data.yunteng.enums.TkScriptFunctionType;
|
|
45
|
+import org.thingsboard.server.common.data.yunteng.utils.ByteUtils;
|
47
|
46
|
import org.thingsboard.server.common.msg.tools.TbRateLimitsException;
|
48
|
47
|
import org.thingsboard.server.common.transport.SessionMsgListener;
|
49
|
48
|
import org.thingsboard.server.common.transport.TransportService;
|
...
|
...
|
@@ -62,7 +61,7 @@ import org.thingsboard.server.transport.tcp.adaptors.TcpUpEntry; |
62
|
61
|
import org.thingsboard.server.transport.tcp.script.TkScriptFactory;
|
63
|
62
|
import org.thingsboard.server.transport.tcp.session.TcpDeviceSessionCtx;
|
64
|
63
|
import org.thingsboard.server.transport.tcp.session.TcpGatewaySessionHandler;
|
65
|
|
-import org.thingsboard.server.transport.tcp.util.ByteUtils;
|
|
64
|
+import org.thingsboard.server.transport.tcp.util.ByteBufUtils;
|
66
|
65
|
|
67
|
66
|
import java.io.IOException;
|
68
|
67
|
import java.net.InetSocketAddress;
|
...
|
...
|
@@ -156,9 +155,9 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements |
156
|
155
|
try {
|
157
|
156
|
if (msg instanceof ByteBuf) {
|
158
|
157
|
ByteBuf message = (ByteBuf) msg;
|
159
|
|
- byte[] byteMsg = ByteUtils.buf2Bytes(message);
|
|
158
|
+ byte[] byteMsg = ByteBufUtils.buf2Bytes(message);
|
160
|
159
|
String msgStr = ByteUtils.bytesToStr(byteMsg);
|
161
|
|
- log.error("会话【{}】收到设备【{}】来自【{}】数据【{}】", sessionId, deviceSessionCtx.getDeviceId(), address, msgStr);
|
|
160
|
+ log.debug("会话【{}】收到设备【{}】来自【{}】数据【{}】", sessionId, deviceSessionCtx.getDeviceId(), address, msgStr);
|
162
|
161
|
deviceSessionCtx.setChannel(ctx);
|
163
|
162
|
if (deviceSessionCtx.getDeviceInfo() == null || deviceSessionCtx.getDeviceProfile() == null) {
|
164
|
163
|
processConnect(ctx, msgStr);
|
...
|
...
|
@@ -535,7 +534,7 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements |
535
|
534
|
|
536
|
535
|
@Override
|
537
|
536
|
public void onToDeviceRpcRequest(UUID sessionId, TransportProtos.ToDeviceRpcRequestMsg rpcRequest) {
|
538
|
|
- log.error("【{}】下发RPC命令【{}】给设备【{}】", sessionId, rpcRequest.getParams(), deviceSessionCtx.getDeviceInfo().getDeviceName());
|
|
537
|
+ log.debug("【{}】下发RPC命令【{}】给设备【{}】", sessionId, rpcRequest.getParams(), deviceSessionCtx.getDeviceInfo().getDeviceName());
|
539
|
538
|
TcpTransportAdaptor adaptor = deviceSessionCtx.getPayloadAdaptor();
|
540
|
539
|
try {
|
541
|
540
|
adaptor.convertToPublish(deviceSessionCtx, rpcRequest).ifPresent(payload -> {
|
...
|
...
|
@@ -573,7 +572,7 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements |
573
|
572
|
|
574
|
573
|
@Override
|
575
|
574
|
public void onToServerRpcResponse(TransportProtos.ToServerRpcResponseMsg rpcResponse) {
|
576
|
|
- log.error("[{}] 服务端响应设备的RPC请求", sessionId);
|
|
575
|
+ log.debug("[{}] 服务端响应设备的RPC请求", sessionId);
|
577
|
576
|
// String baseTopic = toServerRpcSubTopicType.getRpcResponseTopicBase();
|
578
|
577
|
// TcpTransportAdaptor adaptor = deviceSessionCtx.getAdaptor(toServerRpcSubTopicType);
|
579
|
578
|
// try {
|
...
|
...
|
|