aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-10-06 06:40:39 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-10-06 14:41:27 +1300
commit55a3404dd2d82666af8fe4fdfb81212874215879 (patch)
treef1d62af741cc21bf377a277f7866955991e1490d /src/org/traccar/protocol
parent273a1b8faba5894d83c7feb64fce6351817be769 (diff)
downloadtrackermap-server-55a3404dd2d82666af8fe4fdfb81212874215879.tar.gz
trackermap-server-55a3404dd2d82666af8fe4fdfb81212874215879.tar.bz2
trackermap-server-55a3404dd2d82666af8fe4fdfb81212874215879.zip
Fix problem with Ulbotech decoder
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/UlbotechProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java
index 9a951f770..ff41c9cc4 100644
--- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java
+++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java
@@ -55,7 +55,7 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder {
private static final short DATA_RFID = 0x0E;
private static final short DATA_EVENT = 0x10;
- private void decodeObd(Position position, ChannelBuffer buf, short length) {
+ private void decodeObd(Position position, ChannelBuffer buf, int length) {
int end = buf.readerIndex() + length;
@@ -66,7 +66,7 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder {
}
}
- private void decodeJ1708(Position position, ChannelBuffer buf, short length) {
+ private void decodeJ1708(Position position, ChannelBuffer buf, int length) {
int end = buf.readerIndex() + length;
@@ -166,8 +166,8 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder {
while (buf.readableBytes() > 3) {
- short type = buf.readUnsignedByte();
- short length = buf.readUnsignedByte();
+ int type = buf.readUnsignedByte();
+ int length = type == DATA_CANBUS ? buf.readUnsignedShort() : buf.readUnsignedByte();
switch (type) {