aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GalileoProtocolDecoder.java
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2017-02-20 10:54:34 -0500
committerjon-stumpf <jon.stumpf@gmail.com>2017-02-20 10:54:34 -0500
commit888c392af40187f3a0ecc3395495db9acd85b827 (patch)
treebeb74dff8b8052ffb4a7d3c894b2b4e5a4434973 /src/org/traccar/protocol/GalileoProtocolDecoder.java
parent38249673287b908c0ca55847a35ca16a7b6a0c50 (diff)
parent2449895139fa658d082c1085185003a001225bc3 (diff)
downloadtrackermap-server-888c392af40187f3a0ecc3395495db9acd85b827.tar.gz
trackermap-server-888c392af40187f3a0ecc3395495db9acd85b827.tar.bz2
trackermap-server-888c392af40187f3a0ecc3395495db9acd85b827.zip
Resolved conflict with master;
Diffstat (limited to 'src/org/traccar/protocol/GalileoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GalileoProtocolDecoder.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java
index 68063c5c3..c9aae8e96 100644
--- a/src/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -55,6 +55,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
private static final int TAG_ADC1 = 0x51;
private static final int TAG_ADC2 = 0x52;
private static final int TAG_ADC3 = 0x53;
+ private static final int TAG_ARRAY = 0xea;
private static final Map<Integer, Integer> TAG_LENGTH_MAP = new HashMap<>();
@@ -81,7 +82,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
0x20, 0x33, 0x44, 0x90, 0xc0, 0xc2, 0xc3, 0xd3,
0xd4, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xf0, 0xf9,
0x5a, 0x47, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,
- 0xf7, 0xf8
+ 0xf7, 0xf8, 0xe2, 0xe9
};
for (int i : l1) {
TAG_LENGTH_MAP.put(i, 1);
@@ -102,7 +103,11 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
}
private static int getTagLength(int tag) {
- return TAG_LENGTH_MAP.get(tag);
+ Integer length = TAG_LENGTH_MAP.get(tag);
+ if (length == null) {
+ throw new IllegalArgumentException("Unknown tag: " + tag);
+ }
+ return length;
}
private void sendReply(Channel channel, int checksum) {
@@ -207,6 +212,10 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_ADC + 3, buf.readUnsignedShort());
break;
+ case TAG_ARRAY:
+ buf.skipBytes(buf.readUnsignedByte());
+ break;
+
default:
buf.skipBytes(getTagLength(tag));
break;