‘liusuyi’
2023-10-24 4a293865ac437a812eea8800cc0b04314efbd210
ard-work/src/main/java/com/ruoyi/device/dhsdk/module/ConfigModule.java
@@ -69,11 +69,11 @@
                cmdObject.read();
                result = true;
            } else {
                log.error("Parse " + strCmd + " Config Failed!" + ToolKits.getErrorCodePrint());
                log.error("Parse [" + strCmd + "] Config Failed!" + ToolKits.getErrorCodePrint());
                result = false;
            }
        } else {
            log.error("Get %s Config Failed!Last Error = %s\n", strCmd, getErrorCodePrint());
            log.error("Get [" + strCmd + "] Config Failed!Last Error = " + getErrorCodePrint());
            result = false;
        }
@@ -90,25 +90,27 @@
        if (bRet) {
            cmdObject.read();
        } else {
            log.error("Get %s Config Failed!Last Error = %s\n", strCmd, getErrorCodePrint());
            log.error("Get ["+strCmd+"] Config Failed!Last Error = " + getErrorCodePrint());
            result = false;
        }
        return result;
    }
    // 获取配置
    public static boolean GetConfig(NetSDKLib.LLong hLoginHandle, int nChn,int type,Structure cmdObject) {
    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;
            result = true;
        } else {
            log.error("GetConfig Failed!" + getErrorCodePrint());
            result=false;
            result = false;
        }
        return result;
    }
    /**
     * 设置单个配置
     *
@@ -131,11 +133,12 @@
            if (netsdk.CLIENT_SetNewDevConfig(hLoginHandle, strCmd, nChn, szBuffer, nBufferLen, error, restart, 3000)) {
                result = true;
            } else {
                log.error("Set %s Config Failed! Last Error = %s\n", strCmd, getErrorCodePrint());
                log.error("Set [" + strCmd + "] Config Failed! Last Error = " + getErrorCodePrint());
                result = false;
            }
        } else {
            log.error("Packet " + strCmd + " Config Failed!" + getErrorCodePrint());
            log.error("Parse [" + strCmd + "] Config Failed!" + ToolKits.getErrorCodePrint());
            result = false;
        }