aijinhui
2023-10-16 59fcc48c8589b9df2af744fd6c77854061a52f54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
    }
}