aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-27 23:32:26 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-27 23:32:26 -0700
commit02156420e2b7e8ca60982c60c26245c77069dd6e (patch)
treed28a42f04eefe85383fb9aacac7eaa7de75ae0b8 /src/main
parent9188d67c08f309697fed0f4e452b06ea738a67bf (diff)
downloadtrackermap-server-02156420e2b7e8ca60982c60c26245c77069dd6e.tar.gz
trackermap-server-02156420e2b7e8ca60982c60c26245c77069dd6e.tar.bz2
trackermap-server-02156420e2b7e8ca60982c60c26245c77069dd6e.zip
Decode individual inputs
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
index 283dbeb37..194a21bf7 100644
--- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -789,8 +789,14 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
} else if (BitUtil.check(ignition, 5)) {
position.set(Position.KEY_IGNITION, true);
}
- position.set(Position.KEY_INPUT, parser.nextHexInt());
- position.set(Position.KEY_OUTPUT, parser.nextHexInt());
+ int input = parser.nextHexInt();
+ int output = parser.nextHexInt();
+ position.set(Position.KEY_INPUT, input);
+ position.set(Position.PREFIX_IN + 1, BitUtil.check(input, 1));
+ position.set(Position.PREFIX_IN + 2, BitUtil.check(input, 2));
+ position.set(Position.KEY_OUTPUT, output);
+ position.set(Position.PREFIX_OUT + 1, BitUtil.check(output, 0));
+ position.set(Position.PREFIX_OUT + 2, BitUtil.check(output, 1));
}
}