aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-10-10 09:00:59 +0500
committerAbyss777 <abyss@fox5.ru>2016-10-10 09:00:59 +0500
commitd3094ea6e035c2bae2825cf9e031e093ee403264 (patch)
treeec4a0233b8909c6fcd19bd4a3dc0f8777ac8d138
parent787848118108f458c9d209ad362ce8377d38f8dc (diff)
downloadtrackermap-server-d3094ea6e035c2bae2825cf9e031e093ee403264.tar.gz
trackermap-server-d3094ea6e035c2bae2825cf9e031e093ee403264.tar.bz2
trackermap-server-d3094ea6e035c2bae2825cf9e031e093ee403264.zip
Add SOS handle
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Gl200ProtocolDecoderTest.java3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 973907235..a0efc47fa 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -603,6 +603,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
int reportType = parser.nextInt();
if (type.equals("NMR")) {
position.set(Position.KEY_MOTION, reportType);
+ } else if (type.equals("SOS")) {
+ position.set(Position.KEY_ALARM, Position.ALARM_SOS);
}
decodeLocation(position, parser);
diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
index 83f8b02f1..d3c82fb3a 100644
--- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
@@ -176,6 +176,9 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest {
"+RESP:GTJDS,0A0102,135790246811220,,2,0,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,20090214093254,11F0$"));
verifyAttributes(decoder, text(
+ "+RESP:GTSOS,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0$"));
+
+ verifyAttributes(decoder, text(
"+RESP:GTVER,1A0800,860599000773978,GL300,GL300,0A03,0103,20161007041531,10F8$"));
verifyNothing(decoder, text(