1078-人工确认报警消息+链路检测
This commit is contained in:
@@ -2,8 +2,9 @@ package com.genersoft.iot.vmp.jt1078.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "人工确认报警类型")
|
||||
public class JConfirmationAlarmMessageType {
|
||||
@Schema(description = "确认紧急报警 ;")
|
||||
@Schema(description = "确认紧急报警")
|
||||
private boolean urgent;
|
||||
@Schema(description = "确认危险预警")
|
||||
private boolean alarmDangerous;
|
||||
@@ -18,6 +19,31 @@ public class JConfirmationAlarmMessageType {
|
||||
@Schema(description = "确认车辆非法位移报警")
|
||||
private boolean alarmIllegalDisplacement;
|
||||
|
||||
public long encode(){
|
||||
long result = 0L;
|
||||
if (urgent) {
|
||||
result |= 0x01;
|
||||
}
|
||||
if (alarmDangerous) {
|
||||
result |= (0x01 << 3);
|
||||
}
|
||||
if (alarmRegion) {
|
||||
result |= (0x01 << 20);
|
||||
}
|
||||
if (alarmRoute) {
|
||||
result |= (0x01 << 21);
|
||||
}
|
||||
if (alarmTravelTime) {
|
||||
result |= (0x01 << 22);
|
||||
}
|
||||
if (alarmIllegalIgnition) {
|
||||
result |= (0x01 << 27);
|
||||
}
|
||||
if (alarmIllegalDisplacement) {
|
||||
result |= (0x01 << 28);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public boolean isUrgent() {
|
||||
@@ -75,4 +101,17 @@ public class JConfirmationAlarmMessageType {
|
||||
public void setAlarmIllegalDisplacement(boolean alarmIllegalDisplacement) {
|
||||
this.alarmIllegalDisplacement = alarmIllegalDisplacement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "JConfirmationAlarmMessageType{" +
|
||||
"urgent=" + urgent +
|
||||
", alarmDangerous=" + alarmDangerous +
|
||||
", alarmRegion=" + alarmRegion +
|
||||
", alarmRoute=" + alarmRoute +
|
||||
", alarmTravelTime=" + alarmTravelTime +
|
||||
", alarmIllegalIgnition=" + alarmIllegalIgnition +
|
||||
", alarmIllegalDisplacement=" + alarmIllegalDisplacement +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user