提交 2a44938d authored 作者: wangqiang's avatar wangqiang

问题修改

上级 d7ec941f
package com;
import com.priusis.service.control.DeviceChangeCallbackImpl;
import com.priusis.utils.IHwPortController;
import lombok.extern.slf4j.Slf4j;
......@@ -24,8 +23,8 @@ public class TestDemo {
//System.out.println(System.getProperty("user.dir"));
// 初始化硬件接口管理模块
int result = IHwPortController.instanceDll.APQ_HWPORT_Initialize();
log.info("APQ_HWPORT_Initialize ret:{}", result);
// int result = IHwPortController.instanceDll.APQ_HWPORT_Initialize();
// log.info("APQ_HWPORT_Initialize ret:{}", result);
// 注册设备热插拔通知后,接收热插拔事件
// DeviceChangeCallbackImpl deviceChangeCallback = new DeviceChangeCallbackImpl();
......@@ -46,20 +45,30 @@ public class TestDemo {
int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4);
log.info("Check APQ_HWPORT_get_normal_device_permit ret:{}", result33);
*/
boolean flag = true;
// 获取存储设备权限
/*int result31 = IHwPortController.instanceDll.APQ_HWPORT_get_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode());
log.info("APQ_HWPORT_get_storage_device_permit ret:{}", result31);
// APQ_HWPORT_STORAGE_PERM_ALLOW APQ_HWPORT_STORAGE_PERM_DENY
int result32 = IHwPortController.instanceDll.APQ_HWPORT_set_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode(), IHwPortController.HwportStoragePermEnum.APQ_HWPORT_STORAGE_PERM_ALLOW.getCode(), null);
log.info("APQ_HWPORT_set_storage_device_permit ret:{}", result32);
//应用硬件接口管理模块的配置内容
int result5 = IHwPortController.instanceDll.APQ_HWPORT_Apply();
log.info("APQ_HWPORT_Apply ret:{}", result5);
// 再次获取存储设备权限,验证
int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode());
log.info("Check APQ_HWPORT_get_storage_device_permit ret:{}", result33);*/
while (flag) {
IHwPortController.instanceDll.APQ_HWPORT_Initialize();
int result31 = IHwPortController.instanceDll.APQ_HWPORT_get_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode());
log.info("APQ_HWPORT_get_storage_device_permit ret:{}", result31);
IHwPortController.instanceDll.APQ_HWPORT_Uninitialize();
try {
Thread.sleep(6000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// // APQ_HWPORT_STORAGE_PERM_ALLOW APQ_HWPORT_STORAGE_PERM_DENY
// int result32 = IHwPortController.instanceDll.APQ_HWPORT_set_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode(), IHwPortController.HwportStoragePermEnum.APQ_HWPORT_STORAGE_PERM_ALLOW.getCode(), null);
// log.info("APQ_HWPORT_set_storage_device_permit ret:{}", result32);
// //应用硬件接口管理模块的配置内容
// int result5 = IHwPortController.instanceDll.APQ_HWPORT_Apply();
// log.info("APQ_HWPORT_Apply ret:{}", result5);
// // 再次获取存储设备权限,验证
// int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_storage_device_permit(IHwPortController.HwportStorageDevidEnum.APQ_HWPORT_STORAGE_DEVID_UDISK.getCode());
// log.info("Check APQ_HWPORT_get_storage_device_permit ret:{}", result33);
/* // 获取网络设备权限
......
......@@ -120,6 +120,7 @@ public class ApqRegister4BackListJob {
// WinExecuteUtils.killProc("阿普奇检测客户端.exe");
// WinExecuteUtils.killProc("火绒文件粉碎机_v5.0.0.1单文件完整功能版.exe");
WinExecuteUtils.killProc("火绒文件粉碎机_5.0.0.1单文件版.exe");
// taskkill /pid 13124 -t -f
} catch (IOException e) {
log.error("杀进程异常", e);
}
......
......@@ -27,7 +27,7 @@ public class DeviceChangeCallbackImpl implements IDeviceChangeCallback {
@Override
public void P_DEVICE_CHANGE_CB(int changeType, Pointer data) {
String changeData = data.getString(0);
String changeData = data.getString(0, "GBK");
log.info("回调成功!changeType: {}, data: {}", changeType, changeData);
Map mapRequest = new HashMap();
// 1代表插入,2代表拔出
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论