aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GenxProtocolDecoder.java
diff options
context:
space:
mode:
authorIvan Muratov <binakot@gmail.com>2017-10-26 08:28:34 +0300
committerGitHub <noreply@github.com>2017-10-26 08:28:34 +0300
commit74cea90707321c775c11e9cfb91269f63ab4476f (patch)
treec6f3e9d02c43eb28ac8506e198e137ca57b1f102 /src/org/traccar/protocol/GenxProtocolDecoder.java
parentdb02157dbb29539dda4b51a5e8b317293cfc536c (diff)
parentdcc7e0c6ed949604af5e62c671e293f582146bc0 (diff)
downloadtrackermap-server-74cea90707321c775c11e9cfb91269f63ab4476f.tar.gz
trackermap-server-74cea90707321c775c11e9cfb91269f63ab4476f.tar.bz2
trackermap-server-74cea90707321c775c11e9cfb91269f63ab4476f.zip
Merge branch 'master' into master
Diffstat (limited to 'src/org/traccar/protocol/GenxProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GenxProtocolDecoder.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/GenxProtocolDecoder.java b/src/org/traccar/protocol/GenxProtocolDecoder.java
index 3b716796c..ebf6f2b53 100644
--- a/src/org/traccar/protocol/GenxProtocolDecoder.java
+++ b/src/org/traccar/protocol/GenxProtocolDecoder.java
@@ -19,6 +19,7 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
import org.traccar.DeviceSession;
+import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -68,6 +69,24 @@ public class GenxProtocolDecoder extends BaseProtocolDecoder {
case 4:
position.setLongitude(Double.parseDouble(values[i]));
break;
+ case 11:
+ position.set(Position.KEY_IGNITION, values[i].equals("ON"));
+ break;
+ case 13:
+ position.setSpeed(UnitsConverter.knotsFromKph(Integer.parseInt(values[i])));
+ break;
+ case 17:
+ position.setCourse(Integer.parseInt(values[i]));
+ break;
+ case 23:
+ position.set(Position.KEY_ODOMETER, Double.parseDouble(values[i]) * 1000);
+ break;
+ case 27:
+ position.setAltitude(UnitsConverter.metersFromFeet(Integer.parseInt(values[i])));
+ break;
+ case 46:
+ position.set(Position.KEY_SATELLITES, Integer.parseInt(values[i]));
+ break;
default:
break;
}