aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-06-28 16:35:07 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-06-28 16:35:07 +1200
commitaaff3f18b8dbc44287a237cd39eba91b77705f82 (patch)
tree36a1a76526aed75da591076f13ea662ad0f13543 /src
parent7327681f0bd2338f9c8ee3ea1b4a19dcc5f0de48 (diff)
downloadtrackermap-server-aaff3f18b8dbc44287a237cd39eba91b77705f82.tar.gz
trackermap-server-aaff3f18b8dbc44287a237cd39eba91b77705f82.tar.bz2
trackermap-server-aaff3f18b8dbc44287a237cd39eba91b77705f82.zip
Add CAN support for Galileo protocol
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/GalileoProtocolDecoder.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java
index fddabee60..02d3ac314 100644
--- a/src/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -50,6 +50,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
private static final int TAG_ODOMETER = 0xd4;
private static final int TAG_REFRIGERATOR = 0x5b;
private static final int TAG_PRESSURE = 0x5c;
+ private static final int TAG_CAN = 0xc1;
private static final Map<Integer, Integer> TAG_LENGTH_MAP = new HashMap<>();
@@ -74,10 +75,10 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e
};
int[] l4 = {
- 0x20, 0x33, 0x44, 0x90, 0xc0, 0xc1, 0xc2, 0xc3,
- 0xd3, 0xd4, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xf0,
- 0xf9, 0x5a, 0x47, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5,
- 0xf6, 0xf7, 0xf8
+ 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
};
for (int i : l1) {
TAG_LENGTH_MAP.put(i, 1);
@@ -183,6 +184,12 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
break;
+ case TAG_CAN:
+ position.set(Position.KEY_FUEL, buf.readUnsignedByte() * 0.4);
+ position.set(Position.PREFIX_TEMP + 1, buf.readUnsignedByte() - 40);
+ position.set(Position.KEY_RPM, buf.readUnsignedShort() * 0.125);
+ break;
+
default:
buf.skipBytes(getTagLength(tag));
break;