|
@@ -1,5 +1,6 @@
|
1
|
1
|
package com.unissoft.netSDKDemo;
|
2
|
2
|
|
|
3
|
+import com.alibaba.fastjson.JSON;
|
3
|
4
|
import com.sun.jna.Pointer;
|
4
|
5
|
import com.unissoft.pushMsg.AlarmDSService;
|
5
|
6
|
import com.unissoft.pushMsg.AlarmDSServiceImpl;
|
|
@@ -30,6 +31,20 @@ public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
|
30
|
31
|
/*String hexString = Integer.toHexString(lCommand);
|
31
|
32
|
log.info("报警类型 hexString {}", hexString);*/
|
32
|
33
|
switch (lCommand) {
|
|
34
|
+ case HCNetSDK.COMM_ALARM_RULE://行为分析信息上传
|
|
35
|
+ log.info(
|
|
36
|
+ "lCommand {} -> pAlarmer {} -> pAlarmInfo {} -> dwBufLen {} -> pUser {}",
|
|
37
|
+ lCommand, JSON.toJSONString(pAlarmer), JSON.toJSONString(pAlarmInfo),dwBufLen,JSON.toJSONString(pUser)
|
|
38
|
+ );
|
|
39
|
+ HCNetSDK.NET_VCA_RULE_ALARM ruleAlarm = new HCNetSDK.NET_VCA_RULE_ALARM();
|
|
40
|
+ log.info("alarm type in the NET_VCA_RULE_ALARM top ---------->: {}", JSON.toJSONString(ruleAlarm));
|
|
41
|
+ ruleAlarm.write();
|
|
42
|
+ Pointer ruleAlarmPointer = ruleAlarm.getPointer();
|
|
43
|
+ ruleAlarmPointer.write(0, pAlarmInfo.getByteArray(0, ruleAlarm.size()), 0, ruleAlarm.size());
|
|
44
|
+ ruleAlarm.read();
|
|
45
|
+ log.info("alarm type in the NET_VCA_RULE_ALARM ---------->: {}", JSON.toJSONString(ruleAlarm));
|
|
46
|
+ alarmDSService.pushLCommand(lCommand);
|
|
47
|
+ break;
|
33
|
48
|
case HCNetSDK.COMM_SNAP_MATCH_ALARM:
|
34
|
49
|
//人脸黑名单比对报警
|
35
|
50
|
log.info("SNAP_MATCH_ALARM");
|
|
@@ -153,6 +168,7 @@ public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
|
153
|
168
|
buffers.get(bytes);
|
154
|
169
|
log.info("抓拍库附加信息: {}", new String(bytes));
|
155
|
170
|
}
|
|
171
|
+ alarmDSService.pushLCommand(lCommand);
|
156
|
172
|
break;
|
157
|
173
|
default:
|
158
|
174
|
// TODO 单报警设备 目前不需要 sAlarmType alarmNow
|