1.加载动态链接库
public static String strFilePathSmartDevice = "C:\\Windows\\System32\\JsBin\\SmartDevice.dll";//dll所在目录
// public static String strFilePath = System.getProperty("user.dir") + "..\\..\\..\\..\\DLL开发包\\windows\\64bit\\WTY.dll";
public static dll INSTANCE = (dll)Native.loadLibrary(strFilePathSmartDevice, dll.class);//关联dll
2.根据dll提供的SDK实现接口
(1)实现普通接口
函数原型:bool SmartDevice_Init(unsigned short tcpPort, int logLevel);
接口实现:
/**
* 智能设备SDK初始化,其他功能必须在正确初始化后才能使用,程序运行并且只能初始化一次
* @param tcpPort
* @param logLevel
* @return
*/
public boolean SmartDevice_Init(int tcpPort, int logLevel);
(2)包含回调函数的接口实现
接口函数原型