You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.9 KiB
Java
55 lines
1.9 KiB
Java
package com.shxy.xyhkcamera;
|
|
|
|
import com.sun.jna.Pointer;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
@SpringBootTest
|
|
class XyhkcameraApplicationTests {
|
|
|
|
@Autowired
|
|
HcNetSdkUtil hcNetSdkUtil;
|
|
private int handle;
|
|
|
|
@Test
|
|
void contextLoads() {
|
|
// hcNetSdkUtil.init();
|
|
// HCNetSDK instance = hcNetSdkUtil.createSDKInstance();
|
|
// if (b) {
|
|
// int admin = instance.NET_DVR_Login_V30("192.168.1.64", (short) 8000, "admin", "SHxy@510", new HCNetSDK.NET_DVR_DEVICEINFO_V30());
|
|
// System.out.println(admin);
|
|
// }
|
|
|
|
// String loadLibrary = OSUtils.getLoadLibrary();
|
|
// System.out.println(loadLibrary);
|
|
|
|
hcNetSdkUtil.init();
|
|
HCNetSDK instance = hcNetSdkUtil.createSDKInstance();
|
|
int admin = hcNetSdkUtil.login_V40("192.168.1.64", (short) 8000, "admin", "SHxy@510");
|
|
if (admin != -1) {
|
|
HCNetSDK.NET_DVR_REALTIME_THERMOMETRY_COND cond = new HCNetSDK.NET_DVR_REALTIME_THERMOMETRY_COND();
|
|
cond.dwSize = cond.size();
|
|
cond.byRuleID = 1;
|
|
cond.dwChan = 2;
|
|
|
|
HCNetSDK.FRemoteConfigCallBack cbStateCallBack = new HCNetSDK.FRemoteConfigCallBack() {
|
|
@Override
|
|
public void invoke(int dwType, Pointer lpBuffer, int dwBufLen, Pointer pUserData) {
|
|
System.out.println("dfsafasd");
|
|
instance.NET_DVR_StopRemoteConfig(handle);
|
|
|
|
}
|
|
};
|
|
handle = instance.NET_DVR_StartRemoteConfig(admin, HCNetSDK.NET_DVR_GET_REALTIME_THERMOMETRY, cond.getPointer(), cond.size(), cbStateCallBack, null);
|
|
if (handle < 0) {
|
|
System.out.println(instance.NET_DVR_GetLastError());
|
|
}
|
|
System.out.println("fdsafa");
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|