From 3f44240490ccb0cfc0da59cb5ecf101bf622ae1d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 15 Nov 2018 11:11:39 +1300 Subject: Support TR30 Track-pro from Iridium --- src/org/traccar/protocol/Tr20ProtocolDecoder.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol') 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; } -- cgit v1.2.3