hik-sdk jna 版本升级
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -119,6 +119,7 @@
|
||||
<dependency>
|
||||
<groupId>com.hik</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>4.5.2_1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
package org.dromara.sis.sdk.hik;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.sun.jna.Structure;
|
||||
|
||||
public class SDK_Structure extends Structure
|
||||
{
|
||||
protected List<String> getFieldOrder()
|
||||
{
|
||||
List<String> fieldOrderList = new ArrayList<String>();
|
||||
for (Class<?> cls = getClass();!cls.equals(SDK_Structure.class);cls = cls.getSuperclass())
|
||||
{
|
||||
Field[] fields = cls.getDeclaredFields();
|
||||
int modifiers;
|
||||
for (Field field : fields)
|
||||
{
|
||||
modifiers = field.getModifiers();
|
||||
if (Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
fieldOrderList.add(field.getName());
|
||||
}
|
||||
}
|
||||
//System.out.println(fieldOrderList);
|
||||
return fieldOrderList;
|
||||
}
|
||||
}
|
@@ -33,9 +33,9 @@ public class SdkBaseServer {
|
||||
hcNetSDK = (HCNetSDK) Native.loadLibrary(dllFilePath, HCNetSDK.class);
|
||||
log.info("window-sdk加载完成。");
|
||||
} else {
|
||||
String dllFilePath = System.getProperty("user.dir") + "/lib/libhcnetsdk.so";
|
||||
log.info("linux系统加载库路径: {}", dllFilePath);
|
||||
hcNetSDK = (HCNetSDK) Native.loadLibrary(dllFilePath, HCNetSDK.class);
|
||||
String soFilePath = System.getProperty("user.dir") + "/lib/libhcnetsdk.so";
|
||||
log.info("linux系统加载库路径: {}", soFilePath);
|
||||
hcNetSDK = (HCNetSDK) Native.loadLibrary(soFilePath, HCNetSDK.class);
|
||||
HCNetSDK.BYTE_ARRAY ptrByteArray1 = new HCNetSDK.BYTE_ARRAY(256);
|
||||
HCNetSDK.BYTE_ARRAY ptrByteArray2 = new HCNetSDK.BYTE_ARRAY(256);
|
||||
//这里是库的绝对路径,请根据实际情况修改,注意改路径必须有访问权限
|
||||
|
Reference in New Issue
Block a user