Browse Source

添加报警异常报警类型

hanqingsong 2 years ago
parent
commit
494f3cc6fd
1 changed files with 16 additions and 0 deletions
  1. 16 0
      src/main/java/com/unissoft/netSDKDemo/FMSGCallBack_V31.java

+ 16 - 0
src/main/java/com/unissoft/netSDKDemo/FMSGCallBack_V31.java

@@ -1,5 +1,6 @@
1
 package com.unissoft.netSDKDemo;
1
 package com.unissoft.netSDKDemo;
2
 
2
 
3
+import com.alibaba.fastjson.JSON;
3
 import com.sun.jna.Pointer;
4
 import com.sun.jna.Pointer;
4
 import com.unissoft.pushMsg.AlarmDSService;
5
 import com.unissoft.pushMsg.AlarmDSService;
5
 import com.unissoft.pushMsg.AlarmDSServiceImpl;
6
 import com.unissoft.pushMsg.AlarmDSServiceImpl;
@@ -30,6 +31,20 @@ public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
30
         /*String hexString = Integer.toHexString(lCommand);
31
         /*String hexString = Integer.toHexString(lCommand);
31
         log.info("报警类型 hexString {}", hexString);*/
32
         log.info("报警类型 hexString {}", hexString);*/
32
         switch (lCommand) {
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
             case HCNetSDK.COMM_SNAP_MATCH_ALARM:
48
             case HCNetSDK.COMM_SNAP_MATCH_ALARM:
34
                 //人脸黑名单比对报警
49
                 //人脸黑名单比对报警
35
                 log.info("SNAP_MATCH_ALARM");
50
                 log.info("SNAP_MATCH_ALARM");
@@ -153,6 +168,7 @@ public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
153
                     buffers.get(bytes);
168
                     buffers.get(bytes);
154
                     log.info("抓拍库附加信息: {}", new String(bytes));
169
                     log.info("抓拍库附加信息: {}", new String(bytes));
155
                 }
170
                 }
171
+                alarmDSService.pushLCommand(lCommand);
156
                 break;
172
                 break;
157
             default:
173
             default:
158
                 // TODO 单报警设备 目前不需要 sAlarmType alarmNow
174
                 // TODO 单报警设备 目前不需要 sAlarmType alarmNow