| | |
| | | import com.ruoyi.device.dhsdk.lib.NetSDKLib.NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY;
|
| | | import com.sun.jna.ptr.IntByReference;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
|
| | | import static com.ruoyi.device.dhsdk.lib.ToolKits.getErrorCodePrint;
|
| | |
|
| | | /**
|
| | |
| | | public static NetSDKLib netsdk = NetSDKLib.NETSDK_INSTANCE;
|
| | |
|
| | | // 设备信息
|
| | | // public static NetSDKLib.NET_DEVICEINFO_Ex m_stDeviceInfo = new NetSDKLib.NET_DEVICEINFO_Ex();
|
| | | // public static NetSDKLib.NET_DEVICEINFO_Ex m_stDeviceInfo = new NetSDKLib.NET_DEVICEINFO_Ex();
|
| | |
|
| | | // 登陆句柄
|
| | | public static LLong m_hLoginHandle = new LLong(0);//
|
| | |
| | | //System.out.println(logPath);
|
| | | //setLog.bSetPrintStrategy = 1;
|
| | | //bLogopen = netsdk.CLIENT_LogOpen(setLog);
|
| | | // if (!bLogopen) {
|
| | | // System.err.println("Failed to open NetSDK log");
|
| | | // }
|
| | | // if (!bLogopen) {
|
| | | // System.err.println("Failed to open NetSDK log");
|
| | | // }
|
| | |
|
| | | // 设置断线重连回调接口,设置过断线重连成功回调函数后,当设备出现断线情况,SDK内部会自动进行重连操作
|
| | | // 此操作为可选操作,但建议用户进行设置
|
| | |
| | | LLong m_hLoginHandle = netsdk.CLIENT_LoginEx2(m_strIp, m_nPort, m_strUser, m_strPassword, 0, null, lpDeviceInfo, nError);
|
| | | //m_hLoginHandle=netsdk.CLIENT_LoginWithHighLevelSecurity(pstInParam, pstOutParam);
|
| | | if (m_hLoginHandle.longValue() == 0) {
|
| | | log.debug("Login Device[%s] Port[%d]Failed. %s\n", m_strIp, m_nPort, getErrorCodePrint());
|
| | | log.debug("Login Failed [" + m_strIp + ":" + m_nPort + "],错误码:" + getErrorCodePrint());
|
| | | } else {
|
| | | log.debug("Login Success [ " + m_strIp + ":" + m_nPort + " ]");
|
| | | }
|