review:【iot 物联网】tcp 协议的接入

This commit is contained in:
YunaiV
2025-08-06 09:47:45 +08:00
parent 8449ccbb7d
commit bed733519e
2 changed files with 6 additions and 0 deletions

View File

@@ -175,6 +175,7 @@ public class IotTcpBinaryDeviceMessageCodec implements IotDeviceMessageCodec {
} }
} else { } else {
// 请求消息只处理 params 参数 // 请求消息只处理 params 参数
// TODO @haohao如果为空是不是得写个长度 0 哈?
if (message.getParams() != null) { if (message.getParams() != null) {
bodyBuffer.appendBytes(JsonUtils.toJsonByte(message.getParams())); bodyBuffer.appendBytes(JsonUtils.toJsonByte(message.getParams()));
} }

View File

@@ -135,6 +135,7 @@ public class IotTcpConnectionManager {
*/ */
@Data @Data
public static class ConnectionInfo { public static class ConnectionInfo {
/** /**
* 设备 ID * 设备 ID
*/ */
@@ -147,6 +148,7 @@ public class IotTcpConnectionManager {
* 设备名称 * 设备名称
*/ */
private String deviceName; private String deviceName;
/** /**
* 客户端 ID * 客户端 ID
*/ */
@@ -155,9 +157,12 @@ public class IotTcpConnectionManager {
* 消息编解码类型(认证后确定) * 消息编解码类型(认证后确定)
*/ */
private String codecType; private String codecType;
// TODO @haohao有没可能不要 authenticated 字段,通过 deviceId 或者其他的?进一步简化,想的是哈。
/** /**
* 是否已认证 * 是否已认证
*/ */
private boolean authenticated; private boolean authenticated;
} }
} }