diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 13:20:46 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 13:20:46 +1300 |
commit | d4dbf85d9536bfec85252a58fc552e2bad42ff17 (patch) | |
tree | 4a849426c2cd60538b152138b147abef47b40966 /src/org/traccar/protocol/BlackKiteProtocolDecoder.java | |
parent | 9218bc65b9673b24d2866aae3d5bbe1a5388bab0 (diff) | |
download | trackermap-server-d4dbf85d9536bfec85252a58fc552e2bad42ff17.tar.gz trackermap-server-d4dbf85d9536bfec85252a58fc552e2bad42ff17.tar.bz2 trackermap-server-d4dbf85d9536bfec85252a58fc552e2bad42ff17.zip |
Remove trailing whitespaces from code
Diffstat (limited to 'src/org/traccar/protocol/BlackKiteProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/BlackKiteProtocolDecoder.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/org/traccar/protocol/BlackKiteProtocolDecoder.java b/src/org/traccar/protocol/BlackKiteProtocolDecoder.java index 4b78cf647..21c7c5b33 100644 --- a/src/org/traccar/protocol/BlackKiteProtocolDecoder.java +++ b/src/org/traccar/protocol/BlackKiteProtocolDecoder.java @@ -70,16 +70,16 @@ public class BlackKiteProtocolDecoder extends BaseProtocolDecoder { throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; - + buf.readUnsignedByte(); // header int length = (buf.readUnsignedShort() & 0x7fff) + 3; - + List<Position> positions = new LinkedList<>(); Set<Integer> tags = new HashSet<>(); boolean hasLocation = false; Position position = new Position(); position.setProtocol(getProtocolName()); - + while (buf.readerIndex() < length) { // Check if new message started @@ -93,7 +93,7 @@ public class BlackKiteProtocolDecoder extends BaseProtocolDecoder { position = new Position(); } tags.add(tag); - + switch (tag) { case TAG_IMEI: @@ -105,30 +105,30 @@ public class BlackKiteProtocolDecoder extends BaseProtocolDecoder { case TAG_DATE: position.setTime(new Date(buf.readUnsignedInt() * 1000)); break; - + case TAG_COORDINATES: hasLocation = true; position.setValid((buf.readUnsignedByte() & 0xf0) == 0x00); position.setLatitude(buf.readInt() / 1000000.0); position.setLongitude(buf.readInt() / 1000000.0); break; - + case TAG_SPEED_COURSE: position.setSpeed(buf.readUnsignedShort() * 0.0539957); position.setCourse(buf.readUnsignedShort() * 0.1); break; - + case TAG_ALTITUDE: position.setAltitude(buf.readShort()); break; - + case TAG_STATUS: int status = buf.readUnsignedShort(); position.set(Event.KEY_IGNITION, BitUtil.check(status, 9)); position.set(Event.KEY_ALARM, BitUtil.check(status, 15)); position.set(Event.KEY_POWER, BitUtil.check(status, 2)); break; - + case TAG_DIGITAL_INPUTS: int input = buf.readUnsignedShort(); for (int i = 0; i < 16; i++) @@ -140,15 +140,15 @@ public class BlackKiteProtocolDecoder extends BaseProtocolDecoder { for (int i = 0; i < 16; i++) position.set(Event.PREFIX_IO + (i + 17), BitUtil.check(output, i)); break; - + case TAG_INPUT_VOLTAGE1: position.set(Event.PREFIX_ADC + 1, buf.readUnsignedShort() / 1000.0); break; - + case TAG_INPUT_VOLTAGE2: position.set(Event.PREFIX_ADC + 2, buf.readUnsignedShort() / 1000.0); break; - + case TAG_INPUT_VOLTAGE3: position.set(Event.PREFIX_ADC + 3, buf.readUnsignedShort() / 1000.0); break; @@ -165,14 +165,14 @@ public class BlackKiteProtocolDecoder extends BaseProtocolDecoder { default: break; - + } } if (hasLocation && position.getFixTime() != null) { positions.add(position); } - + if (!hasDeviceId()) { Log.warning("Unknown device"); return null; |