From ae92b6823499cfab77201b4033922fa373fb37a3 Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期六, 21 十月 2023 14:03:50 +0800 Subject: [PATCH] 优化 --- ard-work/src/main/java/com/ruoyi/device/dhsdk/module/ConfigModule.java | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/dhsdk/module/ConfigModule.java b/ard-work/src/main/java/com/ruoyi/device/dhsdk/module/ConfigModule.java index cf30284..1234d40 100644 --- a/ard-work/src/main/java/com/ruoyi/device/dhsdk/module/ConfigModule.java +++ b/ard-work/src/main/java/com/ruoyi/device/dhsdk/module/ConfigModule.java @@ -32,6 +32,21 @@ } /** + * 鏌ヨ杩滅▼璁惧鐘舵�� + */ + public static boolean queryRemotDevState(NetSDKLib.LLong hLoginHandle, int nChn, int nType, NetSDKLib.SdkStructure stuInfo) { + + IntByReference intRetLen = new IntByReference(); + stuInfo.write(); + if (!netsdk.CLIENT_QueryRemotDevState(hLoginHandle, nType, nChn, stuInfo.getPointer(), stuInfo.size(), intRetLen, 3000)) { + System.err.println("Config Failed!" + ToolKits.getErrorCodePrint()); + return false; + } + stuInfo.read(); + return true; + } + + /** * 鑾峰彇鍗曚釜閰嶇疆 * * @param hLoginHandle 鐧婚檰鍙ユ焺 @@ -69,7 +84,7 @@ int nBufferLen = 2 * 1024 * 1024; byte[] strBuffer = new byte[nBufferLen]; cmdObject.write(); - boolean bRet = netsdk.CLIENT_QueryNewSystemInfo(hLoginHandle, strCmd, nChn, strBuffer, cmdObject.size(), error,3000); + boolean bRet = netsdk.CLIENT_QueryNewSystemInfo(hLoginHandle, strCmd, nChn, strBuffer, cmdObject.size(), error, 3000); if (bRet) { cmdObject.read(); } else { @@ -78,7 +93,20 @@ } return result; } - + // 鑾峰彇閰嶇疆 + public static boolean GetConfig(NetSDKLib.LLong hLoginHandle, int nChn,int type,Structure cmdObject) { + boolean result = false; + // 鑾峰彇 + cmdObject.write(); + if (netsdk.CLIENT_GetConfig(hLoginHandle, type, nChn, cmdObject.getPointer(), cmdObject.size(), 4000, null)) { + cmdObject.read(); + result=true; + } else { + System.err.println("GetConfig Failed!" + getErrorCodePrint()); + result=false; + } + return result; + } /** * 璁剧疆鍗曚釜閰嶇疆 * @@ -112,4 +140,5 @@ return result; } + } -- Gitblit v1.9.3