aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tr20ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-11-15 11:11:39 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-11-15 11:11:39 +1300
commit3f44240490ccb0cfc0da59cb5ecf101bf622ae1d (patch)
tree4d785f1a5dba4a9901beecedf9c6ecb6944ec79e /src/org/traccar/protocol/Tr20ProtocolDecoder.java
parente36c69db0c5e610d30977de7b2fa71e715d9a1ae (diff)
downloadtrackermap-server-3f44240490ccb0cfc0da59cb5ecf101bf622ae1d.tar.gz
trackermap-server-3f44240490ccb0cfc0da59cb5ecf101bf622ae1d.tar.bz2
trackermap-server-3f44240490ccb0cfc0da59cb5ecf101bf622ae1d.zip
Support TR30 Track-pro from Iridium
Diffstat (limited to 'src/org/traccar/protocol/Tr20ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tr20ProtocolDecoder.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java
index e7ae0185f..6c7b689a6 100644
--- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java
@@ -52,6 +52,9 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
.number("(ddd)(dd.d+),") // longitude
.number("(d+),") // speed
.number("(d+),") // course
+ .number("(?:NA|[FC](-?d+)),") // temperature
+ .number("(x{8}),") // status
+ .number("(d+)") // event
.any()
.compile();
@@ -87,8 +90,12 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));
position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));
- position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0)));
- position.setCourse(parser.nextDouble(0));
+ position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));
+ position.setCourse(parser.nextDouble());
+
+ position.set(Position.PREFIX_TEMP + 1, parser.nextInt());
+ position.set(Position.KEY_STATUS, parser.nextHexLong());
+ position.set(Position.KEY_EVENT, parser.nextInt());
return position;
}