From b96c5afe15d06fedb76bcaf5445b4573c79ce60e Mon Sep 17 00:00:00 2001 From: jon-stumpf Date: Tue, 21 Feb 2017 22:35:50 -0500 Subject: Updated {Gpsmta,Mxt,Tt8850} Protocols to record Accuracy; --- src/org/traccar/protocol/GpsmtaProtocolDecoder.java | 2 +- src/org/traccar/protocol/MxtProtocolDecoder.java | 2 +- src/org/traccar/protocol/Tt8850ProtocolDecoder.java | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/org/traccar/protocol/GpsmtaProtocolDecoder.java b/src/org/traccar/protocol/GpsmtaProtocolDecoder.java index 7360dbc1d..4436b7605 100644 --- a/src/org/traccar/protocol/GpsmtaProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsmtaProtocolDecoder.java @@ -73,7 +73,7 @@ public class GpsmtaProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(parser.nextDouble()); position.setSpeed(parser.nextInt()); position.setCourse(parser.nextInt()); - parser.next(); + position.setAccuracy(parser.nextInt()); position.setAltitude(parser.nextInt()); position.set(Position.KEY_STATUS, parser.nextInt()); diff --git a/src/org/traccar/protocol/MxtProtocolDecoder.java b/src/org/traccar/protocol/MxtProtocolDecoder.java index eaeeacc97..bf1d3b342 100644 --- a/src/org/traccar/protocol/MxtProtocolDecoder.java +++ b/src/org/traccar/protocol/MxtProtocolDecoder.java @@ -134,7 +134,7 @@ public class MxtProtocolDecoder extends BaseProtocolDecoder { if (BitUtil.check(infoGroups, 2)) { position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); position.set(Position.KEY_HDOP, buf.readUnsignedByte()); - buf.readUnsignedByte(); // GPS accuracy + position.setAccuracy(buf.readUnsignedByte()); position.set(Position.KEY_RSSI, buf.readUnsignedByte()); buf.readUnsignedShort(); // time since boot buf.readUnsignedByte(); // input voltage diff --git a/src/org/traccar/protocol/Tt8850ProtocolDecoder.java b/src/org/traccar/protocol/Tt8850ProtocolDecoder.java index 040783ba2..c9cb0bb28 100644 --- a/src/org/traccar/protocol/Tt8850ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tt8850ProtocolDecoder.java @@ -79,7 +79,9 @@ public class Tt8850ProtocolDecoder extends BaseProtocolDecoder { } position.setDeviceId(deviceSession.getDeviceId()); - position.setValid(parser.nextInt() < 20); + int accuracy = parser.nextInt(); + position.setValid(accuracy < 20); + position.setAccuracy(accuracy); position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextDouble()); position.setAltitude(parser.nextDouble()); -- cgit v1.2.3