aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/T800xProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-17 09:52:27 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-17 09:52:27 +0500
commit7dd85faa3018aa6d3c8a192eed99360cb406eb71 (patch)
tree396ae68b381075ea1663c47d6911a28069ddd4fd /src/org/traccar/protocol/T800xProtocolDecoder.java
parent376bd7a7342ed46f20b7c0c94d7c9b0074ae99f3 (diff)
downloadtrackermap-server-7dd85faa3018aa6d3c8a192eed99360cb406eb71.tar.gz
trackermap-server-7dd85faa3018aa6d3c8a192eed99360cb406eb71.tar.bz2
trackermap-server-7dd85faa3018aa6d3c8a192eed99360cb406eb71.zip
- Added Kenji, T800x, Xexun alarm decoders
- Fixed GT06 mistake
Diffstat (limited to 'src/org/traccar/protocol/T800xProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/T800xProtocolDecoder.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java
index de966f901..8301450d5 100644
--- a/src/org/traccar/protocol/T800xProtocolDecoder.java
+++ b/src/org/traccar/protocol/T800xProtocolDecoder.java
@@ -60,6 +60,25 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
}
}
+ private String decodeAlarm(short value) {
+ switch (value) {
+ case 3:
+ return Position.ALARM_SOS;
+ case 4:
+ return Position.ALARM_OVERSPEED;
+ case 5:
+ return Position.ALARM_GEOFENCE_ENTER;
+ case 6:
+ return Position.ALARM_GEOFENCE_EXIT;
+ case 8:
+ case 10:
+ return Position.ALARM_VIBRATION;
+ default:
+ break;
+ }
+ return null;
+ }
+
@Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
@@ -111,7 +130,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort());
position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort());
- position.set(Position.KEY_ALARM, buf.readUnsignedByte());
+ position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
buf.readUnsignedByte(); // reserved