Sfoglia il codice sorgente

feat(iot): add j2mod dependency and refactor connection info method

YunaiV 3 mesi fa
parent
commit
566f5a12b7

+ 8 - 0
yudao-dependencies/pom.xml

@@ -70,6 +70,7 @@
         <vertx.version>4.5.22</vertx.version>
         <okhttp.version>4.12.0</okhttp.version>
         <californium.version>3.12.0</californium.version>
+        <j2mod.version>3.2.1</j2mod.version>
         <!-- 三方云服务相关 -->
         <awssdk.version>2.40.15</awssdk.version>
         <justauth.version>1.16.7</justauth.version>
@@ -601,6 +602,13 @@
                 <version>${californium.version}</version>
             </dependency>
 
+            <!-- Modbus 相关 -->
+            <dependency>
+                <groupId>com.ghgande</groupId>
+                <artifactId>j2mod</artifactId>
+                <version>${j2mod.version}</version>
+            </dependency>
+
             <!-- 三方云服务相关 -->
             <dependency>
                 <groupId>software.amazon.awssdk</groupId>

+ 0 - 1
yudao-module-iot/yudao-module-iot-gateway/pom.xml

@@ -52,7 +52,6 @@
         <dependency>
             <groupId>com.ghgande</groupId>
             <artifactId>j2mod</artifactId>
-            <version>3.2.1</version>
         </dependency>
 
         <!-- CoAP 相关 - Eclipse Californium -->

+ 1 - 1
yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/mqtt/manager/IotMqttConnectionManager.java

@@ -124,7 +124,7 @@ public class IotMqttConnectionManager {
      * @param deviceId 设备 ID
      * @return 连接信息
      */
-    public IotMqttConnectionManager.ConnectionInfo getConnectionInfoByDeviceId(Long deviceId) {
+    public ConnectionInfo getConnectionInfoByDeviceId(Long deviceId) {
         // 通过设备 ID 获取连接端点
         MqttEndpoint endpoint = getDeviceEndpoint(deviceId);
         if (endpoint == null) {