| | |
| | | package com.ruoyi.device.dhsdk.module; |
| | | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib; |
| | | import com.sun.jna.Structure; |
| | | import com.sun.jna.ptr.IntByReference; |
| | | |
| | | /** |
| | | * @Description: |
| | | * @ClassName: ConfigModule |
| | | * @Author: 刘苏义 |
| | | * @Date: 2023年10月14日14:57:01 |
| | | **/ |
| | | public class ConfigModule { |
| | | public static NetSDKLib netsdk = NetSDKLib.NETSDK_INSTANCE; |
| | | |
| | | public static boolean GetDevConfig(NetSDKLib.LLong hLoginHandle, int nType, Structure cmdObject) { |
| | | boolean result = false; |
| | | IntByReference error = new IntByReference(0); |
| | | int nBufferLen = 2 * 1024 * 1024; |
| | | netsdk.CLIENT_QueryDevState(hLoginHandle, nType, cmdObject.getPointer(), nBufferLen, error, 3000); |
| | | return result; |
| | | } |
| | | /** |
| | | * 查询设备状态 |
| | | */ |
| | | public static boolean queryDevState(NetSDKLib.LLong hLoginHandle, int nType, NetSDKLib.SdkStructure stuInfo) { |
| | | |
| | | IntByReference intRetLen = new IntByReference(); |
| | | stuInfo.write(); |
| | | if (!LoginModule.netsdk.CLIENT_QueryDevState(hLoginHandle, nType, stuInfo.getPointer(), stuInfo.size(), intRetLen, 3000)) { |
| | | return false; |
| | | } |
| | | stuInfo.read(); |
| | | return true; |
| | | } |
| | | } |
| | | package com.ruoyi.device.dhsdk.module;
|
| | |
|
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib;
|
| | | import com.sun.jna.Structure;
|
| | | import com.sun.jna.ptr.IntByReference;
|
| | |
|
| | | /**
|
| | | * @Description:
|
| | | * @ClassName: ConfigModule
|
| | | * @Author: 刘苏义
|
| | | * @Date: 2023年10月14日14:57:01
|
| | | **/
|
| | | public class ConfigModule {
|
| | | public static NetSDKLib netsdk = NetSDKLib.NETSDK_INSTANCE;
|
| | | /**
|
| | | * 查询设备状态
|
| | | */
|
| | | public static boolean queryDevState(NetSDKLib.LLong hLoginHandle, int nType, NetSDKLib.SdkStructure stuInfo) {
|
| | |
|
| | | IntByReference intRetLen = new IntByReference();
|
| | | stuInfo.write();
|
| | | if (!LoginModule.netsdk.CLIENT_QueryDevState(hLoginHandle, nType, stuInfo.getPointer(), stuInfo.size(), intRetLen, 3000)) {
|
| | | return false;
|
| | | }
|
| | | stuInfo.read();
|
| | | return true;
|
| | | }
|
| | | }
|