mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2026-04-19 13:08:38 +00:00
review:【iot 物联网】tcp 协议的接入
This commit is contained in:
@@ -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()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user