aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/GenxProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/GenxProtocolDecoderTest.java5
2 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/GenxProtocolDecoder.java b/src/org/traccar/protocol/GenxProtocolDecoder.java
index 1f9e5512c..3b716796c 100644
--- a/src/org/traccar/protocol/GenxProtocolDecoder.java
+++ b/src/org/traccar/protocol/GenxProtocolDecoder.java
@@ -30,7 +30,11 @@ public class GenxProtocolDecoder extends BaseProtocolDecoder {
public GenxProtocolDecoder(GenxProtocol protocol) {
super(protocol);
- String[] columns = Context.getConfig().getString(getProtocolName() + ".reportColumns", "1,2,3,4").split(",");
+ setReportColumns(Context.getConfig().getString(getProtocolName() + ".reportColumns", "1,2,3,4"));
+ }
+
+ public void setReportColumns(String format) {
+ String[] columns = format.split(",");
reportColumns = new int[columns.length];
for (int i = 0; i < columns.length; i++) {
reportColumns[i] = Integer.parseInt(columns[i]);
diff --git a/test/org/traccar/protocol/GenxProtocolDecoderTest.java b/test/org/traccar/protocol/GenxProtocolDecoderTest.java
index 5e99b8fb8..43d9e7d6e 100644
--- a/test/org/traccar/protocol/GenxProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/GenxProtocolDecoderTest.java
@@ -16,6 +16,11 @@ public class GenxProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"000036004130,08/31/2017 17:24:37,45.47257,-73.65506,3,0,117,1.14,124,ON,1489,0,5,N,0,0.000,-95.0,-1.0,0,0.0000,0.0000,0.000,0,0.00,0.00,0.00,NA,U,UUU,0,-95.0,U"));
+ decoder.setReportColumns("1,2,3,4");
+
+ verifyPosition(decoder, text(
+ "000036035855,04/16/2017 21:19:07,45.46485,-73.65424,24,32,61:213,342.51,157,ON,20984,0,12,O,18,0.000,95.0,24.0,1990,64.0894,0.0219,316.009,71,0.00,16.78,5.10,NA,U,UUU,0,-95.0,U"));
+
}
}