aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-01-18 21:59:54 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2021-01-18 21:59:54 -0800
commit48ec866d8e50ce2ef63ca336648db611cc233916 (patch)
tree4984619952ef65205f564e0667286a5795e6decd /src
parent889fabc6ca7f7bc8d744af1f9184d43b76744478 (diff)
downloadtraccar-server-48ec866d8e50ce2ef63ca336648db611cc233916.tar.gz
traccar-server-48ec866d8e50ce2ef63ca336648db611cc233916.tar.bz2
traccar-server-48ec866d8e50ce2ef63ca336648db611cc233916.zip
Decode disassembling alarm
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java3
-rw-r--r--src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index b0cd1ab8c..a3d16cb62 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -115,6 +115,9 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
if (BitUtil.check(value, 8)) {
return Position.ALARM_POWER_OFF;
}
+ if (BitUtil.check(value, 17)) {
+ return Position.ALARM_TAMPERING;
+ }
if (BitUtil.check(value, 20)) {
return Position.ALARM_GEOFENCE;
}
diff --git a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java
index b4a5148d6..552b5bb2d 100644
--- a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java
@@ -15,6 +15,10 @@ public class HuabaoProtocolDecoderTest extends ProtocolTest {
"7E01000021013345678906000F002C012F373031313142534A2D4D3742203030303030303001D4C1423838383838B47E"));
verifyAttribute(decoder, binary(
+ "7e02000033421030000018004c000200000004000201556dcb06c4d41d000c00f100fc210118095853010400000000fe0140ff0c01cc000000002694000055d87a7e"),
+ Position.KEY_ALARM, Position.ALARM_TAMPERING);
+
+ verifyAttribute(decoder, binary(
"7e02000033202011200010001300020000000400020158b30006c93ee5002000000000201127162937010400000000fe0145ff0c01cc00000000263300000f3e627e"),
Position.KEY_BATTERY_LEVEL, 69);