Commit bed733519ebddfc289386720de6dd68ffd7fbef7

Authored by YunaiV
1 parent 8449ccbb

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

yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/codec/tcp/IotTcpBinaryDeviceMessageCodec.java
... ... @@ -175,6 +175,7 @@ public class IotTcpBinaryDeviceMessageCodec implements IotDeviceMessageCodec {
175 175 }
176 176 } else {
177 177 // 请求消息只处理 params 参数
  178 + // TODO @haohao:如果为空,是不是得写个长度 0 哈?
178 179 if (message.getParams() != null) {
179 180 bodyBuffer.appendBytes(JsonUtils.toJsonByte(message.getParams()));
180 181 }
... ...
yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/tcp/manager/IotTcpConnectionManager.java
... ... @@ -135,6 +135,7 @@ public class IotTcpConnectionManager {
135 135 */
136 136 @Data
137 137 public static class ConnectionInfo {
  138 +
138 139 /**
139 140 * 设备 ID
140 141 */
... ... @@ -147,6 +148,7 @@ public class IotTcpConnectionManager {
147 148 * 设备名称
148 149 */
149 150 private String deviceName;
  151 +
150 152 /**
151 153 * 客户端 ID
152 154 */
... ... @@ -155,9 +157,12 @@ public class IotTcpConnectionManager {
155 157 * 消息编解码类型(认证后确定)
156 158 */
157 159 private String codecType;
  160 + // TODO @haohao:有没可能不要 authenticated 字段,通过 deviceId 或者其他的?进一步简化,想的是哈。
158 161 /**
159 162 * 是否已认证
160 163 */
161 164 private boolean authenticated;
  165 +
162 166 }
  167 +
163 168 }
164 169 \ No newline at end of file
... ...