aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-10-31 12:07:11 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-10-31 12:07:11 +1300
commit3dba7d6b7d5dc90366e70ed8ca31d48a0b935669 (patch)
tree5016bafa3f6da935d352de5ae6950f7314bea606
parent735fc1483817da385dce0fb572440261b6a644a3 (diff)
downloadtrackermap-server-3dba7d6b7d5dc90366e70ed8ca31d48a0b935669.tar.gz
trackermap-server-3dba7d6b7d5dc90366e70ed8ca31d48a0b935669.tar.bz2
trackermap-server-3dba7d6b7d5dc90366e70ed8ca31d48a0b935669.zip
Treat report type as hex
-rw-r--r--src/org/traccar/protocol/Gl200TextProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
index 21020ee6d..70627d65d 100644
--- a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -320,7 +320,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
.number("(d{15}|x{14}),") // imei
.expression("[^,]*,") // device name
.number("d*,")
- .number("(d{1,2}),") // report type
+ .number("(x{1,2}),") // report type
.number("d{1,2},") // count
.expression(PATTERN_LOCATION.pattern())
.groupBegin()
@@ -966,15 +966,15 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- int reportType = parser.nextInt();
+ int reportType = parser.nextHexInt();
if (type.equals("NMR")) {
position.set(Position.KEY_MOTION, reportType == 1);
} else if (type.equals("SOS")) {
position.set(Position.KEY_ALARM, Position.ALARM_SOS);
} else if (type.equals("DIS")) {
- position.set(Position.PREFIX_IN + reportType / 10, reportType % 10 == 1);
+ position.set(Position.PREFIX_IN + reportType / 0x10, reportType % 0x10 == 1);
} else if (type.equals("IGL")) {
- position.set(Position.KEY_IGNITION, reportType % 10 == 0);
+ position.set(Position.KEY_IGNITION, reportType % 0x10 == 0);
}
decodeLocation(position, parser);