aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-25 21:46:33 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-25 21:46:33 -0700
commit854e4c6f1de4620b86842ebd5f21aa26b3f13f2f (patch)
tree8eba70ff406001a3421ff548374d4b71d62f2132 /src/main
parent01bdaf38fe425a15310a36b059a862bca661159e (diff)
downloadtraccar-server-854e4c6f1de4620b86842ebd5f21aa26b3f13f2f.tar.gz
traccar-server-854e4c6f1de4620b86842ebd5f21aa26b3f13f2f.tar.bz2
traccar-server-854e4c6f1de4620b86842ebd5f21aa26b3f13f2f.zip
Decode alarm values
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java b/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java
index 6fe54b0b0..30cbf9217 100644
--- a/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java
@@ -86,6 +86,22 @@ public class SolarPoweredProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, buf.readUnsignedByte() * 0.02);
position.setCourse(buf.readUnsignedByte());
break;
+ case 0x82:
+ buf.readUnsignedByte(); // alarm mask
+ int alarm = buf.readUnsignedByte();
+ if (BitUtil.check(alarm, 0)) {
+ position.set(Position.KEY_ALARM, Position.ALARM_TAMPERING);
+ }
+ if (BitUtil.check(alarm, 1)) {
+ position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER);
+ }
+ if (BitUtil.check(alarm, 2)) {
+ position.set(Position.KEY_ALARM, Position.ALARM_SOS);
+ }
+ if (BitUtil.check(alarm, 3)) {
+ position.set(Position.KEY_ALARM, Position.ALARM_FALL_DOWN);
+ }
+ break;
case 0x83:
buf.readUnsignedInt(); // uptime
buf.readUnsignedInt(); // gps count