From 7eb11d561176e99570396120802674cf67fbfd34 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Sep 2016 13:53:39 +1300 Subject: Add JT600C new format test case --- test/org/traccar/protocol/Jt600ProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 4bbfb5627..706987164 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -67,6 +67,9 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, buffer( "(6221107674,2,U09,129,2,A,280513113036,E,02711.0500,S,1721.0876,A,030613171243,E,02756.7618,S,2300.0325,3491,538200,14400,1)")); + verifyPosition(decoder, buffer( + "(3551001012,U01,010100,000032,F,0.000000,N,0.000000,E,0.00,0,0,10%,00000000010000,15748,7923,23,0,0,3E)")); + } } -- cgit v1.2.3 From 7b17e8d1fe1dc85b5a324776cbe87d1525230104 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Sep 2016 16:14:30 +1300 Subject: Implement eeLink protocol commands --- src/org/traccar/protocol/EelinkProtocol.java | 9 ++- .../traccar/protocol/EelinkProtocolDecoder.java | 2 +- .../traccar/protocol/EelinkProtocolEncoder.java | 68 ++++++++++++++++++++++ .../protocol/EelinkProtocolEncoderTest.java | 22 +++++++ 4 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 src/org/traccar/protocol/EelinkProtocolEncoder.java create mode 100644 test/org/traccar/protocol/EelinkProtocolEncoderTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/EelinkProtocol.java b/src/org/traccar/protocol/EelinkProtocol.java index 4da051159..e91fc5efd 100644 --- a/src/org/traccar/protocol/EelinkProtocol.java +++ b/src/org/traccar/protocol/EelinkProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; +import org.traccar.model.Command; import java.util.List; @@ -27,6 +28,11 @@ public class EelinkProtocol extends BaseProtocol { public EelinkProtocol() { super("eelink"); + setSupportedCommands( + Command.TYPE_CUSTOM, + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME, + Command.TYPE_REBOOT_DEVICE); } @Override @@ -35,6 +41,7 @@ public class EelinkProtocol extends BaseProtocol { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2)); + pipeline.addLast("objectEncoder", new EelinkProtocolEncoder()); pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this)); } }); diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 87d706aff..10a8304c9 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -40,7 +40,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { public static final int MSG_STATE = 0x05; public static final int MSG_SMS = 0x06; public static final int MSG_OBD = 0x07; - public static final int MSG_INTERACTIVE = 0x80; + public static final int MSG_DOWNLINK = 0x80; public static final int MSG_DATA = 0x81; public static final int MSG_NORMAL = 0x12; diff --git a/src/org/traccar/protocol/EelinkProtocolEncoder.java b/src/org/traccar/protocol/EelinkProtocolEncoder.java new file mode 100644 index 000000000..a7e96aa97 --- /dev/null +++ b/src/org/traccar/protocol/EelinkProtocolEncoder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; +import org.traccar.BaseProtocolEncoder; +import org.traccar.Context; +import org.traccar.helper.Checksum; +import org.traccar.helper.Log; +import org.traccar.model.Command; +import org.traccar.model.Device; + +import java.nio.charset.StandardCharsets; + +public class EelinkProtocolEncoder extends BaseProtocolEncoder { + + private ChannelBuffer encodeContent(String content) { + + ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); + + buf.writeByte(0x67); + buf.writeByte(0x67); + buf.writeByte(EelinkProtocolDecoder.MSG_DOWNLINK); + buf.writeShort(2 + 1 + 4 + content.length()); // length + buf.writeShort(0); // index + + buf.writeByte(0x01); // command + buf.writeInt(0); // server id + buf.writeBytes(content.getBytes(StandardCharsets.UTF_8)); + + return buf; + } + + @Override + protected Object encodeCommand(Command command) { + + switch (command.getType()) { + case Command.TYPE_CUSTOM: + return encodeContent((String) command.getAttributes().get(Command.KEY_DATA)); + case Command.TYPE_ENGINE_STOP: + return encodeContent("RELAY,1#"); + case Command.TYPE_ENGINE_RESUME: + return encodeContent("RELAY,0#"); + case Command.TYPE_REBOOT_DEVICE: + return encodeContent("RESET#"); + default: + Log.warning(new UnsupportedOperationException(command.getType())); + break; + } + + return null; + } + +} diff --git a/test/org/traccar/protocol/EelinkProtocolEncoderTest.java b/test/org/traccar/protocol/EelinkProtocolEncoderTest.java new file mode 100644 index 000000000..8a8cd5f6b --- /dev/null +++ b/test/org/traccar/protocol/EelinkProtocolEncoderTest.java @@ -0,0 +1,22 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +public class EelinkProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + EelinkProtocolEncoder encoder = new EelinkProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_ENGINE_STOP); + + verifyCommand(encoder, command, binary("676780000f0000010000000052454c41592c3123")); + + } + +} -- cgit v1.2.3 From f6fc3fb5431e0904bde0d3afe35d622b7bdbe935 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Sep 2016 23:51:37 +1300 Subject: Modify CalAmp decoder and add test cases --- src/org/traccar/protocol/CalAmpProtocolDecoder.java | 2 +- test/org/traccar/protocol/CalAmpProtocolDecoderTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java index 47d7bf483..2a4af2f03 100644 --- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java +++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java @@ -121,7 +121,7 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder { int accCount = BitUtil.to(buf.readUnsignedByte(), 6); if (type != MSG_MINI_EVENT_REPORT) { - buf.readUnsignedByte(); // reserved + position.set("append", buf.readUnsignedByte()); } if (accType == 1) { diff --git a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java index 9ed4c4a43..8d7d5f9fe 100644 --- a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java @@ -10,6 +10,12 @@ public class CalAmpProtocolDecoderTest extends ProtocolTest { CalAmpProtocolDecoder decoder = new CalAmpProtocolDecoder(new CalAmpProtocol()); + verifyPosition(decoder, binary( + "8305133303910501010102004557E5AB2457E3B3E01FD828DBFE9E3465000028C90000004201310704001EFFA12F0B22081BCA05000000000000000F87000E8E2F00EA029E0000082D")); + + verifyPosition(decoder, binary( + "8305313301481601010102045557ea2eba57ea2eba1ebf06db005f2e5e0000220c00000000000006200000ff8f000a00000bca06000000000000000f1b000f35ef00ea02900000087000000060")); + verifyPosition(decoder, binary( "8305454205067001010102008157a9bddc57a96aaa17cdb98fccc1a457000056ac00000000000007250000ff8f000e00082711570000000000ffff101b00003148000010680000000000000000000000050000000000000000000005b0000000000000289600000000000000000000069b00000000000008e400000000000000000000000000000003000000010000070f")); -- cgit v1.2.3 From 64a9af3090914eede02a2cc6d33960b9324c5d49 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 28 Sep 2016 01:34:29 +1300 Subject: Decode Tramigo direction (fix #2377) --- src/org/traccar/protocol/TramigoProtocolDecoder.java | 9 ++++++++- test/org/traccar/protocol/TramigoProtocolDecoderTest.java | 9 +++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java index af81616d8..74c6df9e3 100644 --- a/src/org/traccar/protocol/TramigoProtocolDecoder.java +++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java @@ -43,6 +43,8 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { public static final int MSG_COMPACT = 0x0100; public static final int MSG_FULL = 0x00FE; + private static final String[] DIRECTIONS = new String[] { "N", "NE", "E", "SE", "S", "SW", "W", "NW" }; + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { @@ -119,8 +121,13 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { pattern = Pattern.compile("([NSWE]{1,2}) with speed (\\d+) km/h"); matcher = pattern.matcher(sentence); if (matcher.find()) { + for (int i = 0; i < DIRECTIONS.length; i++) { + if (matcher.group(1).equals(DIRECTIONS[i])) { + position.setCourse(i * 45.0); + break; + } + } position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(matcher.group(2)))); - position.setCourse(0); // matcher.group(1) for course } pattern = Pattern.compile("(\\d{1,2}:\\d{2} \\w{3} \\d{1,2})"); diff --git a/test/org/traccar/protocol/TramigoProtocolDecoderTest.java b/test/org/traccar/protocol/TramigoProtocolDecoderTest.java index 9cf7b9006..6da14ba64 100644 --- a/test/org/traccar/protocol/TramigoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TramigoProtocolDecoderTest.java @@ -12,6 +12,9 @@ public class TramigoProtocolDecoderTest extends ProtocolTest { TramigoProtocolDecoder decoder = new TramigoProtocolDecoder(new TramigoProtocol()); + verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "80009e08b00086000101bc1803778a59c58dea57546573742054323320547261636b65723a204d6f76696e672c20312e3639206b6d204e57206f66205574656b6f6e2c2045646f2c204e472c20362e34363137302c20352e36313938322c20452077697468207370656564203333206b6d2f682c2031363a3138205365702032372020454f46")); + verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN, "8000853eb000b8000101fcff032f14665a89e2564176656e7369732053797353657276653a2049676e6974696f6e206f6e2064657465637465642c206d6f76696e672c20302e3135206b6d205357206f66204261626120416e696d61736861756e205374726565742d426f64652054686f6d61732053742e2c20537572756c6572652c204c61676f7320436974792c204e472c20362e34383736352c20332e33343735352c2031303a3031204d6172203131202020454f46")); @@ -39,12 +42,6 @@ public class TramigoProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN, "8000011bb0009e0001015b93032ef6f35994a9545472616d69676f3a204d6f76696e672c20302e3930206b6d205345206f66204372616e6562726f6f6b20466972652053746174696f6e2c2050656e726974682c205379646e65792c2041552c202d33332e37303732322c203135302e37313735392c2053452077697468207370656564203337206b6d2f682c2031393a3438204a616e20342020454f46")); - // Tramigo: Parked, 0.12 km E of McDonald's H.V. dela Costa, Makati, 11:07 Mar 27 - // Tramigo: Moving, 0.90 km SE of Cranebrook Fire Station, Penrith, Sydney, AU, -33.70722, 150.71759, SE with speed 37 km/h, 19:48 Jan 4 EOF - - //verifyPosition(decoder, text( ChannelBuffers.wrappedBuffer(BcdUtil.convertArray( - // new int[] {0x68,0x68,0x25,0x00,0x00,0x01,0x23,0x45,0x67,0x89,0x01,0x23,0x45,0x00,0x01,0x10,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x6B,0x3F,0x3E,0x02,0x6B,0x3F,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0D,0x0A})))); - } } -- cgit v1.2.3 From 7d8f4290bbd4400152660923f4e8024d016b27ec Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 30 Sep 2016 02:58:57 +1300 Subject: Implement JT701 device support --- src/org/traccar/protocol/Jt600FrameDecoder.java | 5 ++-- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 34 +++++++++++++++++++--- .../traccar/protocol/Jt600FrameDecoderTest.java | 4 +++ .../traccar/protocol/Jt600ProtocolDecoderTest.java | 6 ++++ 4 files changed, 43 insertions(+), 6 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Jt600FrameDecoder.java b/src/org/traccar/protocol/Jt600FrameDecoder.java index cb7fce0c0..bc6ad1b53 100644 --- a/src/org/traccar/protocol/Jt600FrameDecoder.java +++ b/src/org/traccar/protocol/Jt600FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,8 @@ public class Jt600FrameDecoder extends FrameDecoder { char type = (char) buf.getByte(buf.readerIndex()); if (type == '$') { - int length = buf.getUnsignedShort(buf.readerIndex() + 7) + 10; + boolean longFormat = buf.getUnsignedByte(buf.readerIndex() + 1) == 0x75; + int length = buf.getUnsignedShort(buf.readerIndex() + (longFormat ? 8 : 7)) + 10; if (length >= buf.readableBytes()) { return buf.readBytes(length); } diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index b30bd7b85..fd2448c0d 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -50,6 +50,8 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { buf.readByte(); // header + boolean longFormat = buf.getUnsignedByte(buf.readerIndex()) == 0x75; + String id = String.valueOf(Long.parseLong(ChannelBuffers.hexDump(buf.readBytes(5)))); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id); if (deviceSession == null) { @@ -57,9 +59,12 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { } position.setDeviceId(deviceSession.getDeviceId()); - int version = BcdUtil.readInteger(buf, 1); - buf.readUnsignedByte(); // type - buf.readBytes(2); // length + if (longFormat) { + buf.readUnsignedByte(); // protocol + } + + int version = buf.readUnsignedByte() >> 4; + buf.readUnsignedShort(); // length DateBuilder dateBuilder = new DateBuilder() .setDay(BcdUtil.readInteger(buf, 2)) @@ -87,7 +92,28 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(BcdUtil.readInteger(buf, 2)); position.setCourse(buf.readUnsignedByte() * 2.0); - if (version == 1) { + if (longFormat) { + + position.set(Position.KEY_ODOMETER, buf.readUnsignedInt() * 1000); + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); + + buf.readUnsignedInt(); // vehicle id combined + + position.set(Position.KEY_STATUS, buf.readUnsignedShort()); + + int battery = buf.readUnsignedByte(); + if (battery == 0xff) { + position.set(Position.KEY_CHARGE, true); + } else { + position.set(Position.KEY_BATTERY, battery + "%"); + } + + position.set(Position.KEY_CID, buf.readUnsignedShort()); + position.set(Position.KEY_LAC, buf.readUnsignedShort()); + position.set(Position.KEY_GSM, buf.readUnsignedByte()); + position.set(Position.KEY_INDEX, buf.readUnsignedByte()); + + } else if (version == 1) { position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); position.set(Position.KEY_POWER, buf.readUnsignedByte()); diff --git a/test/org/traccar/protocol/Jt600FrameDecoderTest.java b/test/org/traccar/protocol/Jt600FrameDecoderTest.java index ccfbcf0d0..43f7461d0 100644 --- a/test/org/traccar/protocol/Jt600FrameDecoderTest.java +++ b/test/org/traccar/protocol/Jt600FrameDecoderTest.java @@ -11,6 +11,10 @@ public class Jt600FrameDecoderTest extends ProtocolTest { Jt600FrameDecoder decoder = new Jt600FrameDecoder(); + Assert.assertEquals( + binary("2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607"), + decoder.decode(null, null, binary("2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607"))); + Assert.assertEquals( binary("28333132303832303032392C5730312C30323535332E333535352C452C323433382E303939372C532C412C3137313031322C3035333333392C302C382C32302C362C33312C352C32302C323029"), decoder.decode(null, null, binary("28333132303832303032392C5730312C30323535332E333535352C452C323433382E303939372C532C412C3137313031322C3035333333392C302C382C32302C362C33312C352C32302C323029"))); diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 706987164..64db2a124 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -11,6 +11,12 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new Jt600Protocol()); + verifyPosition(decoder, binary( + "2475201509260111002313101503464722331560113555309F00000000002D0500CB206800F064109326381A03")); + + verifyPosition(decoder, binary( + "2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607")); + verifyPosition(decoder, buffer( "(3301210003,U01,040812,185302,T,22.564025,N,113.242329,E,5.21,152,9,32%,00000000000011,10133,5173,22,100,1)")); -- cgit v1.2.3 From 4239df1f79ba8a27df8ddd934eb2e4c26d850899 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 30 Sep 2016 03:26:47 +1300 Subject: Add GV500 device test message --- test/org/traccar/protocol/Gl200ProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index ea28928c0..b59782ac5 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol()); + verifyPosition(decoder, text( + "+RESP:GTFRI,360100,864251020141408,3VWGW6AJ0FM237324,gv500,,10,1,1,0.0,0,2258.4,-99.256948,19.555800,20160929214743,0334,0020,0084,65AC,00,0.0,,,,100,410000,0,nan,,20160929214743,13BA$")); + verifyPosition(decoder, text( "+RESP:GTOBD,360201,864251020186064,4T1BE46KX7U018210,,0,19FFFF,4T1BE46KX7U018210,1,14283,983901C0,799,36,18,,33792,0,0,0,,,38,,6,53557,0,0.0,0,219.5,-76.661456,39.832588,20160507132153,20160507132154,0230$")); -- cgit v1.2.3 From f07681fd79bd44a034cb424cb70861d84521968b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 30 Sep 2016 06:42:42 +1300 Subject: Implement Fifotrack protocol --- debug.xml | 1 + src/org/traccar/protocol/FifotrackProtocol.java | 45 ++++++++ .../traccar/protocol/FifotrackProtocolDecoder.java | 123 +++++++++++++++++++++ .../protocol/FifotrackProtocolDecoderTest.java | 18 +++ 4 files changed, 187 insertions(+) create mode 100644 src/org/traccar/protocol/FifotrackProtocol.java create mode 100644 src/org/traccar/protocol/FifotrackProtocolDecoder.java create mode 100644 test/org/traccar/protocol/FifotrackProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/debug.xml b/debug.xml index 39a52fe96..94e30c6b8 100644 --- a/debug.xml +++ b/debug.xml @@ -491,5 +491,6 @@ 5121 5122 5123 + 5124 diff --git a/src/org/traccar/protocol/FifotrackProtocol.java b/src/org/traccar/protocol/FifotrackProtocol.java new file mode 100644 index 000000000..6e441beb1 --- /dev/null +++ b/src/org/traccar/protocol/FifotrackProtocol.java @@ -0,0 +1,45 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +public class FifotrackProtocol extends BaseProtocol { + + public FifotrackProtocol() { + super("fifotrack"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new FifotrackProtocolDecoder(FifotrackProtocol.this)); + } + }); + } + +} diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java new file mode 100644 index 000000000..9e8d01117 --- /dev/null +++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.DeviceSession; +import org.traccar.helper.DateBuilder; +import org.traccar.helper.Parser; +import org.traccar.helper.PatternBuilder; +import org.traccar.helper.UnitsConverter; +import org.traccar.model.Position; + +import java.net.SocketAddress; +import java.util.regex.Pattern; + +public class FifotrackProtocolDecoder extends BaseProtocolDecoder { + + public FifotrackProtocolDecoder(FifotrackProtocol protocol) { + super(protocol); + } + + private static final Pattern PATTERN = new PatternBuilder() + .text("$$") + .number("d+,") // length + .number("(d+),") // imei + .number("d+,") // index + .expression("[^,]+,") // type + .number("(d+)?,") // alarm + .number("(dd)(dd)(dd)") // date + .number("(dd)(dd)(dd),") // time + .number("([AV]),") // validity + .number("(-?d+.d+),") // latitude + .number("(-?d+.d+),") // longitude + .number("(d+),") // speed + .number("(d+),") // course + .number("(-?d+),") // altitude + .number("(d+),") // odometer + .number("d+,") // runtime + .number("(xxxx),") // status + .number("(x+),") // input + .number("(x+),") // output + .number("(d+)|") // mcc + .number("(d+)|") // mnc + .number("(x+)|") // lac + .number("(x+),") // cid + .number("([x|]+),") // adc + .expression("([^,]+),") // rfid + .expression("([^*]+)") // sensors + .any() + .compile(); + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + Parser parser = new Parser(PATTERN, (String) msg); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + parser.next(); // alarm + + DateBuilder dateBuilder = new DateBuilder() + .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + position.setValid(parser.next().equals("A")); + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt())); + position.setCourse(parser.nextInt()); + position.setAltitude(parser.nextInt()); + + position.set(Position.KEY_ODOMETER, parser.nextLong()); + position.set(Position.KEY_STATUS, parser.nextInt(16)); + position.set(Position.KEY_INPUT, parser.nextInt(16)); + position.set(Position.KEY_OUTPUT, parser.nextInt(16)); + + position.set(Position.KEY_MCC, parser.nextInt()); + position.set(Position.KEY_MNC, parser.nextInt()); + position.set(Position.KEY_LAC, parser.nextInt(16)); + position.set(Position.KEY_CID, parser.nextInt(16)); + + String[] adc = parser.next().split("\\|"); + for (int i = 0; i < adc.length; i++) { + position.set(Position.PREFIX_ADC + (i + 1), Integer.parseInt(adc[i], 16)); + } + + position.set(Position.KEY_RFID, parser.next()); + + String[] sensors = parser.next().split("\\|"); + for (int i = 0; i < sensors.length; i++) { + position.set(Position.PREFIX_IO + (i + 1), sensors[i]); + } + + return position; + } + +} diff --git a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java new file mode 100644 index 000000000..60f22a91a --- /dev/null +++ b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java @@ -0,0 +1,18 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class FifotrackProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + FifotrackProtocolDecoder decoder = new FifotrackProtocolDecoder(new FifotrackProtocol()); + + verifyPosition(decoder, text( + "$$135,866104023192332,29,A01,,160606093046,A,22.546430,114.079730,0,186,181,0,415322,0000,02,2,460|0|27B3|EA7,A2F|3B9|3|0,940C7E,31.76|30.98*46")); + + } + +} -- cgit v1.2.3 From cf8aeca07a7187d62dfa3bc79506c6ff41613f32 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 1 Oct 2016 10:09:47 +1300 Subject: Add Ulbotech unit test cases --- test/org/traccar/protocol/UlbotechFrameDecoderTest.java | 4 ++++ test/org/traccar/protocol/UlbotechProtocolDecoderTest.java | 3 +++ 2 files changed, 7 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/UlbotechFrameDecoderTest.java b/test/org/traccar/protocol/UlbotechFrameDecoderTest.java index 3a21fd209..03a4fb336 100644 --- a/test/org/traccar/protocol/UlbotechFrameDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechFrameDecoderTest.java @@ -11,6 +11,10 @@ public class UlbotechFrameDecoderTest extends ProtocolTest { UlbotechFrameDecoder decoder = new UlbotechFrameDecoder(); + Assert.assertEquals( + binary("f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8"), + decoder.decode(null, null, binary("f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8"))); + Assert.assertEquals( binary("2a545330312c33353430343330353133383934363023"), decoder.decode(null, null, binary("2a545330312c33353430343330353133383934363023"))); diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java index cb4e43c38..a73845b87 100644 --- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class UlbotechProtocolDecoderTest extends ProtocolTest { UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new UlbotechProtocol()); + /*verifyPosition(decoder, binary( + "f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8"));*/ + verifyPosition(decoder, binary( "F8010103596580420045259CFB3329010E015ED91506BDE5A800000000009E030402420000040400492AA405060344197E220D071131058F410C1591310D48312F8F413107C60804027666B00C138254D182607A826EE083BE554385F50019423CAD1DF8")); -- cgit v1.2.3 From 69d0cc47d63d9052218a8d87cf436e46165e716c Mon Sep 17 00:00:00 2001 From: Vitaly Litvak Date: Sat, 1 Oct 2016 09:14:33 +0300 Subject: For JT600c - added checksum verification and replying for alarms/positions messages --- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 75 ++++++++++++++++------ .../traccar/protocol/Jt600ProtocolDecoderTest.java | 14 ++-- 2 files changed, 65 insertions(+), 24 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index fd2448c0d..0c235a4b5 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -201,24 +201,25 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN_U01 = new PatternBuilder() .text("(") - .number("(d+),") // id - .number("Udd,") // type - .number("d+,").optional() // alarm - .number("(dd)(dd)(dd),") // date (ddmmyy) - .number("(dd)(dd)(dd),") // time - .expression("([TF]),") // validity - .number("(d+.d+),([NS]),") // latitude - .number("(d+.d+),([EW]),") // longitude - .number("(d+.?d*),") // speed - .number("(d+),") // course - .number("(d+),") // satellites - .number("(d+%),") // battery - .expression("([01]+),") // status - .number("(d+),") // cid - .number("(d+),") // lac - .number("(d+),") // gsm signal - .number("(d+),") // odometer - .number("(d+)") // index + .number("(d+),") // id + .number("(Udd),") // type + .number("d+,").optional() // alarm + .number("(dd)(dd)(dd),") // date (ddmmyy) + .number("(dd)(dd)(dd),") // time + .expression("([TF]),") // validity + .number("(d+.d+),([NS]),") // latitude + .number("(d+.d+),([EW]),") // longitude + .number("(d+.?d*),") // speed + .number("(d+),") // course + .number("(d+),") // satellites + .number("(d+%),") // battery + .expression("([01]+),") // status + .number("(d+),") // cid + .number("(d+),") // lac + .number("(d+),") // gsm signal + .number("(d+),") // odometer + .number("(d+),") // serial number + .expression("([0-9A-F][0-9A-F])").optional() // checksum .any() .compile(); @@ -234,6 +235,8 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { return null; } + String messageType = parser.next(); + Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); @@ -256,11 +259,29 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_CID, parser.nextInt()); position.set(Position.KEY_LAC, parser.nextInt()); position.set(Position.KEY_GSM, parser.nextInt()); - position.set(Position.KEY_ODOMETER, parser.nextLong() * 1000); + position.set(Position.KEY_ODOMETER, parser.nextLong() * 100); position.set(Position.KEY_INDEX, parser.nextInt()); - return position; + switch (messageType) { + case "U01": + case "U02": + case "U03": + String checkSum = parser.next(); + int calculatedCheckSum = checkSum(sentence.substring(1, sentence.length() - checkSum.length() - 1)); + if (Integer.parseInt(checkSum, 16) == calculatedCheckSum) { + sendResponse(channel, "(S39)"); + return position; + } else { + return null; + } + case "U06": + sendResponse(channel, "(S20)"); + return position; + default: + return null; + } } + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { @@ -282,4 +303,18 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { return null; } + private byte checkSum(String sentence) { + byte[] bytes = sentence.getBytes(StandardCharsets.US_ASCII); + byte sum = 0; + for (byte b : bytes) { + sum ^= b; + } + return sum; + } + + private void sendResponse(Channel channel, String response) { + if (channel != null) { + channel.write(ChannelBuffers.copiedBuffer(response, StandardCharsets.US_ASCII)); + } + } } diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 64db2a124..6899418d9 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -18,13 +18,13 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { "2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607")); verifyPosition(decoder, buffer( - "(3301210003,U01,040812,185302,T,22.564025,N,113.242329,E,5.21,152,9,32%,00000000000011,10133,5173,22,100,1)")); + "(3301210003,U01,040812,185302,T,22.564025,N,113.242329,E,5.21,152,9,32%,00000000000011,10133,5173,22,100,1,18)")); verifyPosition(decoder, buffer( - "(3301210003,U02,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1)")); + "(3301210003,U02,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1,36)")); verifyPosition(decoder, buffer( - "(3301210003,U03,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1)")); + "(3301210003,U03,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1,37)")); verifyNothing(decoder, buffer( "(3301210003,U04)")); @@ -68,11 +68,17 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { "(3120820029,W01,02553.3555,E,2438.0997,S,A,171012,053339,0,8,20,6,31,5,20,20)")); verifyPosition(decoder, buffer( - "(3330104377,U01,010100,010228,F,00.000000,N,000.000000,E,0,0,0,0%,00001000000000,741,14,22,0,206)")); + "(3330104377,U01,010100,010228,F,00.000000,N,000.000000,E,0,0,0,0%,00001000000000,741,14,22,0,206,1E)")); verifyNothing(decoder, buffer( "(6221107674,2,U09,129,2,A,280513113036,E,02711.0500,S,1721.0876,A,030613171243,E,02756.7618,S,2300.0325,3491,538200,14400,1)")); + verifyPosition(decoder, buffer( + "(3301210003,U02,040812,185302,T,00.000000,N,000.000000,E,0,0,0,0%,00000000000011,741,51,22,0,1,05)")); + + verifyPosition(decoder, buffer( + "(3301210003,U06,4,250916,133207,T,7.011013,N,25.060708,W,27.61,102,10,0%,00101011000000,0,1,0,448,0,126,1,30)")); + verifyPosition(decoder, buffer( "(3551001012,U01,010100,000032,F,0.000000,N,0.000000,E,0.00,0,0,10%,00000000010000,15748,7923,23,0,0,3E)")); -- cgit v1.2.3 From 2c9c5540cb9c8edace64daba4b60957436d12e76 Mon Sep 17 00:00:00 2001 From: Vitaly Litvak Date: Sat, 1 Oct 2016 09:58:59 +0300 Subject: For JT600c - added engine start/stop, set timezone and reboot commands implementation with tests --- src/org/traccar/protocol/Jt600Protocol.java | 6 +++ src/org/traccar/protocol/Jt600ProtocolEncoder.java | 43 ++++++++++++++++++++++ .../traccar/protocol/Jt600ProtocolEncoderTest.java | 37 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 src/org/traccar/protocol/Jt600ProtocolEncoder.java create mode 100644 test/org/traccar/protocol/Jt600ProtocolEncoderTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Jt600Protocol.java b/src/org/traccar/protocol/Jt600Protocol.java index 2df792b47..78be088c1 100644 --- a/src/org/traccar/protocol/Jt600Protocol.java +++ b/src/org/traccar/protocol/Jt600Protocol.java @@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; +import org.traccar.model.Command; import java.util.List; @@ -26,6 +27,10 @@ public class Jt600Protocol extends BaseProtocol { public Jt600Protocol() { super("jt600"); + setSupportedCommands(Command.TYPE_ENGINE_RESUME, + Command.TYPE_ENGINE_STOP, + Command.TYPE_SET_TIMEZONE, + Command.TYPE_REBOOT_DEVICE); } @Override @@ -34,6 +39,7 @@ public class Jt600Protocol extends BaseProtocol { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new Jt600FrameDecoder()); + pipeline.addLast("objectEncoder", new Jt600ProtocolEncoder()); pipeline.addLast("objectDecoder", new Jt600ProtocolDecoder(Jt600Protocol.this)); } }); diff --git a/src/org/traccar/protocol/Jt600ProtocolEncoder.java b/src/org/traccar/protocol/Jt600ProtocolEncoder.java new file mode 100644 index 000000000..d25ec637f --- /dev/null +++ b/src/org/traccar/protocol/Jt600ProtocolEncoder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.traccar.StringProtocolEncoder; +import org.traccar.helper.Log; +import org.traccar.model.Command; + +public class Jt600ProtocolEncoder extends StringProtocolEncoder { + @Override + protected Object encodeCommand(Command command) { + + switch (command.getType()) { + case Command.TYPE_ENGINE_STOP: + return "(S07,0)"; + case Command.TYPE_ENGINE_RESUME: + return "(S07,1)"; + case Command.TYPE_SET_TIMEZONE: + int offset = ((Number) command.getAttributes().get(Command.KEY_TIMEZONE)).intValue() / 60; + return "(S09,1," + offset + ")"; + case Command.TYPE_REBOOT_DEVICE: + return "(S17)"; + default: + Log.warning(new UnsupportedOperationException(command.getType())); + break; + } + + return null; + } +} diff --git a/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java b/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java new file mode 100644 index 000000000..80802dc35 --- /dev/null +++ b/test/org/traccar/protocol/Jt600ProtocolEncoderTest.java @@ -0,0 +1,37 @@ +package org.traccar.protocol; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +public class Jt600ProtocolEncoderTest extends ProtocolTest { + Jt600ProtocolEncoder encoder = new Jt600ProtocolEncoder(); + Command command = new Command(); + + @Test + public void testEngineStop() throws Exception { + command.setType(Command.TYPE_ENGINE_STOP); + assertEquals("(S07,0)", encoder.encodeCommand(command)); + } + + @Test + public void testEngineResume() throws Exception { + command.setType(Command.TYPE_ENGINE_RESUME); + assertEquals("(S07,1)", encoder.encodeCommand(command)); + } + + @Test + public void testSetTimezone() throws Exception { + command.setType(Command.TYPE_SET_TIMEZONE); + command.set(Command.KEY_TIMEZONE, 240 * 60); + assertEquals("(S09,1,240)", encoder.encodeCommand(command)); + } + + @Test + public void testReboot() throws Exception { + command.setType(Command.TYPE_REBOOT_DEVICE); + assertEquals("(S17)", encoder.encodeCommand(command)); + } +} -- cgit v1.2.3 From bb211eea5f62014c0700138e922cb1adcdc9d9dd Mon Sep 17 00:00:00 2001 From: Vitaly Litvak Date: Sun, 2 Oct 2016 08:28:27 +0300 Subject: Support old protocol versions without checksum --- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 20 +++++++++++++------- .../traccar/protocol/Jt600ProtocolDecoderTest.java | 8 ++++---- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 287235fb1..6d066299a 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -219,7 +219,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { .number("(d+),") // lac .number("(d+),") // gsm signal .number("(d+),") // odometer - .number("(d+),") // serial number + .number("(d+),?") // serial number .number("(xx)").optional() // checksum .any() .compile(); @@ -267,13 +267,19 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { case "U01": case "U02": case "U03": - int checkSum = parser.nextInt(16); - int calculatedCheckSum = Checksum.xor(sentence.substring(1, sentence.length() - 3)); - if (checkSum == calculatedCheckSum) { - sendResponse(channel, "(S39)"); - return position; + // support protocol with check sum + if (parser.hasNext(2)) { + int checkSum = parser.nextInt(16); + int calculatedCheckSum = Checksum.xor(sentence.substring(1, sentence.length() - 3)); + if (checkSum == calculatedCheckSum) { + sendResponse(channel, "(S39)"); + return position; + } else { + return null; + } + // support protocol without check sum } else { - return null; + return position; } case "U06": sendResponse(channel, "(S20)"); diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 6899418d9..3fc74081f 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -18,13 +18,13 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { "2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607")); verifyPosition(decoder, buffer( - "(3301210003,U01,040812,185302,T,22.564025,N,113.242329,E,5.21,152,9,32%,00000000000011,10133,5173,22,100,1,18)")); + "(3301210003,U01,040812,185302,T,22.564025,N,113.242329,E,5.21,152,9,32%,00000000000011,10133,5173,22,100,1)")); verifyPosition(decoder, buffer( - "(3301210003,U02,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1,36)")); + "(3301210003,U02,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1)")); verifyPosition(decoder, buffer( - "(3301210003,U03,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1,37)")); + "(3301210003,U03,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1)")); verifyNothing(decoder, buffer( "(3301210003,U04)")); @@ -68,7 +68,7 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { "(3120820029,W01,02553.3555,E,2438.0997,S,A,171012,053339,0,8,20,6,31,5,20,20)")); verifyPosition(decoder, buffer( - "(3330104377,U01,010100,010228,F,00.000000,N,000.000000,E,0,0,0,0%,00001000000000,741,14,22,0,206,1E)")); + "(3330104377,U01,010100,010228,F,00.000000,N,000.000000,E,0,0,0,0%,00001000000000,741,14,22,0,206)")); verifyNothing(decoder, buffer( "(6221107674,2,U09,129,2,A,280513113036,E,02711.0500,S,1721.0876,A,030613171243,E,02756.7618,S,2300.0325,3491,538200,14400,1)")); -- cgit v1.2.3 From 5fa04496f7f752e6c7fe339b712875ae6b860d3d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 3 Oct 2016 04:57:44 +1300 Subject: Add cell info class --- src/org/traccar/location/CellInfo.java | 136 ++++++++++++++++++++++++++++ test/org/traccar/location/CellInfoTest.java | 36 ++++++++ 2 files changed, 172 insertions(+) create mode 100644 src/org/traccar/location/CellInfo.java create mode 100644 test/org/traccar/location/CellInfoTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/location/CellInfo.java b/src/org/traccar/location/CellInfo.java new file mode 100644 index 000000000..fe61f3bec --- /dev/null +++ b/src/org/traccar/location/CellInfo.java @@ -0,0 +1,136 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.location; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.traccar.Config; +import org.traccar.Context; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +public class CellInfo { + + @JsonInclude(JsonInclude.Include.NON_DEFAULT) + public static class Cell { + + private int mcc; + private int mnc; + private int lac; + private int cid; + private int signal; + + public Cell() { + } + + public Cell(int mcc, int mnc, int lac, int cid, int signal) { + this.mcc = mcc; + this.mnc = mnc; + this.lac = lac; + this.cid = cid; + this.signal = signal; + } + + public int getMcc() { + return mcc; + } + + public void setMcc(int mcc) { + this.mcc = mcc; + } + + public int getMnc() { + return mnc; + } + + public void setMnc(int mnc) { + this.mnc = mnc; + } + + public int getLac() { + return lac; + } + + public void setLac(int lac) { + this.lac = lac; + } + + public int getCid() { + return cid; + } + + public void setCid(int cid) { + this.cid = cid; + } + + public int getSignal() { + return signal; + } + + public void setSignal(int signal) { + this.signal = signal; + } + } + + public CellInfo() { + } + + public CellInfo(Collection cells) { + this.cells.addAll(cells); + } + + private List cells = new ArrayList<>(); + + public List getCells() { + return cells; + } + + public void addCell(int lac, int cid) { + Config config = Context.getConfig(); + if (config.hasKey("location.mcc") && config.hasKey("location.mnc")) { + int mcc = config.getInteger("location.mcc"); + int mnc = config.getInteger("location.mnc"); + cells.add(new Cell(mcc, mnc, lac, cid, 0)); + } + } + + public void addCell(int mcc, int mnc, int lac, int cid) { + cells.add(new Cell(mcc, mnc, lac, cid, 0)); + } + + @Override + public String toString() { + try { + return new ObjectMapper().writeValueAsString(cells); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + + public static CellInfo fromString(String json) { + try { + return new CellInfo(Arrays.asList(new ObjectMapper().readValue(json, Cell[].class))); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/test/org/traccar/location/CellInfoTest.java b/test/org/traccar/location/CellInfoTest.java new file mode 100644 index 000000000..e78ce51fb --- /dev/null +++ b/test/org/traccar/location/CellInfoTest.java @@ -0,0 +1,36 @@ +package org.traccar.location; + +import org.junit.Assert; +import org.junit.Test; + +public class CellInfoTest { + + @Test + public void testToString() { + + CellInfo info = new CellInfo(); + info.addCell(0, 0, 1000, 2000); + info.addCell(400, 1, 3000, 4000); + + Assert.assertEquals("[{\"lac\":1000,\"cid\":2000},{\"mcc\":400,\"mnc\":1,\"lac\":3000,\"cid\":4000}]", info.toString()); + + } + + @Test + public void testFromString() { + + CellInfo info = CellInfo.fromString("[{\"lac\":1000,\"cid\":2000}]"); + + Assert.assertEquals(1, info.getCells().size()); + + CellInfo.Cell cell = info.getCells().get(0); + + Assert.assertEquals(0, cell.getMcc()); + Assert.assertEquals(0, cell.getMnc()); + Assert.assertEquals(1000, cell.getLac()); + Assert.assertEquals(2000, cell.getCid()); + Assert.assertEquals(0, cell.getSignal()); + + } + +} -- cgit v1.2.3 From 118c650bd2fd55e8e61349f9173ce12900dcf4ee Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 3 Oct 2016 08:09:22 +1300 Subject: Start Smokey protocol implementation --- debug.xml | 1 + src/org/traccar/helper/DateBuilder.java | 5 ++ src/org/traccar/model/Position.java | 1 + src/org/traccar/protocol/SmokeyProtocol.java | 41 +++++++++++ .../traccar/protocol/SmokeyProtocolDecoder.java | 83 ++++++++++++++++++++++ .../protocol/SmokeyProtocolDecoderTest.java | 27 +++++++ 6 files changed, 158 insertions(+) create mode 100644 src/org/traccar/protocol/SmokeyProtocol.java create mode 100644 src/org/traccar/protocol/SmokeyProtocolDecoder.java create mode 100644 test/org/traccar/protocol/SmokeyProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/debug.xml b/debug.xml index d01a25248..a529af327 100644 --- a/debug.xml +++ b/debug.xml @@ -482,5 +482,6 @@ 5122 5123 5124 + 5125 diff --git a/src/org/traccar/helper/DateBuilder.java b/src/org/traccar/helper/DateBuilder.java index c52210326..bf4432efc 100644 --- a/src/org/traccar/helper/DateBuilder.java +++ b/src/org/traccar/helper/DateBuilder.java @@ -92,6 +92,11 @@ public class DateBuilder { return this; } + public DateBuilder addSeconds(long seconds) { + calendar.setTimeInMillis(calendar.getTimeInMillis() + seconds * 1000); + return this; + } + public DateBuilder setMillis(int millis) { calendar.set(Calendar.MILLISECOND, millis); return this; diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index c1058aef9..a1423993b 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -35,6 +35,7 @@ public class Position extends Message { public static final String KEY_OUTPUT = "output"; public static final String KEY_POWER = "power"; public static final String KEY_BATTERY = "battery"; + public static final String KEY_CELL_TOWERS = "cellTowers"; public static final String KEY_MCC = "mcc"; public static final String KEY_MNC = "mnc"; public static final String KEY_LAC = "lac"; diff --git a/src/org/traccar/protocol/SmokeyProtocol.java b/src/org/traccar/protocol/SmokeyProtocol.java new file mode 100644 index 000000000..bb7b91fad --- /dev/null +++ b/src/org/traccar/protocol/SmokeyProtocol.java @@ -0,0 +1,41 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ConnectionlessBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +public class SmokeyProtocol extends BaseProtocol { + + public SmokeyProtocol() { + super("smokey"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("objectDecoder", new SmokeyProtocolDecoder(SmokeyProtocol.this)); + } + }); + } + +} diff --git a/src/org/traccar/protocol/SmokeyProtocolDecoder.java b/src/org/traccar/protocol/SmokeyProtocolDecoder.java new file mode 100644 index 000000000..c4b2b4c67 --- /dev/null +++ b/src/org/traccar/protocol/SmokeyProtocolDecoder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.DeviceSession; +import org.traccar.helper.DateBuilder; +import org.traccar.model.Position; + +import java.net.SocketAddress; + +public class SmokeyProtocolDecoder extends BaseProtocolDecoder { + + public SmokeyProtocolDecoder(SmokeyProtocol protocol) { + super(protocol); + } + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + ChannelBuffer buf = (ChannelBuffer) msg; + + buf.skipBytes(2); // header + buf.readUnsignedByte(); // protocol version + + String id = ChannelBuffers.hexDump(buf.readBytes(8)); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id); + if (deviceSession == null) { + return null; + } + + int type = buf.readUnsignedByte(); + + if (type == 0) { + + if (channel != null) { + // TODO send ack + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + position.set(Position.KEY_STATUS, buf.readUnsignedByte()); + + DateBuilder dateBuilder = new DateBuilder() + .setDate(2000, 1, 1).addSeconds(buf.readUnsignedInt()); + + getLastLocation(position, dateBuilder.getDate()); + + position.set(Position.KEY_INDEX, buf.readUnsignedByte()); + + buf.readUnsignedShort(); // task / parameter number + + buf.readUnsignedShort(); // length + + // data + + return position; + + } + + return null; + } + +} diff --git a/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java b/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java new file mode 100644 index 000000000..01950fdb5 --- /dev/null +++ b/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java @@ -0,0 +1,27 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class SmokeyProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + SmokeyProtocolDecoder decoder = new SmokeyProtocolDecoder(new SmokeyProtocol()); + + verifyNothing(decoder, binary( + "534d0300865628025163272f031400000000001c000200000c0168028f000102c9f93a011f538d")); + + verifyNothing(decoder, binary( + "534d0300865628025163272f031400000000001f000200000c0167028f000102c9f93a011f5082")); + + verifyNothing(decoder, binary( + "534d0300865628025163272f031400000000001d000200000c0167028f000102c9f93a011f5282")); + + verifyNothing(decoder, binary( + "534d0300865628025163272f031400000000001e000200000c0167028f000102c9f93a011f5182")); + + } + +} -- cgit v1.2.3 From 8f7ed4ed8ab881c480c22f605d1ff14918a3e43f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 4 Oct 2016 05:35:12 +1300 Subject: Decode GPS103 DTCs (fix #2401) --- src/org/traccar/helper/ObdDecoder.java | 4 ++-- src/org/traccar/model/Position.java | 1 + src/org/traccar/protocol/Gps103ProtocolDecoder.java | 6 ++---- test/org/traccar/protocol/Gps103ProtocolDecoderTest.java | 3 +++ 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/helper/ObdDecoder.java b/src/org/traccar/helper/ObdDecoder.java index 3196c25e4..5a75fa368 100644 --- a/src/org/traccar/helper/ObdDecoder.java +++ b/src/org/traccar/helper/ObdDecoder.java @@ -60,7 +60,7 @@ public final class ObdDecoder { StringBuilder codes = new StringBuilder(); for (int i = 0; i < value.length() / 4; i++) { int numValue = Integer.parseInt(value.substring(i * 4, (i + 1) * 4), 16); - codes.append(','); + codes.append(' '); switch (numValue >> 14) { case 1: codes.append('C'); @@ -78,7 +78,7 @@ public final class ObdDecoder { codes.append(String.format("%04X", numValue & 0x3FFF)); } if (codes.length() > 0) { - return createEntry("dtcs", codes.toString().replaceFirst(",", "")); + return createEntry(Position.KEY_DTCS, codes.toString().trim()); } else { return null; } diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index a1423993b..3a7070083 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -60,6 +60,7 @@ public class Position extends Message { public static final String KEY_ARMED = "armed"; public static final String KEY_ACCURACY = "accuracy"; + public static final String KEY_DTCS = "dtcs"; public static final String KEY_OBD_SPEED = "obdSpeed"; public static final String KEY_OBD_ODOMETER = "obdOdometer"; diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 363834f89..ed50c33f0 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -95,10 +95,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { .number("(d+.?d*%),") // throttle .number("(d+),") // rpm .number("(d+.d+),") // battery - .number("[^,]*,") // dtc 1 - .number("[^,]*,") // dtc 2 - .number("[^,]*,") // dtc 3 - .number("[^,]*") // dtc 4 + .number("([^;]*)") // dtcs .any() .compile(); @@ -197,6 +194,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_THROTTLE, parser.next()); position.set(Position.KEY_RPM, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); + position.set(Position.KEY_DTCS, parser.next().replace(',', ' ').trim()); return position; diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 72b0be1b5..2640051fb 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Gps103ProtocolDecoderTest extends ProtocolTest { Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new Gps103Protocol()); + verifyAttributes(decoder, text( + "imei:359710049057798,OBD,161003192752,1785,,,0,54,96.47%,75,20.00%,1892,0.00,P0134,P0571,,;")); + verifyAttributes(decoder, text( "imei:359710049090138,OBD,160629022949,51442,0.00,15.88,5632,122,40.39%,95,0.00%,2101,13.80,,,,;")); -- cgit v1.2.3 From 44d36f3adea94b98c88b6e491d22f4466678ad6d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 4 Oct 2016 07:15:23 +1300 Subject: Update Smokey unit tests --- src/org/traccar/protocol/SmokeyProtocolDecoder.java | 4 ++-- test/org/traccar/protocol/SmokeyProtocolDecoderTest.java | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/SmokeyProtocolDecoder.java b/src/org/traccar/protocol/SmokeyProtocolDecoder.java index afdd40d1d..a3fa0e5ae 100644 --- a/src/org/traccar/protocol/SmokeyProtocolDecoder.java +++ b/src/org/traccar/protocol/SmokeyProtocolDecoder.java @@ -50,12 +50,12 @@ public class SmokeyProtocolDecoder extends BaseProtocolDecoder { if (type == 0) { - buf.readUnsignedShort(); // firmware version - /*if (channel != null) { // TODO send ack }*/ + buf.readUnsignedShort(); // firmware version + Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); diff --git a/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java b/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java index 01950fdb5..fd862b437 100644 --- a/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SmokeyProtocolDecoderTest.java @@ -10,16 +10,19 @@ public class SmokeyProtocolDecoderTest extends ProtocolTest { SmokeyProtocolDecoder decoder = new SmokeyProtocolDecoder(new SmokeyProtocol()); - verifyNothing(decoder, binary( + verifyAttributes(decoder, binary( + "534D0300865628025161227F030100000000029E03020200A4021405028F0007010658300200028F0007010625F21D028F00070106000027028F00070106584E19028F000701065DCF2707537265696C6C69634E657400E8DE27400DF0A80084C9B2D85A1DB7537265696C6C69634E657400E8DE27401048D44350455F44423745393900A8A668DB7E99A94D794E6574776F726B4E616D6500002675ED6D70AB74686170616E6500002675F4DA3CA94D75666173610088CEFA735AFCA9C524")); + + verifyAttributes(decoder, binary( "534d0300865628025163272f031400000000001c000200000c0168028f000102c9f93a011f538d")); - verifyNothing(decoder, binary( + verifyAttributes(decoder, binary( "534d0300865628025163272f031400000000001f000200000c0167028f000102c9f93a011f5082")); - verifyNothing(decoder, binary( + verifyAttributes(decoder, binary( "534d0300865628025163272f031400000000001d000200000c0167028f000102c9f93a011f5282")); - verifyNothing(decoder, binary( + verifyAttributes(decoder, binary( "534d0300865628025163272f031400000000001e000200000c0167028f000102c9f93a011f5182")); } -- cgit v1.2.3 From 55a3404dd2d82666af8fe4fdfb81212874215879 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 6 Oct 2016 06:40:39 +1300 Subject: Fix problem with Ulbotech decoder --- src/org/traccar/protocol/UlbotechProtocolDecoder.java | 8 ++++---- test/org/traccar/protocol/UlbotechProtocolDecoderTest.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test/org/traccar') 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) { diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java index a73845b87..2c271976e 100644 --- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java @@ -10,8 +10,8 @@ public class UlbotechProtocolDecoderTest extends ProtocolTest { UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new UlbotechProtocol()); - /*verifyPosition(decoder, binary( - "f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8"));*/ + verifyPosition(decoder, binary( + "f8010103515810532780699f7e2e3f010e015ee4c906bde45c00000000008b0304004000000404002c776005060373193622110b00240b00fee8ffff807dffff606d0b00fee9af000000af0000000b00feee7d78807dffffffff100101cc2af8")); verifyPosition(decoder, binary( "F8010103596580420045259CFB3329010E015ED91506BDE5A800000000009E030402420000040400492AA405060344197E220D071131058F410C1591310D48312F8F413107C60804027666B00C138254D182607A826EE083BE554385F50019423CAD1DF8")); -- cgit v1.2.3 From a7b182cbacb730e85c542dac6b50e196add37261 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 6 Oct 2016 07:51:45 +1300 Subject: Support all GL200 GTINF versions (fix #2402) --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 52 +++++++++++++++++----- .../traccar/protocol/Gl200ProtocolDecoderTest.java | 12 +++++ 2 files changed, 52 insertions(+), 12 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index b55f4e606..7cbd76007 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -23,6 +23,7 @@ import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; +import org.traccar.helper.PatternUtil; import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; @@ -50,23 +51,35 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .text("+RESP:GTINF,") .number("[0-9A-Z]{2}xxxx,") // protocol version .number("(d{15}),") // imei - .expression("[0-9A-Z]{17},") // vin - .expression("[^,]{0,20},") // device name + .expression("(?:[0-9A-Z]{17},)?") // vin + .expression("(?:[^,]+)?,") // device name .number("(xx),") // state .expression("[0-9F]{20},") // iccid .number("d{1,2},") .number("d{1,2},") - .expression("[01],") - .number("(d{1,5}),") // power - .text(",") + .expression("[01],") // external power + .number("([d.]+)?,") // odometer or external power + .number("[01]?,") // backup battery .number("(d+.d+),") // battery .expression("([01]),") // charging - .expression("[01],") - .text(",,") + .number("(?:d),") // led + .number("(?:d)?,") // gps on need + .number("(?:d)?,") // gps antenna type + .number("(?:d),").optional() // gps antenna state .number("d{14},") // last fix time - .text(",,,,,") + .groupBegin() + .number("(d+),") // battery percentage + .expression("(?:[01]),") // flash type + .number("(-?[d.]+)?,,,") // temperature + .or() + .expression("(?:[01])?,").optional() // pin15 mode + .number("(d+)?,") // adc1 + .number("(d+)?,").optional() // adc2 + .number("(xx)?,") // digital input + .number("(xx)?,") // digital output .number("[-+]dddd,") // timezone .expression("[01],") // daylight saving + .groupEnd() .number("(dddd)(dd)(dd)") // date .number("(dd)(dd)(dd),") // time .number("(xxxx)") // counter @@ -256,6 +269,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { } private Object decodeInf(Channel channel, SocketAddress remoteAddress, String sentence) { + + PatternUtil.MatchResult r = PatternUtil.checkPattern(PATTERN_INF.pattern(), sentence); + Parser parser = new Parser(PATTERN_INF, sentence); if (!parser.matches()) { return null; @@ -271,9 +287,21 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); position.set(Position.KEY_STATUS, parser.next()); - position.set(Position.KEY_POWER, parser.next()); - position.set(Position.KEY_BATTERY, parser.next()); - position.set(Position.KEY_CHARGE, parser.next()); + + parser.next(); // odometer or external power + + position.set(Position.KEY_BATTERY, parser.nextDouble()); + position.set(Position.KEY_CHARGE, parser.nextInt() == 1); + + parser.next(); // battery percentage + + position.set(Position.PREFIX_TEMP + 1, parser.next()); + + position.set(Position.PREFIX_ADC + 1, parser.next()); + position.set(Position.PREFIX_ADC + 2, parser.next()); + + position.set(Position.KEY_INPUT, parser.next()); + position.set(Position.KEY_OUTPUT, parser.next()); DateBuilder dateBuilder = new DateBuilder() .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) @@ -281,7 +309,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, dateBuilder.getDate()); - position.set(Position.KEY_INDEX, parser.next()); + position.set(Position.KEY_INDEX, parser.nextInt(16)); return position; } diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index b59782ac5..68c4b66a0 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,6 +10,18 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol()); + verifyAttributes(decoder, text( + "+RESP:GTINF,080100,135790246811220,,16,898600810906F8048812,16,0,1,11870,,4.1,0,0,0,,20090214013254,,12340,,00,00,+0800,0,20090214093254,11F0$")); + + verifyAttributes(decoder, text( + "+RESP:GTINF,040100,135790246811220,,16,898600810906F8048812,16,0,1,,0,4.4,0,0,0,0,20090214013254,13000,00,00,+0800,0,20090214093254,11F0$")); + + verifyAttributes(decoder, text( + "+RESP:GTINF,060100,135790246811220,,16,898600810906F8048812,16,0,1,12000,,4.4,0,0,0,0,20090214013254,0,1300,2000,00,00,+0800,0,20090214093254,11F0$")); + + verifyAttributes(decoder, text( + "+RESP:GTINF,1A0800,860599000773978,GL300,41,89701016426133851978,17,0,1,26.6,,3.90,1,1,0,0,0,20161003184043,69,1,44,,,20161004040811,022C$")); + verifyPosition(decoder, text( "+RESP:GTFRI,360100,864251020141408,3VWGW6AJ0FM237324,gv500,,10,1,1,0.0,0,2258.4,-99.256948,19.555800,20160929214743,0334,0020,0084,65AC,00,0.0,,,,100,410000,0,nan,,20160929214743,13BA$")); -- cgit v1.2.3 From a076c67bbdc2ed7d293f6044f4b51493b7e2d3c3 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 6 Oct 2016 11:58:05 +0500 Subject: Handle ACK packets as command result --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 102 ++++++++++++--------- .../traccar/protocol/Gl200ProtocolDecoderTest.java | 9 ++ 2 files changed, 70 insertions(+), 41 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 9b215b32f..e2ddccaa7 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -37,12 +37,14 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { super(protocol); } - private static final Pattern PATTERN_HBD = new PatternBuilder() - .text("+ACK:GTHBD,") + private static final Pattern PATTERN_ACK = new PatternBuilder() + .text("+ACK:GT").expression("...,") .number("([0-9A-Z]{2}xxxx),") // protocol version .number("(d{15}),") // imei .any().text(",") - .number("(xxxx)") + .number("(dddd)(dd)(dd)") // date + .number("(dd)(dd)(dd),") // time + .number("(xxxx)") // counter .text("$").optional() .compile(); @@ -255,13 +257,30 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .text("$").optional() .compile(); - private Object decodeHbd(Channel channel, SocketAddress remoteAddress, String sentence) { - Parser parser = new Parser(PATTERN_HBD, sentence); - if (parser.matches() && channel != null) { + private Object decodeAck(Channel channel, SocketAddress remoteAddress, String sentence, String type) { + Parser parser = new Parser(PATTERN_ACK, sentence); + if (parser.matches()) { String protocolVersion = parser.next(); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); - if (deviceSession != null) { - channel.write("+SACK:GTHBD," + protocolVersion + "," + parser.next() + "$", remoteAddress); + if (deviceSession == null) { + return null; + } + if (type.equals("HBD")) { + if (channel != null) { + parser.skip(6); + channel.write("+SACK:GTHBD," + protocolVersion + "," + parser.next() + "$", remoteAddress); + } + } else { + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + DateBuilder dateBuilder = new DateBuilder() + .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + getLastLocation(position, dateBuilder.getDate()); + position.setValid(false); + position.set(Position.KEY_RESULT, "Command " + type + " accepted"); + return position; } } return null; @@ -620,41 +639,42 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { Object result; String type = sentence.substring(typeIndex + 3, typeIndex + 6); - switch (type) { - case "HBD": - result = decodeHbd(channel, remoteAddress, sentence); - break; - case "INF": - result = decodeInf(channel, remoteAddress, sentence); - break; - case "OBD": - result = decodeObd(channel, remoteAddress, sentence); - break; - case "FRI": - result = decodeFri(channel, remoteAddress, sentence); - break; - case "IGN": - case "IGF": - result = decodeIgn(channel, remoteAddress, sentence); - break; - case "IDA": - result = decodeIda(channel, remoteAddress, sentence); - break; - default: - result = decodeOther(channel, remoteAddress, sentence, type); - break; - } + if (typeIndex >= 4 && sentence.startsWith("+ACK", typeIndex - 4)) { + result = decodeAck(channel, remoteAddress, sentence, type); + } else { + switch (type) { + case "INF": + result = decodeInf(channel, remoteAddress, sentence); + break; + case "OBD": + result = decodeObd(channel, remoteAddress, sentence); + break; + case "FRI": + result = decodeFri(channel, remoteAddress, sentence); + break; + case "IGN": + case "IGF": + result = decodeIgn(channel, remoteAddress, sentence); + break; + case "IDA": + result = decodeIda(channel, remoteAddress, sentence); + break; + default: + result = decodeOther(channel, remoteAddress, sentence, type); + break; + } - if (result == null) { - result = decodeBasic(channel, remoteAddress, sentence); - } + if (result == null) { + result = decodeBasic(channel, remoteAddress, sentence); + } - if (result != null) { - if (result instanceof Position) { - ((Position) result).set(Position.KEY_TYPE, type); - } else { - for (Position p : (List) result) { - p.set(Position.KEY_TYPE, type); + if (result != null) { + if (result instanceof Position) { + ((Position) result).set(Position.KEY_TYPE, type); + } else { + for (Position p : (List) result) { + p.set(Position.KEY_TYPE, type); + } } } } diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 68c4b66a0..914db782e 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -163,6 +163,15 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, text( "+ACK:GTHBD,1A0401,135790246811220,,20100214093254,11F0")); + verifyAttributes(decoder, text( + "+ACK:GTRTO,1A0800,860599000773978,GL300,VER,FFFF,20161006053520,0C19")); + + verifyAttributes(decoder, text( + "+ACK:GTJDC,0A0102,135790246811220,,0016,20090214093254,11F0")); + + verifyAttributes(decoder, text( + "+ACK:GTGEO,1A0102,135790246811220,,0,0008,20100310172830,11F0")); + } } -- cgit v1.2.3 From 4b816255f5e55cddd8ea022b940f33bd204aeb60 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 6 Oct 2016 13:59:31 +0500 Subject: GTINF can come from buffer --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 2 +- test/org/traccar/protocol/Gl200ProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 2d28ea199..7187aa7cc 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -50,7 +50,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .compile(); private static final Pattern PATTERN_INF = new PatternBuilder() - .text("+RESP:GTINF,") + .text("+").expression("(?:RESP|BUFF):GTINF,") .number("[0-9A-Z]{2}xxxx,") // protocol version .number("(d{15}),") // imei .expression("(?:[0-9A-Z]{17},)?") // vin diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 914db782e..c2cdafb49 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -22,6 +22,9 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, text( "+RESP:GTINF,1A0800,860599000773978,GL300,41,89701016426133851978,17,0,1,26.6,,3.90,1,1,0,0,0,20161003184043,69,1,44,,,20161004040811,022C$")); + verifyAttributes(decoder, text( + "+BUFF:GTINF,1A0800,860599000773978,GL300,41,89701016426133851978,23,0,1,204.7,,3.84,1,1,0,0,0,20161006072548,62,1,38,,,20161006082343,0C98$")); + verifyPosition(decoder, text( "+RESP:GTFRI,360100,864251020141408,3VWGW6AJ0FM237324,gv500,,10,1,1,0.0,0,2258.4,-99.256948,19.555800,20160929214743,0334,0020,0084,65AC,00,0.0,,,,100,410000,0,nan,,20160929214743,13BA$")); -- cgit v1.2.3 From bf0bf92ddadee86fc92841fe6087e5a7910bc0a2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 7 Oct 2016 05:35:45 +1300 Subject: Support short Fifotrack format --- .../traccar/protocol/FifotrackProtocolDecoder.java | 26 +++++++++++++--------- .../protocol/FifotrackProtocolDecoderTest.java | 6 +++++ 2 files changed, 22 insertions(+), 10 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java index 9e8d01117..9c0f6be5a 100644 --- a/src/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -51,15 +51,15 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { .number("(d+),") // odometer .number("d+,") // runtime .number("(xxxx),") // status - .number("(x+),") // input - .number("(x+),") // output + .number("(x+)?,") // input + .number("(x+)?,") // output .number("(d+)|") // mcc .number("(d+)|") // mnc .number("(x+)|") // lac .number("(x+),") // cid - .number("([x|]+),") // adc - .expression("([^,]+),") // rfid - .expression("([^*]+)") // sensors + .number("([x|]+)") // adc + .expression(",([^,]+)") // rfid + .expression(",([^*]+)").optional(2) // sensors .any() .compile(); @@ -97,8 +97,12 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextLong()); position.set(Position.KEY_STATUS, parser.nextInt(16)); - position.set(Position.KEY_INPUT, parser.nextInt(16)); - position.set(Position.KEY_OUTPUT, parser.nextInt(16)); + if (parser.hasNext()) { + position.set(Position.KEY_INPUT, parser.nextInt(16)); + } + if (parser.hasNext()) { + position.set(Position.KEY_OUTPUT, parser.nextInt(16)); + } position.set(Position.KEY_MCC, parser.nextInt()); position.set(Position.KEY_MNC, parser.nextInt()); @@ -112,9 +116,11 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_RFID, parser.next()); - String[] sensors = parser.next().split("\\|"); - for (int i = 0; i < sensors.length; i++) { - position.set(Position.PREFIX_IO + (i + 1), sensors[i]); + if (parser.hasNext()) { + String[] sensors = parser.next().split("\\|"); + for (int i = 0; i < sensors.length; i++) { + position.set(Position.PREFIX_IO + (i + 1), sensors[i]); + } } return position; diff --git a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java index 60f22a91a..fa45516a2 100644 --- a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java @@ -10,6 +10,12 @@ public class FifotrackProtocolDecoderTest extends ProtocolTest { FifotrackProtocolDecoder decoder = new FifotrackProtocolDecoder(new FifotrackProtocol()); + verifyPosition(decoder, text( + "$$103,866104023179743,5,A00,,161006192841,A,54.738791,25.271918,0,342,200,0,4265,0000,0,,246|1|65|96DB,9C4|0*75")); + + verifyPosition(decoder, text( + "$$103,866104023179743,4,A00,,161006192810,V,54.738791,25.271918,0,158,122,0,4235,0000,0,,246|1|65|96DB,9C5|0*69")); + verifyPosition(decoder, text( "$$135,866104023192332,29,A01,,160606093046,A,22.546430,114.079730,0,186,181,0,415322,0000,02,2,460|0|27B3|EA7,A2F|3B9|3|0,940C7E,31.76|30.98*46")); -- cgit v1.2.3 From 7ee3482b31288d29d7a46fbdf4ffba6732159a89 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 7 Oct 2016 11:36:12 +0500 Subject: - Handle GTVER packets - Added few alarms --- src/org/traccar/model/Position.java | 2 + src/org/traccar/protocol/Gl200ProtocolDecoder.java | 64 +++++++++++++++++++++- .../traccar/protocol/Gl200ProtocolDecoderTest.java | 15 +++++ 3 files changed, 79 insertions(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index 3a7070083..abe8dd813 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -93,6 +93,8 @@ public class Position extends Message { public static final String ALARM_BREAKING = "hardBreaking"; public static final String ALARM_FATIGUE_DRIVING = "fatigueDriving"; public static final String ALARM_POWER_CUT = "powerCut"; + public static final String ALARM_JAMMING = "jamming"; + public static final String ALARM_TEMPERATURE = "temperature"; private String protocol; diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 7187aa7cc..973907235 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -88,6 +88,20 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .text("$").optional() .compile(); + private static final Pattern PATTERN_VER = new PatternBuilder() + .text("+").expression("(?:RESP|BUFF):GTVER,") + .number("[0-9A-Z]{2}xxxx,") // protocol version + .number("(d{15}),") // imei + .expression("[^,]*,") // device name + .expression("([^,]*),") // device type + .number("(xxxx),") // firmware version + .number("(xxxx),") // hardware version + .number("(dddd)(dd)(dd)") // date + .number("(dd)(dd)(dd),") // time + .number("(xxxx)") // counter + .text("$").optional() + .compile(); + private static final Pattern PATTERN_LOCATION = new PatternBuilder() .number("(?:d{1,2})?,") // gps accuracy .number("(d{1,3}.d)?,") // speed @@ -331,6 +345,34 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { return position; } + private Object decodeVer(Channel channel, SocketAddress remoteAddress, String sentence) { + Parser parser = new Parser(PATTERN_VER, sentence); + if (!parser.matches()) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + position.setDeviceId(deviceSession.getDeviceId()); + + position.set("deviceType", parser.next()); + position.set("firmwareVersion", parser.nextInt(16)); + position.set("hardwareVersion", parser.nextInt(16)); + + DateBuilder dateBuilder = new DateBuilder() + .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + + getLastLocation(position, dateBuilder.getDate()); + + return position; + } + private void decodeLocation(Position position, Parser parser) { position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextDouble()); @@ -587,7 +629,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { return position; } - private Object decodeBasic(Channel channel, SocketAddress remoteAddress, String sentence) { + private Object decodeBasic(Channel channel, SocketAddress remoteAddress, String sentence, String type) { Parser parser = new Parser(PATTERN_BASIC, sentence); if (!parser.matches()) { return null; @@ -624,6 +666,21 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { } } + switch (type) { + case "BPL": + position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY); + break; + case "TEM": + position.set(Position.KEY_ALARM, Position.ALARM_TEMPERATURE); + break; + case "JDR": + case "JDS": + position.set(Position.KEY_ALARM, Position.ALARM_JAMMING); + break; + default: + break; + } + return position; } @@ -660,13 +717,16 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { case "IDA": result = decodeIda(channel, remoteAddress, sentence); break; + case "VER": + result = decodeVer(channel, remoteAddress, sentence); + break; default: result = decodeOther(channel, remoteAddress, sentence, type); break; } if (result == null) { - result = decodeBasic(channel, remoteAddress, sentence); + result = decodeBasic(channel, remoteAddress, sentence, type); } if (result != null) { diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index c2cdafb49..83f8b02f1 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -162,6 +162,21 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, text( "+RESP:GTRTL,280100,A1000043D20139,,0,0,1,1,0.1,321,239.1,-76.661047,39.832501,20150615114455,0310,0484,00600019,0A52,,87,20150615074456,031E$")); + + verifyAttributes(decoder, text( + "+BUFF:GTBPL,1A0800,860599000773978,GL300,3.55,0,0.0,0,257.1,60.565437,56.818277,20161006070553,,,,,204.7,20161006071028,0C75$")); + + verifyAttributes(decoder, text( + "+RESP:GTTEM,1A0102,860599000000448,,3,33,0,5.8,0,33.4,117.201191,31.832502,20130109061410,0460,0000,5678,2079,,20130109061517,0091$")); + + verifyAttributes(decoder, text( + "+RESP:GTJDR,0A0102,135790246811220,,0,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,20090214093254,11F0$")); + + verifyAttributes(decoder, text( + "+RESP:GTJDS,0A0102,135790246811220,,2,0,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,20090214093254,11F0$")); + + verifyAttributes(decoder, text( + "+RESP:GTVER,1A0800,860599000773978,GL300,GL300,0A03,0103,20161007041531,10F8$")); verifyNothing(decoder, text( "+ACK:GTHBD,1A0401,135790246811220,,20100214093254,11F0")); -- cgit v1.2.3 From 5451efd2f5d343cb6c7e6964055305103b4fbdd2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Oct 2016 00:58:24 +1300 Subject: Another small Fifotrack decoder fix --- src/org/traccar/protocol/FifotrackProtocolDecoder.java | 2 +- test/org/traccar/protocol/FifotrackProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java index 9c0f6be5a..a4b7932e6 100644 --- a/src/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -37,7 +37,7 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { .text("$$") .number("d+,") // length .number("(d+),") // imei - .number("d+,") // index + .number("x+,") // index .expression("[^,]+,") // type .number("(d+)?,") // alarm .number("(dd)(dd)(dd)") // date diff --git a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java index fa45516a2..7cde4b5c9 100644 --- a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class FifotrackProtocolDecoderTest extends ProtocolTest { FifotrackProtocolDecoder decoder = new FifotrackProtocolDecoder(new FifotrackProtocol()); + verifyPosition(decoder, text( + "$$105,866104023179743,AB,A00,,161007085534,A,54.738791,25.271918,0,350,151,0,17929,0000,0,,246|1|65|96DB,936|0*0B")); + verifyPosition(decoder, text( "$$103,866104023179743,5,A00,,161006192841,A,54.738791,25.271918,0,342,200,0,4265,0000,0,,246|1|65|96DB,9C4|0*75")); -- cgit v1.2.3 From f30f25164a3b9be08bad55f80481332b73d6e9e1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Oct 2016 12:49:17 +1300 Subject: Decode additional cGuard data (fix #2419) --- .../traccar/protocol/CguardProtocolDecoder.java | 93 ++++++++++++++++++---- .../protocol/CguardProtocolDecoderTest.java | 21 +++-- 2 files changed, 92 insertions(+), 22 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/CguardProtocolDecoder.java b/src/org/traccar/protocol/CguardProtocolDecoder.java index 1646363e5..6c528c559 100644 --- a/src/org/traccar/protocol/CguardProtocolDecoder.java +++ b/src/org/traccar/protocol/CguardProtocolDecoder.java @@ -33,7 +33,7 @@ public class CguardProtocolDecoder extends BaseProtocolDecoder { super(protocol); } - private static final Pattern PATTERN = new PatternBuilder() + private static final Pattern PATTERN_NV = new PatternBuilder() .text("NV:") .number("(dd)(dd)(dd) ") // date .number("(dd)(dd)(dd):") // time @@ -45,23 +45,16 @@ public class CguardProtocolDecoder extends BaseProtocolDecoder { .number("(?:NAN|(d+.?d*))") // altitude .compile(); - @Override - protected Object decode( - Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - - String sentence = (String) msg; - - if (sentence.startsWith("ID:") || sentence.startsWith("IDRO:")) { - getDeviceSession(channel, remoteAddress, sentence.substring(sentence.indexOf(':') + 1)); - return null; - } + private static final Pattern PATTERN_BC = new PatternBuilder() + .text("BC:") + .number("(dd)(dd)(dd) ") // date + .number("(dd)(dd)(dd):") // time + .expression("(.+)") // data + .compile(); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); - if (deviceSession == null) { - return null; - } + private Position decodePosition(DeviceSession deviceSession, String sentence) { - Parser parser = new Parser(PATTERN, (String) msg); + Parser parser = new Parser(PATTERN_NV, sentence); if (!parser.matches()) { return null; } @@ -88,4 +81,72 @@ public class CguardProtocolDecoder extends BaseProtocolDecoder { return position; } + private Position decodeStatus(DeviceSession deviceSession, String sentence) { + + Parser parser = new Parser(PATTERN_BC, sentence); + if (!parser.matches()) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + DateBuilder dateBuilder = new DateBuilder() + .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + + getLastLocation(position, dateBuilder.getDate()); + + String[] data = parser.next().split(":"); + for (int i = 0; i < data.length / 2; i++) { + String key = data[i * 2]; + String value = data[i * 2 + 1]; + switch (key) { + case "CSQ1": + position.set(Position.KEY_GSM, Integer.parseInt(value)); + break; + case "NSQ1": + position.set(Position.KEY_SATELLITES, Integer.parseInt(value)); + break; + case "BAT1": + position.set(Position.KEY_BATTERY, Integer.parseInt(value) + "%"); + break; + case "PWR1": + position.set(Position.KEY_POWER, Double.parseDouble(value)); + break; + default: + position.set(key.toLowerCase(), value); + break; + } + } + + return position; + } + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + String sentence = (String) msg; + + if (sentence.startsWith("ID:") || sentence.startsWith("IDRO:")) { + getDeviceSession(channel, remoteAddress, sentence.substring(sentence.indexOf(':') + 1)); + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); + if (deviceSession == null) { + return null; + } + + if (sentence.startsWith("NV:")) { + return decodePosition(deviceSession, sentence); + } else if (sentence.startsWith("BC:")) { + return decodeStatus(deviceSession, sentence); + } + + return null; + } + } diff --git a/test/org/traccar/protocol/CguardProtocolDecoderTest.java b/test/org/traccar/protocol/CguardProtocolDecoderTest.java index 49d037f8f..ff9ecb9be 100644 --- a/test/org/traccar/protocol/CguardProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CguardProtocolDecoderTest.java @@ -13,16 +13,25 @@ public class CguardProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, text( "IDRO:354868050655283")); + verifyPosition(decoder, text( + "NV:161007 122043:55.812730:37.733689:3.62:NAN:244.05:143.4")); + + verifyPosition(decoder, text( + "NV:161007 122044:55.812732:37.733670:3.97:NAN:260.95:143.9")); + + verifyAttributes(decoder, text( + "BC:161007 122044:CSQ1:77:NSQ1:18:BAT1:100")); + verifyPosition(decoder, text( "NV:160711 044023:54.342907:48.582590:0:NAN:0:110.1")); verifyPosition(decoder, text( "NV:160711 044023:54.342907:-148.582590:0:NAN:0:110.1")); - verifyNothing(decoder, text( + verifyAttributes(decoder, text( "BC:160711 044023:CSQ1:48:NSQ1:7:NSQ2:1:BAT1:98:PWR1:11.7:CLG1:NAN")); - verifyNothing(decoder, text( + verifyAttributes(decoder, text( "BC:160711 044524:CSQ1:61:NSQ1:18:BAT1:98:PWR1:11.7:CLG1:NAN")); verifyNothing(decoder, text( @@ -31,19 +40,19 @@ public class CguardProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, text( "NV:160420 101902:55.799425:37.674033:0.94:NAN:213.59:156.6")); - verifyNothing(decoder, text( + verifyAttributes(decoder, text( "BC:160628 081024:CSQ1:32:NSQ1:10:BAT1:100")); - verifyNothing(decoder, text( + verifyAttributes(decoder, text( "BC:160628 081033:NSQ2:0")); verifyPosition(decoder, text( "NV:160630 151537:55.799913:37.674267:0.7:NAN:10.21:174.9")); - verifyNothing(decoder, text( + verifyAttributes(decoder, text( "BC:160630 153316:BAT1:76")); - verifyNothing(decoder, text( + verifyAttributes(decoder, text( "BC:160630 153543:NSQ2:0")); verifyNothing(decoder, text( -- cgit v1.2.3 From 54107d04c96ef5541d9910134bce946bbc7d777a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Oct 2016 15:20:49 +1300 Subject: Add some HuaSheng test cases --- test/org/traccar/protocol/HuaShengProtocolDecoderTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java b/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java index 7cb6b65a0..d1165b226 100644 --- a/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java @@ -13,6 +13,15 @@ public class HuaShengProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, binary( "c000000077aa0200000000000e000100143347315f48312e315f56312e30372e54000300133335353835353035303434303635380004000b3531323030303000050005010006000400070004000800050000090018383936313032353431343533333239313833360d000a000f796573696e7465726e6574c0")); + verifyPosition(decoder, binary( + "c00000004baa000000000000098000000031363130303732323236343700e6d4efffcc789f000000000026000000010015000000000000000000000488ffffffffff0005000a10060000008dc0")); + + /*verifyPosition(decoder, binary( + "c00000004baa0000000000000aa5a5a55a3f008000000031363130303732333139343600e61e4fffcc33fe0000000000470000000100150000000000000000000004b4ffffffffff0005000ac0"));*/ + + verifyPosition(decoder, binary( + "c00000004baa000000000000098000000031363130303732323236343700e6d4efffcc789f000000000026000000010015000000000000000000000488ffffffffff0005000a10060000008dc0")); + verifyPosition(decoder, binary( "c00000004baa00000000000005c400000131363037303630323537303800e6c82effcc7cb0003900a30089000000010015000000000000000000f20559ff577ce3980005000a060500000087c0")); -- cgit v1.2.3 From bc39a5aaa85813cb003405dd67387454011da450 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Oct 2016 19:01:31 +1300 Subject: Support Laipac new message type --- src/org/traccar/protocol/LaipacProtocolDecoder.java | 10 +++++----- test/org/traccar/protocol/LaipacProtocolDecoderTest.java | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index ebca443a1..25678af88 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { .text("$AVRMC,") .expression("([^,]+),") // identifier .number("(dd)(dd)(dd),") // time - .expression("([AVRavr]),") // validity + .expression("([AVRPavrp]),") // validity .number("(dd)(dd.d+),") // latitude .expression("([NS]),") .number("(ddd)(dd.d+),") // longitude @@ -66,13 +66,13 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } + + Position position = new Position(); + position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() diff --git a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java index 23477b186..d1fafe71a 100644 --- a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java +++ b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java @@ -83,11 +83,14 @@ public class LaipacProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, text( "$AVRMC,MSG00002,125517,R,5053.0442,N,00557.8694,E,0.00,0.00,240614,H,4076,167,1,0,0,0D7AB913,020408*75")); - /*verifyPosition(decoder, text( + verifyPosition(decoder, text( "$AVRMC,MSG00002,043104,p,5114.4664,N,00534.3308,E,0.00,0.00,280614,0,4115,495,1,0,0,0D48C3DC,020408*52")); verifyPosition(decoder, text( - "$AVRMC,MSG00002,050601,P,5114.4751,N,00534.3175,E,0.00,0.00,280614,0,4115,495,1,0,0,0D48C3DC,020408*7D"));*/ + "$AVRMC,MSG00002,050601,P,5114.4751,N,00534.3175,E,0.00,0.00,280614,0,4115,495,1,0,0,0D48C3DC,020408*7D")); + + verifyPosition(decoder, text( + "$AVRMC,96414215,170046,p,4310.7965,N,07652.0816,E,0.00,0.00,071016,0,4069,98,1,0,0*04")); } -- cgit v1.2.3 From d3094ea6e035c2bae2825cf9e031e093ee403264 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 10 Oct 2016 09:00:59 +0500 Subject: Add SOS handle --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 2 ++ test/org/traccar/protocol/Gl200ProtocolDecoderTest.java | 3 +++ 2 files changed, 5 insertions(+) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 973907235..a0efc47fa 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -603,6 +603,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { int reportType = parser.nextInt(); if (type.equals("NMR")) { position.set(Position.KEY_MOTION, reportType); + } else if (type.equals("SOS")) { + position.set(Position.KEY_ALARM, Position.ALARM_SOS); } decodeLocation(position, parser); diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 83f8b02f1..d3c82fb3a 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -175,6 +175,9 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, text( "+RESP:GTJDS,0A0102,135790246811220,,2,0,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,20090214093254,11F0$")); + verifyAttributes(decoder, text( + "+RESP:GTSOS,020102,135790246811220,,0,0,1,1,4.3,92,70.0,121.354335,31.222073,20090214013254,0460,0000,18d8,6141,00,,20090214093254,11F0$")); + verifyAttributes(decoder, text( "+RESP:GTVER,1A0800,860599000773978,GL300,GL300,0A03,0103,20161007041531,10F8$")); -- cgit v1.2.3 From 018a50801033b4c636faae52bcb955fb8d3a0105 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 11 Oct 2016 05:24:36 +1300 Subject: Implement ExtremTrac protocol --- debug.xml | 1 + src/org/traccar/protocol/ExtremTracProtocol.java | 47 ++++++++++++ .../protocol/ExtremTracProtocolDecoder.java | 83 ++++++++++++++++++++++ .../protocol/ExtremTracProtocolDecoderTest.java | 30 ++++++++ 4 files changed, 161 insertions(+) create mode 100644 src/org/traccar/protocol/ExtremTracProtocol.java create mode 100644 src/org/traccar/protocol/ExtremTracProtocolDecoder.java create mode 100644 test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/debug.xml b/debug.xml index 7a72ff4b4..0b07ed140 100644 --- a/debug.xml +++ b/debug.xml @@ -484,5 +484,6 @@ 5123 5124 5125 + 5126 diff --git a/src/org/traccar/protocol/ExtremTracProtocol.java b/src/org/traccar/protocol/ExtremTracProtocol.java new file mode 100644 index 000000000..ce9f2b914 --- /dev/null +++ b/src/org/traccar/protocol/ExtremTracProtocol.java @@ -0,0 +1,47 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +public class ExtremTracProtocol extends BaseProtocol { + + public ExtremTracProtocol() { + super("extremtrac"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new ExtremTracProtocolDecoder(ExtremTracProtocol.this)); + } + }); + } + +} diff --git a/src/org/traccar/protocol/ExtremTracProtocolDecoder.java b/src/org/traccar/protocol/ExtremTracProtocolDecoder.java new file mode 100644 index 000000000..3d42a5a28 --- /dev/null +++ b/src/org/traccar/protocol/ExtremTracProtocolDecoder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.DeviceSession; +import org.traccar.helper.DateBuilder; +import org.traccar.helper.Parser; +import org.traccar.helper.PatternBuilder; +import org.traccar.model.Position; + +import java.net.SocketAddress; +import java.util.regex.Pattern; + +public class ExtremTracProtocolDecoder extends BaseProtocolDecoder { + + public ExtremTracProtocolDecoder(ExtremTracProtocol protocol) { + super(protocol); + } + + private static final Pattern PATTERN = new PatternBuilder() + .text("$GPRMC,") + .number("(d+),") // device id + .number("(dd)(dd)(dd).d+,") // time + .expression("([AV]),") // validity + .number("(d+)(dd.d+),") // latitude + .expression("([NS]),") + .number("(d+)(dd.d+),") // longitude + .expression("([EW]),") + .number("(d+.d+),") // speed + .number("(d+.d+),") // course + .number("(dd)(dd)(dd),") // date + .any() + .compile(); + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + Parser parser = new Parser(PATTERN, (String) msg); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + DateBuilder dateBuilder = new DateBuilder() + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + + position.setValid(parser.next().equals("A")); + position.setLatitude(parser.nextCoordinate()); + position.setLongitude(parser.nextCoordinate()); + position.setSpeed(parser.nextDouble()); + position.setCourse(parser.nextDouble()); + + dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + return position; + } + +} diff --git a/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java b/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java new file mode 100644 index 000000000..82e461fc7 --- /dev/null +++ b/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java @@ -0,0 +1,30 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class ExtremTracProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + ExtremTracProtocolDecoder decoder = new ExtremTracProtocolDecoder(new ExtremTracProtocol()); + + verifyPosition(decoder, text( + "$GPRMC,10000000001,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,")); + + verifyPosition(decoder, text( + "$GPRMC,00000000000,092244.000,A,0000.0000,S,00000.0000,E,0.00,0.00,101016,0,,8000,0")); + + verifyNothing(decoder, text( + "$GPRMC,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,1111,1111")); + + verifyNothing(decoder, text( + "$GPRMC,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,")); + + verifyNothing(decoder, text( + "$GPRMC,100936.000,A,0000.0000,S,00000.0000,E,0.00,0.00,101016,0,,8000,0")); + + } + +} -- cgit v1.2.3 From b13aad0f2764d7112363ce188abc03ea9cd37ddd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 12 Oct 2016 03:33:20 +1300 Subject: Improvements to mail module --- src/org/traccar/notification/NotificationMail.java | 141 +++++++++------------ .../traccar/notification/PropertiesProvider.java | 51 ++++++++ .../notification/NotificiationMailTest.java | 60 +++++++++ 3 files changed, 170 insertions(+), 82 deletions(-) create mode 100644 src/org/traccar/notification/PropertiesProvider.java create mode 100644 test/org/traccar/notification/NotificiationMailTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java index b3531a97b..1298a484d 100644 --- a/src/org/traccar/notification/NotificationMail.java +++ b/src/org/traccar/notification/NotificationMail.java @@ -24,11 +24,9 @@ import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; -import org.traccar.Config; import org.traccar.Context; import org.traccar.helper.Log; import org.traccar.model.Event; -import org.traccar.model.Extensible; import org.traccar.model.Position; import org.traccar.model.User; @@ -37,106 +35,86 @@ public final class NotificationMail { private NotificationMail() { } - private static Properties getConfigProperies() { - Config config = Context.getConfig(); - Properties result = new Properties(); - String host = config.getString("mail.smtp.host", null); + private static Properties getProperties(PropertiesProvider provider) { + Properties properties = new Properties(); + String host = provider.getString("mail.smtp.host"); if (host != null) { - result.put("mail.smtp.host", host); - result.put("mail.smtp.port", config.getString("mail.smtp.port", "25")); + properties.put("mail.transport.protocol", provider.getString("mail.transport.protocol", "smtp")); + properties.put("mail.smtp.host", host); + properties.put("mail.smtp.port", provider.getString("mail.smtp.port", "25")); - if (config.getBoolean("mail.smtp.starttls.enable")) { - result.put("mail.smtp.starttls.enable", config.getBoolean("mail.smtp.starttls.enable")); - } else if (config.getBoolean("mail.smtp.ssl.enable")) { - result.put("mail.smtp.ssl.enable", config.getBoolean("mail.smtp.ssl.enable")); + String starttlsEnable = provider.getString("mail.smtp.starttls.enable"); + if (starttlsEnable != null) { + properties.put("mail.smtp.starttls.enable", Boolean.parseBoolean(starttlsEnable)); } - result.put("mail.smtp.ssl.trust", config.getBoolean("mail.smtp.ssl.trust")); - - result.put("mail.smtp.auth", config.getBoolean("mail.smtp.auth")); - - String username = config.getString("mail.smtp.username"); - if (username != null) { - result.put("mail.smtp.username", username); + String starttlsRequired = provider.getString("mail.smtp.starttls.required"); + if (starttlsRequired != null) { + properties.put("mail.smtp.starttls.required", Boolean.parseBoolean(starttlsRequired)); } - String password = config.getString("mail.smtp.password"); - if (password != null) { - result.put("mail.smtp.password", password); - } - String from = config.getString("mail.smtp.from"); - if (from != null) { - result.put("mail.smtp.from", from); - } - } - return result; - } - private static Properties getAttributesProperties(Extensible object) { - Properties result = new Properties(); - - if (object.getAttributes().containsKey("mail.smtp.host")) { - result.put("mail.smtp.host", object.getAttributes().get("mail.smtp.host")); - String port = (String) object.getAttributes().get("mail.smtp.port"); - result.put("mail.smtp.port", (port != null) ? port : "25"); - if (object.getAttributes().containsKey("mail.smtp.starttls.enable")) { - boolean tls = Boolean.parseBoolean((String) object.getAttributes().get("mail.smtp.starttls.enable")); - result.put("mail.smtp.starttls.enable", tls); - } else if (object.getAttributes().containsKey("mail.smtp.ssl.enable")) { - boolean ssl = Boolean.parseBoolean((String) object.getAttributes().get("mail.smtp.ssl.enable")); - result.put("mail.smtp.ssl.enable", ssl); + String sslEnable = provider.getString("mail.smtp.ssl.enable"); + if (sslEnable != null) { + properties.put("mail.smtp.ssl.enable", Boolean.parseBoolean(sslEnable)); } - if (object.getAttributes().containsKey("mail.smtp.ssl.trust")) { - result.put("mail.smtp.ssl.trust", object.getAttributes().get("mail.smtp.ssl.trust")); + String sslTrust = provider.getString("mail.smtp.ssl.trust"); + if (sslTrust != null) { + properties.put("mail.smtp.ssl.trust", sslTrust); } - boolean auth = Boolean.parseBoolean((String) object.getAttributes().get("mail.smtp.auth")); - result.put("mail.smtp.auth", auth); - if (object.getAttributes().containsKey("mail.smtp.username")) { - result.put("mail.smtp.username", object.getAttributes().get("mail.smtp.username")); + properties.put("mail.smtp.auth", provider.getString("mail.smtp.auth")); + + String username = provider.getString("mail.smtp.username"); + if (username != null) { + properties.put("mail.smtp.username", username); } - if (object.getAttributes().containsKey("mail.smtp.password")) { - result.put("mail.smtp.password", object.getAttributes().get("mail.smtp.password")); + String password = provider.getString("mail.smtp.password"); + if (password != null) { + properties.put("mail.smtp.password", password); } - if (object.getAttributes().containsKey("mail.smtp.from")) { - result.put("mail.smtp.from", object.getAttributes().get("mail.smtp.from")); + String from = provider.getString("mail.smtp.from"); + if (from != null) { + properties.put("mail.smtp.from", from); } } - return result; + return properties; } - public static void sendMailSync(long userId, Event event, Position position) { - - Properties mailServerProperties; - Session mailSession; - MimeMessage mailMessage; - + private static void sendMailSync(long userId, Event event, Position position) { try { User user = Context.getPermissionsManager().getUser(userId); - mailServerProperties = getConfigProperies(); - if (!mailServerProperties.containsKey("mail.smtp.host")) { - mailServerProperties = getAttributesProperties(user); - if (!mailServerProperties.containsKey("mail.smtp.host")) { + Properties properties = getProperties(new PropertiesProvider(Context.getConfig())); + if (!properties.containsKey("mail.smtp.host")) { + properties = getProperties(new PropertiesProvider(user)); + if (!properties.containsKey("mail.smtp.host")) { + Log.warning("No SMTP configuration found"); return; } } - mailSession = Session.getDefaultInstance(mailServerProperties); - mailMessage = new MimeMessage(mailSession); + Session session = Session.getInstance(properties); - if (mailServerProperties.getProperty("mail.smtp.from") != null) { - mailMessage.setFrom(new InternetAddress(mailServerProperties.getProperty("mail.smtp.from"))); - } + MimeMessage message = new MimeMessage(session); - mailMessage.addRecipient(Message.RecipientType.TO, new InternetAddress(user.getEmail())); - mailMessage.setSubject(NotificationFormatter.formatTitle(userId, event, position)); - mailMessage.setText(NotificationFormatter.formatMessage(userId, event, position)); + String from = properties.getProperty("mail.smtp.from"); + if (from != null) { + message.setFrom(new InternetAddress(from)); + } - Transport transport = mailSession.getTransport("smtp"); - transport.connect(mailServerProperties.getProperty("mail.smtp.host"), - mailServerProperties.getProperty("mail.smtp.username"), - mailServerProperties.getProperty("mail.smtp.password")); - transport.sendMessage(mailMessage, mailMessage.getAllRecipients()); - transport.close(); + message.addRecipient(Message.RecipientType.TO, new InternetAddress(user.getEmail())); + message.setSubject(NotificationFormatter.formatTitle(userId, event, position)); + message.setText(NotificationFormatter.formatMessage(userId, event, position)); + + Transport transport = session.getTransport(); + try { + transport.connect( + properties.getProperty("mail.smtp.host"), + properties.getProperty("mail.smtp.username"), + properties.getProperty("mail.smtp.password")); + transport.sendMessage(message, message.getAllRecipients()); + } finally { + transport.close(); + } } catch (MessagingException error) { Log.warning(error); @@ -144,12 +122,11 @@ public final class NotificationMail { } public static void sendMailAsync(final long userId, final Event event, final Position position) { - Runnable runnableSend = new Runnable() { + new Thread(new Runnable() { public void run() { sendMailSync(userId, event, position); } - }; - - new Thread(runnableSend).start(); + }).start(); } + } diff --git a/src/org/traccar/notification/PropertiesProvider.java b/src/org/traccar/notification/PropertiesProvider.java new file mode 100644 index 000000000..9a7338591 --- /dev/null +++ b/src/org/traccar/notification/PropertiesProvider.java @@ -0,0 +1,51 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.notification; + +import org.traccar.Config; +import org.traccar.model.Extensible; + +public class PropertiesProvider { + + private Config config; + + private Extensible extensible; + + public PropertiesProvider(Config config) { + this.config = config; + } + + public PropertiesProvider(Extensible extensible) { + this.extensible = extensible; + } + + public String getString(String key) { + if (config != null) { + return config.getString(key); + } else { + return (String) extensible.getAttributes().get(key); + } + } + + public String getString(String key, String defaultValue) { + String value = getString(key); + if (value == null) { + value = defaultValue; + } + return value; + } + +} diff --git a/test/org/traccar/notification/NotificiationMailTest.java b/test/org/traccar/notification/NotificiationMailTest.java new file mode 100644 index 000000000..9405ff94f --- /dev/null +++ b/test/org/traccar/notification/NotificiationMailTest.java @@ -0,0 +1,60 @@ +package org.traccar.notification; + +import org.junit.Assert; +import org.junit.Test; +import org.traccar.location.CellInfo; + +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; +import java.util.Properties; + +public class NotificiationMailTest { + + private static final String FROM = "notification@traccar.org"; + private static final String TO = "anton.tananaev@gmail.com"; + + private static final String BODY = "Test email body."; + private static final String SUBJECT = "Test"; + + private static final String SMTP_USERNAME = "username"; + private static final String SMTP_PASSWORD = "password"; + + private static final String HOST = "email-smtp.us-west-2.amazonaws.com"; + + private static final int PORT = 25; + + @Test + public void test() throws Exception { + + Properties props = System.getProperties(); + props.put("mail.transport.protocol", "smtps"); + props.put("mail.smtp.port", PORT); + + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.starttls.enable", "true"); + props.put("mail.smtp.starttls.required", "true"); + + Session session = Session.getInstance(props); + + MimeMessage msg = new MimeMessage(session); + msg.setFrom(new InternetAddress(FROM)); + msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); + msg.setSubject(SUBJECT); + msg.setContent(BODY,"text/plain"); + + Transport transport = session.getTransport(); + + try + { + transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); + transport.sendMessage(msg, msg.getAllRecipients()); + } finally { + transport.close(); + } + + } + +} -- cgit v1.2.3 From 18d39ff2412b9aced899915d0187f21eb25f49b6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 12 Oct 2016 03:35:09 +1300 Subject: Minor formatting fix --- test/org/traccar/notification/NotificiationMailTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/test/org/traccar/notification/NotificiationMailTest.java b/test/org/traccar/notification/NotificiationMailTest.java index 9405ff94f..41c895ef8 100644 --- a/test/org/traccar/notification/NotificiationMailTest.java +++ b/test/org/traccar/notification/NotificiationMailTest.java @@ -47,8 +47,7 @@ public class NotificiationMailTest { Transport transport = session.getTransport(); - try - { + try { transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); transport.sendMessage(msg, msg.getAllRecipients()); } finally { -- cgit v1.2.3 From 46d286fbe1d023c8cfee78f876e8f9612249927b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 12 Oct 2016 03:39:28 +1300 Subject: Disable mail notification test --- test/org/traccar/notification/NotificiationMailTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test/org/traccar') diff --git a/test/org/traccar/notification/NotificiationMailTest.java b/test/org/traccar/notification/NotificiationMailTest.java index 41c895ef8..adb7b5c15 100644 --- a/test/org/traccar/notification/NotificiationMailTest.java +++ b/test/org/traccar/notification/NotificiationMailTest.java @@ -1,8 +1,6 @@ package org.traccar.notification; -import org.junit.Assert; import org.junit.Test; -import org.traccar.location.CellInfo; import javax.mail.Message; import javax.mail.Session; @@ -26,7 +24,7 @@ public class NotificiationMailTest { private static final int PORT = 25; - @Test + //@Test public void test() throws Exception { Properties props = System.getProperties(); @@ -43,7 +41,7 @@ public class NotificiationMailTest { msg.setFrom(new InternetAddress(FROM)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); - msg.setContent(BODY,"text/plain"); + msg.setContent(BODY, "text/plain"); Transport transport = session.getTransport(); -- cgit v1.2.3 From 6b16be4ae85d6d2ee4e182a82a9ca3ef1173a27e Mon Sep 17 00:00:00 2001 From: Santosh Date: Mon, 3 Oct 2016 18:53:45 +0530 Subject: Implement trakmate protocol --- debug.xml | 2 + src/org/traccar/protocol/TkmateProtocol.java | 32 ++++ .../traccar/protocol/TkmateProtocolDecoder.java | 210 +++++++++++++++++++++ .../protocol/TkmateProtocolDecoderTest.java | 28 +++ 4 files changed, 272 insertions(+) create mode 100644 src/org/traccar/protocol/TkmateProtocol.java create mode 100644 src/org/traccar/protocol/TkmateProtocolDecoder.java create mode 100644 test/org/traccar/protocol/TkmateProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/debug.xml b/debug.xml index 0b07ed140..4dcb143fc 100644 --- a/debug.xml +++ b/debug.xml @@ -485,5 +485,7 @@ 5124 5125 5126 + 5127 + 19800 diff --git a/src/org/traccar/protocol/TkmateProtocol.java b/src/org/traccar/protocol/TkmateProtocol.java new file mode 100644 index 000000000..156718aaa --- /dev/null +++ b/src/org/traccar/protocol/TkmateProtocol.java @@ -0,0 +1,32 @@ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; +import org.traccar.BaseProtocol; +import org.traccar.CharacterDelimiterFrameDecoder; +import org.traccar.TrackerServer; + +import java.util.List; + + +public class TkmateProtocol extends BaseProtocol { + + public TkmateProtocol() { + super("trakmate"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "#")); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new TkmateProtocolDecoder(TkmateProtocol.this)); + } + }); + } +} diff --git a/src/org/traccar/protocol/TkmateProtocolDecoder.java b/src/org/traccar/protocol/TkmateProtocolDecoder.java new file mode 100644 index 000000000..2886e48a2 --- /dev/null +++ b/src/org/traccar/protocol/TkmateProtocolDecoder.java @@ -0,0 +1,210 @@ +package org.traccar.protocol; + +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.Context; +import org.traccar.DeviceSession; +import org.traccar.helper.DateBuilder; +import org.traccar.helper.Parser; +import org.traccar.helper.PatternBuilder; +import org.traccar.model.Position; + +import java.net.SocketAddress; +import java.util.TimeZone; +import java.util.regex.Pattern; + + +public class TkmateProtocolDecoder extends BaseProtocolDecoder { + + private final TimeZone timeZone = TimeZone.getTimeZone("UTC"); + + public TkmateProtocolDecoder(TkmateProtocol protocol) { + super(protocol); + + if (Context.getConfig().hasKey(getProtocolName() + ".timezone")) { + timeZone.setRawOffset(Context.getConfig().getInteger(getProtocolName() + ".timezone") * 1000); + } + } + + private static final Pattern PATTERN_SRT = new PatternBuilder() + .text("^TMSRT|") + .expression("([^ ]+)|") // uid + .number("(d+.d+)|") // latitude + .number("(d+.d+)|") // longitude + .number("(dd)(dd)(dd)|") // time + .number("(dd)(dd)(dd)|") // date + .number("(d+.d+)|") // software ver + .number("(d+.d+)|") // Hardware ver + .any() + .compile(); + + + private static final Pattern PATTERN_PER = new PatternBuilder() + .text("^TMPER|") + .expression("([^ ]+)|") // uid + .number("(d+)|") // seq + .number("(d+.d+)|") // latitude + .number("(d+.d+)|") // longitude + .number("(dd)(dd)(dd)|") // time + .number("(dd)(dd)(dd)|") // date + .number("(d+.d+)|") // speed + .number("(d+.d+)|") // heading + .number("(d+)|") // ignition + .number("(d+)|") // dop1 + .number("(d+)|") // dop2 + .number("(d+.d+)|") // analog + .number("(d+.d+)|") // internal battery + .number("(d+.d+)|") // vehicle battery + .number("(d+.d+)|") // gps odometer + .number("(d+.d+)|") // pulse odometer + .number("(d+)|") // main power status + .number("(d+)|") // gps data validity + .number("(d+)|") // live or cache + .any() + .compile(); + + + private static final Pattern PATTERN_ALT = new PatternBuilder() + .text("^TMALT|") + .expression("([^ ]+)|") // uid + .number("(d+)|") // seq + .number("(d+)|") // Alert type + .number("(d+)|") // Alert status + .number("(d+.d+)|") // latitude + .number("(d+.d+)|") // longitude + .number("(dd)(dd)(dd)|") // time + .number("(dd)(dd)(dd)|") // date + .number("(d+.d+)|") // speed + .number("(d+.d+)|") // heading + .any() + .compile(); + + + private String decodeAlarm(int value) { + switch (value) { + case 1: + return Position.ALARM_SOS; + case 3: + return Position.ALARM_GEOFENCE; + case 4: + return Position.ALARM_POWER_CUT; + default: + return null; + } + } + + private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { + Parser parser = new Parser(PATTERN_SRT, sentence); + if (!parser.matches()) { + return null; + } + Position position = new Position(); + position.setProtocol(getProtocolName()); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + position.setDeviceId(deviceSession.getDeviceId()); + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + position.set(Position.KEY_VERSION, parser.next()); + parser.next(); //hardware version + return position; + } + + + private Object decodeAlt(Channel channel, SocketAddress remoteAddress, String sentence) { + Parser parser = new Parser(PATTERN_ALT, sentence); + if (!parser.matches()) { + return null; + } + Position position = new Position(); + position.setProtocol(getProtocolName()); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + position.setDeviceId(deviceSession.getDeviceId()); + parser.next(); // seq + int alarm = parser.nextInt(); + position.set(Position.KEY_ALARM, decodeAlarm(alarm)); + parser.next(); //alert status or data + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + position.setSpeed(parser.nextDouble()); + position.setCourse(parser.nextDouble()); + return position; + } + + + protected Object decodePer(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + Parser parser = new Parser(PATTERN_PER, (String) msg); + if (!parser.matches()) { + return null; + } + Position position = new Position(); + position.setProtocol(getProtocolName()); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + position.setDeviceId(deviceSession.getDeviceId()); + parser.next(); //seq + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + position.setSpeed(parser.nextDouble()); + position.setCourse(parser.nextDouble()); + position.set(Position.KEY_IGNITION, parser.nextInt() == 1); + parser.next(); //dop1 + parser.next(); //dop2 + parser.next(); //analog input + position.set(Position.KEY_BATTERY, parser.nextDouble()); //device battery voltage + parser.next(); //vehicle internal voltage + position.set(Position.KEY_ODOMETER, parser.nextDouble()); //GPS odometer + parser.next(); //pulse odometer + position.set(Position.KEY_STATUS, parser.nextInt()); + position.setValid(parser.nextInt() != 0); + position.set(Position.KEY_ARCHIVE, parser.nextInt() == 1); + return position; + } + + @Override + protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + String sentence = (String) msg; + int typeIndex = sentence.indexOf("^TM"); + if (typeIndex < 0) { + return null; + } + + Object result; + String type = sentence.substring(typeIndex + 3, typeIndex + 6); + switch (type) { + case "ALT": + result = decodeAlt(channel, remoteAddress, sentence); + break; + case "SRT": + result = decodeSrt(channel, remoteAddress, sentence); + break; + case "PER": + result = decodePer(channel, remoteAddress, sentence); + break; + default: + return null; + } + return result; + + } +} + diff --git a/test/org/traccar/protocol/TkmateProtocolDecoderTest.java b/test/org/traccar/protocol/TkmateProtocolDecoderTest.java new file mode 100644 index 000000000..61df237d7 --- /dev/null +++ b/test/org/traccar/protocol/TkmateProtocolDecoderTest.java @@ -0,0 +1,28 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + + +public class TkmateProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + + TkmateProtocolDecoder decoder = new TkmateProtocolDecoder(new TkmateProtocol()); + + verifyPosition(decoder, text( + "^TMPER|354678456723764|1|12.59675|77.56789|123456|030414|2.3|34.0|1|0|0|0.015|3.9|12.0|23.4|" + + "23.4|1|1|0|#")); + + verifyPosition(decoder, text( + "^TMALT|354678456723764|3|2|1|12.59675|77.56789|123456|030414|1.2|34.0|#")); + + verifyPosition(decoder, text( + "^TMSRT|354678456723764|12.59675|77.56789|123456|030414|1.03|1.01|#")); + + } + +} + -- cgit v1.2.3 From 974fccb9b808f2ff615f9c9e04f3b722301d2ace Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 15 Oct 2016 08:14:36 +1300 Subject: Add u-pro unit test case --- test/org/traccar/protocol/UproProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index c58a748a1..82d159d18 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(new UproProtocol()); + verifyNothing(decoder, text( + "*AI2000905447674,BA&A2003064913201201845107561627121016&B0100000000&C05>8=961&F0333&K023101002154A7#")); + verifyPosition(decoder, text( "*AI200905300036,AH&A0317264913209801844913060000251115&B0500000000&C0;4?72:9&F0000#")); -- cgit v1.2.3 From 4e07ad9afa05e61e884e2c4be83b1cd4f9d051ae Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 15 Oct 2016 14:06:00 +1300 Subject: Rename and format TrakMate protocol --- src/org/traccar/protocol/TkmateProtocol.java | 32 --- .../traccar/protocol/TkmateProtocolDecoder.java | 207 ------------------ src/org/traccar/protocol/TrakMateProtocol.java | 47 ++++ .../traccar/protocol/TrakMateProtocolDecoder.java | 236 +++++++++++++++++++++ .../protocol/TkmateProtocolDecoderTest.java | 28 --- .../protocol/TrakMateProtocolDecoderTest.java | 24 +++ 6 files changed, 307 insertions(+), 267 deletions(-) delete mode 100644 src/org/traccar/protocol/TkmateProtocol.java delete mode 100644 src/org/traccar/protocol/TkmateProtocolDecoder.java create mode 100644 src/org/traccar/protocol/TrakMateProtocol.java create mode 100644 src/org/traccar/protocol/TrakMateProtocolDecoder.java delete mode 100644 test/org/traccar/protocol/TkmateProtocolDecoderTest.java create mode 100644 test/org/traccar/protocol/TrakMateProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/TkmateProtocol.java b/src/org/traccar/protocol/TkmateProtocol.java deleted file mode 100644 index 156718aaa..000000000 --- a/src/org/traccar/protocol/TkmateProtocol.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.traccar.protocol; - -import org.jboss.netty.bootstrap.ServerBootstrap; -import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.handler.codec.string.StringDecoder; -import org.jboss.netty.handler.codec.string.StringEncoder; -import org.traccar.BaseProtocol; -import org.traccar.CharacterDelimiterFrameDecoder; -import org.traccar.TrackerServer; - -import java.util.List; - - -public class TkmateProtocol extends BaseProtocol { - - public TkmateProtocol() { - super("trakmate"); - } - - @Override - public void initTrackerServers(List serverList) { - serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { - @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "#")); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TkmateProtocolDecoder(TkmateProtocol.this)); - } - }); - } -} diff --git a/src/org/traccar/protocol/TkmateProtocolDecoder.java b/src/org/traccar/protocol/TkmateProtocolDecoder.java deleted file mode 100644 index 08f189ece..000000000 --- a/src/org/traccar/protocol/TkmateProtocolDecoder.java +++ /dev/null @@ -1,207 +0,0 @@ -package org.traccar.protocol; - -import org.jboss.netty.channel.Channel; -import org.traccar.BaseProtocolDecoder; -import org.traccar.Context; -import org.traccar.DeviceSession; -import org.traccar.helper.DateBuilder; -import org.traccar.helper.Parser; -import org.traccar.helper.PatternBuilder; -import org.traccar.model.Position; - -import java.net.SocketAddress; -import java.util.TimeZone; -import java.util.regex.Pattern; - - -public class TkmateProtocolDecoder extends BaseProtocolDecoder { - - private final TimeZone timeZone = TimeZone.getTimeZone("UTC"); - - public TkmateProtocolDecoder(TkmateProtocol protocol) { - super(protocol); - timeZone.setRawOffset(Context.getConfig().getInteger(getProtocolName() + ".timezone") * 1000); - } - - private static final Pattern PATTERN_SRT = new PatternBuilder() - .text("^TMSRT|") - .expression("([^ ]+)|") // uid - .number("(d+.d+)|") // latitude - .number("(d+.d+)|") // longitude - .number("(dd)(dd)(dd)|") // time - .number("(dd)(dd)(dd)|") // date - .number("(d+.d+)|") // software ver - .number("(d+.d+)|") // Hardware ver - .any() - .compile(); - - - private static final Pattern PATTERN_PER = new PatternBuilder() - .text("^TMPER|") - .expression("([^ ]+)|") // uid - .number("(d+)|") // seq - .number("(d+.d+)|") // latitude - .number("(d+.d+)|") // longitude - .number("(dd)(dd)(dd)|") // time - .number("(dd)(dd)(dd)|") // date - .number("(d+.d+)|") // speed - .number("(d+.d+)|") // heading - .number("(d+)|") // ignition - .number("(d+)|") // dop1 - .number("(d+)|") // dop2 - .number("(d+.d+)|") // analog - .number("(d+.d+)|") // internal battery - .number("(d+.d+)|") // vehicle battery - .number("(d+.d+)|") // gps odometer - .number("(d+.d+)|") // pulse odometer - .number("(d+)|") // main power status - .number("(d+)|") // gps data validity - .number("(d+)|") // live or cache - .any() - .compile(); - - - private static final Pattern PATTERN_ALT = new PatternBuilder() - .text("^TMALT|") - .expression("([^ ]+)|") // uid - .number("(d+)|") // seq - .number("(d+)|") // Alert type - .number("(d+)|") // Alert status - .number("(d+.d+)|") // latitude - .number("(d+.d+)|") // longitude - .number("(dd)(dd)(dd)|") // time - .number("(dd)(dd)(dd)|") // date - .number("(d+.d+)|") // speed - .number("(d+.d+)|") // heading - .any() - .compile(); - - - private String decodeAlarm(int value) { - switch (value) { - case 1: - return Position.ALARM_SOS; - case 3: - return Position.ALARM_GEOFENCE; - case 4: - return Position.ALARM_POWER_CUT; - default: - return null; - } - } - - private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { - Parser parser = new Parser(PATTERN_SRT, sentence); - if (!parser.matches()) { - return null; - } - Position position = new Position(); - position.setProtocol(getProtocolName()); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); - if (deviceSession == null) { - return null; - } - position.setDeviceId(deviceSession.getDeviceId()); - position.setLatitude(parser.nextDouble()); - position.setLongitude(parser.nextDouble()); - DateBuilder dateBuilder = new DateBuilder(timeZone) - .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) - .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); - position.setTime(dateBuilder.getDate()); - position.set(Position.KEY_VERSION, parser.next()); - parser.next(); //hardware version - return position; - } - - - private Object decodeAlt(Channel channel, SocketAddress remoteAddress, String sentence) { - Parser parser = new Parser(PATTERN_ALT, sentence); - if (!parser.matches()) { - return null; - } - Position position = new Position(); - position.setProtocol(getProtocolName()); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); - if (deviceSession == null) { - return null; - } - position.setDeviceId(deviceSession.getDeviceId()); - parser.next(); // seq - int alarm = parser.nextInt(); - position.set(Position.KEY_ALARM, decodeAlarm(alarm)); - parser.next(); //alert status or data - position.setLatitude(parser.nextDouble()); - position.setLongitude(parser.nextDouble()); - DateBuilder dateBuilder = new DateBuilder(timeZone) - .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) - .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); - position.setTime(dateBuilder.getDate()); - position.setSpeed(parser.nextDouble()); - position.setCourse(parser.nextDouble()); - return position; - } - - - protected Object decodePer(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - Parser parser = new Parser(PATTERN_PER, (String) msg); - if (!parser.matches()) { - return null; - } - Position position = new Position(); - position.setProtocol(getProtocolName()); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); - if (deviceSession == null) { - return null; - } - position.setDeviceId(deviceSession.getDeviceId()); - parser.next(); //seq - position.setLatitude(parser.nextDouble()); - position.setLongitude(parser.nextDouble()); - DateBuilder dateBuilder = new DateBuilder(timeZone) - .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) - .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); - position.setTime(dateBuilder.getDate()); - position.setSpeed(parser.nextDouble()); - position.setCourse(parser.nextDouble()); - position.set(Position.KEY_IGNITION, parser.nextInt() == 1); - parser.next(); //dop1 - parser.next(); //dop2 - parser.next(); //analog input - position.set(Position.KEY_BATTERY, parser.nextDouble()); //device battery voltage - parser.next(); //vehicle internal voltage - position.set(Position.KEY_ODOMETER, parser.nextDouble()); //GPS odometer - parser.next(); //pulse odometer - position.set(Position.KEY_STATUS, parser.nextInt()); - position.setValid(parser.nextInt() != 0); - position.set(Position.KEY_ARCHIVE, parser.nextInt() == 1); - return position; - } - - @Override - protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - String sentence = (String) msg; - int typeIndex = sentence.indexOf("^TM"); - if (typeIndex < 0) { - return null; - } - - Object result; - String type = sentence.substring(typeIndex + 3, typeIndex + 6); - switch (type) { - case "ALT": - result = decodeAlt(channel, remoteAddress, sentence); - break; - case "SRT": - result = decodeSrt(channel, remoteAddress, sentence); - break; - case "PER": - result = decodePer(channel, remoteAddress, sentence); - break; - default: - return null; - } - return result; - - } -} - diff --git a/src/org/traccar/protocol/TrakMateProtocol.java b/src/org/traccar/protocol/TrakMateProtocol.java new file mode 100644 index 000000000..3126fb80b --- /dev/null +++ b/src/org/traccar/protocol/TrakMateProtocol.java @@ -0,0 +1,47 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; +import org.traccar.BaseProtocol; +import org.traccar.CharacterDelimiterFrameDecoder; +import org.traccar.TrackerServer; + +import java.util.List; + +public class TrakMateProtocol extends BaseProtocol { + + public TrakMateProtocol() { + super("trakmate"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new TrakMateProtocolDecoder(TrakMateProtocol.this)); + } + }); + } + +} diff --git a/src/org/traccar/protocol/TrakMateProtocolDecoder.java b/src/org/traccar/protocol/TrakMateProtocolDecoder.java new file mode 100644 index 000000000..0ca40e6ab --- /dev/null +++ b/src/org/traccar/protocol/TrakMateProtocolDecoder.java @@ -0,0 +1,236 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.Context; +import org.traccar.DeviceSession; +import org.traccar.helper.DateBuilder; +import org.traccar.helper.Parser; +import org.traccar.helper.PatternBuilder; +import org.traccar.model.Position; + +import java.net.SocketAddress; +import java.util.TimeZone; +import java.util.regex.Pattern; + +public class TrakMateProtocolDecoder extends BaseProtocolDecoder { + + private final TimeZone timeZone = TimeZone.getTimeZone("UTC"); + + public TrakMateProtocolDecoder(TrakMateProtocol protocol) { + super(protocol); + timeZone.setRawOffset(Context.getConfig().getInteger(getProtocolName() + ".timezone") * 1000); + } + + private static final Pattern PATTERN_SRT = new PatternBuilder() + .text("^TMSRT|") + .expression("([^ ]+)|") // uid + .number("(d+.d+)|") // latitude + .number("(d+.d+)|") // longitude + .number("(dd)(dd)(dd)|") // time + .number("(dd)(dd)(dd)|") // date + .number("(d+.d+)|") // software ver + .number("(d+.d+)|") // Hardware ver + .any() + .compile(); + + private static final Pattern PATTERN_PER = new PatternBuilder() + .text("^TMPER|") + .expression("([^ ]+)|") // uid + .number("(d+)|") // seq + .number("(d+.d+)|") // latitude + .number("(d+.d+)|") // longitude + .number("(dd)(dd)(dd)|") // time + .number("(dd)(dd)(dd)|") // date + .number("(d+.d+)|") // speed + .number("(d+.d+)|") // heading + .number("(d+)|") // ignition + .number("(d+)|") // dop1 + .number("(d+)|") // dop2 + .number("(d+.d+)|") // analog + .number("(d+.d+)|") // internal battery + .number("(d+.d+)|") // vehicle battery + .number("(d+.d+)|") // gps odometer + .number("(d+.d+)|") // pulse odometer + .number("(d+)|") // main power status + .number("(d+)|") // gps data validity + .number("(d+)|") // live or cache + .any() + .compile(); + + private static final Pattern PATTERN_ALT = new PatternBuilder() + .text("^TMALT|") + .expression("([^ ]+)|") // uid + .number("(d+)|") // seq + .number("(d+)|") // Alert type + .number("(d+)|") // Alert status + .number("(d+.d+)|") // latitude + .number("(d+.d+)|") // longitude + .number("(dd)(dd)(dd)|") // time + .number("(dd)(dd)(dd)|") // date + .number("(d+.d+)|") // speed + .number("(d+.d+)|") // heading + .any() + .compile(); + + private String decodeAlarm(int value) { + switch (value) { + case 1: + return Position.ALARM_SOS; + case 3: + return Position.ALARM_GEOFENCE; + case 4: + return Position.ALARM_POWER_CUT; + default: + return null; + } + } + + private Object decodeSrt(Channel channel, SocketAddress remoteAddress, String sentence) { + + Parser parser = new Parser(PATTERN_SRT, sentence); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + position.set(Position.KEY_VERSION, parser.next()); + parser.next(); // hardware version + + return position; + } + + private Object decodeAlt(Channel channel, SocketAddress remoteAddress, String sentence) { + + Parser parser = new Parser(PATTERN_ALT, sentence); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + parser.next(); // seq + position.set(Position.KEY_ALARM, decodeAlarm(parser.nextInt())); + parser.next(); // alert status or data + + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + position.setSpeed(parser.nextDouble()); + position.setCourse(parser.nextDouble()); + + return position; + } + + private Object decodePer(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + Parser parser = new Parser(PATTERN_PER, (String) msg); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + parser.next(); // seq + + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + + DateBuilder dateBuilder = new DateBuilder(timeZone) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + position.setSpeed(parser.nextDouble()); + position.setCourse(parser.nextDouble()); + + position.set(Position.KEY_IGNITION, parser.nextInt() == 1); + parser.next(); // dop1 + parser.next(); // dop2 + parser.next(); // analog input + position.set(Position.KEY_BATTERY, parser.nextDouble()); // device battery voltage + parser.next(); // vehicle internal voltage + position.set(Position.KEY_ODOMETER, parser.nextDouble()); // gps odometer + parser.next(); // pulse odometer + position.set(Position.KEY_STATUS, parser.nextInt()); + + position.setValid(parser.nextInt() != 0); + + position.set(Position.KEY_ARCHIVE, parser.nextInt() == 1); + + return position; + } + + @Override + protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + String sentence = (String) msg; + int typeIndex = sentence.indexOf("^TM"); + if (typeIndex < 0) { + return null; + } + + String type = sentence.substring(typeIndex + 3, typeIndex + 6); + switch (type) { + case "ALT": + return decodeAlt(channel, remoteAddress, sentence); + case "SRT": + return decodeSrt(channel, remoteAddress, sentence); + case "PER": + return decodePer(channel, remoteAddress, sentence); + default: + return null; + } + } + +} diff --git a/test/org/traccar/protocol/TkmateProtocolDecoderTest.java b/test/org/traccar/protocol/TkmateProtocolDecoderTest.java deleted file mode 100644 index 61df237d7..000000000 --- a/test/org/traccar/protocol/TkmateProtocolDecoderTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.traccar.protocol; - -import org.junit.Test; -import org.traccar.ProtocolTest; - - -public class TkmateProtocolDecoderTest extends ProtocolTest { - - @Test - public void testDecode() throws Exception { - - - TkmateProtocolDecoder decoder = new TkmateProtocolDecoder(new TkmateProtocol()); - - verifyPosition(decoder, text( - "^TMPER|354678456723764|1|12.59675|77.56789|123456|030414|2.3|34.0|1|0|0|0.015|3.9|12.0|23.4|" + - "23.4|1|1|0|#")); - - verifyPosition(decoder, text( - "^TMALT|354678456723764|3|2|1|12.59675|77.56789|123456|030414|1.2|34.0|#")); - - verifyPosition(decoder, text( - "^TMSRT|354678456723764|12.59675|77.56789|123456|030414|1.03|1.01|#")); - - } - -} - diff --git a/test/org/traccar/protocol/TrakMateProtocolDecoderTest.java b/test/org/traccar/protocol/TrakMateProtocolDecoderTest.java new file mode 100644 index 000000000..b08decc92 --- /dev/null +++ b/test/org/traccar/protocol/TrakMateProtocolDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class TrakMateProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + TrakMateProtocolDecoder decoder = new TrakMateProtocolDecoder(new TrakMateProtocol()); + + verifyPosition(decoder, text( + "^TMPER|354678456723764|1|12.59675|77.56789|123456|030414|2.3|34.0|1|0|0|0.015|3.9|12.0|23.4|23.4|1|1|0|#")); + + verifyPosition(decoder, text( + "^TMALT|354678456723764|3|2|1|12.59675|77.56789|123456|030414|1.2|34.0|#")); + + verifyPosition(decoder, text( + "^TMSRT|354678456723764|12.59675|77.56789|123456|030414|1.03|1.01|#")); + + } + +} -- cgit v1.2.3 From 7e2698ea6d1933030cd7e7a2fb33e3c984166f78 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 17 Oct 2016 22:04:02 +1300 Subject: Fix style problem with filter handler --- src/org/traccar/FilterHandler.java | 65 +++++++++++++++++++++------------ test/org/traccar/FilterHandlerTest.java | 12 +++++- 2 files changed, 52 insertions(+), 25 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index b6917cbfb..1ce9e2460 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,40 +23,59 @@ public class FilterHandler extends BaseDataHandler { private static final long FILTER_FUTURE_LIMIT = 5 * 60 * 1000; - private final boolean filterInvalid; - private final boolean filterZero; - private final boolean filterDuplicate; - private final boolean filterFuture; - private final boolean filterApproximate; - private final boolean filterStatic; - private final int filterDistance; - private final long filterLimit; - - public FilterHandler( - boolean filterInvalid, boolean filterZero, boolean filterDuplicate, boolean filterFuture, - boolean filterApproximate, boolean filterStatic, int filterDistance, long filterLimit) { + private boolean filterInvalid; + private boolean filterZero; + private boolean filterDuplicate; + private boolean filterFuture; + private boolean filterApproximate; + private boolean filterStatic; + private int filterDistance; + private long filterLimit; + public void setFilterInvalid(boolean filterInvalid) { this.filterInvalid = filterInvalid; + } + + public void setFilterZero(boolean filterZero) { this.filterZero = filterZero; + } + + public void setFilterDuplicate(boolean filterDuplicate) { this.filterDuplicate = filterDuplicate; - this.filterDistance = filterDistance; + } + + public void setFilterFuture(boolean filterFuture) { this.filterFuture = filterFuture; + } + + public void setFilterApproximate(boolean filterApproximate) { this.filterApproximate = filterApproximate; + } + + public void setFilterStatic(boolean filterStatic) { this.filterStatic = filterStatic; + } + + public void setFilterDistance(int filterDistance) { + this.filterDistance = filterDistance; + } + + public void setFilterLimit(long filterLimit) { this.filterLimit = filterLimit; } public FilterHandler() { Config config = Context.getConfig(); - - filterInvalid = config.getBoolean("filter.invalid"); - filterZero = config.getBoolean("filter.zero"); - filterDuplicate = config.getBoolean("filter.duplicate"); - filterFuture = config.getBoolean("filter.future"); - filterApproximate = config.getBoolean("filter.approximate"); - filterStatic = config.getBoolean("filter.static"); - filterDistance = config.getInteger("filter.distance"); - filterLimit = config.getLong("filter.limit") * 1000; + if (config != null) { + filterInvalid = config.getBoolean("filter.invalid"); + filterZero = config.getBoolean("filter.zero"); + filterDuplicate = config.getBoolean("filter.duplicate"); + filterFuture = config.getBoolean("filter.future"); + filterApproximate = config.getBoolean("filter.approximate"); + filterStatic = config.getBoolean("filter.static"); + filterDistance = config.getInteger("filter.distance"); + filterLimit = config.getLong("filter.limit") * 1000; + } } private Position getLastPosition(long deviceId) { diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index b1e4fcb16..bb7e69dc0 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -15,8 +15,16 @@ public class FilterHandlerTest { @Before public void setUp() { - filtingHandler = new FilterHandler(true, true, true, true, true, 10, 10); - passingHandler = new FilterHandler(false, false, false, false, false, 0, 0); + passingHandler = new FilterHandler(); + filtingHandler = new FilterHandler(); + filtingHandler.setFilterInvalid(true); + filtingHandler.setFilterZero(true); + filtingHandler.setFilterDuplicate(true); + filtingHandler.setFilterFuture(true); + filtingHandler.setFilterApproximate(true); + filtingHandler.setFilterStatic(true); + filtingHandler.setFilterDistance(10); + filtingHandler.setFilterLimit(10); } @After -- cgit v1.2.3 From e7a545ee8b6d03ab085896ac162da7ae12e5557d Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Wed, 19 Oct 2016 15:10:07 +0200 Subject: Log device uniqueId in filters logging This combined with another commit to traccar-web makes it easier to see which device has been filtered. --- src/org/traccar/FilterHandler.java | 11 +++++++++- test/org/traccar/FilterHandlerTest.java | 38 ++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index 83d79a3c0..9a6c7936a 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -175,7 +175,16 @@ public class FilterHandler extends BaseDataHandler { } if (filterType.length() > 0 && !filterLimit(position)) { - Log.info("Position filtered by " + filterType.toString() + "filters from " + position.getDeviceId()); + + StringBuilder logmsg = new StringBuilder(); + logmsg.append("Position filtered by "); + logmsg.append(filterType.toString()); + logmsg.append("filters from device: "); + logmsg.append(Context.getIdentityManager().getDeviceById(position.getDeviceId()).getUniqueId()); + logmsg.append(" with id: "); + logmsg.append(position.getDeviceId()); + + Log.info(logmsg.toString()); return true; } diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index bb7e69dc0..9c2ce416e 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -6,10 +6,46 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Before; import org.junit.Test; +import org.traccar.database.IdentityManager; import org.traccar.model.Position; +import org.traccar.model.Device; public class FilterHandlerTest { + static { + Context.init(new IdentityManager() { + + private Device createDevice() { + Device device = new Device(); + device.setId(1); + device.setName("test"); + device.setUniqueId("123456789012345"); + return device; + } + + @Override + public Device getDeviceById(long id) { + return createDevice(); + } + + @Override + public Device getDeviceByUniqueId(String uniqueId) { + return createDevice(); + } + + @Override + public Position getLastPosition(long deviceId) { + return null; + } + + @Override + public boolean isLatestPosition(Position position) { + return true; + } + + }); + } + private FilterHandler filtingHandler; private FilterHandler passingHandler; @@ -32,7 +68,7 @@ public class FilterHandlerTest { filtingHandler = null; passingHandler = null; } - + private Position createPosition( long deviceId, Date time, -- cgit v1.2.3 From 23e11715cc6f5e94002123293a1108a48044316e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 20 Oct 2016 08:00:39 +1300 Subject: Support Ruptela extended format (fix #2460) --- .../traccar/protocol/RuptelaProtocolDecoder.java | 32 +++++++++++++++------- .../protocol/RuptelaProtocolDecoderTest.java | 6 ++++ 2 files changed, 28 insertions(+), 10 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/org/traccar/protocol/RuptelaProtocolDecoder.java index 224c027f3..84cc0e101 100644 --- a/src/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { } public static final int MSG_RECORDS = 1; + public static final int MSG_EXTENDED_RECORDS = 68; public static final int MSG_SMS_VIA_GPRS = 108; @Override @@ -53,7 +54,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { int type = buf.readUnsignedByte(); - if (type == MSG_RECORDS) { + if (type == MSG_RECORDS || type == MSG_EXTENDED_RECORDS) { List positions = new LinkedList<>(); buf.readUnsignedByte(); // records left @@ -67,45 +68,56 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { position.setTime(new Date(buf.readUnsignedInt() * 1000)); buf.readUnsignedByte(); // timestamp extension + if (type == MSG_EXTENDED_RECORDS) { + buf.readUnsignedByte(); // record extension + } + buf.readUnsignedByte(); // priority (reserved) + position.setValid(true); position.setLongitude(buf.readInt() / 10000000.0); position.setLatitude(buf.readInt() / 10000000.0); position.setAltitude(buf.readUnsignedShort() / 10.0); position.setCourse(buf.readUnsignedShort() / 100.0); - int satellites = buf.readUnsignedByte(); - position.set(Position.KEY_SATELLITES, satellites); - position.setValid(satellites >= 3); + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort())); position.set(Position.KEY_HDOP, buf.readUnsignedByte() / 10.0); - buf.readUnsignedByte(); + if (type == MSG_EXTENDED_RECORDS) { + buf.readUnsignedShort(); // event + } else { + buf.readUnsignedByte(); // event + } // Read 1 byte data int cnt = buf.readUnsignedByte(); for (int j = 0; j < cnt; j++) { - position.set(Position.PREFIX_IO + buf.readUnsignedByte(), buf.readUnsignedByte()); + int id = type == MSG_EXTENDED_RECORDS ? buf.readUnsignedShort() : buf.readUnsignedByte(); + position.set(Position.PREFIX_IO + id, buf.readUnsignedByte()); } // Read 2 byte data cnt = buf.readUnsignedByte(); for (int j = 0; j < cnt; j++) { - position.set(Position.PREFIX_IO + buf.readUnsignedByte(), buf.readUnsignedShort()); + int id = type == MSG_EXTENDED_RECORDS ? buf.readUnsignedShort() : buf.readUnsignedByte(); + position.set(Position.PREFIX_IO + id, buf.readUnsignedShort()); } // Read 4 byte data cnt = buf.readUnsignedByte(); for (int j = 0; j < cnt; j++) { - position.set(Position.PREFIX_IO + buf.readUnsignedByte(), buf.readUnsignedInt()); + int id = type == MSG_EXTENDED_RECORDS ? buf.readUnsignedShort() : buf.readUnsignedByte(); + position.set(Position.PREFIX_IO + id, buf.readUnsignedInt()); } // Read 8 byte data cnt = buf.readUnsignedByte(); for (int j = 0; j < cnt; j++) { - position.set(Position.PREFIX_IO + buf.readUnsignedByte(), buf.readLong()); + int id = type == MSG_EXTENDED_RECORDS ? buf.readUnsignedShort() : buf.readUnsignedByte(); + position.set(Position.PREFIX_IO + id, buf.readLong()); } positions.add(position); diff --git a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java index 902752811..cc457efca 100644 --- a/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/RuptelaProtocolDecoderTest.java @@ -9,6 +9,12 @@ public class RuptelaProtocolDecoderTest extends ProtocolTest { public void testDecode() throws Exception { RuptelaProtocolDecoder decoder = new RuptelaProtocolDecoder(new RuptelaProtocol()); + + verifyPositions(decoder, binary( + "01a4000315bc70f9b69244000458068f4a0030000d11398a1c0c19fd056524040b000c0a00090c0005010031f40032fd0033f200ce47002400002500001c010199000195010196010086000900aa0000001e0ff000d3ffff0043ffff01930000019200000194000002220000022300000200300000000200af000e872401008e000000000000000058068f4a0031000d11398a1c0c19fd056524040b000c0a00090400870000880000a90000820010008b0002021e0000021f0000021d0000021c0000022400000225000000890000008505f00220000002210000008300000084000002260000022700000228000003008a00000000008d00000000008c000000000058068f4a0032000d11398a1c0c19fd056524040b000c0a000905019f01005800001b1f00ad0000cfb10b02290000022a0000022b0000022c0000022d00000012000000130000001d367400c52f8000740055023e0502060097000000000096000058520041007746cb00d0000003f1005c0007c21b0072001864880058068f4a0033000d11398a1c0c19fd056524040b000c0a000900000001008e0000000000000000e815")); + + verifyPositions(decoder, binary( + "033d000315bc70f9b69244000858068f3b0030010d11354e1c0c17a5055d54560c00000900050c0005010031f30032fb0033f300ce00002400002500001c010199000195010196010086000900aa0000001e0ff300d3ffff0043ffff01930000019200000194000002220000022300000200300000000000af000e872401008e000000000000000058068f3b0031010d11354e1c0c17a5055d54560c00000900050400870000880000a90000820010008b0000021e0000021f0000021d0000021c0000022400000225000000890000008500000220000002210000008300000084000002260000022700000228000003008a00000000008d00000000008c000000000058068f3b0032010d11354e1c0c17a5055d54560c000009000505019f01005800001b1f00ad0000cfac0b02290000022a0000022b0000022c0000022d00000012000000130000001d31b100c5000000740000023e0502060097000000000096000058520041007746be00d0000003f1005c0007c2150072001864880058068f3b0033010d11354e1c0c17a5055d54560c000009000500000001008e000000000000000058068f3b0130000d11354e1c0c17a5055d54560d00000900070c0005010031f30032fb0033f300ce00002400002500001c010199000195010196010086000900aa0000001e0ff300d3ffff0043ffff01930000019200000194000002220000022300000200300000000000af000e872401008e000000000000000058068f3b0131000d11354e1c0c17a5055d54560d00000900070400870000880000a90000820010008b0000021e0000021f0000021d0000021c0000022400000225000000890000008500000220000002210000008300000084000002260000022700000228000003008a00000000008d00000000008c000000000058068f3b0132000d11354e1c0c17a5055d54560d000009000705019f01005800001b1f00ad0000cfac0b02290000022a0000022b0000022c0000022d00000012000000130000001d31ae00c5000000740000023e0502060097000000000096000058520041007746be00d0000003f1005c0007c2150072001864880058068f3b0133000d11354e1c0c17a5055d54560d000009000700000001008e0000000000000000084d")); verifyPositions(decoder, binary( "0050000310f5615f419c0100015613d8ed0000fff5b37a035af37801e700000900000d07071b0c020003001c01202cad000500064302a81d33e61e100116317cd3ffff174ad60241000077fa960000f232003c2e")); -- cgit v1.2.3 From f64840b9e85d4869c92e9f20a2f5043522ad4008 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 20 Oct 2016 16:32:24 +1300 Subject: Use heuristics for H02 message length --- src/org/traccar/protocol/H02FrameDecoder.java | 16 +++++++++++++--- src/org/traccar/protocol/H02Protocol.java | 2 +- test/org/traccar/protocol/H02FrameDecoderTest.java | 6 +++++- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/H02FrameDecoder.java b/src/org/traccar/protocol/H02FrameDecoder.java index feba8033d..2a005e760 100644 --- a/src/org/traccar/protocol/H02FrameDecoder.java +++ b/src/org/traccar/protocol/H02FrameDecoder.java @@ -22,6 +22,9 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder; public class H02FrameDecoder extends FrameDecoder { + private static final int MESSAGE_SHORT = 32; + private static final int MESSAGE_LONG = 45; + private int messageLength; public H02FrameDecoder(int messageLength) { @@ -49,10 +52,17 @@ public class H02FrameDecoder extends FrameDecoder { return buf.readBytes(index + 1 - buf.readerIndex()); } - } else if (marker == '$' && buf.readableBytes() >= messageLength) { + } else if (marker == '$') { - // Return binary message - return buf.readBytes(messageLength); + if (messageLength > 0 && buf.readableBytes() >= messageLength) { + return buf.readBytes(messageLength); + } else if (buf.readableBytes() >= MESSAGE_SHORT) { + if (buf.getUnsignedByte(buf.readerIndex() + MESSAGE_SHORT - 1) == 0) { + return buf.readBytes(MESSAGE_SHORT); + } else if (buf.readableBytes() >= MESSAGE_LONG) { + return buf.readBytes(MESSAGE_LONG); + } + } } diff --git a/src/org/traccar/protocol/H02Protocol.java b/src/org/traccar/protocol/H02Protocol.java index 06ac2a6fa..089721aed 100644 --- a/src/org/traccar/protocol/H02Protocol.java +++ b/src/org/traccar/protocol/H02Protocol.java @@ -43,7 +43,7 @@ public class H02Protocol extends BaseProtocol { serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - int messageLength = Context.getConfig().getInteger(getName() + ".messageLength", 32); + int messageLength = Context.getConfig().getInteger(getName() + ".messageLength"); pipeline.addLast("frameDecoder", new H02FrameDecoder(messageLength)); pipeline.addLast("stringEncoder", new StringEncoder()); pipeline.addLast("objectEncoder", new H02ProtocolEncoder()); diff --git a/test/org/traccar/protocol/H02FrameDecoderTest.java b/test/org/traccar/protocol/H02FrameDecoderTest.java index a8417341a..3e12bb446 100644 --- a/test/org/traccar/protocol/H02FrameDecoderTest.java +++ b/test/org/traccar/protocol/H02FrameDecoderTest.java @@ -9,7 +9,11 @@ public class H02FrameDecoderTest extends ProtocolTest { @Test public void testDecode() throws Exception { - H02FrameDecoder decoder = new H02FrameDecoder(32); + H02FrameDecoder decoder = new H02FrameDecoder(0); + + Assert.assertEquals( + binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"), + decoder.decode(null, null, binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"))); Assert.assertEquals( binary("2a48512c3335333538383036303031353536382c56312c3139333530352c412c3830392e303031302c532c333435342e383939372c572c302e30302c302e30302c3239313031332c65666666666266662c3030303264342c3030303030622c3030353338352c3030353261612c323523"), -- cgit v1.2.3 From 0d347cd7aac2ebfad01c1635f3893964be2e67ae Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Thu, 20 Oct 2016 07:19:10 +0200 Subject: Reuse EvenHandlerTest device rename log message variable --- src/org/traccar/FilterHandler.java | 18 ++++++++--------- test/org/traccar/FilterHandlerTest.java | 36 ++------------------------------- 2 files changed, 11 insertions(+), 43 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index 9a6c7936a..f9904ccaf 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -176,15 +176,15 @@ public class FilterHandler extends BaseDataHandler { if (filterType.length() > 0 && !filterLimit(position)) { - StringBuilder logmsg = new StringBuilder(); - logmsg.append("Position filtered by "); - logmsg.append(filterType.toString()); - logmsg.append("filters from device: "); - logmsg.append(Context.getIdentityManager().getDeviceById(position.getDeviceId()).getUniqueId()); - logmsg.append(" with id: "); - logmsg.append(position.getDeviceId()); - - Log.info(logmsg.toString()); + StringBuilder message = new StringBuilder(); + message.append("Position filtered by "); + message.append(filterType.toString()); + message.append("filters from device: "); + message.append(Context.getIdentityManager().getDeviceById(position.getDeviceId()).getUniqueId()); + message.append(" with id: "); + message.append(position.getDeviceId()); + + Log.info(message.toString()); return true; } diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index 9c2ce416e..a03c04536 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -12,45 +12,13 @@ import org.traccar.model.Device; public class FilterHandlerTest { - static { - Context.init(new IdentityManager() { - - private Device createDevice() { - Device device = new Device(); - device.setId(1); - device.setName("test"); - device.setUniqueId("123456789012345"); - return device; - } - - @Override - public Device getDeviceById(long id) { - return createDevice(); - } - - @Override - public Device getDeviceByUniqueId(String uniqueId) { - return createDevice(); - } - - @Override - public Position getLastPosition(long deviceId) { - return null; - } - - @Override - public boolean isLatestPosition(Position position) { - return true; - } - - }); - } - + private EventHandlerTest deviceHandler; private FilterHandler filtingHandler; private FilterHandler passingHandler; @Before public void setUp() { + deviceHandler = new EventHandlerTest(); passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); -- cgit v1.2.3 From 838e60102dca8e0d9abaf4439493f7226fc3ef88 Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Thu, 20 Oct 2016 09:37:37 +0200 Subject: Create a BaseTest class and reuse it --- test/org/traccar/BaseTest.java | 43 +++++++++++++++++++++++++++++++++ test/org/traccar/EventHandlerTest.java | 36 +-------------------------- test/org/traccar/FilterHandlerTest.java | 4 +-- test/org/traccar/ProtocolTest.java | 36 +-------------------------- 4 files changed, 46 insertions(+), 73 deletions(-) create mode 100644 test/org/traccar/BaseTest.java (limited to 'test/org/traccar') diff --git a/test/org/traccar/BaseTest.java b/test/org/traccar/BaseTest.java new file mode 100644 index 000000000..0d74f50e5 --- /dev/null +++ b/test/org/traccar/BaseTest.java @@ -0,0 +1,43 @@ +package org.traccar; + +import org.traccar.database.IdentityManager; +import org.traccar.model.Device; +import org.traccar.model.Position; + +public class BaseTest { + + static { + Context.init(new IdentityManager() { + + private Device createDevice() { + Device device = new Device(); + device.setId(1); + device.setName("test"); + device.setUniqueId("123456789012345"); + return device; + } + + @Override + public Device getDeviceById(long id) { + return createDevice(); + } + + @Override + public Device getDeviceByUniqueId(String uniqueId) { + return createDevice(); + } + + @Override + public Position getLastPosition(long deviceId) { + return null; + } + + @Override + public boolean isLatestPosition(Position position) { + return true; + } + + }); + } + +} diff --git a/test/org/traccar/EventHandlerTest.java b/test/org/traccar/EventHandlerTest.java index 423a5084f..277dbeb40 100644 --- a/test/org/traccar/EventHandlerTest.java +++ b/test/org/traccar/EventHandlerTest.java @@ -4,40 +4,6 @@ import org.traccar.database.IdentityManager; import org.traccar.model.Device; import org.traccar.model.Position; -public class EventHandlerTest { +public class EventHandlerTest extends BaseTest { - static { - Context.init(new IdentityManager() { - - private Device createDevice() { - Device device = new Device(); - device.setId(1); - device.setName("test"); - device.setUniqueId("123456789012345"); - return device; - } - - @Override - public Device getDeviceById(long id) { - return createDevice(); - } - - @Override - public Device getDeviceByUniqueId(String uniqueId) { - return createDevice(); - } - - @Override - public Position getLastPosition(long deviceId) { - return null; - } - - @Override - public boolean isLatestPosition(Position position) { - return true; - } - - }); - } - } diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index a03c04536..ea06a490d 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -10,15 +10,13 @@ import org.traccar.database.IdentityManager; import org.traccar.model.Position; import org.traccar.model.Device; -public class FilterHandlerTest { +public class FilterHandlerTest extends BaseTest { - private EventHandlerTest deviceHandler; private FilterHandler filtingHandler; private FilterHandler passingHandler; @Before public void setUp() { - deviceHandler = new EventHandlerTest(); passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index c6c957679..8211e9d6d 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -22,41 +22,7 @@ import java.util.List; import java.util.Map; import java.util.TimeZone; -public class ProtocolTest { - - static { - Context.init(new IdentityManager() { - - private Device createDevice() { - Device device = new Device(); - device.setId(1); - device.setName("test"); - device.setUniqueId("123456789012345"); - return device; - } - - @Override - public Device getDeviceById(long id) { - return createDevice(); - } - - @Override - public Device getDeviceByUniqueId(String uniqueId) { - return createDevice(); - } - - @Override - public Position getLastPosition(long deviceId) { - return null; - } - - @Override - public boolean isLatestPosition(Position position) { - return true; - } - - }); - } +public class ProtocolTest extends BaseTest { protected Position position(String time, boolean valid, double lat, double lon) throws ParseException { -- cgit v1.2.3 From d997b79ec28ae8f2d8778ee388c342dbf40bc40e Mon Sep 17 00:00:00 2001 From: Renaud Allard Date: Thu, 20 Oct 2016 09:51:16 +0200 Subject: Kill EventHandlerTest class, it has been replaced by BaseTest --- test/org/traccar/EventHandlerTest.java | 9 --------- test/org/traccar/events/AlertEventHandlerTest.java | 4 ++-- test/org/traccar/events/CommandResultEventHandlerTest.java | 4 ++-- test/org/traccar/events/IgnitionEventHandlerTest.java | 4 ++-- test/org/traccar/events/MotionEventHandlerTest.java | 4 ++-- 5 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 test/org/traccar/EventHandlerTest.java (limited to 'test/org/traccar') diff --git a/test/org/traccar/EventHandlerTest.java b/test/org/traccar/EventHandlerTest.java deleted file mode 100644 index 277dbeb40..000000000 --- a/test/org/traccar/EventHandlerTest.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.traccar; - -import org.traccar.database.IdentityManager; -import org.traccar.model.Device; -import org.traccar.model.Position; - -public class EventHandlerTest extends BaseTest { - -} diff --git a/test/org/traccar/events/AlertEventHandlerTest.java b/test/org/traccar/events/AlertEventHandlerTest.java index c6d5e07d9..77128f066 100644 --- a/test/org/traccar/events/AlertEventHandlerTest.java +++ b/test/org/traccar/events/AlertEventHandlerTest.java @@ -6,11 +6,11 @@ import static org.junit.Assert.assertNotNull; import java.util.Collection; import org.junit.Test; -import org.traccar.EventHandlerTest; +import org.traccar.BaseTest; import org.traccar.model.Event; import org.traccar.model.Position; -public class AlertEventHandlerTest extends EventHandlerTest { +public class AlertEventHandlerTest extends BaseTest { @Test public void testAlertEventHandler() throws Exception { diff --git a/test/org/traccar/events/CommandResultEventHandlerTest.java b/test/org/traccar/events/CommandResultEventHandlerTest.java index b09898b4a..f028e86ee 100644 --- a/test/org/traccar/events/CommandResultEventHandlerTest.java +++ b/test/org/traccar/events/CommandResultEventHandlerTest.java @@ -6,11 +6,11 @@ import static org.junit.Assert.assertNotNull; import java.util.Collection; import org.junit.Test; -import org.traccar.EventHandlerTest; +import org.traccar.BaseTest; import org.traccar.model.Event; import org.traccar.model.Position; -public class CommandResultEventHandlerTest extends EventHandlerTest { +public class CommandResultEventHandlerTest extends BaseTest { @Test public void testCommandResultEventHandler() throws Exception { diff --git a/test/org/traccar/events/IgnitionEventHandlerTest.java b/test/org/traccar/events/IgnitionEventHandlerTest.java index 96df6e1ed..ad329d139 100644 --- a/test/org/traccar/events/IgnitionEventHandlerTest.java +++ b/test/org/traccar/events/IgnitionEventHandlerTest.java @@ -6,11 +6,11 @@ import static org.junit.Assert.assertNotNull; import java.util.Collection; import org.junit.Test; -import org.traccar.EventHandlerTest; +import org.traccar.BaseTest; import org.traccar.model.Event; import org.traccar.model.Position; -public class IgnitionEventHandlerTest extends EventHandlerTest{ +public class IgnitionEventHandlerTest extends BaseTest { @Test public void testIgnitionEventHandler() throws Exception { diff --git a/test/org/traccar/events/MotionEventHandlerTest.java b/test/org/traccar/events/MotionEventHandlerTest.java index 34b2c481d..622680d91 100644 --- a/test/org/traccar/events/MotionEventHandlerTest.java +++ b/test/org/traccar/events/MotionEventHandlerTest.java @@ -6,11 +6,11 @@ import static org.junit.Assert.assertNotNull; import java.util.Collection; import org.junit.Test; -import org.traccar.EventHandlerTest; +import org.traccar.BaseTest; import org.traccar.model.Event; import org.traccar.model.Position; -public class MotionEventHandlerTest extends EventHandlerTest { +public class MotionEventHandlerTest extends BaseTest { @Test public void testMotionEventHandler() throws Exception { -- cgit v1.2.3 From dd6170837ebcda6303410f741b14e162e2ff2a29 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 20 Oct 2016 21:13:01 +1300 Subject: Decode HuaSheng validity flag --- src/org/traccar/protocol/HuaShengProtocolDecoder.java | 8 +++++++- test/org/traccar/protocol/HuaShengProtocolDecoderTest.java | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/HuaShengProtocolDecoder.java b/src/org/traccar/protocol/HuaShengProtocolDecoder.java index cbe931bd0..d83cea2ee 100644 --- a/src/org/traccar/protocol/HuaShengProtocolDecoder.java +++ b/src/org/traccar/protocol/HuaShengProtocolDecoder.java @@ -20,6 +20,7 @@ import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; +import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; @@ -98,7 +99,12 @@ public class HuaShengProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - position.set(Position.KEY_STATUS, buf.readUnsignedShort()); + int status = buf.readUnsignedShort(); + + position.setValid(BitUtil.check(status, 15)); + + position.set(Position.KEY_STATUS, status); + position.set(Position.KEY_IGNITION, BitUtil.check(status, 14)); position.set(Position.KEY_EVENT, buf.readUnsignedShort()); String time = buf.readBytes(12).toString(StandardCharsets.US_ASCII); diff --git a/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java b/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java index d1165b226..e6c918ff3 100644 --- a/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HuaShengProtocolDecoderTest.java @@ -13,6 +13,9 @@ public class HuaShengProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, binary( "c000000077aa0200000000000e000100143347315f48312e315f56312e30372e54000300133335353835353035303434303635380004000b3531323030303000050005010006000400070004000800050000090018383936313032353431343533333239313833360d000a000f796573696e7465726e6574c0")); + verifyPosition(decoder, binary( + "c00000004baa0000000000000f8000000031363130323030373236333600e6d4f9ffcc78c700000022003600000001001500000000000000000000059bffffffffff0005000a040300000253c0")); + verifyPosition(decoder, binary( "c00000004baa000000000000098000000031363130303732323236343700e6d4efffcc789f000000000026000000010015000000000000000000000488ffffffffff0005000a10060000008dc0")); -- cgit v1.2.3 From a30c3a830e56d1943fbf70ce7551ff026ecd3337 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 22 Oct 2016 14:32:24 +1300 Subject: Add Meiligao decoder unit test --- test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index 58d761ed8..94f91e825 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class MeiligaoProtocolDecoderTest extends ProtocolTest { MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new MeiligaoProtocol()); + verifyPosition(decoder, binary( + "2424007d0000000000000099553231303333302e3030302c562c343533342e333832342c532c30373230332e303630302c572c302e30302c302c3231313031362c2c2a31327c302e307c3332397c323030307c303030452c303030437c303244413030303145413634393541417c31307c30303030303030306e540d0a")); + verifyAttributes(decoder, binary( "4040005066104020094432990131302E312C302C3135362C302E30302C31392E36312C2D33342C33342E32362C32312E38332C372E39312C313033332C322E36392C362E35352C302C302C309DBF0D0A")); -- cgit v1.2.3 From 6e1b6dc596e50fe0460abbc252540674c72153b1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 24 Oct 2016 22:27:30 +1300 Subject: Correctly decode negative coords (fix #2479) --- src/org/traccar/helper/Parser.java | 2 +- test/org/traccar/protocol/WatchProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/helper/Parser.java b/src/org/traccar/helper/Parser.java index dcea1c8f7..2f99d6e49 100644 --- a/src/org/traccar/helper/Parser.java +++ b/src/org/traccar/helper/Parser.java @@ -155,7 +155,7 @@ public class Parser { } if (hemisphere != null && (hemisphere.equals("S") || hemisphere.equals("W") || hemisphere.equals("-"))) { - coordinate = -coordinate; + coordinate = -Math.abs(coordinate); } return coordinate; diff --git a/test/org/traccar/protocol/WatchProtocolDecoderTest.java b/test/org/traccar/protocol/WatchProtocolDecoderTest.java index 6116c2c2b..25d4f7cc2 100644 --- a/test/org/traccar/protocol/WatchProtocolDecoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class WatchProtocolDecoderTest extends ProtocolTest { WatchProtocolDecoder decoder = new WatchProtocolDecoder(new WatchProtocol()); + verifyPosition(decoder, text( + "[3G*6430073509*00E7*UD2,241016,081622,V,09.951861,N,-84.1422119,W,0.00,0.0,0.0,0,39,94,0,0,00000000,1,0,712,3,2007,18961,123,4,Luz,00:23:6a:34:ee:76,-70,familia,b0:c5:54:b9:90:ef,-78,fam salas delgado,fc:b4:e6:5d:50:ea,-81,QWERTY,c8:3a:35:43:0f:e8,-93")); + verifyPosition(decoder, text( "[3G*6105117105*008D*UD2,210716,231601,V,-33.480366,N,-70.7630692,E,0.00,0.0,0.0,0,100,34,0,0,00000000,3,255,730,2,29731,54315,167,29731,54316,162,29731,54317,145"), position("2016-07-21 23:16:01.000", false, -33.48037, -70.76307)); -- cgit v1.2.3 From 45a0a7ff45edf661f6f9a78fafb63f31207fbf43 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 25 Oct 2016 04:07:22 +1300 Subject: Fix unit test issue --- test/org/traccar/protocol/UproProtocolDecoderTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index 82d159d18..aab31ba26 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -10,7 +10,7 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(new UproProtocol()); - verifyNothing(decoder, text( + verifyPosition(decoder, text( "*AI2000905447674,BA&A2003064913201201845107561627121016&B0100000000&C05>8=961&F0333&K023101002154A7#")); verifyPosition(decoder, text( -- cgit v1.2.3 From 607d7229c7d6fee9e97fd1204016b6dda59f9be6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 25 Oct 2016 07:18:50 +1300 Subject: Add Bofan unit test cases --- test/org/traccar/protocol/Pt502ProtocolDecoderTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java index 3ea83ef60..8b1dd5ad6 100644 --- a/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Pt502ProtocolDecoderTest.java @@ -10,6 +10,15 @@ public class Pt502ProtocolDecoderTest extends ProtocolTest { Pt502ProtocolDecoder decoder = new Pt502ProtocolDecoder(new Pt502Protocol()); + verifyPosition(decoder, text( + "$HDA,20007,134657.000,A,0626.1607,N,00330.2245,E,33.38,81.79,041016,,,A/00010,00000/270,0,0,0/19948900//fa4//")); + + verifyPosition(decoder, text( + "$HDB,20007,134708.000,A,0626.1759,N,00330.3192,E,26.55,80.37,041016,,,A/00010,00000/23b,0,0,0/19949100//fa4//")); + + verifyPosition(decoder, text( + "$POS,20007,134704.000,A,0626.1698,N,00330.2870,E,31.23,79.58,041016,,,A/00010,00000/26c,0,0,0/19949100//fa4//#")); + verifyPosition(decoder, text( "$PHO6608,115099,133140.000,A,1307.1238,N,05936.4194,W,0.00,21.50,290816,,,A/00010,00000/0,0,0,0/185100//f59/")); -- cgit v1.2.3 From 70a3fd581b79556b3feb083d79228384efdf66d2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Nov 2016 03:21:21 +1300 Subject: Handle Prime AT Plus protocol --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 18 +++++++++--------- .../org/traccar/protocol/Gl200ProtocolDecoderTest.java | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index a0efc47fa..5785c08b7 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -41,7 +41,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .text("+ACK:GT") .expression("...,") // type .number("([0-9A-Z]{2}xxxx),") // protocol version - .number("(d{15}),") // imei + .number("(d{15}|x{14}),") // imei .any().text(",") .number("(dddd)(dd)(dd)") // date .number("(dd)(dd)(dd),") // time @@ -52,16 +52,16 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN_INF = new PatternBuilder() .text("+").expression("(?:RESP|BUFF):GTINF,") .number("[0-9A-Z]{2}xxxx,") // protocol version - .number("(d{15}),") // imei + .number("(d{15}|x{14}),") // imei .expression("(?:[0-9A-Z]{17},)?") // vin .expression("(?:[^,]+)?,") // device name .number("(xx),") // state - .expression("[0-9F]{20},") // iccid + .expression("(?:[0-9F]{20})?,") // iccid .number("d{1,2},") .number("d{1,2},") .expression("[01],") // external power .number("([d.]+)?,") // odometer or external power - .number("[01]?,") // backup battery + .number("d*,") // backup battery or lightness .number("(d+.d+),") // battery .expression("([01]),") // charging .number("(?:d),") // led @@ -71,7 +71,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .number("d{14},") // last fix time .groupBegin() .number("(d+),") // battery percentage - .expression("(?:[01]),") // flash type + .expression("[01]?,") // flash type .number("(-?[d.]+)?,,,") // temperature .or() .expression("(?:[01])?,").optional() // pin15 mode @@ -91,7 +91,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN_VER = new PatternBuilder() .text("+").expression("(?:RESP|BUFF):GTVER,") .number("[0-9A-Z]{2}xxxx,") // protocol version - .number("(d{15}),") // imei + .number("(d{15}|x{14}),") // imei .expression("[^,]*,") // device name .expression("([^,]*),") // device type .number("(xxxx),") // firmware version @@ -129,7 +129,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN_OBD = new PatternBuilder() .text("+RESP:GTOBD,") .number("[0-9A-Z]{2}xxxx,") // protocol version - .number("(d{15}),") // imei + .number("(d{15}|x{14}),") // imei .expression("(?:[0-9A-Z]{17})?,") // vin .expression("[^,]{0,20},") // device name .expression("[01],") // report type @@ -197,7 +197,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN_IGN = new PatternBuilder() .text("+").expression("(?:RESP|BUFF):GTIG[NF],") .number("(?:[0-9A-Z]{2}xxxx)?,") // protocol version - .number("(d{15}),") // imei + .number("(d{15}|x{14}),") // imei .expression("[^,]*,") // device name .number("d+,") // ignition off duration .expression(PATTERN_LOCATION.pattern()) @@ -213,7 +213,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN_IDA = new PatternBuilder() .text("+RESP:GTIDA,") .number("(?:[0-9A-Z]{2}xxxx)?,") // protocol version - .number("(d{15}),") // imei + .number("(d{15}|x{14}),") // imei .expression("[^,]*,,") // device name .number("([^,]+),") // rfid .expression("[01],") // report type diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index d3c82fb3a..fa8373898 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,6 +10,21 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol()); + verifyAttributes(decoder, text( + "+RESP:GTINF,210102,A10000499AEF9B,,41,,0,0,0,15.0,9,3.87,0,1,1,0,0,20161101140211,72,,,,,20161101140211,00A3$")); + + verifyAttributes(decoder, text( + "+RESP:GTNMR,210102,A10000499AEF9B,,0,0,1,9,0.0,0,288.0,-76.902364,39.578828,20161101134145,,,,,00,73,20161101134145,009F$")); + + verifyPositions(decoder, text( + "+RESP:GTFRI,210102,A10000499AEF9B,,0,1,1,9,0.5,0,288.0,-76.902364,39.578828,20161101134124,,,,,00,73,20161101134123,009D$")); + + verifyAttributes(decoder, text( + "+RESP:GTRTL,210102,A10000499AEF9B,,0,0,1,10,0.2,0,305.4,-76.902274,39.578517,20161101155001,,,,,00,73,20161101155001,00A6$")); + + verifyAttributes(decoder, text( + "+RESP:GTINF,110100,358688000000158,,41,898600810906F8048812,18,99,0,33.23,1,4.19,1,1,1,0,0,20110714104934,100,,,,,20110714104934,0014$")); + verifyAttributes(decoder, text( "+RESP:GTINF,080100,135790246811220,,16,898600810906F8048812,16,0,1,11870,,4.1,0,0,0,,20090214013254,,12340,,00,00,+0800,0,20090214093254,11F0$")); -- cgit v1.2.3 From 262069d02c8fa1a5848fab749a617bc53b928c70 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Nov 2016 06:21:30 +1300 Subject: Change TK102 protocol to binary --- src/org/traccar/protocol/Ardi01Protocol.java | 2 +- src/org/traccar/protocol/Tk102Protocol.java | 10 +--- src/org/traccar/protocol/Tk102ProtocolDecoder.java | 68 +++++++++++++++++----- test/org/traccar/ProtocolTest.java | 2 +- .../traccar/protocol/Tk102ProtocolDecoderTest.java | 45 ++++++++------ 5 files changed, 87 insertions(+), 40 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Ardi01Protocol.java b/src/org/traccar/protocol/Ardi01Protocol.java index 5b7770647..66916db17 100644 --- a/src/org/traccar/protocol/Ardi01Protocol.java +++ b/src/org/traccar/protocol/Ardi01Protocol.java @@ -37,8 +37,8 @@ public class Ardi01Protocol extends BaseProtocol { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); - pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("objectDecoder", new Ardi01ProtocolDecoder(Ardi01Protocol.this)); } }); diff --git a/src/org/traccar/protocol/Tk102Protocol.java b/src/org/traccar/protocol/Tk102Protocol.java index 7310d23bd..ad3d8affa 100644 --- a/src/org/traccar/protocol/Tk102Protocol.java +++ b/src/org/traccar/protocol/Tk102Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,8 @@ package org.traccar.protocol; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.handler.codec.string.StringDecoder; -import org.jboss.netty.handler.codec.string.StringEncoder; +import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; import org.traccar.BaseProtocol; -import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; import java.util.List; @@ -36,9 +34,7 @@ public class Tk102Protocol extends BaseProtocol { serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ']')); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 1 + 1 + 10, 1, 1, 0)); pipeline.addLast("objectDecoder", new Tk102ProtocolDecoder(Tk102Protocol.this)); } }); diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java index bb7510eb1..58eb36cff 100644 --- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ */ package org.traccar.protocol; +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; @@ -24,6 +26,7 @@ import org.traccar.helper.PatternBuilder; import org.traccar.model.Position; import java.net.SocketAddress; +import java.nio.charset.StandardCharsets; import java.util.regex.Pattern; public class Tk102ProtocolDecoder extends BaseProtocolDecoder { @@ -32,11 +35,18 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { super(protocol); } + public static final int MSG_LOGIN_REQUEST = 0x80; + public static final int MSG_LOGIN_REQUEST_2 = 0x21; + public static final int MSG_LOGIN_RESPONSE = 0x00; + public static final int MSG_HEARTBEAT_REQUEST = 0xF0; + public static final int MSG_HEARTBEAT_RESPONSE = 0xFF; + public static final int MSG_REPORT_ONCE = 0x90; + public static final int MSG_REPORT_INTERVAL = 0x93; + + public static final int MODE_GPRS = 0x30; + public static final int MODE_GPRS_SMS = 0x33; + private static final Pattern PATTERN = new PatternBuilder() - .text("[") - .expression(".") - .number("d{10}") - .expression(".") .text("(") .expression("[A-Z]+") .number("(dd)(dd)(dd)") // time @@ -45,25 +55,56 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { .number("(ddd)(dd.dddd)([EW])") // longitude .number("(ddd.ddd)") // speed .number("(dd)(dd)(dd)") // date (ddmmyy) - .number("d+") .any() .text(")") - .text("]").optional() .compile(); + private void sendResponse(Channel channel, int type, ChannelBuffer dataSequence, ChannelBuffer content) { + if (channel != null) { + ChannelBuffer response = ChannelBuffers.dynamicBuffer(); + response.writeByte('['); + response.writeByte(type); + response.writeBytes(dataSequence); + response.writeByte(content.readableBytes()); + response.writeBytes(content); + response.writeByte(']'); + channel.write(response); + } + } + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - String sentence = (String) msg; + ChannelBuffer buf = (ChannelBuffer) msg; + + buf.skipBytes(1); // header + int type = buf.readUnsignedByte(); + ChannelBuffer dataSequence = buf.readBytes(10); + int length = buf.readUnsignedByte(); - if (sentence.startsWith("[!")) { + if (type == MSG_LOGIN_REQUEST || type == MSG_LOGIN_REQUEST_2) { - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, sentence.substring(14, 14 + 15)); - if (deviceSession != null && channel != null) { - channel.write("[”0000000001" + sentence.substring(13) + "]"); + ChannelBuffer data = buf.readBytes(length); + + String id; + if (type == MSG_LOGIN_REQUEST) { + id = data.toString(StandardCharsets.US_ASCII); + } else { + id = data.copy(1, 15).toString(StandardCharsets.US_ASCII); + } + + if (getDeviceSession(channel, remoteAddress, id) != null) { + ChannelBuffer response = ChannelBuffers.dynamicBuffer(); + response.writeByte(MODE_GPRS); + response.writeBytes(data); + sendResponse(channel, MSG_LOGIN_RESPONSE, dataSequence, response); } + } else if (type == MSG_HEARTBEAT_REQUEST) { + + sendResponse(channel, MSG_HEARTBEAT_RESPONSE, dataSequence, buf.readBytes(length)); + } else { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); @@ -71,7 +112,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { return null; } - Parser parser = new Parser(PATTERN, sentence); + Parser parser = new Parser(PATTERN, buf.readBytes(length).toString(StandardCharsets.US_ASCII)); if (!parser.matches()) { return null; } @@ -92,6 +133,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { position.setTime(dateBuilder.getDate()); return position; + } return null; diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 8211e9d6d..756393288 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -62,7 +62,7 @@ public class ProtocolTest extends BaseTest { } protected ChannelBuffer buffer(String... data) { - return ChannelBuffers.copiedBuffer(concatenateStrings(data), StandardCharsets.US_ASCII); + return ChannelBuffers.copiedBuffer(concatenateStrings(data), StandardCharsets.ISO_8859_1); } protected DefaultHttpRequest request(String url) { diff --git a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java index 501466eeb..34ae1ab90 100644 --- a/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk102ProtocolDecoderTest.java @@ -10,32 +10,41 @@ public class Tk102ProtocolDecoderTest extends ProtocolTest { Tk102ProtocolDecoder decoder = new Tk102ProtocolDecoder(new Tk102Protocol()); - verifyNothing(decoder, text( - "")); + verifyNothing(decoder, buffer( + "[\u00800000000000\u000821315452]")); - verifyNothing(decoder, text( - "[!0000000081r(353327023367238,TK102-W998_01_V1.1.001_130219,255,001,255,001,0,100,100,0,internet,0000,0000,0,0,255,0,4,1,11,00)")); + verifyNothing(decoder, buffer( + "[\u00f00000000000\u000821315452]")); + + verifyPosition(decoder, buffer( + "[\u00900100100001\u0036(ONE025857A2232.0729N11356.0030E000.02109110100000000)]")); + + verifyPosition(decoder, buffer( + "[\u00900100100001\u0036(ITV025857A2232.0729N11356.0030E000.02109110100000000)]")); + + verifyNothing(decoder, buffer( + "[\u00210000000081\u0072(353327023367238,TK102-W998_01_V1.1.001_130219,255,001,255,001,0,100,100,0,internet,0000,0000,0,0,255,0,4,1,11,00)]")); - verifyNothing(decoder, text( - "[L0000001323N(GSM,0,0,07410001,20120101162600,404,010,9261,130,0,2353,130,35,9263,130,33,1)")); + verifyNothing(decoder, buffer( + "[\u004c0000001323\u004e(GSM,0,0,07410001,20120101162600,404,010,9261,130,0,2353,130,35,9263,130,33,1)]")); - verifyNothing(decoder, text( - "[%0000000082\u001d(100100000000000600-30-65535)")); + verifyNothing(decoder, buffer( + "[\u00250000000082\u001d(100100000000000600-30-65535)]")); - verifyNothing(decoder, text( - "[#0000000004\u0018(062100000000000600-0-0)")); + verifyNothing(decoder, buffer( + "[\u00230000000004\u0018(062100000000000600-0-0)]")); - verifyPosition(decoder, text( - "[=00000000836(ITV013939A4913.8317N02824.9241E000.90018031310010000)")); + verifyPosition(decoder, buffer( + "[\u003d0000000083\u0036(ITV013939A4913.8317N02824.9241E000.90018031310010000)]")); - verifyPosition(decoder, text( - "[=00000000366(ITV012209A4913.8281N02824.9258E000.32018031310010000)")); + verifyPosition(decoder, buffer( + "[\u003d0000000036\u0036(ITV012209A4913.8281N02824.9258E000.32018031310010000)]")); - verifyPosition(decoder, text( - "[;00000000106(ONE200834A5952.8114N01046.0832E003.93212071305010000)")); + verifyPosition(decoder, buffer( + "[\u003b0000000010\u0036(ONE200834A5952.8114N01046.0832E003.93212071305010000)]")); - verifyPosition(decoder, text( - "[\u00930000000000F(ITV153047A1534.0805N03233.0888E000.00029041500000400&Wsz-wl001&B0000)]")); + verifyPosition(decoder, buffer( + "[\u00930000000000\u0046(ITV153047A1534.0805N03233.0888E000.00029041500000400&Wsz-wl001&B0000)]")); } -- cgit v1.2.3 From fa01e90f6ee1381766d15494e57ccf7b3eb14ca5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Nov 2016 23:18:41 +1300 Subject: Update copyright notice emails --- src/org/traccar/BaseDataHandler.java | 2 +- src/org/traccar/BaseEventHandler.java | 2 +- src/org/traccar/BasePipelineFactory.java | 2 +- src/org/traccar/BaseProtocol.java | 2 +- src/org/traccar/BaseProtocolDecoder.java | 2 +- src/org/traccar/BaseProtocolEncoder.java | 2 +- src/org/traccar/CharacterDelimiterFrameDecoder.java | 2 +- src/org/traccar/Config.java | 2 +- src/org/traccar/Context.java | 2 +- src/org/traccar/CoordinatesHandler.java | 2 +- src/org/traccar/CopyAttributesHandler.java | 4 ++-- src/org/traccar/DefaultDataHandler.java | 2 +- src/org/traccar/DeviceSession.java | 2 +- src/org/traccar/DistanceHandler.java | 2 +- src/org/traccar/ExtendedObjectDecoder.java | 2 +- src/org/traccar/FilterHandler.java | 2 +- src/org/traccar/GlobalChannelFactory.java | 2 +- src/org/traccar/GlobalTimer.java | 2 +- src/org/traccar/HemisphereHandler.java | 2 +- src/org/traccar/LocationProviderHandler.java | 2 +- src/org/traccar/Main.java | 2 +- src/org/traccar/MainEventHandler.java | 2 +- src/org/traccar/RemoteAddressHandler.java | 2 +- src/org/traccar/ReverseGeocoderHandler.java | 2 +- src/org/traccar/ServerManager.java | 2 +- src/org/traccar/StringProtocolEncoder.java | 2 +- src/org/traccar/TrackerServer.java | 2 +- src/org/traccar/WebDataHandler.java | 2 +- src/org/traccar/api/AsyncSocket.java | 2 +- src/org/traccar/api/AsyncSocketServlet.java | 2 +- src/org/traccar/api/BaseResource.java | 2 +- src/org/traccar/api/CorsResponseFilter.java | 2 +- src/org/traccar/api/ObjectMapperProvider.java | 2 +- src/org/traccar/api/ResourceErrorHandler.java | 2 +- src/org/traccar/api/SecurityRequestFilter.java | 2 +- src/org/traccar/api/UserPrincipal.java | 2 +- src/org/traccar/api/UserSecurityContext.java | 2 +- src/org/traccar/api/resource/AttributeAliasResource.java | 4 ++-- src/org/traccar/api/resource/CommandResource.java | 2 +- src/org/traccar/api/resource/DeviceGeofenceResource.java | 2 +- src/org/traccar/api/resource/DevicePermissionResource.java | 2 +- src/org/traccar/api/resource/DeviceResource.java | 2 +- src/org/traccar/api/resource/GeofencePermissionResource.java | 2 +- src/org/traccar/api/resource/GeofenceResource.java | 2 +- src/org/traccar/api/resource/GroupGeofenceResource.java | 2 +- src/org/traccar/api/resource/GroupPermissionResource.java | 2 +- src/org/traccar/api/resource/GroupResource.java | 2 +- src/org/traccar/api/resource/NotificationResource.java | 2 +- src/org/traccar/api/resource/PositionResource.java | 2 +- src/org/traccar/api/resource/ServerResource.java | 2 +- src/org/traccar/api/resource/SessionResource.java | 2 +- src/org/traccar/api/resource/StatisticsResource.java | 2 +- src/org/traccar/api/resource/UserResource.java | 2 +- src/org/traccar/database/ActiveDevice.java | 2 +- src/org/traccar/database/AliasesManager.java | 4 ++-- src/org/traccar/database/ConnectionManager.java | 2 +- src/org/traccar/database/DataManager.java | 2 +- src/org/traccar/database/DeviceManager.java | 2 +- src/org/traccar/database/GeofenceManager.java | 2 +- src/org/traccar/database/GroupTree.java | 2 +- src/org/traccar/database/IdentityManager.java | 2 +- src/org/traccar/database/NotificationManager.java | 2 +- src/org/traccar/database/PermissionsManager.java | 2 +- src/org/traccar/database/QueryBuilder.java | 2 +- src/org/traccar/database/StatisticsManager.java | 2 +- src/org/traccar/events/AlertEventHandler.java | 2 +- src/org/traccar/events/CommandResultEventHandler.java | 2 +- src/org/traccar/events/GeofenceEventHandler.java | 2 +- src/org/traccar/events/IgnitionEventHandler.java | 4 ++-- src/org/traccar/events/MotionEventHandler.java | 2 +- src/org/traccar/events/OverspeedEventHandler.java | 2 +- src/org/traccar/geocode/Address.java | 2 +- src/org/traccar/geocode/AddressFormat.java | 2 +- src/org/traccar/geocode/GeocodeFarmReverseGeocoder.java | 2 +- src/org/traccar/geocode/GisgraphyReverseGeocoder.java | 2 +- src/org/traccar/geocode/GoogleReverseGeocoder.java | 2 +- src/org/traccar/geocode/JsonReverseGeocoder.java | 2 +- src/org/traccar/geocode/NominatimReverseGeocoder.java | 2 +- src/org/traccar/geocode/OpenCageReverseGeocoder.java | 2 +- src/org/traccar/geocode/ReverseGeocoder.java | 2 +- src/org/traccar/geofence/GeofenceCircle.java | 2 +- src/org/traccar/geofence/GeofenceGeometry.java | 2 +- src/org/traccar/geofence/GeofencePolygon.java | 2 +- src/org/traccar/helper/BcdUtil.java | 2 +- src/org/traccar/helper/BitUtil.java | 2 +- src/org/traccar/helper/Checksum.java | 2 +- src/org/traccar/helper/DateBuilder.java | 2 +- src/org/traccar/helper/DateUtil.java | 2 +- src/org/traccar/helper/DistanceCalculator.java | 2 +- src/org/traccar/helper/Hashing.java | 2 +- src/org/traccar/helper/LocationTree.java | 2 +- src/org/traccar/helper/Log.java | 2 +- src/org/traccar/helper/ObdDecoder.java | 2 +- src/org/traccar/helper/Parser.java | 2 +- src/org/traccar/helper/PatternBuilder.java | 2 +- src/org/traccar/helper/PatternUtil.java | 2 +- src/org/traccar/helper/StringFinder.java | 2 +- src/org/traccar/helper/UnitsConverter.java | 2 +- src/org/traccar/location/BaseLocationProvider.java | 2 +- src/org/traccar/location/CellInfo.java | 2 +- src/org/traccar/location/LocationProvider.java | 2 +- src/org/traccar/location/MozillaLocationProvider.java | 2 +- src/org/traccar/location/OpenCellIdLocationProvider.java | 2 +- src/org/traccar/model/AttributeAlias.java | 4 ++-- src/org/traccar/model/Command.java | 2 +- src/org/traccar/model/Device.java | 2 +- src/org/traccar/model/DeviceGeofence.java | 2 +- src/org/traccar/model/DevicePermission.java | 2 +- src/org/traccar/model/DeviceTotalDistance.java | 4 ++-- src/org/traccar/model/Event.java | 2 +- src/org/traccar/model/Extensible.java | 2 +- src/org/traccar/model/Geofence.java | 2 +- src/org/traccar/model/GeofencePermission.java | 2 +- src/org/traccar/model/Group.java | 2 +- src/org/traccar/model/GroupGeofence.java | 2 +- src/org/traccar/model/GroupPermission.java | 2 +- src/org/traccar/model/Message.java | 2 +- src/org/traccar/model/MiscFormatter.java | 2 +- src/org/traccar/model/Notification.java | 2 +- src/org/traccar/model/Position.java | 2 +- src/org/traccar/model/Server.java | 2 +- src/org/traccar/model/Statistics.java | 2 +- src/org/traccar/model/User.java | 2 +- src/org/traccar/notification/EventForwarder.java | 2 +- src/org/traccar/notification/NotificationFormatter.java | 2 +- src/org/traccar/notification/NotificationMail.java | 2 +- src/org/traccar/notification/PropertiesProvider.java | 2 +- src/org/traccar/protocol/AdmProtocol.java | 2 +- src/org/traccar/protocol/AdmProtocolDecoder.java | 2 +- src/org/traccar/protocol/ApelProtocol.java | 2 +- src/org/traccar/protocol/ApelProtocolDecoder.java | 2 +- src/org/traccar/protocol/AplicomFrameDecoder.java | 2 +- src/org/traccar/protocol/AplicomProtocol.java | 2 +- src/org/traccar/protocol/AplicomProtocolDecoder.java | 2 +- src/org/traccar/protocol/AppelloProtocol.java | 2 +- src/org/traccar/protocol/AppelloProtocolDecoder.java | 2 +- src/org/traccar/protocol/AquilaProtocol.java | 2 +- src/org/traccar/protocol/AquilaProtocolDecoder.java | 2 +- src/org/traccar/protocol/Ardi01Protocol.java | 2 +- src/org/traccar/protocol/Ardi01ProtocolDecoder.java | 2 +- src/org/traccar/protocol/ArknavProtocol.java | 2 +- src/org/traccar/protocol/ArknavProtocolDecoder.java | 2 +- src/org/traccar/protocol/ArknavX8Protocol.java | 2 +- src/org/traccar/protocol/ArknavX8ProtocolDecoder.java | 2 +- src/org/traccar/protocol/ArnaviProtocol.java | 2 +- src/org/traccar/protocol/ArnaviProtocolDecoder.java | 2 +- src/org/traccar/protocol/AstraProtocol.java | 2 +- src/org/traccar/protocol/AstraProtocolDecoder.java | 2 +- src/org/traccar/protocol/AtrackFrameDecoder.java | 2 +- src/org/traccar/protocol/AtrackProtocol.java | 2 +- src/org/traccar/protocol/AtrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/AuroProtocol.java | 2 +- src/org/traccar/protocol/AuroProtocolDecoder.java | 2 +- src/org/traccar/protocol/AutoFonFrameDecoder.java | 2 +- src/org/traccar/protocol/AutoFonProtocol.java | 2 +- src/org/traccar/protocol/AutoFonProtocolDecoder.java | 2 +- src/org/traccar/protocol/AutoGradeProtocol.java | 2 +- src/org/traccar/protocol/AutoGradeProtocolDecoder.java | 2 +- src/org/traccar/protocol/Avl301Protocol.java | 2 +- src/org/traccar/protocol/Avl301ProtocolDecoder.java | 2 +- src/org/traccar/protocol/BceFrameDecoder.java | 2 +- src/org/traccar/protocol/BceProtocol.java | 2 +- src/org/traccar/protocol/BceProtocolDecoder.java | 2 +- src/org/traccar/protocol/BlackKiteProtocol.java | 2 +- src/org/traccar/protocol/BlackKiteProtocolDecoder.java | 2 +- src/org/traccar/protocol/BoxProtocol.java | 2 +- src/org/traccar/protocol/BoxProtocolDecoder.java | 2 +- src/org/traccar/protocol/CalAmpProtocol.java | 2 +- src/org/traccar/protocol/CalAmpProtocolDecoder.java | 2 +- src/org/traccar/protocol/CarTrackProtocol.java | 2 +- src/org/traccar/protocol/CarTrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/CarcellProtocol.java | 2 +- src/org/traccar/protocol/CarcellProtocolDecoder.java | 2 +- src/org/traccar/protocol/CarcellProtocolEncoder.java | 2 +- src/org/traccar/protocol/CarscopProtocol.java | 2 +- src/org/traccar/protocol/CarscopProtocolDecoder.java | 2 +- src/org/traccar/protocol/CastelProtocol.java | 2 +- src/org/traccar/protocol/CastelProtocolDecoder.java | 2 +- src/org/traccar/protocol/CellocatorFrameDecoder.java | 2 +- src/org/traccar/protocol/CellocatorProtocol.java | 2 +- src/org/traccar/protocol/CellocatorProtocolDecoder.java | 2 +- src/org/traccar/protocol/CguardProtocol.java | 2 +- src/org/traccar/protocol/CguardProtocolDecoder.java | 2 +- src/org/traccar/protocol/CityeasyProtocol.java | 2 +- src/org/traccar/protocol/CityeasyProtocolDecoder.java | 2 +- src/org/traccar/protocol/CityeasyProtocolEncoder.java | 2 +- src/org/traccar/protocol/CradlepointProtocol.java | 2 +- src/org/traccar/protocol/CradlepointProtocolDecoder.java | 2 +- src/org/traccar/protocol/DishaProtocol.java | 2 +- src/org/traccar/protocol/DishaProtocolDecoder.java | 2 +- src/org/traccar/protocol/EasyTrackProtocol.java | 2 +- src/org/traccar/protocol/EasyTrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/EelinkProtocol.java | 2 +- src/org/traccar/protocol/EelinkProtocolDecoder.java | 2 +- src/org/traccar/protocol/EelinkProtocolEncoder.java | 2 +- src/org/traccar/protocol/EnforaProtocol.java | 2 +- src/org/traccar/protocol/EnforaProtocolDecoder.java | 2 +- src/org/traccar/protocol/ExtremTracProtocol.java | 2 +- src/org/traccar/protocol/ExtremTracProtocolDecoder.java | 2 +- src/org/traccar/protocol/FifotrackProtocol.java | 2 +- src/org/traccar/protocol/FifotrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/FlextrackProtocol.java | 2 +- src/org/traccar/protocol/FlextrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/FoxProtocol.java | 2 +- src/org/traccar/protocol/FoxProtocolDecoder.java | 2 +- src/org/traccar/protocol/FreedomProtocol.java | 2 +- src/org/traccar/protocol/FreedomProtocolDecoder.java | 2 +- src/org/traccar/protocol/GalileoFrameDecoder.java | 2 +- src/org/traccar/protocol/GalileoProtocol.java | 2 +- src/org/traccar/protocol/GalileoProtocolDecoder.java | 2 +- src/org/traccar/protocol/GatorProtocol.java | 2 +- src/org/traccar/protocol/GatorProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gl100Protocol.java | 2 +- src/org/traccar/protocol/Gl100ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gl200Protocol.java | 2 +- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gl200ProtocolEncoder.java | 2 +- src/org/traccar/protocol/GlobalSatProtocol.java | 2 +- src/org/traccar/protocol/GlobalSatProtocolDecoder.java | 2 +- src/org/traccar/protocol/GnxProtocol.java | 2 +- src/org/traccar/protocol/GnxProtocolDecoder.java | 2 +- src/org/traccar/protocol/GoSafeProtocol.java | 2 +- src/org/traccar/protocol/GoSafeProtocolDecoder.java | 2 +- src/org/traccar/protocol/GotopProtocol.java | 2 +- src/org/traccar/protocol/GotopProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gps103Protocol.java | 2 +- src/org/traccar/protocol/Gps103ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gps103ProtocolEncoder.java | 2 +- src/org/traccar/protocol/GpsGateProtocol.java | 2 +- src/org/traccar/protocol/GpsGateProtocolDecoder.java | 2 +- src/org/traccar/protocol/GpsMarkerProtocol.java | 2 +- src/org/traccar/protocol/GpsMarkerProtocolDecoder.java | 2 +- src/org/traccar/protocol/GpsmtaProtocol.java | 2 +- src/org/traccar/protocol/GpsmtaProtocolDecoder.java | 2 +- src/org/traccar/protocol/GranitFrameDecoder.java | 2 +- src/org/traccar/protocol/GranitProtocol.java | 2 +- src/org/traccar/protocol/GranitProtocolDecoder.java | 2 +- src/org/traccar/protocol/GranitProtocolEncoder.java | 2 +- src/org/traccar/protocol/Gt02Protocol.java | 2 +- src/org/traccar/protocol/Gt02ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gt06FrameDecoder.java | 2 +- src/org/traccar/protocol/Gt06Protocol.java | 2 +- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Gt06ProtocolEncoder.java | 2 +- src/org/traccar/protocol/H02FrameDecoder.java | 2 +- src/org/traccar/protocol/H02Protocol.java | 2 +- src/org/traccar/protocol/H02ProtocolDecoder.java | 2 +- src/org/traccar/protocol/H02ProtocolEncoder.java | 2 +- src/org/traccar/protocol/HaicomProtocol.java | 2 +- src/org/traccar/protocol/HaicomProtocolDecoder.java | 2 +- src/org/traccar/protocol/HomtecsProtocol.java | 2 +- src/org/traccar/protocol/HomtecsProtocolDecoder.java | 2 +- src/org/traccar/protocol/HuaShengFrameDecoder.java | 2 +- src/org/traccar/protocol/HuaShengProtocol.java | 2 +- src/org/traccar/protocol/HuaShengProtocolDecoder.java | 2 +- src/org/traccar/protocol/HuabaoFrameDecoder.java | 2 +- src/org/traccar/protocol/HuabaoProtocol.java | 2 +- src/org/traccar/protocol/HuabaoProtocolDecoder.java | 2 +- src/org/traccar/protocol/HunterProProtocol.java | 2 +- src/org/traccar/protocol/HunterProProtocolDecoder.java | 2 +- src/org/traccar/protocol/IdplProtocol.java | 2 +- src/org/traccar/protocol/IdplProtocolDecoder.java | 2 +- src/org/traccar/protocol/IntellitracFrameDecoder.java | 2 +- src/org/traccar/protocol/IntellitracProtocol.java | 2 +- src/org/traccar/protocol/IntellitracProtocolDecoder.java | 2 +- src/org/traccar/protocol/JpKorjarProtocolDecoder.java | 2 +- src/org/traccar/protocol/Jt600FrameDecoder.java | 2 +- src/org/traccar/protocol/Jt600Protocol.java | 2 +- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Jt600ProtocolEncoder.java | 2 +- src/org/traccar/protocol/KenjiProtocolDecoder.java | 2 +- src/org/traccar/protocol/KhdProtocol.java | 2 +- src/org/traccar/protocol/KhdProtocolDecoder.java | 2 +- src/org/traccar/protocol/KhdProtocolEncoder.java | 2 +- src/org/traccar/protocol/L100FrameDecoder.java | 2 +- src/org/traccar/protocol/L100Protocol.java | 2 +- src/org/traccar/protocol/L100ProtocolDecoder.java | 2 +- src/org/traccar/protocol/LaipacProtocol.java | 2 +- src/org/traccar/protocol/LaipacProtocolDecoder.java | 2 +- src/org/traccar/protocol/M2mProtocol.java | 2 +- src/org/traccar/protocol/M2mProtocolDecoder.java | 2 +- src/org/traccar/protocol/ManPowerProtocol.java | 2 +- src/org/traccar/protocol/ManPowerProtocolDecoder.java | 2 +- src/org/traccar/protocol/MegastekFrameDecoder.java | 2 +- src/org/traccar/protocol/MegastekProtocol.java | 2 +- src/org/traccar/protocol/MegastekProtocolDecoder.java | 2 +- src/org/traccar/protocol/MeiligaoFrameDecoder.java | 2 +- src/org/traccar/protocol/MeiligaoProtocol.java | 2 +- src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 2 +- src/org/traccar/protocol/MeiligaoProtocolEncoder.java | 2 +- src/org/traccar/protocol/MeitrackFrameDecoder.java | 2 +- src/org/traccar/protocol/MeitrackProtocol.java | 2 +- src/org/traccar/protocol/MeitrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/MeitrackProtocolEncoder.java | 2 +- src/org/traccar/protocol/MiniFinderProtocol.java | 2 +- src/org/traccar/protocol/MiniFinderProtocolDecoder.java | 2 +- src/org/traccar/protocol/MiniFinderProtocolEncoder.java | 2 +- src/org/traccar/protocol/Mta6Protocol.java | 2 +- src/org/traccar/protocol/Mta6ProtocolDecoder.java | 2 +- src/org/traccar/protocol/MtxProtocol.java | 2 +- src/org/traccar/protocol/MtxProtocolDecoder.java | 2 +- src/org/traccar/protocol/MxtFrameDecoder.java | 2 +- src/org/traccar/protocol/MxtProtocol.java | 2 +- src/org/traccar/protocol/MxtProtocolDecoder.java | 2 +- src/org/traccar/protocol/NavigilFrameDecoder.java | 2 +- src/org/traccar/protocol/NavigilProtocol.java | 2 +- src/org/traccar/protocol/NavigilProtocolDecoder.java | 2 +- src/org/traccar/protocol/NavisProtocol.java | 2 +- src/org/traccar/protocol/NavisProtocolDecoder.java | 2 +- src/org/traccar/protocol/NoranProtocol.java | 2 +- src/org/traccar/protocol/NoranProtocolDecoder.java | 2 +- src/org/traccar/protocol/NoranProtocolEncoder.java | 2 +- src/org/traccar/protocol/NvsFrameDecoder.java | 2 +- src/org/traccar/protocol/NvsProtocol.java | 2 +- src/org/traccar/protocol/NvsProtocolDecoder.java | 2 +- src/org/traccar/protocol/ObdDongleProtocol.java | 2 +- src/org/traccar/protocol/ObdDongleProtocolDecoder.java | 2 +- src/org/traccar/protocol/OigoProtocol.java | 2 +- src/org/traccar/protocol/OigoProtocolDecoder.java | 2 +- src/org/traccar/protocol/OrionFrameDecoder.java | 2 +- src/org/traccar/protocol/OrionProtocol.java | 2 +- src/org/traccar/protocol/OrionProtocolDecoder.java | 2 +- src/org/traccar/protocol/OsmAndProtocol.java | 2 +- src/org/traccar/protocol/OsmAndProtocolDecoder.java | 2 +- src/org/traccar/protocol/PathAwayProtocol.java | 2 +- src/org/traccar/protocol/PathAwayProtocolDecoder.java | 2 +- src/org/traccar/protocol/PiligrimProtocol.java | 2 +- src/org/traccar/protocol/PiligrimProtocolDecoder.java | 2 +- src/org/traccar/protocol/ProgressProtocol.java | 2 +- src/org/traccar/protocol/ProgressProtocolDecoder.java | 2 +- src/org/traccar/protocol/Pt3000Protocol.java | 2 +- src/org/traccar/protocol/Pt3000ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Pt502FrameDecoder.java | 2 +- src/org/traccar/protocol/Pt502Protocol.java | 2 +- src/org/traccar/protocol/Pt502ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Pt502ProtocolEncoder.java | 2 +- src/org/traccar/protocol/RaveonProtocol.java | 2 +- src/org/traccar/protocol/RaveonProtocolDecoder.java | 2 +- src/org/traccar/protocol/RitiProtocol.java | 2 +- src/org/traccar/protocol/RitiProtocolDecoder.java | 2 +- src/org/traccar/protocol/RuptelaProtocol.java | 2 +- src/org/traccar/protocol/RuptelaProtocolDecoder.java | 2 +- src/org/traccar/protocol/RuptelaProtocolEncoder.java | 2 +- src/org/traccar/protocol/SanavProtocol.java | 2 +- src/org/traccar/protocol/SanavProtocolDecoder.java | 2 +- src/org/traccar/protocol/SkypatrolProtocol.java | 2 +- src/org/traccar/protocol/SkypatrolProtocolDecoder.java | 2 +- src/org/traccar/protocol/SmokeyProtocol.java | 2 +- src/org/traccar/protocol/SmokeyProtocolDecoder.java | 2 +- src/org/traccar/protocol/Stl060FrameDecoder.java | 2 +- src/org/traccar/protocol/Stl060Protocol.java | 2 +- src/org/traccar/protocol/Stl060ProtocolDecoder.java | 2 +- src/org/traccar/protocol/SuntechProtocol.java | 2 +- src/org/traccar/protocol/SuntechProtocolDecoder.java | 2 +- src/org/traccar/protocol/SuntechProtocolEncoder.java | 2 +- src/org/traccar/protocol/SupermateProtocol.java | 2 +- src/org/traccar/protocol/SupermateProtocolDecoder.java | 2 +- src/org/traccar/protocol/T55Protocol.java | 2 +- src/org/traccar/protocol/T55ProtocolDecoder.java | 2 +- src/org/traccar/protocol/T800xProtocol.java | 2 +- src/org/traccar/protocol/T800xProtocolDecoder.java | 2 +- src/org/traccar/protocol/T800xProtocolEncoder.java | 2 +- src/org/traccar/protocol/TaipProtocol.java | 2 +- src/org/traccar/protocol/TaipProtocolDecoder.java | 2 +- src/org/traccar/protocol/TelicFrameDecoder.java | 2 +- src/org/traccar/protocol/TelicProtocol.java | 2 +- src/org/traccar/protocol/TelicProtocolDecoder.java | 2 +- src/org/traccar/protocol/TeltonikaFrameDecoder.java | 2 +- src/org/traccar/protocol/TeltonikaProtocol.java | 2 +- src/org/traccar/protocol/TeltonikaProtocolDecoder.java | 2 +- src/org/traccar/protocol/TeltonikaProtocolEncoder.java | 2 +- src/org/traccar/protocol/ThinkRaceProtocol.java | 2 +- src/org/traccar/protocol/ThinkRaceProtocolDecoder.java | 2 +- src/org/traccar/protocol/Tk102Protocol.java | 2 +- src/org/traccar/protocol/Tk102ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Tk103Protocol.java | 2 +- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Tlt2hProtocol.java | 2 +- src/org/traccar/protocol/Tlt2hProtocolDecoder.java | 2 +- src/org/traccar/protocol/TopflytechProtocol.java | 2 +- src/org/traccar/protocol/TopflytechProtocolDecoder.java | 2 +- src/org/traccar/protocol/TotemFrameDecoder.java | 2 +- src/org/traccar/protocol/TotemProtocol.java | 2 +- src/org/traccar/protocol/TotemProtocolDecoder.java | 2 +- src/org/traccar/protocol/TotemProtocolEncoder.java | 2 +- src/org/traccar/protocol/Tr20Protocol.java | 2 +- src/org/traccar/protocol/Tr20ProtocolDecoder.java | 2 +- src/org/traccar/protocol/Tr900Protocol.java | 2 +- src/org/traccar/protocol/Tr900ProtocolDecoder.java | 2 +- src/org/traccar/protocol/TrackboxProtocol.java | 2 +- src/org/traccar/protocol/TrackboxProtocolDecoder.java | 2 +- src/org/traccar/protocol/TrakMateProtocol.java | 2 +- src/org/traccar/protocol/TrakMateProtocolDecoder.java | 2 +- src/org/traccar/protocol/TramigoFrameDecoder.java | 2 +- src/org/traccar/protocol/TramigoProtocol.java | 2 +- src/org/traccar/protocol/TramigoProtocolDecoder.java | 2 +- src/org/traccar/protocol/TrvProtocol.java | 2 +- src/org/traccar/protocol/TrvProtocolDecoder.java | 2 +- src/org/traccar/protocol/Tt8850Protocol.java | 2 +- src/org/traccar/protocol/Tt8850ProtocolDecoder.java | 2 +- src/org/traccar/protocol/TytanProtocol.java | 2 +- src/org/traccar/protocol/TytanProtocolDecoder.java | 2 +- src/org/traccar/protocol/TzoneProtocol.java | 2 +- src/org/traccar/protocol/TzoneProtocolDecoder.java | 2 +- src/org/traccar/protocol/UlbotechFrameDecoder.java | 2 +- src/org/traccar/protocol/UlbotechProtocol.java | 2 +- src/org/traccar/protocol/UlbotechProtocolDecoder.java | 2 +- src/org/traccar/protocol/UproProtocol.java | 2 +- src/org/traccar/protocol/UproProtocolDecoder.java | 2 +- src/org/traccar/protocol/V680Protocol.java | 2 +- src/org/traccar/protocol/V680ProtocolDecoder.java | 2 +- src/org/traccar/protocol/VisiontekProtocol.java | 2 +- src/org/traccar/protocol/VisiontekProtocolDecoder.java | 2 +- src/org/traccar/protocol/WatchProtocol.java | 2 +- src/org/traccar/protocol/WatchProtocolDecoder.java | 2 +- src/org/traccar/protocol/WatchProtocolEncoder.java | 2 +- src/org/traccar/protocol/WialonProtocol.java | 2 +- src/org/traccar/protocol/WialonProtocolDecoder.java | 2 +- src/org/traccar/protocol/WialonProtocolEncoder.java | 4 ++-- src/org/traccar/protocol/WondexFrameDecoder.java | 2 +- src/org/traccar/protocol/WondexProtocol.java | 2 +- src/org/traccar/protocol/WondexProtocolDecoder.java | 2 +- src/org/traccar/protocol/WondexProtocolEncoder.java | 2 +- src/org/traccar/protocol/XexunFrameDecoder.java | 2 +- src/org/traccar/protocol/XexunProtocol.java | 2 +- src/org/traccar/protocol/XexunProtocolDecoder.java | 2 +- src/org/traccar/protocol/XirgoProtocol.java | 2 +- src/org/traccar/protocol/XirgoProtocolDecoder.java | 2 +- src/org/traccar/protocol/Xt013Protocol.java | 2 +- src/org/traccar/protocol/Xt013ProtocolDecoder.java | 2 +- src/org/traccar/protocol/YwtProtocol.java | 2 +- src/org/traccar/protocol/YwtProtocolDecoder.java | 2 +- src/org/traccar/reports/Events.java | 4 ++-- src/org/traccar/reports/ReportUtils.java | 4 ++-- src/org/traccar/reports/Route.java | 4 ++-- src/org/traccar/reports/Summary.java | 4 ++-- src/org/traccar/reports/Trips.java | 4 ++-- src/org/traccar/reports/model/BaseReport.java | 4 ++-- src/org/traccar/reports/model/DeviceReport.java | 4 ++-- src/org/traccar/reports/model/SummaryReport.java | 4 ++-- src/org/traccar/reports/model/TripReport.java | 4 ++-- src/org/traccar/web/ConsoleServlet.java | 2 +- src/org/traccar/web/CsvBuilder.java | 4 ++-- src/org/traccar/web/GpxBuilder.java | 4 ++-- src/org/traccar/web/JsonConverter.java | 2 +- src/org/traccar/web/WebServer.java | 2 +- test/org/traccar/notification/NotificiationMailTest.java | 2 +- 447 files changed, 465 insertions(+), 465 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/BaseDataHandler.java b/src/org/traccar/BaseDataHandler.java index 5ab124a79..0c71a6a4d 100644 --- a/src/org/traccar/BaseDataHandler.java +++ b/src/org/traccar/BaseDataHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/BaseEventHandler.java b/src/org/traccar/BaseEventHandler.java index 82e78c6b3..588406bf4 100644 --- a/src/org/traccar/BaseEventHandler.java +++ b/src/org/traccar/BaseEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 6d7089644..22bb80ca1 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/BaseProtocol.java b/src/org/traccar/BaseProtocol.java index eb09022f5..4cbb5bd7c 100644 --- a/src/org/traccar/BaseProtocol.java +++ b/src/org/traccar/BaseProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index f1101567d..d8130c79e 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/BaseProtocolEncoder.java b/src/org/traccar/BaseProtocolEncoder.java index a9aa24cb0..5c2c503e4 100644 --- a/src/org/traccar/BaseProtocolEncoder.java +++ b/src/org/traccar/BaseProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/CharacterDelimiterFrameDecoder.java b/src/org/traccar/CharacterDelimiterFrameDecoder.java index 96e86a947..d71974e78 100644 --- a/src/org/traccar/CharacterDelimiterFrameDecoder.java +++ b/src/org/traccar/CharacterDelimiterFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/Config.java b/src/org/traccar/Config.java index e63444f1f..e59c3c554 100644 --- a/src/org/traccar/Config.java +++ b/src/org/traccar/Config.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 827761cc5..581f00082 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/CoordinatesHandler.java b/src/org/traccar/CoordinatesHandler.java index b9c33dc2b..80a423da1 100644 --- a/src/org/traccar/CoordinatesHandler.java +++ b/src/org/traccar/CoordinatesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/CopyAttributesHandler.java b/src/org/traccar/CopyAttributesHandler.java index 10a065113..c4cac2e7f 100644 --- a/src/org/traccar/CopyAttributesHandler.java +++ b/src/org/traccar/CopyAttributesHandler.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/DefaultDataHandler.java b/src/org/traccar/DefaultDataHandler.java index 7194c6a77..e32fe0e7d 100644 --- a/src/org/traccar/DefaultDataHandler.java +++ b/src/org/traccar/DefaultDataHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/DeviceSession.java b/src/org/traccar/DeviceSession.java index 5e2686f23..36958287d 100644 --- a/src/org/traccar/DeviceSession.java +++ b/src/org/traccar/DeviceSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/DistanceHandler.java b/src/org/traccar/DistanceHandler.java index 7537e2867..138fc85d6 100644 --- a/src/org/traccar/DistanceHandler.java +++ b/src/org/traccar/DistanceHandler.java @@ -1,6 +1,6 @@ /* * Copyright 2015 Amila Silva - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/ExtendedObjectDecoder.java b/src/org/traccar/ExtendedObjectDecoder.java index 1cfc93541..ec03afa60 100644 --- a/src/org/traccar/ExtendedObjectDecoder.java +++ b/src/org/traccar/ExtendedObjectDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index f9904ccaf..40676c72d 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/GlobalChannelFactory.java b/src/org/traccar/GlobalChannelFactory.java index aa4f855c5..c5cd1a697 100644 --- a/src/org/traccar/GlobalChannelFactory.java +++ b/src/org/traccar/GlobalChannelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/GlobalTimer.java b/src/org/traccar/GlobalTimer.java index f5dc9b87a..70e6e2e45 100644 --- a/src/org/traccar/GlobalTimer.java +++ b/src/org/traccar/GlobalTimer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/HemisphereHandler.java b/src/org/traccar/HemisphereHandler.java index b46d0791c..b1e7d3fb2 100644 --- a/src/org/traccar/HemisphereHandler.java +++ b/src/org/traccar/HemisphereHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/LocationProviderHandler.java b/src/org/traccar/LocationProviderHandler.java index 8d5647d4b..d47f05bd1 100644 --- a/src/org/traccar/LocationProviderHandler.java +++ b/src/org/traccar/LocationProviderHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java index e992691ad..21625d3c1 100644 --- a/src/org/traccar/Main.java +++ b/src/org/traccar/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java index 9f172c584..ec31c5efd 100644 --- a/src/org/traccar/MainEventHandler.java +++ b/src/org/traccar/MainEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/RemoteAddressHandler.java b/src/org/traccar/RemoteAddressHandler.java index 3d9695dab..188bbcab9 100644 --- a/src/org/traccar/RemoteAddressHandler.java +++ b/src/org/traccar/RemoteAddressHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/ReverseGeocoderHandler.java b/src/org/traccar/ReverseGeocoderHandler.java index 0b4fd53ce..88875fb3a 100644 --- a/src/org/traccar/ReverseGeocoderHandler.java +++ b/src/org/traccar/ReverseGeocoderHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 010438a44..953428b8f 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/StringProtocolEncoder.java b/src/org/traccar/StringProtocolEncoder.java index 119b40cc4..1945ae174 100644 --- a/src/org/traccar/StringProtocolEncoder.java +++ b/src/org/traccar/StringProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/TrackerServer.java b/src/org/traccar/TrackerServer.java index 7bbab071d..108688fb8 100644 --- a/src/org/traccar/TrackerServer.java +++ b/src/org/traccar/TrackerServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java index b179fac8f..b9de37ed2 100644 --- a/src/org/traccar/WebDataHandler.java +++ b/src/org/traccar/WebDataHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/AsyncSocket.java b/src/org/traccar/api/AsyncSocket.java index 4422dbccd..7ac3810fa 100644 --- a/src/org/traccar/api/AsyncSocket.java +++ b/src/org/traccar/api/AsyncSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/AsyncSocketServlet.java b/src/org/traccar/api/AsyncSocketServlet.java index ef6cef732..9318b6fc6 100644 --- a/src/org/traccar/api/AsyncSocketServlet.java +++ b/src/org/traccar/api/AsyncSocketServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/BaseResource.java b/src/org/traccar/api/BaseResource.java index 567b9735a..44ef33c53 100644 --- a/src/org/traccar/api/BaseResource.java +++ b/src/org/traccar/api/BaseResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/CorsResponseFilter.java b/src/org/traccar/api/CorsResponseFilter.java index 459fcee66..70ea7e3e1 100644 --- a/src/org/traccar/api/CorsResponseFilter.java +++ b/src/org/traccar/api/CorsResponseFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/ObjectMapperProvider.java b/src/org/traccar/api/ObjectMapperProvider.java index 6f654118a..c916c1f4c 100644 --- a/src/org/traccar/api/ObjectMapperProvider.java +++ b/src/org/traccar/api/ObjectMapperProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/ResourceErrorHandler.java b/src/org/traccar/api/ResourceErrorHandler.java index 2f0c21a63..1d618b08d 100644 --- a/src/org/traccar/api/ResourceErrorHandler.java +++ b/src/org/traccar/api/ResourceErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java index 9e0f03de7..fd4c77525 100644 --- a/src/org/traccar/api/SecurityRequestFilter.java +++ b/src/org/traccar/api/SecurityRequestFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/UserPrincipal.java b/src/org/traccar/api/UserPrincipal.java index 25fcdb233..80e92c2dd 100644 --- a/src/org/traccar/api/UserPrincipal.java +++ b/src/org/traccar/api/UserPrincipal.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/UserSecurityContext.java b/src/org/traccar/api/UserSecurityContext.java index 0ff67a0f8..55c0621bc 100644 --- a/src/org/traccar/api/UserSecurityContext.java +++ b/src/org/traccar/api/UserSecurityContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/AttributeAliasResource.java b/src/org/traccar/api/resource/AttributeAliasResource.java index 2417fb0ec..9e01432d3 100644 --- a/src/org/traccar/api/resource/AttributeAliasResource.java +++ b/src/org/traccar/api/resource/AttributeAliasResource.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/CommandResource.java b/src/org/traccar/api/resource/CommandResource.java index f41faae2e..cce2dac2b 100644 --- a/src/org/traccar/api/resource/CommandResource.java +++ b/src/org/traccar/api/resource/CommandResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/DeviceGeofenceResource.java b/src/org/traccar/api/resource/DeviceGeofenceResource.java index 27535617d..6254fe3cf 100644 --- a/src/org/traccar/api/resource/DeviceGeofenceResource.java +++ b/src/org/traccar/api/resource/DeviceGeofenceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/DevicePermissionResource.java b/src/org/traccar/api/resource/DevicePermissionResource.java index 7faa1ab09..3b89507fa 100644 --- a/src/org/traccar/api/resource/DevicePermissionResource.java +++ b/src/org/traccar/api/resource/DevicePermissionResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index 1f65fa041..f20ed86ad 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/GeofencePermissionResource.java b/src/org/traccar/api/resource/GeofencePermissionResource.java index 3a82845f5..8faa63d85 100644 --- a/src/org/traccar/api/resource/GeofencePermissionResource.java +++ b/src/org/traccar/api/resource/GeofencePermissionResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/GeofenceResource.java b/src/org/traccar/api/resource/GeofenceResource.java index 615606cdc..df5eb2414 100644 --- a/src/org/traccar/api/resource/GeofenceResource.java +++ b/src/org/traccar/api/resource/GeofenceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/GroupGeofenceResource.java b/src/org/traccar/api/resource/GroupGeofenceResource.java index 1ef495a86..81fd4e45f 100644 --- a/src/org/traccar/api/resource/GroupGeofenceResource.java +++ b/src/org/traccar/api/resource/GroupGeofenceResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/GroupPermissionResource.java b/src/org/traccar/api/resource/GroupPermissionResource.java index 94100362b..07f101765 100644 --- a/src/org/traccar/api/resource/GroupPermissionResource.java +++ b/src/org/traccar/api/resource/GroupPermissionResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/GroupResource.java b/src/org/traccar/api/resource/GroupResource.java index 6b722ef6d..0bc42ea97 100644 --- a/src/org/traccar/api/resource/GroupResource.java +++ b/src/org/traccar/api/resource/GroupResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/NotificationResource.java b/src/org/traccar/api/resource/NotificationResource.java index 5bec7fd85..9010babf2 100644 --- a/src/org/traccar/api/resource/NotificationResource.java +++ b/src/org/traccar/api/resource/NotificationResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/PositionResource.java b/src/org/traccar/api/resource/PositionResource.java index 1ba126b62..c1cfc0b5c 100644 --- a/src/org/traccar/api/resource/PositionResource.java +++ b/src/org/traccar/api/resource/PositionResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/ServerResource.java b/src/org/traccar/api/resource/ServerResource.java index 0ca0d62aa..034a5c492 100644 --- a/src/org/traccar/api/resource/ServerResource.java +++ b/src/org/traccar/api/resource/ServerResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/SessionResource.java b/src/org/traccar/api/resource/SessionResource.java index deed70b37..2847e41c1 100644 --- a/src/org/traccar/api/resource/SessionResource.java +++ b/src/org/traccar/api/resource/SessionResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/StatisticsResource.java b/src/org/traccar/api/resource/StatisticsResource.java index f63fc0ddb..e801d4ff3 100644 --- a/src/org/traccar/api/resource/StatisticsResource.java +++ b/src/org/traccar/api/resource/StatisticsResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java index 7790dc908..f0a8597cc 100644 --- a/src/org/traccar/api/resource/UserResource.java +++ b/src/org/traccar/api/resource/UserResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/ActiveDevice.java b/src/org/traccar/database/ActiveDevice.java index 3f2510af1..6109bc517 100644 --- a/src/org/traccar/database/ActiveDevice.java +++ b/src/org/traccar/database/ActiveDevice.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/AliasesManager.java b/src/org/traccar/database/AliasesManager.java index 6c09e8731..4f4f09731 100644 --- a/src/org/traccar/database/AliasesManager.java +++ b/src/org/traccar/database/AliasesManager.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index 2017e81a0..216c90bc2 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index e98e1429c..afa8b1677 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index f71b9308c..5681602fe 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/GeofenceManager.java b/src/org/traccar/database/GeofenceManager.java index 74dff70f4..e2e0c12d4 100644 --- a/src/org/traccar/database/GeofenceManager.java +++ b/src/org/traccar/database/GeofenceManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/GroupTree.java b/src/org/traccar/database/GroupTree.java index 9062e7aa8..8798f55bc 100644 --- a/src/org/traccar/database/GroupTree.java +++ b/src/org/traccar/database/GroupTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/IdentityManager.java b/src/org/traccar/database/IdentityManager.java index 8507d1f2e..db8e9c1c7 100644 --- a/src/org/traccar/database/IdentityManager.java +++ b/src/org/traccar/database/IdentityManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 779f42483..110f699b7 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index b9707ab7d..b0ae504d0 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java index 1a83daab9..50d689a2a 100644 --- a/src/org/traccar/database/QueryBuilder.java +++ b/src/org/traccar/database/QueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/database/StatisticsManager.java b/src/org/traccar/database/StatisticsManager.java index b9af4d9b7..5b0aa5f41 100644 --- a/src/org/traccar/database/StatisticsManager.java +++ b/src/org/traccar/database/StatisticsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/events/AlertEventHandler.java b/src/org/traccar/events/AlertEventHandler.java index 61c2d7b16..296fe488c 100644 --- a/src/org/traccar/events/AlertEventHandler.java +++ b/src/org/traccar/events/AlertEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/events/CommandResultEventHandler.java b/src/org/traccar/events/CommandResultEventHandler.java index 3f4ff521b..aaa1d23f0 100644 --- a/src/org/traccar/events/CommandResultEventHandler.java +++ b/src/org/traccar/events/CommandResultEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/events/GeofenceEventHandler.java b/src/org/traccar/events/GeofenceEventHandler.java index 6126331bd..d31e516ef 100644 --- a/src/org/traccar/events/GeofenceEventHandler.java +++ b/src/org/traccar/events/GeofenceEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/events/IgnitionEventHandler.java b/src/org/traccar/events/IgnitionEventHandler.java index e241e450b..b52083f57 100644 --- a/src/org/traccar/events/IgnitionEventHandler.java +++ b/src/org/traccar/events/IgnitionEventHandler.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java index 33c7735cd..db19535a0 100644 --- a/src/org/traccar/events/MotionEventHandler.java +++ b/src/org/traccar/events/MotionEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/events/OverspeedEventHandler.java b/src/org/traccar/events/OverspeedEventHandler.java index 57f60d864..c3e3e19cb 100644 --- a/src/org/traccar/events/OverspeedEventHandler.java +++ b/src/org/traccar/events/OverspeedEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/Address.java b/src/org/traccar/geocode/Address.java index 144a49474..d77602f2c 100644 --- a/src/org/traccar/geocode/Address.java +++ b/src/org/traccar/geocode/Address.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/AddressFormat.java b/src/org/traccar/geocode/AddressFormat.java index a2a0862bf..8046abfd7 100644 --- a/src/org/traccar/geocode/AddressFormat.java +++ b/src/org/traccar/geocode/AddressFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/GeocodeFarmReverseGeocoder.java b/src/org/traccar/geocode/GeocodeFarmReverseGeocoder.java index 306fc25b8..477eec15b 100644 --- a/src/org/traccar/geocode/GeocodeFarmReverseGeocoder.java +++ b/src/org/traccar/geocode/GeocodeFarmReverseGeocoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/GisgraphyReverseGeocoder.java b/src/org/traccar/geocode/GisgraphyReverseGeocoder.java index 18f59c7b0..dd5e1ff5b 100644 --- a/src/org/traccar/geocode/GisgraphyReverseGeocoder.java +++ b/src/org/traccar/geocode/GisgraphyReverseGeocoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/GoogleReverseGeocoder.java b/src/org/traccar/geocode/GoogleReverseGeocoder.java index 1f607df78..b9835440e 100644 --- a/src/org/traccar/geocode/GoogleReverseGeocoder.java +++ b/src/org/traccar/geocode/GoogleReverseGeocoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/JsonReverseGeocoder.java b/src/org/traccar/geocode/JsonReverseGeocoder.java index dcc880ef9..c107d24e8 100644 --- a/src/org/traccar/geocode/JsonReverseGeocoder.java +++ b/src/org/traccar/geocode/JsonReverseGeocoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/NominatimReverseGeocoder.java b/src/org/traccar/geocode/NominatimReverseGeocoder.java index c1481d1cb..0fbeaef83 100644 --- a/src/org/traccar/geocode/NominatimReverseGeocoder.java +++ b/src/org/traccar/geocode/NominatimReverseGeocoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/OpenCageReverseGeocoder.java b/src/org/traccar/geocode/OpenCageReverseGeocoder.java index b5b31179e..df447d59e 100644 --- a/src/org/traccar/geocode/OpenCageReverseGeocoder.java +++ b/src/org/traccar/geocode/OpenCageReverseGeocoder.java @@ -1,6 +1,6 @@ /* * Copyright 2014 - 2015 Stefaan Van Dooren (stefaan.vandooren@gmail.com) - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geocode/ReverseGeocoder.java b/src/org/traccar/geocode/ReverseGeocoder.java index 5d985fb31..e2641fa37 100644 --- a/src/org/traccar/geocode/ReverseGeocoder.java +++ b/src/org/traccar/geocode/ReverseGeocoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geofence/GeofenceCircle.java b/src/org/traccar/geofence/GeofenceCircle.java index a36620aec..d78734714 100644 --- a/src/org/traccar/geofence/GeofenceCircle.java +++ b/src/org/traccar/geofence/GeofenceCircle.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geofence/GeofenceGeometry.java b/src/org/traccar/geofence/GeofenceGeometry.java index e717ede0b..6b5b0acb7 100644 --- a/src/org/traccar/geofence/GeofenceGeometry.java +++ b/src/org/traccar/geofence/GeofenceGeometry.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index 33d91c0ff..03638d6c9 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/BcdUtil.java b/src/org/traccar/helper/BcdUtil.java index a248daf22..495f94104 100644 --- a/src/org/traccar/helper/BcdUtil.java +++ b/src/org/traccar/helper/BcdUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/BitUtil.java b/src/org/traccar/helper/BitUtil.java index 31271a691..b6108edff 100644 --- a/src/org/traccar/helper/BitUtil.java +++ b/src/org/traccar/helper/BitUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/Checksum.java b/src/org/traccar/helper/Checksum.java index 815962be0..629f6e7ca 100644 --- a/src/org/traccar/helper/Checksum.java +++ b/src/org/traccar/helper/Checksum.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/DateBuilder.java b/src/org/traccar/helper/DateBuilder.java index bf4432efc..6e1b779f0 100644 --- a/src/org/traccar/helper/DateBuilder.java +++ b/src/org/traccar/helper/DateBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/DateUtil.java b/src/org/traccar/helper/DateUtil.java index c2e691d5d..ad8534eb8 100644 --- a/src/org/traccar/helper/DateUtil.java +++ b/src/org/traccar/helper/DateUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/DistanceCalculator.java b/src/org/traccar/helper/DistanceCalculator.java index d191a27af..3452597ab 100644 --- a/src/org/traccar/helper/DistanceCalculator.java +++ b/src/org/traccar/helper/DistanceCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/Hashing.java b/src/org/traccar/helper/Hashing.java index 38ae5813e..55086bac7 100644 --- a/src/org/traccar/helper/Hashing.java +++ b/src/org/traccar/helper/Hashing.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/LocationTree.java b/src/org/traccar/helper/LocationTree.java index 5e16fc095..3aff3ce33 100644 --- a/src/org/traccar/helper/LocationTree.java +++ b/src/org/traccar/helper/LocationTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/Log.java b/src/org/traccar/helper/Log.java index d13210a17..bdf83c4f3 100644 --- a/src/org/traccar/helper/Log.java +++ b/src/org/traccar/helper/Log.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/ObdDecoder.java b/src/org/traccar/helper/ObdDecoder.java index 5a75fa368..aea23ca60 100644 --- a/src/org/traccar/helper/ObdDecoder.java +++ b/src/org/traccar/helper/ObdDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/Parser.java b/src/org/traccar/helper/Parser.java index 2f99d6e49..d64993ccb 100644 --- a/src/org/traccar/helper/Parser.java +++ b/src/org/traccar/helper/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/PatternBuilder.java b/src/org/traccar/helper/PatternBuilder.java index 1e7613043..f3de5c1e5 100644 --- a/src/org/traccar/helper/PatternBuilder.java +++ b/src/org/traccar/helper/PatternBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/PatternUtil.java b/src/org/traccar/helper/PatternUtil.java index f665eb30d..c308012e6 100644 --- a/src/org/traccar/helper/PatternUtil.java +++ b/src/org/traccar/helper/PatternUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/StringFinder.java b/src/org/traccar/helper/StringFinder.java index 6c1dafcfd..2fa0aa9a4 100644 --- a/src/org/traccar/helper/StringFinder.java +++ b/src/org/traccar/helper/StringFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/helper/UnitsConverter.java b/src/org/traccar/helper/UnitsConverter.java index 70916727e..00b00861e 100644 --- a/src/org/traccar/helper/UnitsConverter.java +++ b/src/org/traccar/helper/UnitsConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/location/BaseLocationProvider.java b/src/org/traccar/location/BaseLocationProvider.java index 7778cc0c5..d228685e2 100644 --- a/src/org/traccar/location/BaseLocationProvider.java +++ b/src/org/traccar/location/BaseLocationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/location/CellInfo.java b/src/org/traccar/location/CellInfo.java index fe61f3bec..2257cb1e8 100644 --- a/src/org/traccar/location/CellInfo.java +++ b/src/org/traccar/location/CellInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/location/LocationProvider.java b/src/org/traccar/location/LocationProvider.java index 2bff1a7ca..cc445c2b3 100644 --- a/src/org/traccar/location/LocationProvider.java +++ b/src/org/traccar/location/LocationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/location/MozillaLocationProvider.java b/src/org/traccar/location/MozillaLocationProvider.java index d30fbf642..37040a95e 100644 --- a/src/org/traccar/location/MozillaLocationProvider.java +++ b/src/org/traccar/location/MozillaLocationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/location/OpenCellIdLocationProvider.java b/src/org/traccar/location/OpenCellIdLocationProvider.java index 94cc1a4e4..d5d1b0ace 100644 --- a/src/org/traccar/location/OpenCellIdLocationProvider.java +++ b/src/org/traccar/location/OpenCellIdLocationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/AttributeAlias.java b/src/org/traccar/model/AttributeAlias.java index 023925ac3..2835c0558 100644 --- a/src/org/traccar/model/AttributeAlias.java +++ b/src/org/traccar/model/AttributeAlias.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java index 67c624fcd..51a61b966 100644 --- a/src/org/traccar/model/Command.java +++ b/src/org/traccar/model/Command.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Device.java b/src/org/traccar/model/Device.java index 821984c47..e492a6120 100644 --- a/src/org/traccar/model/Device.java +++ b/src/org/traccar/model/Device.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/DeviceGeofence.java b/src/org/traccar/model/DeviceGeofence.java index 05f06bb3d..00c99add6 100644 --- a/src/org/traccar/model/DeviceGeofence.java +++ b/src/org/traccar/model/DeviceGeofence.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/DevicePermission.java b/src/org/traccar/model/DevicePermission.java index b3bc0cae0..c62173132 100644 --- a/src/org/traccar/model/DevicePermission.java +++ b/src/org/traccar/model/DevicePermission.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/DeviceTotalDistance.java b/src/org/traccar/model/DeviceTotalDistance.java index 1faa7ce11..4c89b7689 100644 --- a/src/org/traccar/model/DeviceTotalDistance.java +++ b/src/org/traccar/model/DeviceTotalDistance.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Event.java b/src/org/traccar/model/Event.java index 5b4b0e089..cdb79f04d 100644 --- a/src/org/traccar/model/Event.java +++ b/src/org/traccar/model/Event.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Extensible.java b/src/org/traccar/model/Extensible.java index eceeccadf..efe60fb75 100644 --- a/src/org/traccar/model/Extensible.java +++ b/src/org/traccar/model/Extensible.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java index 9a60f784f..ecfd3101c 100644 --- a/src/org/traccar/model/Geofence.java +++ b/src/org/traccar/model/Geofence.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/GeofencePermission.java b/src/org/traccar/model/GeofencePermission.java index 269918d66..464f4e9eb 100644 --- a/src/org/traccar/model/GeofencePermission.java +++ b/src/org/traccar/model/GeofencePermission.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Group.java b/src/org/traccar/model/Group.java index e70b3f3d5..c21d43127 100644 --- a/src/org/traccar/model/Group.java +++ b/src/org/traccar/model/Group.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/GroupGeofence.java b/src/org/traccar/model/GroupGeofence.java index 0e261fd54..736e6c704 100644 --- a/src/org/traccar/model/GroupGeofence.java +++ b/src/org/traccar/model/GroupGeofence.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/GroupPermission.java b/src/org/traccar/model/GroupPermission.java index 9b0011575..59b41b049 100644 --- a/src/org/traccar/model/GroupPermission.java +++ b/src/org/traccar/model/GroupPermission.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Message.java b/src/org/traccar/model/Message.java index 55d9fd0c7..ab472202b 100644 --- a/src/org/traccar/model/Message.java +++ b/src/org/traccar/model/Message.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/MiscFormatter.java b/src/org/traccar/model/MiscFormatter.java index 9bb856400..6194a998f 100644 --- a/src/org/traccar/model/MiscFormatter.java +++ b/src/org/traccar/model/MiscFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Notification.java b/src/org/traccar/model/Notification.java index 0664d6a00..64e1ac60c 100644 --- a/src/org/traccar/model/Notification.java +++ b/src/org/traccar/model/Notification.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index abe8dd813..183fab72f 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java index b922c4340..060a7d1d6 100644 --- a/src/org/traccar/model/Server.java +++ b/src/org/traccar/model/Server.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/Statistics.java b/src/org/traccar/model/Statistics.java index 0461ebd7e..f458ddfad 100644 --- a/src/org/traccar/model/Statistics.java +++ b/src/org/traccar/model/Statistics.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java index 860c91629..aa0b33713 100644 --- a/src/org/traccar/model/User.java +++ b/src/org/traccar/model/User.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/notification/EventForwarder.java b/src/org/traccar/notification/EventForwarder.java index 6a1dc32a4..9bd116339 100644 --- a/src/org/traccar/notification/EventForwarder.java +++ b/src/org/traccar/notification/EventForwarder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java index ae1a58d3a..b48fe9efc 100644 --- a/src/org/traccar/notification/NotificationFormatter.java +++ b/src/org/traccar/notification/NotificationFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java index 1298a484d..c7c1d689c 100644 --- a/src/org/traccar/notification/NotificationMail.java +++ b/src/org/traccar/notification/NotificationMail.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/notification/PropertiesProvider.java b/src/org/traccar/notification/PropertiesProvider.java index 9a7338591..9136288f8 100644 --- a/src/org/traccar/notification/PropertiesProvider.java +++ b/src/org/traccar/notification/PropertiesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AdmProtocol.java b/src/org/traccar/protocol/AdmProtocol.java index 067ccf053..442121f0a 100644 --- a/src/org/traccar/protocol/AdmProtocol.java +++ b/src/org/traccar/protocol/AdmProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AdmProtocolDecoder.java b/src/org/traccar/protocol/AdmProtocolDecoder.java index e234e3f0b..72a6e5bce 100644 --- a/src/org/traccar/protocol/AdmProtocolDecoder.java +++ b/src/org/traccar/protocol/AdmProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ApelProtocol.java b/src/org/traccar/protocol/ApelProtocol.java index 47bce37a0..690b5ed99 100644 --- a/src/org/traccar/protocol/ApelProtocol.java +++ b/src/org/traccar/protocol/ApelProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java index f10c4b5b1..aa58e478f 100644 --- a/src/org/traccar/protocol/ApelProtocolDecoder.java +++ b/src/org/traccar/protocol/ApelProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AplicomFrameDecoder.java b/src/org/traccar/protocol/AplicomFrameDecoder.java index 8a896535c..785d90767 100644 --- a/src/org/traccar/protocol/AplicomFrameDecoder.java +++ b/src/org/traccar/protocol/AplicomFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AplicomProtocol.java b/src/org/traccar/protocol/AplicomProtocol.java index 5155133c9..80f6f528f 100644 --- a/src/org/traccar/protocol/AplicomProtocol.java +++ b/src/org/traccar/protocol/AplicomProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index d1f92ea0a..8c06aad6f 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AppelloProtocol.java b/src/org/traccar/protocol/AppelloProtocol.java index b129a7520..8581850a1 100755 --- a/src/org/traccar/protocol/AppelloProtocol.java +++ b/src/org/traccar/protocol/AppelloProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AppelloProtocolDecoder.java b/src/org/traccar/protocol/AppelloProtocolDecoder.java index 4535464ed..02c966834 100755 --- a/src/org/traccar/protocol/AppelloProtocolDecoder.java +++ b/src/org/traccar/protocol/AppelloProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AquilaProtocol.java b/src/org/traccar/protocol/AquilaProtocol.java index 9607edd55..c1de71cd3 100644 --- a/src/org/traccar/protocol/AquilaProtocol.java +++ b/src/org/traccar/protocol/AquilaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AquilaProtocolDecoder.java b/src/org/traccar/protocol/AquilaProtocolDecoder.java index 514448d9b..1ce763463 100644 --- a/src/org/traccar/protocol/AquilaProtocolDecoder.java +++ b/src/org/traccar/protocol/AquilaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Ardi01Protocol.java b/src/org/traccar/protocol/Ardi01Protocol.java index 66916db17..446592bd0 100644 --- a/src/org/traccar/protocol/Ardi01Protocol.java +++ b/src/org/traccar/protocol/Ardi01Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Ardi01ProtocolDecoder.java b/src/org/traccar/protocol/Ardi01ProtocolDecoder.java index 1eaa65d84..71beb7d1d 100644 --- a/src/org/traccar/protocol/Ardi01ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ardi01ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ArknavProtocol.java b/src/org/traccar/protocol/ArknavProtocol.java index 6b9398f68..c22e5f443 100644 --- a/src/org/traccar/protocol/ArknavProtocol.java +++ b/src/org/traccar/protocol/ArknavProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ArknavProtocolDecoder.java b/src/org/traccar/protocol/ArknavProtocolDecoder.java index 6c6edc905..d6abd4134 100644 --- a/src/org/traccar/protocol/ArknavProtocolDecoder.java +++ b/src/org/traccar/protocol/ArknavProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ArknavX8Protocol.java b/src/org/traccar/protocol/ArknavX8Protocol.java index 3b78a27ff..e759b5294 100644 --- a/src/org/traccar/protocol/ArknavX8Protocol.java +++ b/src/org/traccar/protocol/ArknavX8Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java b/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java index c0a18311e..214ccfae2 100644 --- a/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java +++ b/src/org/traccar/protocol/ArknavX8ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ArnaviProtocol.java b/src/org/traccar/protocol/ArnaviProtocol.java index 29661b8d4..956f2329a 100644 --- a/src/org/traccar/protocol/ArnaviProtocol.java +++ b/src/org/traccar/protocol/ArnaviProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ArnaviProtocolDecoder.java b/src/org/traccar/protocol/ArnaviProtocolDecoder.java index f7e146172..1215f7bad 100644 --- a/src/org/traccar/protocol/ArnaviProtocolDecoder.java +++ b/src/org/traccar/protocol/ArnaviProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AstraProtocol.java b/src/org/traccar/protocol/AstraProtocol.java index 461888c4f..87c562a9d 100644 --- a/src/org/traccar/protocol/AstraProtocol.java +++ b/src/org/traccar/protocol/AstraProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AstraProtocolDecoder.java b/src/org/traccar/protocol/AstraProtocolDecoder.java index d89a21082..d51be633d 100644 --- a/src/org/traccar/protocol/AstraProtocolDecoder.java +++ b/src/org/traccar/protocol/AstraProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AtrackFrameDecoder.java b/src/org/traccar/protocol/AtrackFrameDecoder.java index d1010daeb..a075254ea 100644 --- a/src/org/traccar/protocol/AtrackFrameDecoder.java +++ b/src/org/traccar/protocol/AtrackFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AtrackProtocol.java b/src/org/traccar/protocol/AtrackProtocol.java index d61d31522..2ab33ea6d 100644 --- a/src/org/traccar/protocol/AtrackProtocol.java +++ b/src/org/traccar/protocol/AtrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index cb89f9438..9c34a2e78 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AuroProtocol.java b/src/org/traccar/protocol/AuroProtocol.java index e5635f12a..e1b23478f 100644 --- a/src/org/traccar/protocol/AuroProtocol.java +++ b/src/org/traccar/protocol/AuroProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AuroProtocolDecoder.java b/src/org/traccar/protocol/AuroProtocolDecoder.java index 428e83f99..26bf7dfc8 100644 --- a/src/org/traccar/protocol/AuroProtocolDecoder.java +++ b/src/org/traccar/protocol/AuroProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AutoFonFrameDecoder.java b/src/org/traccar/protocol/AutoFonFrameDecoder.java index 2c547d822..2fa1b4072 100644 --- a/src/org/traccar/protocol/AutoFonFrameDecoder.java +++ b/src/org/traccar/protocol/AutoFonFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * Copyright 2015 Vitaly Litvak (vitavaque@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/org/traccar/protocol/AutoFonProtocol.java b/src/org/traccar/protocol/AutoFonProtocol.java index 3e61b81a3..927bda120 100644 --- a/src/org/traccar/protocol/AutoFonProtocol.java +++ b/src/org/traccar/protocol/AutoFonProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AutoFonProtocolDecoder.java b/src/org/traccar/protocol/AutoFonProtocolDecoder.java index 90e8ca103..1c618fdee 100644 --- a/src/org/traccar/protocol/AutoFonProtocolDecoder.java +++ b/src/org/traccar/protocol/AutoFonProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * Copyright 2015 Vitaly Litvak (vitavaque@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/org/traccar/protocol/AutoGradeProtocol.java b/src/org/traccar/protocol/AutoGradeProtocol.java index 1fb6b1ce2..41bb8d9ad 100644 --- a/src/org/traccar/protocol/AutoGradeProtocol.java +++ b/src/org/traccar/protocol/AutoGradeProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/AutoGradeProtocolDecoder.java b/src/org/traccar/protocol/AutoGradeProtocolDecoder.java index 5c9dd7ece..d520c282c 100644 --- a/src/org/traccar/protocol/AutoGradeProtocolDecoder.java +++ b/src/org/traccar/protocol/AutoGradeProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Avl301Protocol.java b/src/org/traccar/protocol/Avl301Protocol.java index b8453cfb3..4a217bad6 100644 --- a/src/org/traccar/protocol/Avl301Protocol.java +++ b/src/org/traccar/protocol/Avl301Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Avl301ProtocolDecoder.java b/src/org/traccar/protocol/Avl301ProtocolDecoder.java index 818dd94df..cac6f717f 100644 --- a/src/org/traccar/protocol/Avl301ProtocolDecoder.java +++ b/src/org/traccar/protocol/Avl301ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/BceFrameDecoder.java b/src/org/traccar/protocol/BceFrameDecoder.java index 1f8b8efcd..4fac79f85 100644 --- a/src/org/traccar/protocol/BceFrameDecoder.java +++ b/src/org/traccar/protocol/BceFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/BceProtocol.java b/src/org/traccar/protocol/BceProtocol.java index 576eb6862..5374fd0e1 100644 --- a/src/org/traccar/protocol/BceProtocol.java +++ b/src/org/traccar/protocol/BceProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java index 06290b6b0..dace89659 100644 --- a/src/org/traccar/protocol/BceProtocolDecoder.java +++ b/src/org/traccar/protocol/BceProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/BlackKiteProtocol.java b/src/org/traccar/protocol/BlackKiteProtocol.java index ea5120b2b..db32f5328 100644 --- a/src/org/traccar/protocol/BlackKiteProtocol.java +++ b/src/org/traccar/protocol/BlackKiteProtocol.java @@ -1,6 +1,6 @@ /* * Copyright 2015 Vijay Kumar (vijaykumar@zilogic.com) - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/BlackKiteProtocolDecoder.java b/src/org/traccar/protocol/BlackKiteProtocolDecoder.java index c2c051884..86736c4c9 100644 --- a/src/org/traccar/protocol/BlackKiteProtocolDecoder.java +++ b/src/org/traccar/protocol/BlackKiteProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * Copyright 2015 Vijay Kumar (vijaykumar@zilogic.com) * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/org/traccar/protocol/BoxProtocol.java b/src/org/traccar/protocol/BoxProtocol.java index 6e60a0dd8..36e7790f0 100644 --- a/src/org/traccar/protocol/BoxProtocol.java +++ b/src/org/traccar/protocol/BoxProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/BoxProtocolDecoder.java b/src/org/traccar/protocol/BoxProtocolDecoder.java index 55d3142b2..b1fe55e5e 100644 --- a/src/org/traccar/protocol/BoxProtocolDecoder.java +++ b/src/org/traccar/protocol/BoxProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CalAmpProtocol.java b/src/org/traccar/protocol/CalAmpProtocol.java index a8eb59d0e..a3577f10c 100644 --- a/src/org/traccar/protocol/CalAmpProtocol.java +++ b/src/org/traccar/protocol/CalAmpProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java index 2a4af2f03..510684411 100644 --- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java +++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CarTrackProtocol.java b/src/org/traccar/protocol/CarTrackProtocol.java index 0244c0ce1..d235c92be 100644 --- a/src/org/traccar/protocol/CarTrackProtocol.java +++ b/src/org/traccar/protocol/CarTrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java index 0d21e77e6..94f5d208b 100644 --- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * Copyright 2014 Rohit * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/org/traccar/protocol/CarcellProtocol.java b/src/org/traccar/protocol/CarcellProtocol.java index 1303b56b3..e53a10eb5 100644 --- a/src/org/traccar/protocol/CarcellProtocol.java +++ b/src/org/traccar/protocol/CarcellProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CarcellProtocolDecoder.java b/src/org/traccar/protocol/CarcellProtocolDecoder.java index e9b6cdf28..5f5877852 100644 --- a/src/org/traccar/protocol/CarcellProtocolDecoder.java +++ b/src/org/traccar/protocol/CarcellProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CarcellProtocolEncoder.java b/src/org/traccar/protocol/CarcellProtocolEncoder.java index d01a11e52..0846949c4 100644 --- a/src/org/traccar/protocol/CarcellProtocolEncoder.java +++ b/src/org/traccar/protocol/CarcellProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CarscopProtocol.java b/src/org/traccar/protocol/CarscopProtocol.java index 23c597a5b..01a754027 100644 --- a/src/org/traccar/protocol/CarscopProtocol.java +++ b/src/org/traccar/protocol/CarscopProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CarscopProtocolDecoder.java b/src/org/traccar/protocol/CarscopProtocolDecoder.java index 5e1973ae8..9abfe2f86 100644 --- a/src/org/traccar/protocol/CarscopProtocolDecoder.java +++ b/src/org/traccar/protocol/CarscopProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CastelProtocol.java b/src/org/traccar/protocol/CastelProtocol.java index 42f7cbb88..db9df0674 100644 --- a/src/org/traccar/protocol/CastelProtocol.java +++ b/src/org/traccar/protocol/CastelProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java index 47df3735c..9ac8c5240 100644 --- a/src/org/traccar/protocol/CastelProtocolDecoder.java +++ b/src/org/traccar/protocol/CastelProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CellocatorFrameDecoder.java b/src/org/traccar/protocol/CellocatorFrameDecoder.java index c9cfab99e..b4708f5db 100644 --- a/src/org/traccar/protocol/CellocatorFrameDecoder.java +++ b/src/org/traccar/protocol/CellocatorFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CellocatorProtocol.java b/src/org/traccar/protocol/CellocatorProtocol.java index e5f6ac8f6..bfaf03692 100644 --- a/src/org/traccar/protocol/CellocatorProtocol.java +++ b/src/org/traccar/protocol/CellocatorProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index f074cb5d3..14325e619 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CguardProtocol.java b/src/org/traccar/protocol/CguardProtocol.java index 1e6d212c8..460bd331f 100644 --- a/src/org/traccar/protocol/CguardProtocol.java +++ b/src/org/traccar/protocol/CguardProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CguardProtocolDecoder.java b/src/org/traccar/protocol/CguardProtocolDecoder.java index 6c528c559..c5dc51d81 100644 --- a/src/org/traccar/protocol/CguardProtocolDecoder.java +++ b/src/org/traccar/protocol/CguardProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CityeasyProtocol.java b/src/org/traccar/protocol/CityeasyProtocol.java index e22c964ce..c5ad05fcd 100644 --- a/src/org/traccar/protocol/CityeasyProtocol.java +++ b/src/org/traccar/protocol/CityeasyProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CityeasyProtocolDecoder.java b/src/org/traccar/protocol/CityeasyProtocolDecoder.java index 5cdbe525d..9f2a0250d 100644 --- a/src/org/traccar/protocol/CityeasyProtocolDecoder.java +++ b/src/org/traccar/protocol/CityeasyProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CityeasyProtocolEncoder.java b/src/org/traccar/protocol/CityeasyProtocolEncoder.java index 9c5695001..0c149c1c9 100644 --- a/src/org/traccar/protocol/CityeasyProtocolEncoder.java +++ b/src/org/traccar/protocol/CityeasyProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CradlepointProtocol.java b/src/org/traccar/protocol/CradlepointProtocol.java index 9b8de7fb8..6ed54aa17 100644 --- a/src/org/traccar/protocol/CradlepointProtocol.java +++ b/src/org/traccar/protocol/CradlepointProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/CradlepointProtocolDecoder.java b/src/org/traccar/protocol/CradlepointProtocolDecoder.java index 4532172c0..f46459482 100644 --- a/src/org/traccar/protocol/CradlepointProtocolDecoder.java +++ b/src/org/traccar/protocol/CradlepointProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/DishaProtocol.java b/src/org/traccar/protocol/DishaProtocol.java index 612316112..53ba36004 100644 --- a/src/org/traccar/protocol/DishaProtocol.java +++ b/src/org/traccar/protocol/DishaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/DishaProtocolDecoder.java b/src/org/traccar/protocol/DishaProtocolDecoder.java index eb00700d8..dc8bddd38 100644 --- a/src/org/traccar/protocol/DishaProtocolDecoder.java +++ b/src/org/traccar/protocol/DishaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EasyTrackProtocol.java b/src/org/traccar/protocol/EasyTrackProtocol.java index 86ec530d4..78f7f0b12 100644 --- a/src/org/traccar/protocol/EasyTrackProtocol.java +++ b/src/org/traccar/protocol/EasyTrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index cec68b967..688629063 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EelinkProtocol.java b/src/org/traccar/protocol/EelinkProtocol.java index e91fc5efd..5900f0059 100644 --- a/src/org/traccar/protocol/EelinkProtocol.java +++ b/src/org/traccar/protocol/EelinkProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 10a8304c9..0bf7d229b 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EelinkProtocolEncoder.java b/src/org/traccar/protocol/EelinkProtocolEncoder.java index 1b9d6303f..b9d6b6f97 100644 --- a/src/org/traccar/protocol/EelinkProtocolEncoder.java +++ b/src/org/traccar/protocol/EelinkProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EnforaProtocol.java b/src/org/traccar/protocol/EnforaProtocol.java index f4ca505ca..156e09d67 100644 --- a/src/org/traccar/protocol/EnforaProtocol.java +++ b/src/org/traccar/protocol/EnforaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/EnforaProtocolDecoder.java b/src/org/traccar/protocol/EnforaProtocolDecoder.java index e9a32da2d..3c4473200 100644 --- a/src/org/traccar/protocol/EnforaProtocolDecoder.java +++ b/src/org/traccar/protocol/EnforaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ExtremTracProtocol.java b/src/org/traccar/protocol/ExtremTracProtocol.java index ce9f2b914..d9b178e23 100644 --- a/src/org/traccar/protocol/ExtremTracProtocol.java +++ b/src/org/traccar/protocol/ExtremTracProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ExtremTracProtocolDecoder.java b/src/org/traccar/protocol/ExtremTracProtocolDecoder.java index 3d42a5a28..c2f420d1c 100644 --- a/src/org/traccar/protocol/ExtremTracProtocolDecoder.java +++ b/src/org/traccar/protocol/ExtremTracProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FifotrackProtocol.java b/src/org/traccar/protocol/FifotrackProtocol.java index 6e441beb1..f4ca450c0 100644 --- a/src/org/traccar/protocol/FifotrackProtocol.java +++ b/src/org/traccar/protocol/FifotrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java index a4b7932e6..9243d1894 100644 --- a/src/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FlextrackProtocol.java b/src/org/traccar/protocol/FlextrackProtocol.java index d62c064d0..77e316d82 100644 --- a/src/org/traccar/protocol/FlextrackProtocol.java +++ b/src/org/traccar/protocol/FlextrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FlextrackProtocolDecoder.java b/src/org/traccar/protocol/FlextrackProtocolDecoder.java index 0ce2ab780..db85acd5d 100644 --- a/src/org/traccar/protocol/FlextrackProtocolDecoder.java +++ b/src/org/traccar/protocol/FlextrackProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FoxProtocol.java b/src/org/traccar/protocol/FoxProtocol.java index 30b76ef25..501bff4c4 100644 --- a/src/org/traccar/protocol/FoxProtocol.java +++ b/src/org/traccar/protocol/FoxProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FoxProtocolDecoder.java b/src/org/traccar/protocol/FoxProtocolDecoder.java index 0a47f7ed1..cf1e4f1f2 100644 --- a/src/org/traccar/protocol/FoxProtocolDecoder.java +++ b/src/org/traccar/protocol/FoxProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FreedomProtocol.java b/src/org/traccar/protocol/FreedomProtocol.java index 0176d9781..5b4bf22ff 100644 --- a/src/org/traccar/protocol/FreedomProtocol.java +++ b/src/org/traccar/protocol/FreedomProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/FreedomProtocolDecoder.java b/src/org/traccar/protocol/FreedomProtocolDecoder.java index 3a05486eb..a8995b8aa 100644 --- a/src/org/traccar/protocol/FreedomProtocolDecoder.java +++ b/src/org/traccar/protocol/FreedomProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GalileoFrameDecoder.java b/src/org/traccar/protocol/GalileoFrameDecoder.java index 3c4284fe0..6d02ce744 100644 --- a/src/org/traccar/protocol/GalileoFrameDecoder.java +++ b/src/org/traccar/protocol/GalileoFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GalileoProtocol.java b/src/org/traccar/protocol/GalileoProtocol.java index 7d5b47bbb..11151e9ca 100644 --- a/src/org/traccar/protocol/GalileoProtocol.java +++ b/src/org/traccar/protocol/GalileoProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java index 12b35333d..68063c5c3 100644 --- a/src/org/traccar/protocol/GalileoProtocolDecoder.java +++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GatorProtocol.java b/src/org/traccar/protocol/GatorProtocol.java index e6b7161db..7fa4854d3 100644 --- a/src/org/traccar/protocol/GatorProtocol.java +++ b/src/org/traccar/protocol/GatorProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 88da9a37f..d9c8a086c 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gl100Protocol.java b/src/org/traccar/protocol/Gl100Protocol.java index a78aff35f..0fd18d44f 100644 --- a/src/org/traccar/protocol/Gl100Protocol.java +++ b/src/org/traccar/protocol/Gl100Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gl100ProtocolDecoder.java b/src/org/traccar/protocol/Gl100ProtocolDecoder.java index d9e5bc6e6..daef6ea52 100644 --- a/src/org/traccar/protocol/Gl100ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl100ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gl200Protocol.java b/src/org/traccar/protocol/Gl200Protocol.java index 57c8fce1b..b6f01c773 100644 --- a/src/org/traccar/protocol/Gl200Protocol.java +++ b/src/org/traccar/protocol/Gl200Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 5785c08b7..66a4e2f7e 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gl200ProtocolEncoder.java b/src/org/traccar/protocol/Gl200ProtocolEncoder.java index 25ca1bf75..2c8efa318 100644 --- a/src/org/traccar/protocol/Gl200ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GlobalSatProtocol.java b/src/org/traccar/protocol/GlobalSatProtocol.java index 25d7656f1..f3d07fc96 100644 --- a/src/org/traccar/protocol/GlobalSatProtocol.java +++ b/src/org/traccar/protocol/GlobalSatProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 084279732..4c127a90b 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GnxProtocol.java b/src/org/traccar/protocol/GnxProtocol.java index aeef247c2..84af24000 100644 --- a/src/org/traccar/protocol/GnxProtocol.java +++ b/src/org/traccar/protocol/GnxProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GnxProtocolDecoder.java b/src/org/traccar/protocol/GnxProtocolDecoder.java index b88d306a8..aff86ea7b 100644 --- a/src/org/traccar/protocol/GnxProtocolDecoder.java +++ b/src/org/traccar/protocol/GnxProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GoSafeProtocol.java b/src/org/traccar/protocol/GoSafeProtocol.java index 54abacd42..bfd473df9 100644 --- a/src/org/traccar/protocol/GoSafeProtocol.java +++ b/src/org/traccar/protocol/GoSafeProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java index a511f9926..a258e922c 100644 --- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GotopProtocol.java b/src/org/traccar/protocol/GotopProtocol.java index 6b31e1acf..5d522adf5 100644 --- a/src/org/traccar/protocol/GotopProtocol.java +++ b/src/org/traccar/protocol/GotopProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GotopProtocolDecoder.java b/src/org/traccar/protocol/GotopProtocolDecoder.java index 0dcae3c8d..0c613eb2d 100644 --- a/src/org/traccar/protocol/GotopProtocolDecoder.java +++ b/src/org/traccar/protocol/GotopProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gps103Protocol.java b/src/org/traccar/protocol/Gps103Protocol.java index 559de3187..82d42f1c9 100644 --- a/src/org/traccar/protocol/Gps103Protocol.java +++ b/src/org/traccar/protocol/Gps103Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index ed50c33f0..7754bd831 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gps103ProtocolEncoder.java b/src/org/traccar/protocol/Gps103ProtocolEncoder.java index 23942e554..afe87cf8c 100644 --- a/src/org/traccar/protocol/Gps103ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GpsGateProtocol.java b/src/org/traccar/protocol/GpsGateProtocol.java index 78a7588ad..c7dc2c4f3 100644 --- a/src/org/traccar/protocol/GpsGateProtocol.java +++ b/src/org/traccar/protocol/GpsGateProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java index ac859b592..47b02de94 100644 --- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GpsMarkerProtocol.java b/src/org/traccar/protocol/GpsMarkerProtocol.java index bb4b5b561..5c64d16b2 100644 --- a/src/org/traccar/protocol/GpsMarkerProtocol.java +++ b/src/org/traccar/protocol/GpsMarkerProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java b/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java index 89537fa3d..3f9b52cd1 100644 --- a/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GpsmtaProtocol.java b/src/org/traccar/protocol/GpsmtaProtocol.java index 51cce2650..2d1181bec 100644 --- a/src/org/traccar/protocol/GpsmtaProtocol.java +++ b/src/org/traccar/protocol/GpsmtaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GpsmtaProtocolDecoder.java b/src/org/traccar/protocol/GpsmtaProtocolDecoder.java index f10b3771c..7360dbc1d 100644 --- a/src/org/traccar/protocol/GpsmtaProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsmtaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GranitFrameDecoder.java b/src/org/traccar/protocol/GranitFrameDecoder.java index 5f1297c6d..7e8f4a3f5 100644 --- a/src/org/traccar/protocol/GranitFrameDecoder.java +++ b/src/org/traccar/protocol/GranitFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GranitProtocol.java b/src/org/traccar/protocol/GranitProtocol.java index 1e097c17b..a5d5458f0 100644 --- a/src/org/traccar/protocol/GranitProtocol.java +++ b/src/org/traccar/protocol/GranitProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GranitProtocolDecoder.java b/src/org/traccar/protocol/GranitProtocolDecoder.java index 3a2d24fa2..63b1671c6 100644 --- a/src/org/traccar/protocol/GranitProtocolDecoder.java +++ b/src/org/traccar/protocol/GranitProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/GranitProtocolEncoder.java b/src/org/traccar/protocol/GranitProtocolEncoder.java index 805bfbe24..dbfd30ff1 100644 --- a/src/org/traccar/protocol/GranitProtocolEncoder.java +++ b/src/org/traccar/protocol/GranitProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gt02Protocol.java b/src/org/traccar/protocol/Gt02Protocol.java index 595e6649e..e484b66cd 100644 --- a/src/org/traccar/protocol/Gt02Protocol.java +++ b/src/org/traccar/protocol/Gt02Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java index dea1416ac..8a42293b9 100644 --- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gt06FrameDecoder.java b/src/org/traccar/protocol/Gt06FrameDecoder.java index 67f42efb4..f35af6572 100644 --- a/src/org/traccar/protocol/Gt06FrameDecoder.java +++ b/src/org/traccar/protocol/Gt06FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gt06Protocol.java b/src/org/traccar/protocol/Gt06Protocol.java index e4c9ef2e0..e96679799 100644 --- a/src/org/traccar/protocol/Gt06Protocol.java +++ b/src/org/traccar/protocol/Gt06Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 4af814e24..35cb83dac 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/org/traccar/protocol/Gt06ProtocolEncoder.java index e78a1b388..b6ec5a0d1 100644 --- a/src/org/traccar/protocol/Gt06ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/H02FrameDecoder.java b/src/org/traccar/protocol/H02FrameDecoder.java index 2a005e760..d461c9219 100644 --- a/src/org/traccar/protocol/H02FrameDecoder.java +++ b/src/org/traccar/protocol/H02FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/H02Protocol.java b/src/org/traccar/protocol/H02Protocol.java index 089721aed..498f63c0e 100644 --- a/src/org/traccar/protocol/H02Protocol.java +++ b/src/org/traccar/protocol/H02Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index f876f40bc..e74f9e862 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/H02ProtocolEncoder.java b/src/org/traccar/protocol/H02ProtocolEncoder.java index 4045b46d4..7b5ff13bb 100644 --- a/src/org/traccar/protocol/H02ProtocolEncoder.java +++ b/src/org/traccar/protocol/H02ProtocolEncoder.java @@ -1,6 +1,6 @@ /* * Copyright 2016 Gabor Somogyi (gabor.g.somogyi@gmail.com) - * 2016 Anton Tananaev (anton.tananaev@gmail.com) + * 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HaicomProtocol.java b/src/org/traccar/protocol/HaicomProtocol.java index 71970d476..4380dd2cc 100644 --- a/src/org/traccar/protocol/HaicomProtocol.java +++ b/src/org/traccar/protocol/HaicomProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index 647477d50..8fbf98d3c 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HomtecsProtocol.java b/src/org/traccar/protocol/HomtecsProtocol.java index e8a86fa37..a9ea19c51 100644 --- a/src/org/traccar/protocol/HomtecsProtocol.java +++ b/src/org/traccar/protocol/HomtecsProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HomtecsProtocolDecoder.java b/src/org/traccar/protocol/HomtecsProtocolDecoder.java index 21eb2c0b5..78bf0a813 100644 --- a/src/org/traccar/protocol/HomtecsProtocolDecoder.java +++ b/src/org/traccar/protocol/HomtecsProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HuaShengFrameDecoder.java b/src/org/traccar/protocol/HuaShengFrameDecoder.java index 0e1becc30..4c29b7915 100644 --- a/src/org/traccar/protocol/HuaShengFrameDecoder.java +++ b/src/org/traccar/protocol/HuaShengFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HuaShengProtocol.java b/src/org/traccar/protocol/HuaShengProtocol.java index dcef2bd69..e0fddae20 100644 --- a/src/org/traccar/protocol/HuaShengProtocol.java +++ b/src/org/traccar/protocol/HuaShengProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HuaShengProtocolDecoder.java b/src/org/traccar/protocol/HuaShengProtocolDecoder.java index d83cea2ee..a0a1eb0ab 100644 --- a/src/org/traccar/protocol/HuaShengProtocolDecoder.java +++ b/src/org/traccar/protocol/HuaShengProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HuabaoFrameDecoder.java b/src/org/traccar/protocol/HuabaoFrameDecoder.java index 003876fe5..8e9c9fe72 100644 --- a/src/org/traccar/protocol/HuabaoFrameDecoder.java +++ b/src/org/traccar/protocol/HuabaoFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HuabaoProtocol.java b/src/org/traccar/protocol/HuabaoProtocol.java index 4a83689e3..053ce59bb 100644 --- a/src/org/traccar/protocol/HuabaoProtocol.java +++ b/src/org/traccar/protocol/HuabaoProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/org/traccar/protocol/HuabaoProtocolDecoder.java index 9223ea9a5..196d7927d 100644 --- a/src/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HunterProProtocol.java b/src/org/traccar/protocol/HunterProProtocol.java index 502a95e11..17352a0f3 100644 --- a/src/org/traccar/protocol/HunterProProtocol.java +++ b/src/org/traccar/protocol/HunterProProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/HunterProProtocolDecoder.java b/src/org/traccar/protocol/HunterProProtocolDecoder.java index 2274ab1b8..fc19257f6 100644 --- a/src/org/traccar/protocol/HunterProProtocolDecoder.java +++ b/src/org/traccar/protocol/HunterProProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/IdplProtocol.java b/src/org/traccar/protocol/IdplProtocol.java index 88e106def..a954397cd 100644 --- a/src/org/traccar/protocol/IdplProtocol.java +++ b/src/org/traccar/protocol/IdplProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/IdplProtocolDecoder.java b/src/org/traccar/protocol/IdplProtocolDecoder.java index 4fdf9d677..cfef75952 100644 --- a/src/org/traccar/protocol/IdplProtocolDecoder.java +++ b/src/org/traccar/protocol/IdplProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/IntellitracFrameDecoder.java b/src/org/traccar/protocol/IntellitracFrameDecoder.java index 4e6241a40..49f8b4a5d 100644 --- a/src/org/traccar/protocol/IntellitracFrameDecoder.java +++ b/src/org/traccar/protocol/IntellitracFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/IntellitracProtocol.java b/src/org/traccar/protocol/IntellitracProtocol.java index 6db2b0011..2d9421636 100644 --- a/src/org/traccar/protocol/IntellitracProtocol.java +++ b/src/org/traccar/protocol/IntellitracProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java index af9f9bbab..a2720028f 100644 --- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java +++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/JpKorjarProtocolDecoder.java b/src/org/traccar/protocol/JpKorjarProtocolDecoder.java index e0fe0678d..debc66673 100644 --- a/src/org/traccar/protocol/JpKorjarProtocolDecoder.java +++ b/src/org/traccar/protocol/JpKorjarProtocolDecoder.java @@ -1,6 +1,6 @@ /* * Copyright 2016 Nyash (nyashh@gmail.com) - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Jt600FrameDecoder.java b/src/org/traccar/protocol/Jt600FrameDecoder.java index bc6ad1b53..5606ae1fc 100644 --- a/src/org/traccar/protocol/Jt600FrameDecoder.java +++ b/src/org/traccar/protocol/Jt600FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Jt600Protocol.java b/src/org/traccar/protocol/Jt600Protocol.java index 8a73cbbe9..132770511 100644 --- a/src/org/traccar/protocol/Jt600Protocol.java +++ b/src/org/traccar/protocol/Jt600Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index e42ae5e09..ad7a00dc2 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Jt600ProtocolEncoder.java b/src/org/traccar/protocol/Jt600ProtocolEncoder.java index d25ec637f..3eb0566a4 100644 --- a/src/org/traccar/protocol/Jt600ProtocolEncoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/KenjiProtocolDecoder.java b/src/org/traccar/protocol/KenjiProtocolDecoder.java index e13c91e3a..8e59341bd 100755 --- a/src/org/traccar/protocol/KenjiProtocolDecoder.java +++ b/src/org/traccar/protocol/KenjiProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/KhdProtocol.java b/src/org/traccar/protocol/KhdProtocol.java index e5bcc1be3..bf0d2855d 100644 --- a/src/org/traccar/protocol/KhdProtocol.java +++ b/src/org/traccar/protocol/KhdProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java index e34a24b40..0c3d8ee51 100644 --- a/src/org/traccar/protocol/KhdProtocolDecoder.java +++ b/src/org/traccar/protocol/KhdProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/KhdProtocolEncoder.java b/src/org/traccar/protocol/KhdProtocolEncoder.java index a056fdf05..618e43dad 100644 --- a/src/org/traccar/protocol/KhdProtocolEncoder.java +++ b/src/org/traccar/protocol/KhdProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/L100FrameDecoder.java b/src/org/traccar/protocol/L100FrameDecoder.java index 92af255dd..a597cbd7d 100644 --- a/src/org/traccar/protocol/L100FrameDecoder.java +++ b/src/org/traccar/protocol/L100FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/L100Protocol.java b/src/org/traccar/protocol/L100Protocol.java index 418b9beb7..2bcef4caa 100644 --- a/src/org/traccar/protocol/L100Protocol.java +++ b/src/org/traccar/protocol/L100Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/L100ProtocolDecoder.java b/src/org/traccar/protocol/L100ProtocolDecoder.java index ff0687751..7eed7df9a 100644 --- a/src/org/traccar/protocol/L100ProtocolDecoder.java +++ b/src/org/traccar/protocol/L100ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/LaipacProtocol.java b/src/org/traccar/protocol/LaipacProtocol.java index f64204749..45b803a0f 100644 --- a/src/org/traccar/protocol/LaipacProtocol.java +++ b/src/org/traccar/protocol/LaipacProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index 25678af88..a0e394d2c 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/M2mProtocol.java b/src/org/traccar/protocol/M2mProtocol.java index 662aa3f0f..09393fed0 100644 --- a/src/org/traccar/protocol/M2mProtocol.java +++ b/src/org/traccar/protocol/M2mProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/M2mProtocolDecoder.java b/src/org/traccar/protocol/M2mProtocolDecoder.java index 601b6d191..a3c2ada2f 100644 --- a/src/org/traccar/protocol/M2mProtocolDecoder.java +++ b/src/org/traccar/protocol/M2mProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ManPowerProtocol.java b/src/org/traccar/protocol/ManPowerProtocol.java index ce7045899..60ce8b282 100644 --- a/src/org/traccar/protocol/ManPowerProtocol.java +++ b/src/org/traccar/protocol/ManPowerProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ManPowerProtocolDecoder.java b/src/org/traccar/protocol/ManPowerProtocolDecoder.java index a2ede32b8..39b651d7e 100644 --- a/src/org/traccar/protocol/ManPowerProtocolDecoder.java +++ b/src/org/traccar/protocol/ManPowerProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MegastekFrameDecoder.java b/src/org/traccar/protocol/MegastekFrameDecoder.java index da77d95fd..d9cb07108 100644 --- a/src/org/traccar/protocol/MegastekFrameDecoder.java +++ b/src/org/traccar/protocol/MegastekFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MegastekProtocol.java b/src/org/traccar/protocol/MegastekProtocol.java index 77c2510bd..b28a05b92 100644 --- a/src/org/traccar/protocol/MegastekProtocol.java +++ b/src/org/traccar/protocol/MegastekProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index 3ea76536c..005d38c41 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeiligaoFrameDecoder.java b/src/org/traccar/protocol/MeiligaoFrameDecoder.java index 9fb530f8a..9340b6198 100644 --- a/src/org/traccar/protocol/MeiligaoFrameDecoder.java +++ b/src/org/traccar/protocol/MeiligaoFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeiligaoProtocol.java b/src/org/traccar/protocol/MeiligaoProtocol.java index 2c61af5cb..23af19ef1 100644 --- a/src/org/traccar/protocol/MeiligaoProtocol.java +++ b/src/org/traccar/protocol/MeiligaoProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index f0e5032b4..9915eab8c 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeiligaoProtocolEncoder.java b/src/org/traccar/protocol/MeiligaoProtocolEncoder.java index 93399df60..a91b33a60 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolEncoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeitrackFrameDecoder.java b/src/org/traccar/protocol/MeitrackFrameDecoder.java index 3c2d34394..1eb0dae0f 100644 --- a/src/org/traccar/protocol/MeitrackFrameDecoder.java +++ b/src/org/traccar/protocol/MeitrackFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeitrackProtocol.java b/src/org/traccar/protocol/MeitrackProtocol.java index 0c85c6203..918729f97 100644 --- a/src/org/traccar/protocol/MeitrackProtocol.java +++ b/src/org/traccar/protocol/MeitrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index f2208984c..72ccaa037 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MeitrackProtocolEncoder.java b/src/org/traccar/protocol/MeitrackProtocolEncoder.java index 784b3b917..b10a751c1 100644 --- a/src/org/traccar/protocol/MeitrackProtocolEncoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MiniFinderProtocol.java b/src/org/traccar/protocol/MiniFinderProtocol.java index 605633267..71a956d0f 100644 --- a/src/org/traccar/protocol/MiniFinderProtocol.java +++ b/src/org/traccar/protocol/MiniFinderProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java index 348476c6b..33396cebb 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java index c5210aa0b..96079745c 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolEncoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Mta6Protocol.java b/src/org/traccar/protocol/Mta6Protocol.java index cafda2bc6..65a48808d 100644 --- a/src/org/traccar/protocol/Mta6Protocol.java +++ b/src/org/traccar/protocol/Mta6Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index 1da55f715..2109a63c3 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MtxProtocol.java b/src/org/traccar/protocol/MtxProtocol.java index c549653d0..58b2361cd 100644 --- a/src/org/traccar/protocol/MtxProtocol.java +++ b/src/org/traccar/protocol/MtxProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MtxProtocolDecoder.java b/src/org/traccar/protocol/MtxProtocolDecoder.java index 6a6677830..0b84603bd 100644 --- a/src/org/traccar/protocol/MtxProtocolDecoder.java +++ b/src/org/traccar/protocol/MtxProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MxtFrameDecoder.java b/src/org/traccar/protocol/MxtFrameDecoder.java index cb1d8ed8e..b2cd6de93 100644 --- a/src/org/traccar/protocol/MxtFrameDecoder.java +++ b/src/org/traccar/protocol/MxtFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MxtProtocol.java b/src/org/traccar/protocol/MxtProtocol.java index a5d21e445..03c1da71e 100644 --- a/src/org/traccar/protocol/MxtProtocol.java +++ b/src/org/traccar/protocol/MxtProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/MxtProtocolDecoder.java b/src/org/traccar/protocol/MxtProtocolDecoder.java index 1dbfc3696..0e01f807f 100644 --- a/src/org/traccar/protocol/MxtProtocolDecoder.java +++ b/src/org/traccar/protocol/MxtProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NavigilFrameDecoder.java b/src/org/traccar/protocol/NavigilFrameDecoder.java index 7a8989115..34eb28941 100644 --- a/src/org/traccar/protocol/NavigilFrameDecoder.java +++ b/src/org/traccar/protocol/NavigilFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NavigilProtocol.java b/src/org/traccar/protocol/NavigilProtocol.java index 7cf6f35ff..6646c6cc6 100644 --- a/src/org/traccar/protocol/NavigilProtocol.java +++ b/src/org/traccar/protocol/NavigilProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index e2afdf8d3..d18217861 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NavisProtocol.java b/src/org/traccar/protocol/NavisProtocol.java index d4cf40f1f..771c9d61d 100644 --- a/src/org/traccar/protocol/NavisProtocol.java +++ b/src/org/traccar/protocol/NavisProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 210c1d8c1..077f34e8d 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NoranProtocol.java b/src/org/traccar/protocol/NoranProtocol.java index eeddbdead..bf10eb127 100644 --- a/src/org/traccar/protocol/NoranProtocol.java +++ b/src/org/traccar/protocol/NoranProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index e062a9907..ebeacc659 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NoranProtocolEncoder.java b/src/org/traccar/protocol/NoranProtocolEncoder.java index 1f1988802..5bd069218 100644 --- a/src/org/traccar/protocol/NoranProtocolEncoder.java +++ b/src/org/traccar/protocol/NoranProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NvsFrameDecoder.java b/src/org/traccar/protocol/NvsFrameDecoder.java index 3991a1865..598bb1e4c 100644 --- a/src/org/traccar/protocol/NvsFrameDecoder.java +++ b/src/org/traccar/protocol/NvsFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NvsProtocol.java b/src/org/traccar/protocol/NvsProtocol.java index 4610e4abc..fdcb2bbcf 100644 --- a/src/org/traccar/protocol/NvsProtocol.java +++ b/src/org/traccar/protocol/NvsProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/NvsProtocolDecoder.java b/src/org/traccar/protocol/NvsProtocolDecoder.java index c32501d56..0e82fae69 100644 --- a/src/org/traccar/protocol/NvsProtocolDecoder.java +++ b/src/org/traccar/protocol/NvsProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ObdDongleProtocol.java b/src/org/traccar/protocol/ObdDongleProtocol.java index d91eb765a..6547a31ab 100644 --- a/src/org/traccar/protocol/ObdDongleProtocol.java +++ b/src/org/traccar/protocol/ObdDongleProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ObdDongleProtocolDecoder.java b/src/org/traccar/protocol/ObdDongleProtocolDecoder.java index 84ff1450a..e5ae5e93f 100644 --- a/src/org/traccar/protocol/ObdDongleProtocolDecoder.java +++ b/src/org/traccar/protocol/ObdDongleProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OigoProtocol.java b/src/org/traccar/protocol/OigoProtocol.java index c60ee1be6..4b6ad0dd0 100644 --- a/src/org/traccar/protocol/OigoProtocol.java +++ b/src/org/traccar/protocol/OigoProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OigoProtocolDecoder.java b/src/org/traccar/protocol/OigoProtocolDecoder.java index bbea38183..15a215c4f 100644 --- a/src/org/traccar/protocol/OigoProtocolDecoder.java +++ b/src/org/traccar/protocol/OigoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OrionFrameDecoder.java b/src/org/traccar/protocol/OrionFrameDecoder.java index 3babda175..f7371747a 100644 --- a/src/org/traccar/protocol/OrionFrameDecoder.java +++ b/src/org/traccar/protocol/OrionFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OrionProtocol.java b/src/org/traccar/protocol/OrionProtocol.java index c0166b05d..f4bfef985 100644 --- a/src/org/traccar/protocol/OrionProtocol.java +++ b/src/org/traccar/protocol/OrionProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OrionProtocolDecoder.java b/src/org/traccar/protocol/OrionProtocolDecoder.java index c65e534f4..c65924337 100644 --- a/src/org/traccar/protocol/OrionProtocolDecoder.java +++ b/src/org/traccar/protocol/OrionProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OsmAndProtocol.java b/src/org/traccar/protocol/OsmAndProtocol.java index 7f5318576..785f4bd75 100644 --- a/src/org/traccar/protocol/OsmAndProtocol.java +++ b/src/org/traccar/protocol/OsmAndProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index 6017f4a6c..5508cad92 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/PathAwayProtocol.java b/src/org/traccar/protocol/PathAwayProtocol.java index 2583670a2..a41692750 100644 --- a/src/org/traccar/protocol/PathAwayProtocol.java +++ b/src/org/traccar/protocol/PathAwayProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/PathAwayProtocolDecoder.java b/src/org/traccar/protocol/PathAwayProtocolDecoder.java index aa2de5704..036cfa445 100644 --- a/src/org/traccar/protocol/PathAwayProtocolDecoder.java +++ b/src/org/traccar/protocol/PathAwayProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/PiligrimProtocol.java b/src/org/traccar/protocol/PiligrimProtocol.java index 0ab529d5c..a2960f762 100644 --- a/src/org/traccar/protocol/PiligrimProtocol.java +++ b/src/org/traccar/protocol/PiligrimProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index 47f73fe8f..9d5bb9e24 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ProgressProtocol.java b/src/org/traccar/protocol/ProgressProtocol.java index 3fb702b7b..6e2093346 100644 --- a/src/org/traccar/protocol/ProgressProtocol.java +++ b/src/org/traccar/protocol/ProgressProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java index 0032a9a1b..9e24efc38 100644 --- a/src/org/traccar/protocol/ProgressProtocolDecoder.java +++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Pt3000Protocol.java b/src/org/traccar/protocol/Pt3000Protocol.java index c4cb4129d..9c9da3301 100644 --- a/src/org/traccar/protocol/Pt3000Protocol.java +++ b/src/org/traccar/protocol/Pt3000Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java index 88ffb0616..d25d96150 100644 --- a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Pt502FrameDecoder.java b/src/org/traccar/protocol/Pt502FrameDecoder.java index 95289929e..200012965 100644 --- a/src/org/traccar/protocol/Pt502FrameDecoder.java +++ b/src/org/traccar/protocol/Pt502FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Pt502Protocol.java b/src/org/traccar/protocol/Pt502Protocol.java index b609927ac..a15938dc3 100644 --- a/src/org/traccar/protocol/Pt502Protocol.java +++ b/src/org/traccar/protocol/Pt502Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index 24dc2094f..2d3cb9101 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * Copyright 2012 Luis Parada (luis.parada@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/org/traccar/protocol/Pt502ProtocolEncoder.java b/src/org/traccar/protocol/Pt502ProtocolEncoder.java index d8aeb6e5d..5f7665e50 100644 --- a/src/org/traccar/protocol/Pt502ProtocolEncoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RaveonProtocol.java b/src/org/traccar/protocol/RaveonProtocol.java index a81d52f0e..e4e100e0b 100644 --- a/src/org/traccar/protocol/RaveonProtocol.java +++ b/src/org/traccar/protocol/RaveonProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RaveonProtocolDecoder.java b/src/org/traccar/protocol/RaveonProtocolDecoder.java index d6942da6f..19a9d6314 100644 --- a/src/org/traccar/protocol/RaveonProtocolDecoder.java +++ b/src/org/traccar/protocol/RaveonProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RitiProtocol.java b/src/org/traccar/protocol/RitiProtocol.java index 8a39c29e1..0ff3ce87b 100644 --- a/src/org/traccar/protocol/RitiProtocol.java +++ b/src/org/traccar/protocol/RitiProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index 455c1387a..1ca517057 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RuptelaProtocol.java b/src/org/traccar/protocol/RuptelaProtocol.java index 1fe7b02ad..54cdcc267 100644 --- a/src/org/traccar/protocol/RuptelaProtocol.java +++ b/src/org/traccar/protocol/RuptelaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/org/traccar/protocol/RuptelaProtocolDecoder.java index 84cc0e101..461f9abc0 100644 --- a/src/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/RuptelaProtocolEncoder.java b/src/org/traccar/protocol/RuptelaProtocolEncoder.java index c036870d9..c3b3a3619 100644 --- a/src/org/traccar/protocol/RuptelaProtocolEncoder.java +++ b/src/org/traccar/protocol/RuptelaProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SanavProtocol.java b/src/org/traccar/protocol/SanavProtocol.java index 0e7958b8e..4f463725e 100644 --- a/src/org/traccar/protocol/SanavProtocol.java +++ b/src/org/traccar/protocol/SanavProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index 103b2d395..606668713 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SkypatrolProtocol.java b/src/org/traccar/protocol/SkypatrolProtocol.java index 7d8240294..fba432522 100644 --- a/src/org/traccar/protocol/SkypatrolProtocol.java +++ b/src/org/traccar/protocol/SkypatrolProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index d07bb152b..dfe87caf5 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SmokeyProtocol.java b/src/org/traccar/protocol/SmokeyProtocol.java index bb7b91fad..4f9a8dd74 100644 --- a/src/org/traccar/protocol/SmokeyProtocol.java +++ b/src/org/traccar/protocol/SmokeyProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SmokeyProtocolDecoder.java b/src/org/traccar/protocol/SmokeyProtocolDecoder.java index a3fa0e5ae..86496fba6 100644 --- a/src/org/traccar/protocol/SmokeyProtocolDecoder.java +++ b/src/org/traccar/protocol/SmokeyProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Stl060FrameDecoder.java b/src/org/traccar/protocol/Stl060FrameDecoder.java index f11d86564..455a869ee 100644 --- a/src/org/traccar/protocol/Stl060FrameDecoder.java +++ b/src/org/traccar/protocol/Stl060FrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Stl060Protocol.java b/src/org/traccar/protocol/Stl060Protocol.java index ccdd256d7..6fe2c5181 100644 --- a/src/org/traccar/protocol/Stl060Protocol.java +++ b/src/org/traccar/protocol/Stl060Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java index 86b097f77..fa789510e 100644 --- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java +++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SuntechProtocol.java b/src/org/traccar/protocol/SuntechProtocol.java index df6109722..410dc8af7 100644 --- a/src/org/traccar/protocol/SuntechProtocol.java +++ b/src/org/traccar/protocol/SuntechProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java index 503f4d6f8..c9235f47f 100644 --- a/src/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SuntechProtocolEncoder.java b/src/org/traccar/protocol/SuntechProtocolEncoder.java index 000583759..4a2b230f2 100644 --- a/src/org/traccar/protocol/SuntechProtocolEncoder.java +++ b/src/org/traccar/protocol/SuntechProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SupermateProtocol.java b/src/org/traccar/protocol/SupermateProtocol.java index 70c3c00e6..c9ae86fc1 100755 --- a/src/org/traccar/protocol/SupermateProtocol.java +++ b/src/org/traccar/protocol/SupermateProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/SupermateProtocolDecoder.java b/src/org/traccar/protocol/SupermateProtocolDecoder.java index f673bff40..7f12121bb 100755 --- a/src/org/traccar/protocol/SupermateProtocolDecoder.java +++ b/src/org/traccar/protocol/SupermateProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/T55Protocol.java b/src/org/traccar/protocol/T55Protocol.java index 657155042..402fd46b8 100644 --- a/src/org/traccar/protocol/T55Protocol.java +++ b/src/org/traccar/protocol/T55Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index 1909d9bea..faf9c4b7d 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/T800xProtocol.java b/src/org/traccar/protocol/T800xProtocol.java index 05650124c..70341d0dc 100644 --- a/src/org/traccar/protocol/T800xProtocol.java +++ b/src/org/traccar/protocol/T800xProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java index d92145e05..52d711a8d 100644 --- a/src/org/traccar/protocol/T800xProtocolDecoder.java +++ b/src/org/traccar/protocol/T800xProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/T800xProtocolEncoder.java b/src/org/traccar/protocol/T800xProtocolEncoder.java index d603328e2..7b02ed10b 100644 --- a/src/org/traccar/protocol/T800xProtocolEncoder.java +++ b/src/org/traccar/protocol/T800xProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TaipProtocol.java b/src/org/traccar/protocol/TaipProtocol.java index 8b93eb42d..c3d934c04 100644 --- a/src/org/traccar/protocol/TaipProtocol.java +++ b/src/org/traccar/protocol/TaipProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java index 11acbd343..7927c28e6 100644 --- a/src/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/org/traccar/protocol/TaipProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TelicFrameDecoder.java b/src/org/traccar/protocol/TelicFrameDecoder.java index 2a6e121cf..245be28fb 100644 --- a/src/org/traccar/protocol/TelicFrameDecoder.java +++ b/src/org/traccar/protocol/TelicFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TelicProtocol.java b/src/org/traccar/protocol/TelicProtocol.java index b55e16caf..fdd0b94c6 100644 --- a/src/org/traccar/protocol/TelicProtocol.java +++ b/src/org/traccar/protocol/TelicProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TelicProtocolDecoder.java b/src/org/traccar/protocol/TelicProtocolDecoder.java index 376ff4c84..4d496426d 100644 --- a/src/org/traccar/protocol/TelicProtocolDecoder.java +++ b/src/org/traccar/protocol/TelicProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TeltonikaFrameDecoder.java b/src/org/traccar/protocol/TeltonikaFrameDecoder.java index f8add090b..e7313b722 100644 --- a/src/org/traccar/protocol/TeltonikaFrameDecoder.java +++ b/src/org/traccar/protocol/TeltonikaFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TeltonikaProtocol.java b/src/org/traccar/protocol/TeltonikaProtocol.java index c9c0f0f4d..f0ed61886 100644 --- a/src/org/traccar/protocol/TeltonikaProtocol.java +++ b/src/org/traccar/protocol/TeltonikaProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index 00ab90ce0..474718ee8 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TeltonikaProtocolEncoder.java b/src/org/traccar/protocol/TeltonikaProtocolEncoder.java index d91f7f7bf..eb83477b8 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolEncoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ThinkRaceProtocol.java b/src/org/traccar/protocol/ThinkRaceProtocol.java index add7d33d3..98f43e2e3 100644 --- a/src/org/traccar/protocol/ThinkRaceProtocol.java +++ b/src/org/traccar/protocol/ThinkRaceProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java b/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java index 2c49cccaf..f78f01329 100644 --- a/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java +++ b/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tk102Protocol.java b/src/org/traccar/protocol/Tk102Protocol.java index ad3d8affa..962f2401b 100644 --- a/src/org/traccar/protocol/Tk102Protocol.java +++ b/src/org/traccar/protocol/Tk102Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java index 58eb36cff..c2a94257d 100644 --- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tk103Protocol.java b/src/org/traccar/protocol/Tk103Protocol.java index 3fe82ad8b..1520e88f6 100644 --- a/src/org/traccar/protocol/Tk103Protocol.java +++ b/src/org/traccar/protocol/Tk103Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index c638e7f27..9d04483c1 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tlt2hProtocol.java b/src/org/traccar/protocol/Tlt2hProtocol.java index e33b1b561..752b0d8ef 100644 --- a/src/org/traccar/protocol/Tlt2hProtocol.java +++ b/src/org/traccar/protocol/Tlt2hProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index 6a58d6dcb..7df671109 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TopflytechProtocol.java b/src/org/traccar/protocol/TopflytechProtocol.java index 225cb66d7..7d4b13ee6 100644 --- a/src/org/traccar/protocol/TopflytechProtocol.java +++ b/src/org/traccar/protocol/TopflytechProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TopflytechProtocolDecoder.java b/src/org/traccar/protocol/TopflytechProtocolDecoder.java index 04f379557..0be411246 100644 --- a/src/org/traccar/protocol/TopflytechProtocolDecoder.java +++ b/src/org/traccar/protocol/TopflytechProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TotemFrameDecoder.java b/src/org/traccar/protocol/TotemFrameDecoder.java index 374161758..6940d7b46 100644 --- a/src/org/traccar/protocol/TotemFrameDecoder.java +++ b/src/org/traccar/protocol/TotemFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TotemProtocol.java b/src/org/traccar/protocol/TotemProtocol.java index 638755b7f..860fff894 100644 --- a/src/org/traccar/protocol/TotemProtocol.java +++ b/src/org/traccar/protocol/TotemProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index fbda41921..121b56ff9 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TotemProtocolEncoder.java b/src/org/traccar/protocol/TotemProtocolEncoder.java index 5e0ca407a..ff41a7df3 100644 --- a/src/org/traccar/protocol/TotemProtocolEncoder.java +++ b/src/org/traccar/protocol/TotemProtocolEncoder.java @@ -1,6 +1,6 @@ /* * Copyright 2015 Irving Gonzalez - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tr20Protocol.java b/src/org/traccar/protocol/Tr20Protocol.java index 1c47db86a..8de004be9 100644 --- a/src/org/traccar/protocol/Tr20Protocol.java +++ b/src/org/traccar/protocol/Tr20Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java index 54b303b5d..20f7d2968 100644 --- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tr900Protocol.java b/src/org/traccar/protocol/Tr900Protocol.java index d54e4cb3c..40f287efa 100644 --- a/src/org/traccar/protocol/Tr900Protocol.java +++ b/src/org/traccar/protocol/Tr900Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tr900ProtocolDecoder.java b/src/org/traccar/protocol/Tr900ProtocolDecoder.java index 8dfff9e41..32362acd2 100644 --- a/src/org/traccar/protocol/Tr900ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr900ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TrackboxProtocol.java b/src/org/traccar/protocol/TrackboxProtocol.java index b71eb3810..c1aa5ac6a 100644 --- a/src/org/traccar/protocol/TrackboxProtocol.java +++ b/src/org/traccar/protocol/TrackboxProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TrackboxProtocolDecoder.java b/src/org/traccar/protocol/TrackboxProtocolDecoder.java index 89253b891..f909e8488 100644 --- a/src/org/traccar/protocol/TrackboxProtocolDecoder.java +++ b/src/org/traccar/protocol/TrackboxProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TrakMateProtocol.java b/src/org/traccar/protocol/TrakMateProtocol.java index 3126fb80b..f6d9bf457 100644 --- a/src/org/traccar/protocol/TrakMateProtocol.java +++ b/src/org/traccar/protocol/TrakMateProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TrakMateProtocolDecoder.java b/src/org/traccar/protocol/TrakMateProtocolDecoder.java index 0ca40e6ab..57003e832 100644 --- a/src/org/traccar/protocol/TrakMateProtocolDecoder.java +++ b/src/org/traccar/protocol/TrakMateProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TramigoFrameDecoder.java b/src/org/traccar/protocol/TramigoFrameDecoder.java index 4178fba8d..20992c04b 100644 --- a/src/org/traccar/protocol/TramigoFrameDecoder.java +++ b/src/org/traccar/protocol/TramigoFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TramigoProtocol.java b/src/org/traccar/protocol/TramigoProtocol.java index ea4ea7140..28673c97b 100644 --- a/src/org/traccar/protocol/TramigoProtocol.java +++ b/src/org/traccar/protocol/TramigoProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java index 0aab1de34..9affa08b9 100644 --- a/src/org/traccar/protocol/TramigoProtocolDecoder.java +++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TrvProtocol.java b/src/org/traccar/protocol/TrvProtocol.java index 585cb7cf6..348ccd92a 100644 --- a/src/org/traccar/protocol/TrvProtocol.java +++ b/src/org/traccar/protocol/TrvProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TrvProtocolDecoder.java b/src/org/traccar/protocol/TrvProtocolDecoder.java index 42f8d313c..0afe065c2 100644 --- a/src/org/traccar/protocol/TrvProtocolDecoder.java +++ b/src/org/traccar/protocol/TrvProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tt8850Protocol.java b/src/org/traccar/protocol/Tt8850Protocol.java index 5d188de60..79dc031bc 100644 --- a/src/org/traccar/protocol/Tt8850Protocol.java +++ b/src/org/traccar/protocol/Tt8850Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Tt8850ProtocolDecoder.java b/src/org/traccar/protocol/Tt8850ProtocolDecoder.java index 39fedc138..b128068be 100644 --- a/src/org/traccar/protocol/Tt8850ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tt8850ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TytanProtocol.java b/src/org/traccar/protocol/TytanProtocol.java index b6608f925..0c27fb12b 100644 --- a/src/org/traccar/protocol/TytanProtocol.java +++ b/src/org/traccar/protocol/TytanProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index 7b5dc5ffe..b67902e56 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TzoneProtocol.java b/src/org/traccar/protocol/TzoneProtocol.java index ca3e490d2..38d5b139a 100644 --- a/src/org/traccar/protocol/TzoneProtocol.java +++ b/src/org/traccar/protocol/TzoneProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java index 477dc6399..8fd695b80 100644 --- a/src/org/traccar/protocol/TzoneProtocolDecoder.java +++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/UlbotechFrameDecoder.java b/src/org/traccar/protocol/UlbotechFrameDecoder.java index 09c1db717..8e7b497c5 100644 --- a/src/org/traccar/protocol/UlbotechFrameDecoder.java +++ b/src/org/traccar/protocol/UlbotechFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/UlbotechProtocol.java b/src/org/traccar/protocol/UlbotechProtocol.java index ca31dffc9..40f4594a5 100644 --- a/src/org/traccar/protocol/UlbotechProtocol.java +++ b/src/org/traccar/protocol/UlbotechProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java index ff41c9cc4..d2a58f1b8 100644 --- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java +++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/UproProtocol.java b/src/org/traccar/protocol/UproProtocol.java index 8f940fa15..ae6cac603 100644 --- a/src/org/traccar/protocol/UproProtocol.java +++ b/src/org/traccar/protocol/UproProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java index e6cb4e132..91404a241 100644 --- a/src/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/org/traccar/protocol/UproProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/V680Protocol.java b/src/org/traccar/protocol/V680Protocol.java index 83157790d..98c64830b 100644 --- a/src/org/traccar/protocol/V680Protocol.java +++ b/src/org/traccar/protocol/V680Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 29ac4fd90..181983f04 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/VisiontekProtocol.java b/src/org/traccar/protocol/VisiontekProtocol.java index dde906370..c6dd09562 100644 --- a/src/org/traccar/protocol/VisiontekProtocol.java +++ b/src/org/traccar/protocol/VisiontekProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/VisiontekProtocolDecoder.java b/src/org/traccar/protocol/VisiontekProtocolDecoder.java index 49c5dcc44..5ce12bd19 100644 --- a/src/org/traccar/protocol/VisiontekProtocolDecoder.java +++ b/src/org/traccar/protocol/VisiontekProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WatchProtocol.java b/src/org/traccar/protocol/WatchProtocol.java index 8f28916f0..b13fcfb11 100644 --- a/src/org/traccar/protocol/WatchProtocol.java +++ b/src/org/traccar/protocol/WatchProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index d74fdbe81..13eb73254 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WatchProtocolEncoder.java b/src/org/traccar/protocol/WatchProtocolEncoder.java index dc07a1046..f15c0f0c0 100644 --- a/src/org/traccar/protocol/WatchProtocolEncoder.java +++ b/src/org/traccar/protocol/WatchProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WialonProtocol.java b/src/org/traccar/protocol/WialonProtocol.java index 98af6973b..04e18cd85 100644 --- a/src/org/traccar/protocol/WialonProtocol.java +++ b/src/org/traccar/protocol/WialonProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index 538ee51ca..e3db1f8f0 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WialonProtocolEncoder.java b/src/org/traccar/protocol/WialonProtocolEncoder.java index d3a0fc3b9..9c60a1356 100644 --- a/src/org/traccar/protocol/WialonProtocolEncoder.java +++ b/src/org/traccar/protocol/WialonProtocolEncoder.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WondexFrameDecoder.java b/src/org/traccar/protocol/WondexFrameDecoder.java index ac1622350..db65ff80f 100644 --- a/src/org/traccar/protocol/WondexFrameDecoder.java +++ b/src/org/traccar/protocol/WondexFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WondexProtocol.java b/src/org/traccar/protocol/WondexProtocol.java index 54b39a5c4..0cc21d2b4 100644 --- a/src/org/traccar/protocol/WondexProtocol.java +++ b/src/org/traccar/protocol/WondexProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WondexProtocolDecoder.java b/src/org/traccar/protocol/WondexProtocolDecoder.java index 0fcb99578..491252bf6 100644 --- a/src/org/traccar/protocol/WondexProtocolDecoder.java +++ b/src/org/traccar/protocol/WondexProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/WondexProtocolEncoder.java b/src/org/traccar/protocol/WondexProtocolEncoder.java index c350838d0..8f9887b10 100644 --- a/src/org/traccar/protocol/WondexProtocolEncoder.java +++ b/src/org/traccar/protocol/WondexProtocolEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/XexunFrameDecoder.java b/src/org/traccar/protocol/XexunFrameDecoder.java index 184e2f57b..801fb4d59 100644 --- a/src/org/traccar/protocol/XexunFrameDecoder.java +++ b/src/org/traccar/protocol/XexunFrameDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/XexunProtocol.java b/src/org/traccar/protocol/XexunProtocol.java index ecaf18db4..2aea2f246 100644 --- a/src/org/traccar/protocol/XexunProtocol.java +++ b/src/org/traccar/protocol/XexunProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 06f255b91..5e390a4b7 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/XirgoProtocol.java b/src/org/traccar/protocol/XirgoProtocol.java index 9298f71ad..9d7475308 100644 --- a/src/org/traccar/protocol/XirgoProtocol.java +++ b/src/org/traccar/protocol/XirgoProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/XirgoProtocolDecoder.java b/src/org/traccar/protocol/XirgoProtocolDecoder.java index edab1af11..f20f4ef35 100644 --- a/src/org/traccar/protocol/XirgoProtocolDecoder.java +++ b/src/org/traccar/protocol/XirgoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Xt013Protocol.java b/src/org/traccar/protocol/Xt013Protocol.java index db9d21333..ad3e24df0 100644 --- a/src/org/traccar/protocol/Xt013Protocol.java +++ b/src/org/traccar/protocol/Xt013Protocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/Xt013ProtocolDecoder.java b/src/org/traccar/protocol/Xt013ProtocolDecoder.java index b5c222ba6..68497980b 100644 --- a/src/org/traccar/protocol/Xt013ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt013ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/YwtProtocol.java b/src/org/traccar/protocol/YwtProtocol.java index e24c8b02e..412365ecb 100644 --- a/src/org/traccar/protocol/YwtProtocol.java +++ b/src/org/traccar/protocol/YwtProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/protocol/YwtProtocolDecoder.java b/src/org/traccar/protocol/YwtProtocolDecoder.java index da5a86175..85f1264a8 100644 --- a/src/org/traccar/protocol/YwtProtocolDecoder.java +++ b/src/org/traccar/protocol/YwtProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2014 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/Events.java b/src/org/traccar/reports/Events.java index 88ff687d8..0ad6ab309 100644 --- a/src/org/traccar/reports/Events.java +++ b/src/org/traccar/reports/Events.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java index 818920ad5..6cbda0ede 100644 --- a/src/org/traccar/reports/ReportUtils.java +++ b/src/org/traccar/reports/ReportUtils.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/Route.java b/src/org/traccar/reports/Route.java index 4226d05ef..9ac183aea 100644 --- a/src/org/traccar/reports/Route.java +++ b/src/org/traccar/reports/Route.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/Summary.java b/src/org/traccar/reports/Summary.java index a82624bcf..d008f5d88 100644 --- a/src/org/traccar/reports/Summary.java +++ b/src/org/traccar/reports/Summary.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/Trips.java b/src/org/traccar/reports/Trips.java index 30fef40c9..5a3a9a355 100644 --- a/src/org/traccar/reports/Trips.java +++ b/src/org/traccar/reports/Trips.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/model/BaseReport.java b/src/org/traccar/reports/model/BaseReport.java index 246cdede0..c33b9a8dd 100644 --- a/src/org/traccar/reports/model/BaseReport.java +++ b/src/org/traccar/reports/model/BaseReport.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/model/DeviceReport.java b/src/org/traccar/reports/model/DeviceReport.java index c072de231..58caa809b 100644 --- a/src/org/traccar/reports/model/DeviceReport.java +++ b/src/org/traccar/reports/model/DeviceReport.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/model/SummaryReport.java b/src/org/traccar/reports/model/SummaryReport.java index 1e6655904..2d650381d 100644 --- a/src/org/traccar/reports/model/SummaryReport.java +++ b/src/org/traccar/reports/model/SummaryReport.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/reports/model/TripReport.java b/src/org/traccar/reports/model/TripReport.java index d726195cb..b28793e44 100644 --- a/src/org/traccar/reports/model/TripReport.java +++ b/src/org/traccar/reports/model/TripReport.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/web/ConsoleServlet.java b/src/org/traccar/web/ConsoleServlet.java index c1ab7c468..9b3d8d54b 100644 --- a/src/org/traccar/web/ConsoleServlet.java +++ b/src/org/traccar/web/ConsoleServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/web/CsvBuilder.java b/src/org/traccar/web/CsvBuilder.java index 4afc33144..532f06e3d 100644 --- a/src/org/traccar/web/CsvBuilder.java +++ b/src/org/traccar/web/CsvBuilder.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/web/GpxBuilder.java b/src/org/traccar/web/GpxBuilder.java index f9bebb730..bac7182dc 100644 --- a/src/org/traccar/web/GpxBuilder.java +++ b/src/org/traccar/web/GpxBuilder.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) - * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru) + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/web/JsonConverter.java b/src/org/traccar/web/JsonConverter.java index 19ac6f777..bec0afe8e 100644 --- a/src/org/traccar/web/JsonConverter.java +++ b/src/org/traccar/web/JsonConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index 3970fb6eb..8201f8d16 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/org/traccar/notification/NotificiationMailTest.java b/test/org/traccar/notification/NotificiationMailTest.java index adb7b5c15..975505a3a 100644 --- a/test/org/traccar/notification/NotificiationMailTest.java +++ b/test/org/traccar/notification/NotificiationMailTest.java @@ -12,7 +12,7 @@ import java.util.Properties; public class NotificiationMailTest { private static final String FROM = "notification@traccar.org"; - private static final String TO = "anton.tananaev@gmail.com"; + private static final String TO = "anton@traccar.org"; private static final String BODY = "Test email body."; private static final String SUBJECT = "Test"; -- cgit v1.2.3 From 77d193bf840ceb5294a6cb0d0cd6e1512e2b1efb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Nov 2016 15:04:07 +1300 Subject: Support new Totem protocol format --- src/org/traccar/protocol/TotemProtocolDecoder.java | 2 ++ test/org/traccar/protocol/TotemProtocolDecoderTest.java | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 121b56ff9..1fe91b942 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -138,9 +138,11 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { .number("(dd)") // external power .number("(dddd)") // adc 1 .groupBegin() + .groupBegin() .number("(dddd)") // adc 2 .number("(dddd)") // adc 3 .number("(dddd)") // adc 4 + .groupEnd("?") .number("(dddd)") // temperature 1 .number("(dddd)") // temperature 2 .groupEnd("?") diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java index 8ff2e6f11..89400fe22 100644 --- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java @@ -10,6 +10,12 @@ public class TotemProtocolDecoderTest extends ProtocolTest { TotemProtocolDecoder decoder = new TotemProtocolDecoder(new TotemProtocol()); + verifyPosition(decoder, text( + "$$0116AA864244026065291|18001800140916020524401100000000000027BA0E57063100000001.200000002237.8119N11403.5075E052020")); + + verifyPosition(decoder, text( + "$$0116AA867119025683137|108000001611020925324112000000000000616027F7001300000099.900000000000.0000N00000.0000E531824")); + verifyPosition(decoder, text( "$$0128AA864244026065291|18001800140916020524401100000000000000000000000027BA0E57063100000001.200000002237.8119N11403.5075E05202D")); -- cgit v1.2.3 From 850734d2f1bef8aba5761f540caa40c23608acc6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 6 Nov 2016 08:34:02 +1300 Subject: Fix NMEA checksum calculation (fix #2405) --- src/org/traccar/helper/Checksum.java | 5 +++-- test/org/traccar/WebDataHandlerTest.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/helper/Checksum.java b/src/org/traccar/helper/Checksum.java index 629f6e7ca..f08292392 100644 --- a/src/org/traccar/helper/Checksum.java +++ b/src/org/traccar/helper/Checksum.java @@ -204,8 +204,9 @@ public final class Checksum { public static String nmea(String msg) { int checksum = 0; - for (byte b : msg.getBytes(StandardCharsets.US_ASCII)) { - checksum ^= b; + byte[] bytes = msg.getBytes(StandardCharsets.US_ASCII); + for (int i = 1; i < bytes.length; i++) { + checksum ^= bytes[i]; } return String.format("*%02x", checksum).toUpperCase(); } diff --git a/test/org/traccar/WebDataHandlerTest.java b/test/org/traccar/WebDataHandlerTest.java index e68eaf74e..2a8205ad1 100644 --- a/test/org/traccar/WebDataHandlerTest.java +++ b/test/org/traccar/WebDataHandlerTest.java @@ -14,7 +14,7 @@ public class WebDataHandlerTest extends ProtocolTest { WebDataHandler handler = new WebDataHandler("http://localhost/?fixTime={fixTime}&gprmc={gprmc}&name={name}"); Assert.assertEquals( - "http://localhost/?fixTime=1451610123000&gprmc=$GPRMC,010203.000,A,2000.0000,N,03000.0000,E,0.00,0.00,010116,,*21&name=test", + "http://localhost/?fixTime=1451610123000&gprmc=$GPRMC,010203.000,A,2000.0000,N,03000.0000,E,0.00,0.00,010116,,*05&name=test", handler.formatRequest(p)); } -- cgit v1.2.3 From eb2165714a1ef71b4ec48a80613598b222284f0f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 7 Nov 2016 02:10:44 +1300 Subject: Handle new line in ET messages (fix #2509) --- src/org/traccar/protocol/EasyTrackProtocol.java | 4 ++-- test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/EasyTrackProtocol.java b/src/org/traccar/protocol/EasyTrackProtocol.java index 78f7f0b12..eeed07129 100644 --- a/src/org/traccar/protocol/EasyTrackProtocol.java +++ b/src/org/traccar/protocol/EasyTrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ public class EasyTrackProtocol extends BaseProtocol { serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); + pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "#", "\r\n")); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(EasyTrackProtocol.this)); diff --git a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java index 41c747ad6..51c515544 100644 --- a/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java +++ b/test/org/traccar/protocol/EasyTrackProtocolDecoderTest.java @@ -10,6 +10,18 @@ public class EasyTrackProtocolDecoderTest extends ProtocolTest { EasyTrackProtocolDecoder decoder = new EasyTrackProtocolDecoder(new EasyTrackProtocol()); + verifyPosition(decoder, text( + "*ET,358155100054249,HB,A,100b06,053318,803a0b51,03d507c9,0017,0000,00400000,07,100,0000,1435,63")); + + verifyNothing(decoder, text( + "*ET,358155100054249,MQ")); + + verifyNothing(decoder, text( + "*ET,358155100054249,TX,A,100b06,053230")); + + verifyPosition(decoder, text( + "*ET,358155100054249,HB,A,100b06,053212,803a0b20,03d507a2,0054,0000,40400000,06,100,0000,1435,44")); + verifyNothing(decoder, text( "*ET,135790246811221,GZ,0001,0005")); -- cgit v1.2.3 From 2114a9f943da3f346a4882d4ca930de7eb8eb99f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 8 Nov 2016 00:41:44 +1300 Subject: Add some more Caltel unit tests --- .../traccar/protocol/CastelProtocolDecoderTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/CastelProtocolDecoderTest.java b/test/org/traccar/protocol/CastelProtocolDecoderTest.java index e2f2c26bf..4ecb263ba 100644 --- a/test/org/traccar/protocol/CastelProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CastelProtocolDecoderTest.java @@ -12,6 +12,24 @@ public class CastelProtocolDecoderTest extends ProtocolTest { CastelProtocolDecoder decoder = new CastelProtocolDecoder(new CastelProtocol()); + verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "404043000432313345503230313630303035383500000000004006a2021d5810031d58ae940400da050000f6040000070000000400076401680000000001001bd20d0a")); + + verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "4040d0000432313345503230313630303035383500000000001001831c1c58b1fc1c58ae94040012220000f60400005800000000000763016800008484004944445f3231335730315f532056312e302e37004944445f3231335730315f482056312e302e370032000110021003100410051006100710081009100a100b100c100d100e1011100111021103110411051106110711011202120312041201130213031301160216011701180218011b011c011d011e011f021f031f041f051f061f071f0121022101260127012861780d0a")); + + verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "404029000432313345503230313630303035383500000000009001ffffffff0000b4fc1c582b6e0d0a")); + + verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "40406000043231334550323031363030303538350000000000400708000000831c1c58f4fb1c58ae94040012220000f604000058000000200007630168000084c401040b10090c3532db3f07f07f7520090100000101010e00000000c7920d0a")); + + verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "404042000432313345503230313630303035383500000000001002831c1c58b7fc1c58ae94040012220000f604000058000000000007630168000084840072a20d0a")); + + verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "4040d0000432313345503230313630303035383500000000001001831c1c5805fe1c58ae94040012220000f60400005800000000000763016800008484004944445f3231335730315f532056312e302e37004944445f3231335730315f482056312e302e370032000110021003100410051006100710081009100a100b100c100d100e1011100111021103110411051106110711011202120312041201130213031301160216011701180218011b011c011d011e011f021f031f041f051f061f071f012102210126012701284eb10d0a")); + verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN, "40405700043231334e583230313630303131373700000000004002c458ce572159ce57a9e2020082030000500c00000f0000000400036401240e0403023c000505210c210d210f21102101075b14030121330269430d0a")); -- cgit v1.2.3 From 504c0dbc6e77c35041f0f1237bb0325ab1c0bd24 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 8 Nov 2016 10:17:53 +1300 Subject: Add H02 unit test case --- test/org/traccar/protocol/H02ProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index e4db2f56f..88c76f66a 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { H02ProtocolDecoder decoder = new H02ProtocolDecoder(new H02Protocol()); + verifyNothing(decoder, buffer( + "*HQ,355488020533263,V3,121536,65501,04,000152,014001,156,-64,000161,010642,138,,000152,014003,129,,000152,013973,126,,02E4,0,X,071116,FFFFFBFF#")); + verifyPosition(decoder, buffer( "*HQ,4209917484,V19,093043,V,5052.9749,N,00426.4322,E,000.00,000,130916,,0032475874141,8944538530000543700F,FFFFFBFF#")); -- cgit v1.2.3 From 2a312faf02efc0130c419d31abd6169b6da30806 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 9 Nov 2016 03:36:54 +1300 Subject: Extend upro protocol decoder --- src/org/traccar/protocol/UproProtocolDecoder.java | 91 +++++++++++++++++----- .../traccar/protocol/UproProtocolDecoderTest.java | 9 +++ 2 files changed, 80 insertions(+), 20 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java index 91404a241..e48162322 100644 --- a/src/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/org/traccar/protocol/UproProtocolDecoder.java @@ -18,10 +18,10 @@ package org.traccar.protocol; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; +import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; -import org.traccar.helper.PatternUtil; import org.traccar.model.Position; import java.net.SocketAddress; @@ -34,50 +34,101 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern PATTERN = new PatternBuilder() - .text("*AI20") + .text("*") + .expression("..20") .expression("[01]") // ack .number("(d+),") // device id - .expression(".+&A") + .expression(".") // type + .expression(".") // subtype + .expression("(.*)") // content + .expression("#?") // delimiter + .compile(); + + private static final Pattern PATTERN_LOCATION = new PatternBuilder() + .text("A") .number("(dd)(dd)(dd)") // time .number("(dd)(dd)(dddd)") // latitude .number("(ddd)(dd)(dddd)") // longitude - .number("d{5}") + .number("(d)") // flags + .number("(dd)") // speed + .number("(dd)") // course .number("(dd)(dd)(dd)") // date - .expression("&B") - .any() .compile(); + private void decodeLocation(Position position, String data) { + Parser parser = new Parser(PATTERN_LOCATION, data); + if (parser.matches()) { + + DateBuilder dateBuilder = new DateBuilder() + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + + position.setValid(true); + position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN)); + position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN)); + + int flags = parser.nextInt(); + position.setValid(BitUtil.check(flags, 0)); + if (!BitUtil.check(flags, 1)) { + position.setLatitude(-position.getLatitude()); + } + if (!BitUtil.check(flags, 2)) { + position.setLatitude(-position.getLatitude()); + } + + position.setSpeed(parser.nextInt() * 2); + position.setCourse(parser.nextInt() * 10); + + dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + } + } + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - PatternUtil.MatchResult r = PatternUtil.checkPattern(PATTERN.pattern(), (String) msg); - Parser parser = new Parser(PATTERN, (String) msg); if (!parser.matches()) { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } - position.setDeviceId(deviceSession.getDeviceId()); - DateBuilder dateBuilder = new DateBuilder() - .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); - position.setValid(true); - position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN)); - position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN)); + String[] data = parser.next().split("&"); + for (int i = 0; i < data.length; i++) { + if (i != 0) { + switch (data[i].charAt(0)) { + case 'A': + decodeLocation(position, data[i]); + break; + case 'B': + position.set(Position.KEY_STATUS, data[i].substring(1)); + break; + case 'P': + position.set(Position.KEY_MCC, Integer.parseInt(data[i].substring(1, 5))); + position.set(Position.KEY_MNC, Integer.parseInt(data[i].substring(5, 9))); + position.set(Position.KEY_LAC, Integer.parseInt(data[i].substring(9, 13), 16)); + position.set(Position.KEY_CID, Integer.parseInt(data[i].substring(13, 17), 16)); + break; + default: + break; + } + } + } - dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); - position.setTime(dateBuilder.getDate()); + if (position.getLatitude() != 0 && position.getLongitude() != 0) { + return position; + } - return position; + return null; } } diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index aab31ba26..d553d5f52 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -10,6 +10,15 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(new UproProtocol()); + verifyNothing(decoder, text( + "*MG20113800138000,AH#")); + + verifyPosition(decoder, text( + "*MG201693502000034964,AB&A0200183324418107033792800009051116&B0000000000&N15&Z94&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0#")); + + verifyPosition(decoder, text( + "*MG201693502000034964,AB&A0200543324412007033805910000051116&P0730000032d66785&B0000000000&N15&Z92&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0#")); + verifyPosition(decoder, text( "*AI2000905447674,BA&A2003064913201201845107561627121016&B0100000000&C05>8=961&F0333&K023101002154A7#")); -- cgit v1.2.3 From ef7247060c22c060744580f825391673773703c5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 9 Nov 2016 20:50:48 +1300 Subject: Support LBS for H02 protocol --- src/org/traccar/protocol/H02ProtocolDecoder.java | 65 ++++++++++++++++++++-- .../traccar/protocol/H02ProtocolDecoderTest.java | 14 ++++- 2 files changed, 74 insertions(+), 5 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index e74f9e862..45a978571 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -170,6 +170,22 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .any() .compile(); + private static final Pattern PATTERN_NBR = new PatternBuilder() + .text("*") + .expression("..,") // manufacturer + .number("(d+),") // imei + .text("NBR,") + .number("(dd)(dd)(dd),") // time + .number("(d+),") // mcc + .number("(d+),") // mnc + .number("d+,") // gsm delay time + .number("d+,") // count + .number("((?:d+,d+,d+,)+)") // cells + .number("(dd)(dd)(dd),") // date (ddmmyy) + .number("(x{8})") // status + .any() + .compile(); + private Position decodeText(String sentence, Channel channel, SocketAddress remoteAddress) { Parser parser = new Parser(PATTERN, sentence); @@ -177,13 +193,13 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { return null; } - Position position = new Position(); - position.setProtocol(getProtocolName()); - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } + + Position position = new Position(); + position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder(); @@ -224,6 +240,42 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { return position; } + private Position decodeLbs(String sentence, Channel channel, SocketAddress remoteAddress) { + + Parser parser = new Parser(PATTERN_NBR, sentence); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + DateBuilder dateBuilder = new DateBuilder() + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + + position.set(Position.KEY_MCC, parser.nextInt()); + position.set(Position.KEY_MNC, parser.nextInt()); + + String[] cells = parser.next().split(","); // decode all in future + position.set(Position.KEY_LAC, Integer.parseInt(cells[0])); + position.set(Position.KEY_CID, Integer.parseInt(cells[1])); + position.set(Position.KEY_GSM, Integer.parseInt(cells[2])); + + dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); + + getLastLocation(position, dateBuilder.getDate()); + + processStatus(position, parser.nextLong(16)); + + return position; + } + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { @@ -234,7 +286,12 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { // handle X mode? if (marker.equals("*")) { - return decodeText(buf.toString(StandardCharsets.US_ASCII), channel, remoteAddress); + String sentence = buf.toString(StandardCharsets.US_ASCII); + if (sentence.contains(",NBR,")) { + return decodeLbs(sentence, channel, remoteAddress); + } else { + return decodeText(sentence, channel, remoteAddress); + } } else if (marker.equals("$")) { return decodeBinary(buf, channel, remoteAddress); } diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index 88c76f66a..48fe408d8 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -10,6 +10,18 @@ public class H02ProtocolDecoderTest extends ProtocolTest { H02ProtocolDecoder decoder = new H02ProtocolDecoder(new H02Protocol()); + verifyAttributes(decoder, buffer( + "*HQ,1400046168,NBR,160169,460,0,1,4,9338,3692,150,9338,3691,145,9338,3690,140,9338,3692,139,180813,FFFFFBFF#")); + + verifyAttributes(decoder, buffer( + "*HQ,1600068860,NBR,120156,262,03,255,6,802,54702,46,802,5032,37,802,54782,30,802,5052,28,802,54712,12,802,5042,12,081116,FFFFFBFF#")); + + verifyAttributes(decoder, buffer( + "*HQ,1600068860,NBR,110326,262,03,255,6,802,23152,23,812,49449,14,802,35382,13,802,35402,11,812,56622,09,802,23132,04,081116,FFFFFBFF#")); + + verifyNothing(decoder, buffer( + "*HQ,1600068860,LINK,112137,20,8,67,0,0,081116,FFFFFBFF#")); + verifyNothing(decoder, buffer( "*HQ,355488020533263,V3,121536,65501,04,000152,014001,156,-64,000161,010642,138,,000152,014003,129,,000152,013973,126,,02E4,0,X,071116,FFFFFBFF#")); @@ -23,7 +35,7 @@ public class H02ProtocolDecoderTest extends ProtocolTest { "*HQ,4210051415,V1,164549,A,0956.3869,N,08406.7068,W,000.00,000,221215,FFFFFBFF,712,01,0,0,6#"), position("2015-12-22 16:45:49.000", true, 9.93978, -84.11178)); - verifyNothing(decoder, buffer( + verifyAttributes(decoder, buffer( "*HQ,1451316451,NBR,112315,724,10,2,2,215,2135,123,215,2131,121,011215,FFFFFFFF#")); verifyPosition(decoder, buffer( -- cgit v1.2.3 From 9d9dbcdd3229c6f852031d2e458aca194bcee8b9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 10 Nov 2016 01:35:35 +1300 Subject: Fix issues with upro coordinates --- src/org/traccar/protocol/UproProtocolDecoder.java | 2 +- test/org/traccar/protocol/UproProtocolDecoderTest.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java index e48162322..02a241ddd 100644 --- a/src/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/org/traccar/protocol/UproProtocolDecoder.java @@ -72,7 +72,7 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(-position.getLatitude()); } if (!BitUtil.check(flags, 2)) { - position.setLatitude(-position.getLatitude()); + position.setLongitude(-position.getLongitude()); } position.setSpeed(parser.nextInt() * 2); diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index d553d5f52..034fd78a1 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -10,6 +10,10 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(new UproProtocol()); + verifyPosition(decoder, text( + "*MG201693502000034964,AB&A0800253335360507036975710000091116&P0730000032d2a94d&B0000000000&N13&Z12&U_P\0\0\0\u0004\0\0\0\0\0\0\0\0\0\0#"), + position("2016-11-09 08:00:25.000", true, -33.58934, -70.61626)); + verifyNothing(decoder, text( "*MG20113800138000,AH#")); @@ -23,7 +27,8 @@ public class UproProtocolDecoderTest extends ProtocolTest { "*AI2000905447674,BA&A2003064913201201845107561627121016&B0100000000&C05>8=961&F0333&K023101002154A7#")); verifyPosition(decoder, text( - "*AI200905300036,AH&A0317264913209801844913060000251115&B0500000000&C0;4?72:9&F0000#")); + "*AI200905300036,AH&A0317264913209801844913060000251115&B0500000000&C0;4?72:9&F0000#"), + position("2015-11-25 03:17:26.000", false, 49.22016, 18.74855)); verifyPosition(decoder, text( "*AI2000905300036,AS&A1647304913209801844913060000251115&B0400000000&C0;4?72:9&F0000")); -- cgit v1.2.3 From bafda68f2b84c77553e663f116305ab6ed807254 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 12 Nov 2016 09:47:43 +1300 Subject: New format for V680 protocol --- src/org/traccar/protocol/V680ProtocolDecoder.java | 28 ++++++++++++++++------ .../traccar/protocol/V680ProtocolDecoderTest.java | 7 +++++- 2 files changed, 27 insertions(+), 8 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 181983f04..ca9c451c2 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,10 +43,8 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { .number("(d+)#") // packet number .expression("([^#]+)?#?") // gsm base station .expression("(?:[^#]+#)?") - .number("(d+)?(dd.d+),") // longitude - .expression("([EW]),") - .number("(d+)?(dd.d+),") // latitude - .expression("([NS]),") + .number("(d+.d+),([EW]),") // longitude + .number("(d+.d+),([NS]),") // latitude .number("(d+.d+),") // speed .number("(d+.?d*)?#") // course .number("(dd)(dd)(dd)#") // date @@ -93,8 +91,24 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { position.set("packet", parser.next()); position.set(Position.KEY_GSM, parser.next()); - position.setLongitude(parser.nextCoordinate()); - position.setLatitude(parser.nextCoordinate()); + double lon = parser.nextDouble(); + boolean west = parser.next().equals("W"); + double lat = parser.nextDouble(); + boolean south = parser.next().equals("S"); + + if (lat > 90 || lon > 180) { + int lonDegrees = (int) (lon * 0.01); + lon = (lon - lonDegrees * 100) / 60.0; + lon += lonDegrees; + + int latDegrees = (int) (lat * 0.01); + lat = (lat - latDegrees * 100) / 60.0; + lat += latDegrees; + } + + position.setLongitude(west ? -lon : lon); + position.setLatitude(south ? -lat : lat); + position.setSpeed(parser.nextDouble()); position.setCourse(parser.nextDouble()); diff --git a/test/org/traccar/protocol/V680ProtocolDecoderTest.java b/test/org/traccar/protocol/V680ProtocolDecoderTest.java index 2e36010c7..f68497304 100644 --- a/test/org/traccar/protocol/V680ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/V680ProtocolDecoderTest.java @@ -10,6 +10,10 @@ public class V680ProtocolDecoderTest extends ProtocolTest { V680ProtocolDecoder decoder = new V680ProtocolDecoder(new V680Protocol()); + verifyPosition(decoder, text( + "#867967020910610#01234567890#1#0000#AUT#1#0500000000120000#114.036291,E,22.665795,N,111.00,000.00#111116#193333##"), + position("2016-11-11 19:33:33.000", true, 22.66579, 114.03629)); + verifyPosition(decoder, text( "#355488020168617##1#0000#AUT#01#260001a412966f#1834.790700,E,5302.748800,N,0.00,0.00#310316#174538.000##")); @@ -23,7 +27,8 @@ public class V680ProtocolDecoderTest extends ProtocolTest { "#135790246811222#13486119277#1#0000#SOS#1#27bc10af#11407.4182,E,2232.7632,N,0.00,79.50#070709#134147.000##")); verifyPosition(decoder, text( - "#356823031193431##0#0000#SF#1#72403#V#04702.3025,W,2252.18380,S,008.18,0#090413#134938")); + "#356823031193431##0#0000#SF#1#72403#V#04702.3025,W,2252.18380,S,008.18,0#090413#134938"), + position("2013-04-09 13:49:38.000", false, -22.86973, -47.038375)); verifyPosition(decoder, text( "#356823033219838#1000#0#1478#AUT#1#66830FFB#03855.6628,E,4716.6821,N,001.41,259#130812#143905")); -- cgit v1.2.3 From c2866eb249b3896bdabe1a5ef421a33acc0ff138 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 13 Nov 2016 11:09:40 +1300 Subject: Add Navis protocol unit test --- test/org/traccar/protocol/NavisProtocolDecoderTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/NavisProtocolDecoderTest.java b/test/org/traccar/protocol/NavisProtocolDecoderTest.java index 4b612e941..432d0eaca 100644 --- a/test/org/traccar/protocol/NavisProtocolDecoderTest.java +++ b/test/org/traccar/protocol/NavisProtocolDecoderTest.java @@ -16,6 +16,10 @@ public class NavisProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN, "404E5443010000007B000000130044342A3E533A383631373835303035323035303739")); + verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "404e5443010000000000000059009adb2a3e54250000000000ff1500040b0a1008291838001200760ee600000000000000000000000f1500040b0a10ac20703fb1aec23f00000000320149668f430000000000000000000000000000000000000000000000f3808080"), + position("2016-11-11 21:00:04.000", true, 53.74336, 87.14437)); + verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN, "404e544300000000040000005a00c6812a3e410125e3a60700011705071503011030210c0000fa200910e6000000000000000000000001082106150010ae97643f88a39f3f0000000090001fcc6c450000000000000000000000000000000000000000000000f6808080")); -- cgit v1.2.3 From 4066c24ed1ba8749a1a682acb5b027401d0df70f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 14 Nov 2016 01:56:26 +1300 Subject: Another attempt to fix H02 frame decoder --- src/org/traccar/protocol/H02FrameDecoder.java | 16 +++++++++------- test/org/traccar/protocol/H02FrameDecoderTest.java | 21 ++++++++++++++++++--- .../traccar/protocol/H02ProtocolDecoderTest.java | 3 +++ 3 files changed, 30 insertions(+), 10 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/H02FrameDecoder.java b/src/org/traccar/protocol/H02FrameDecoder.java index d461c9219..a22252a57 100644 --- a/src/org/traccar/protocol/H02FrameDecoder.java +++ b/src/org/traccar/protocol/H02FrameDecoder.java @@ -54,16 +54,18 @@ public class H02FrameDecoder extends FrameDecoder { } else if (marker == '$') { - if (messageLength > 0 && buf.readableBytes() >= messageLength) { - return buf.readBytes(messageLength); - } else if (buf.readableBytes() >= MESSAGE_SHORT) { - if (buf.getUnsignedByte(buf.readerIndex() + MESSAGE_SHORT - 1) == 0) { - return buf.readBytes(MESSAGE_SHORT); - } else if (buf.readableBytes() >= MESSAGE_LONG) { - return buf.readBytes(MESSAGE_LONG); + if (messageLength == 0) { + if (buf.readableBytes() == MESSAGE_LONG) { + messageLength = MESSAGE_LONG; + } else { + messageLength = MESSAGE_SHORT; } } + if (buf.readableBytes() >= messageLength) { + return buf.readBytes(messageLength); + } + } return null; diff --git a/test/org/traccar/protocol/H02FrameDecoderTest.java b/test/org/traccar/protocol/H02FrameDecoderTest.java index 3e12bb446..7d54299a5 100644 --- a/test/org/traccar/protocol/H02FrameDecoderTest.java +++ b/test/org/traccar/protocol/H02FrameDecoderTest.java @@ -7,13 +7,17 @@ import org.traccar.ProtocolTest; public class H02FrameDecoderTest extends ProtocolTest { @Test - public void testDecode() throws Exception { + public void testDecodeShort() throws Exception { H02FrameDecoder decoder = new H02FrameDecoder(0); Assert.assertEquals( - binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"), - decoder.decode(null, null, binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"))); + binary("2441060116601245431311165035313006004318210e000000fffffbffff0024"), + decoder.decode(null, null, binary("2441060116601245431311165035313006004318210e000000fffffbffff0024"))); + + Assert.assertEquals( + binary("2441060116601245431311165035313006004318210e000000fffffbffff0024"), + decoder.decode(null, null, binary("2441060116601245431311165035313006004318210e000000fffffbffff00242a48512c343130363031313636302c56312c3132343535322c412c353033352e333132392c4e2c30303433312e383231312c452c3030302e32302c3030302c3133313131362c464646464642464623"))); Assert.assertEquals( binary("2a48512c3335333538383036303031353536382c56312c3139333530352c412c3830392e303031302c532c333435342e383939372c572c302e30302c302e30302c3239313031332c65666666666266662c3030303264342c3030303030622c3030353338352c3030353261612c323523"), @@ -25,4 +29,15 @@ public class H02FrameDecoderTest extends ProtocolTest { } + @Test + public void testDecodeLong() throws Exception { + + H02FrameDecoder decoder = new H02FrameDecoder(0); + + Assert.assertEquals( + binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"), + decoder.decode(null, null, binary("24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"))); + + } + } diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index 48fe408d8..9fed9943c 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -115,6 +115,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, buffer( "*HQ,8401016597,BASE,152609,0,0,0,0,211014,FFFFFFFF#")); + verifyPosition(decoder, binary( + "2441060116601245431311165035313006004318210e000000fffffbffff0024")); + verifyPosition(decoder, binary( "24410600082621532131081504419390060740418306000000fffffbfdff0015060000002c02dc0c000000001f"), position("2015-08-31 21:53:21.000", true, 4.69898, -74.06971)); -- cgit v1.2.3 From 4b1b5855ea48624605574c69f5c8ae8f7b8fa54d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 14 Nov 2016 05:33:31 +1300 Subject: Add H02 unit test case --- test/org/traccar/protocol/H02ProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index 9fed9943c..b2e336076 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { H02ProtocolDecoder decoder = new H02ProtocolDecoder(new H02Protocol()); + verifyNothing(decoder, buffer( + "*HQ,356803210091319,BS,,2d4,a,1b63,1969,26,1b63,10b2,31,0,0,25,,ffffffff,60#")); + verifyAttributes(decoder, buffer( "*HQ,1400046168,NBR,160169,460,0,1,4,9338,3692,150,9338,3691,145,9338,3690,140,9338,3692,139,180813,FFFFFBFF#")); -- cgit v1.2.3 From 3507d5f7aa0670c0970b7e65c91a31fdada41ea2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 15 Nov 2016 03:50:30 +1300 Subject: Add JT600 unit test cases --- test/org/traccar/protocol/Jt600FrameDecoderTest.java | 8 ++++++++ test/org/traccar/protocol/Jt600ProtocolDecoderTest.java | 3 +++ 2 files changed, 11 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/Jt600FrameDecoderTest.java b/test/org/traccar/protocol/Jt600FrameDecoderTest.java index 43f7461d0..afa53ba13 100644 --- a/test/org/traccar/protocol/Jt600FrameDecoderTest.java +++ b/test/org/traccar/protocol/Jt600FrameDecoderTest.java @@ -11,6 +11,10 @@ public class Jt600FrameDecoderTest extends ProtocolTest { Jt600FrameDecoder decoder = new Jt600FrameDecoder(); + Assert.assertEquals( + binary("2475604055531611002311111600311326144436028210791d016c0000001f070000000020c03c4f6d07d80ccf"), + decoder.decode(null, null, binary("2475604055531611002311111600311326144436028210791d016c0000001f070000000020c03c4f6d07d80ccf"))); + Assert.assertEquals( binary("2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607"), decoder.decode(null, null, binary("2475605035891613002328091601152806086750106533350c00000000000a000000000000e1ff4f97007f1607"))); @@ -23,6 +27,10 @@ public class Jt600FrameDecoderTest extends ProtocolTest { binary("24312082002911001B171012053405243809970255335555000406140003EE2B91044D1F02"), decoder.decode(null, null, binary("24312082002911001B171012053405243809970255335555000406140003EE2B91044D1F02"))); + Assert.assertEquals( + binary("28373536303430353535332c404a5429"), + decoder.decode(null, null, binary("28373536303430353535332c404a5429"))); + } } diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 3fc74081f..59dc311aa 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new Jt600Protocol()); + verifyPosition(decoder, binary( + "2475604055531611002311111600311326144436028210791d016c0000001f070000000020c03c4f6d07d80ccf")); + verifyPosition(decoder, binary( "2475201509260111002313101503464722331560113555309F00000000002D0500CB206800F064109326381A03")); -- cgit v1.2.3 From fcc70df74b1fb17280b837b2a31722c2f3fc8ad2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 15 Nov 2016 22:06:41 +1300 Subject: Fix Astra decoding problem --- src/org/traccar/protocol/AstraProtocolDecoder.java | 12 +++++++++--- test/org/traccar/protocol/AstraProtocolDecoderTest.java | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/AstraProtocolDecoder.java b/src/org/traccar/protocol/AstraProtocolDecoder.java index d51be633d..390434d54 100644 --- a/src/org/traccar/protocol/AstraProtocolDecoder.java +++ b/src/org/traccar/protocol/AstraProtocolDecoder.java @@ -22,6 +22,7 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; +import org.traccar.helper.Log; import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; @@ -82,7 +83,9 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder { int reason = buf.readUnsignedMedium(); position.set(Position.KEY_EVENT, reason); - position.set(Position.KEY_STATUS, buf.readUnsignedShort()); + int status = buf.readUnsignedShort(); + position.set(Position.KEY_STATUS, status); + position.set(Position.PREFIX_IO + 1, buf.readUnsignedByte()); position.set(Position.PREFIX_ADC + 1, buf.readUnsignedByte()); position.set(Position.KEY_BATTERY, buf.readUnsignedByte()); @@ -101,7 +104,7 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // geofence events - if (BitUtil.check(reason, 6) || BitUtil.check(reason, 7)) { + if (BitUtil.check(status, 8)) { position.set(Position.KEY_RFID, buf.readBytes(7).toString(StandardCharsets.US_ASCII)); position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium() * 1000); @@ -110,7 +113,10 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder { } - // extra data + if (BitUtil.check(status, 6)) { + Log.warning("Extension data is not supported"); + return position; + } positions.add(position); diff --git a/test/org/traccar/protocol/AstraProtocolDecoderTest.java b/test/org/traccar/protocol/AstraProtocolDecoderTest.java index e8a9b12b5..3531be5a8 100644 --- a/test/org/traccar/protocol/AstraProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AstraProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class AstraProtocolDecoderTest extends ProtocolTest { AstraProtocolDecoder decoder = new AstraProtocolDecoder(new AstraProtocol()); + verifyPositions(decoder, binary( + "4b00700529c0c265976b8202cba9ff00676d864554a9c30000000020073401006436000300030008000000000000a0000100001920c43d00009600428302cba9ff00676d864554aa3e000000002007240100643b000300020008000000000000b0000100001920c43d00009600420f0e")); + verifyPositions(decoder, binary( "4b00320524c1da58769e6d0322617effe874024453065600a800000100080000643e0000000000000000000000069500e7bb")); -- cgit v1.2.3 From 57b831ca0b08c3ac2c4aa93b9ba2a3c44d78344b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 16 Nov 2016 03:32:20 +1300 Subject: Decode upro odometer and OBD --- src/org/traccar/protocol/UproProtocolDecoder.java | 11 +++++++++++ test/org/traccar/protocol/UproProtocolDecoderTest.java | 3 +++ 2 files changed, 14 insertions(+) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java index d5a00c6df..c6f400cae 100644 --- a/src/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/org/traccar/protocol/UproProtocolDecoder.java @@ -121,12 +121,23 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { case 'B': position.set(Position.KEY_STATUS, data[i].substring(1)); break; + case 'C': + long odometer = 0; + for (int j = 1; j < data[i].length(); j++) { + odometer <<= 4; + odometer += data[i].charAt(j) - '0'; + } + position.set(Position.KEY_ODOMETER, odometer); + break; case 'P': position.set(Position.KEY_MCC, Integer.parseInt(data[i].substring(1, 5))); position.set(Position.KEY_MNC, Integer.parseInt(data[i].substring(5, 9))); position.set(Position.KEY_LAC, Integer.parseInt(data[i].substring(9, 13), 16)); position.set(Position.KEY_CID, Integer.parseInt(data[i].substring(13, 17), 16)); break; + case 'S': + position.set("obd", data[i]); + break; default: break; } diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index 034fd78a1..711fe39b6 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(new UproProtocol()); + verifyPosition(decoder, text( + "*MG201693502000035441,BA&A1213073325458307036690710000151116&P0730000032ce4fb3&D1&B0000000000&C005799?7&S3,20161115120025,07035.54659E,3324.87721N,3000,0,0,0,0,847,599,8,40,0,19,20&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0&T0107#")); + verifyPosition(decoder, text( "*MG201693502000034964,AB&A0800253335360507036975710000091116&P0730000032d2a94d&B0000000000&N13&Z12&U_P\0\0\0\u0004\0\0\0\0\0\0\0\0\0\0#"), position("2016-11-09 08:00:25.000", true, -33.58934, -70.61626)); -- cgit v1.2.3 From 0d9bc43602b496aa1afdd83748388526e84cdf80 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 18 Nov 2016 00:27:15 +1300 Subject: Add Meiligao unit test case --- test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index 94f91e825..10fa3f971 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class MeiligaoProtocolDecoderTest extends ProtocolTest { MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new MeiligaoProtocol()); + verifyPosition(decoder, binary( + "242400706573402852404799553130313932372e3030302c412c313732362e38323739332c4e2c30373832382e31393637312c452c312e382c362e342c3137313131362c2c2a32427c312e36387c3534342e327c313030307c303030302c303030307c3030303032383638373a1a0d0a")); + verifyPosition(decoder, binary( "2424007d0000000000000099553231303333302e3030302c562c343533342e333832342c532c30373230332e303630302c572c302e30302c302c3231313031362c2c2a31327c302e307c3332397c323030307c303030452c303030437c303244413030303145413634393541417c31307c30303030303030306e540d0a")); -- cgit v1.2.3 From f04881e56938315867a97db2027d58f27f7a20fd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 18 Nov 2016 03:53:09 +1300 Subject: Add TK103 OBD test cases --- test/org/traccar/protocol/Tk103ProtocolDecoderTest.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index ba820f2f6..4c6f0e004 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -10,6 +10,12 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest { Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new Tk103Protocol()); + verifyNothing(decoder, text( + "(027028258309BQ86,0,05550c21b10d1d0f431008bd114c0ea5078400010007a100423932,161117005322,01000001)")); + + verifyNothing(decoder, text( + "(027028258309BQ86,0,05470c0eb20d040f4410022911360e92077e00010007a1004237c7,161117005232,01000001)")); + verifyPosition(decoder, text( "(01602009983BR00160830V1855.7022S4817.8731W000.0002729000.0010000000L00000000)")); -- cgit v1.2.3 From 15d54b086be597f5698acc5750694f93c7629ca7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 24 Nov 2016 13:38:12 +1300 Subject: Add Appello unit test cases --- test/org/traccar/protocol/AppelloProtocolDecoderTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/AppelloProtocolDecoderTest.java b/test/org/traccar/protocol/AppelloProtocolDecoderTest.java index f83039265..2e7d8f082 100644 --- a/test/org/traccar/protocol/AppelloProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AppelloProtocolDecoderTest.java @@ -10,9 +10,15 @@ public class AppelloProtocolDecoderTest extends ProtocolTest { AppelloProtocolDecoder decoder = new AppelloProtocolDecoder(new AppelloProtocol()); + verifyAttributes(decoder, text( + "FOLLOWIT,867273024233699,UTCTIME,0.000000,0.000000,0,0,0,0,L,262:3:c703:4bf8:64:255|262:3:c703:9a18:45|262:3:c703:e838:33|262:3:c703:7190:20|262:3:c704:d896:17|,02,44,,31,,4.20,0,0,86/44/24,,,,26,02264DFF6E16:69|4C09D408554E:79|4C09D408554F:79|E0885DE705E5:81|E2885DE705E7:81|246511122CCC:83|,34925")); + + verifyAttributes(decoder, text( + "FOLLOWIT,867273024233699,UTCTIME,0.000000,0.000000,0,0,0,0,L,262:3:c703:4bf8:64:1|262:3:c703:9a18:44|262:3:c703:e838:33|262:3:c703:7190:21|262:3:c704:d896:18|262:3:c703:71a6:13|262:3:c703:253d:13|,02,44,,22,,4.20,0,0,86/44/24,,,,30,02264DFF6E16:67|E0885DE705E5:87|B4A5EF284B94:88|E2885DE705E7:85|4C09D408554E:78|3481C4D71B13:43|,24033")); + verifyAttributes(decoder, text( "FOLLOWIT,860719028336968,UTCTIME,-12.112660,-77.045189,0,0,3,-0,L,716,10,049C,2A47,23,,4.22,,53,999/00/00,,,,,,59826,")); - + verifyPosition(decoder, text( "FOLLOWIT,860719028336968,160211221959,-12.112660,-77.045258,1,0,6,116,F,716,17,4E85,050C,29,,4.22,,39,999/00/00,,,,,,46206,")); -- cgit v1.2.3 From 04f33e6ba29b3a73a65b081d2a8b6ac3e0e0ebee Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 24 Nov 2016 15:52:52 +1300 Subject: Implement Teltonika AT200 protocol --- setup/default.xml | 1 + src/org/traccar/protocol/At2000FrameDecoder.java | 57 +++++++++ src/org/traccar/protocol/At2000Protocol.java | 42 +++++++ .../traccar/protocol/At2000ProtocolDecoder.java | 134 +++++++++++++++++++++ .../traccar/protocol/At2000FrameDecoderTest.java | 26 ++++ .../protocol/At2000ProtocolDecoderTest.java | 24 ++++ 6 files changed, 284 insertions(+) create mode 100644 src/org/traccar/protocol/At2000FrameDecoder.java create mode 100644 src/org/traccar/protocol/At2000Protocol.java create mode 100644 src/org/traccar/protocol/At2000ProtocolDecoder.java create mode 100644 test/org/traccar/protocol/At2000FrameDecoderTest.java create mode 100644 test/org/traccar/protocol/At2000ProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/setup/default.xml b/setup/default.xml index d6f8a1752..869c077cf 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -440,5 +440,6 @@ 5125 5126 5127 + 5128 diff --git a/src/org/traccar/protocol/At2000FrameDecoder.java b/src/org/traccar/protocol/At2000FrameDecoder.java new file mode 100644 index 000000000..d0be3f5f4 --- /dev/null +++ b/src/org/traccar/protocol/At2000FrameDecoder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.channel.Channel; +import org.jboss.netty.channel.ChannelHandlerContext; +import org.jboss.netty.handler.codec.frame.FrameDecoder; + +public class At2000FrameDecoder extends FrameDecoder { + + private static final int BLOCK_LENGTH = 16; + + private boolean firstPacket = true; + + @Override + protected Object decode( + ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { + + if (buf.readableBytes() < 5) { + return null; + } + + int length; + if (firstPacket) { + firstPacket = false; + length = buf.getUnsignedMedium(buf.readerIndex() + 2); + } else { + length = buf.getUnsignedMedium(buf.readerIndex() + 1); + } + + length += BLOCK_LENGTH; + if (length % BLOCK_LENGTH != 0) { + length = (length / BLOCK_LENGTH + 1) * BLOCK_LENGTH; + } + + if (buf.readableBytes() >= length) { + return buf.readBytes(length); + } + + return null; + } + +} diff --git a/src/org/traccar/protocol/At2000Protocol.java b/src/org/traccar/protocol/At2000Protocol.java new file mode 100644 index 000000000..418619cb4 --- /dev/null +++ b/src/org/traccar/protocol/At2000Protocol.java @@ -0,0 +1,42 @@ +/* + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +public class At2000Protocol extends BaseProtocol { + + public At2000Protocol() { + super("at2000"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new At2000FrameDecoder()); + pipeline.addLast("objectDecoder", new At2000ProtocolDecoder(At2000Protocol.this)); + } + }); + } + +} diff --git a/src/org/traccar/protocol/At2000ProtocolDecoder.java b/src/org/traccar/protocol/At2000ProtocolDecoder.java new file mode 100644 index 000000000..17da0eef7 --- /dev/null +++ b/src/org/traccar/protocol/At2000ProtocolDecoder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.DeviceSession; +import org.traccar.helper.UnitsConverter; +import org.traccar.model.Position; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.bind.DatatypeConverter; +import java.net.SocketAddress; +import java.nio.ByteOrder; +import java.nio.charset.StandardCharsets; +import java.util.Date; + +public class At2000ProtocolDecoder extends BaseProtocolDecoder { + + private static final int BLOCK_LENGTH = 16; + + public At2000ProtocolDecoder(At2000Protocol protocol) { + super(protocol); + } + + public static final int MSG_ACKNOWLEDGEMENT = 0x00; + public static final int MSG_DEVICE_ID = 0x01; + public static final int MSG_TRACK_REQUEST = 0x88; + public static final int MSG_TRACK_RESPONSE = 0x89; + public static final int MSG_SESSION_END = 0x0c; + + private Cipher cipher; + + private static void sendResponse(Channel channel) { + if (channel != null) { + ChannelBuffer response = ChannelBuffers.directBuffer(BLOCK_LENGTH); + response.writeByte(MSG_ACKNOWLEDGEMENT); + response.writeMedium(1); + response.writeByte(0x00); // success + response.writerIndex(BLOCK_LENGTH); + channel.write(response); + } + } + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + ChannelBuffer buf = (ChannelBuffer) msg; + + if (buf.getUnsignedByte(buf.readerIndex()) == 0x01) { + buf.readUnsignedByte(); // codec id + } + + int type = buf.readUnsignedByte(); + buf.readUnsignedMedium(); // length + buf.skipBytes(BLOCK_LENGTH - 1 - 3); + + if (type == MSG_DEVICE_ID) { + + String imei = buf.readBytes(15).toString(StandardCharsets.US_ASCII); + if (getDeviceSession(channel, remoteAddress, imei) != null) { + + byte[] iv = new byte[BLOCK_LENGTH]; + buf.readBytes(iv); + IvParameterSpec ivSpec = new IvParameterSpec(iv); + + SecretKeySpec keySpec = new SecretKeySpec( + DatatypeConverter.parseHexBinary("000102030405060708090a0b0c0d0e0f"), "AES"); + + cipher = Cipher.getInstance("AES/CBC/NoPadding"); + cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); + + byte[] data = new byte[BLOCK_LENGTH]; + buf.readBytes(data); + cipher.update(data); + + } + + } else if (type == MSG_TRACK_RESPONSE) { + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + byte[] data = new byte[buf.capacity() - BLOCK_LENGTH]; + buf.readBytes(data); + buf = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, cipher.update(data)); + + buf.readUnsignedShort(); // index + buf.readUnsignedShort(); // reserved + + position.setValid(true); + + position.setTime(new Date(buf.readLong() * 1000)); + + position.setLatitude(buf.readFloat()); + position.setLongitude(buf.readFloat()); + position.setAltitude(buf.readFloat()); + position.setSpeed(UnitsConverter.knotsFromKph(buf.readFloat())); + position.setCourse(buf.readFloat()); + + return position; + + } + + sendResponse(channel); + + return null; + } + +} diff --git a/test/org/traccar/protocol/At2000FrameDecoderTest.java b/test/org/traccar/protocol/At2000FrameDecoderTest.java new file mode 100644 index 000000000..c7a3dc0b1 --- /dev/null +++ b/test/org/traccar/protocol/At2000FrameDecoderTest.java @@ -0,0 +1,26 @@ +package org.traccar.protocol; + +import org.junit.Assert; +import org.junit.Test; +import org.traccar.ProtocolTest; + +import java.nio.ByteOrder; + +public class At2000FrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + At2000FrameDecoder decoder = new At2000FrameDecoder(); + + Assert.assertEquals( + binary(ByteOrder.LITTLE_ENDIAN, "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8"), + decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8"))); + + Assert.assertEquals( + binary(ByteOrder.LITTLE_ENDIAN, "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e"), + decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e"))); + + } + +} diff --git a/test/org/traccar/protocol/At2000ProtocolDecoderTest.java b/test/org/traccar/protocol/At2000ProtocolDecoderTest.java new file mode 100644 index 000000000..14c6920d0 --- /dev/null +++ b/test/org/traccar/protocol/At2000ProtocolDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class At2000ProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + At2000ProtocolDecoder decoder = new At2000ProtocolDecoder(new At2000Protocol()); + + verifyNothing(decoder, binary( + "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8")); + + verifyPosition(decoder, binary( + "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e")); + + verifyNothing(decoder, binary( + "01012f00000000000000000000000000003335373435343037313632363831345612da3748bede02ea4faf04ac02f420c0ff37719eccf2864fa2b8191abf8242")); + + } + +} -- cgit v1.2.3 From ab8fc4daef86295f9bab39890aa6de2e51342400 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 24 Nov 2016 22:37:09 +1300 Subject: Fix exception in TK103 protocol (fix #2598) --- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 6 ++++-- test/org/traccar/protocol/Tk103ProtocolDecoderTest.java | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index 9d04483c1..d3bc0efdc 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -113,9 +113,11 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { String type = sentence.substring(12, 16); if (type.equals("BP00") || type.equals("BP05")) { String content = sentence.substring(16); - getDeviceSession(channel, remoteAddress, content.substring(0, 15)); + if (content.length() >= 15) { + getDeviceSession(channel, remoteAddress, content.substring(0, 15)); + } if (type.equals("BP00")) { - channel.write("(" + id + "AP01" + content.substring(15) + ")"); + channel.write("(" + id + "AP01HSO)"); return null; } else if (type.equals("BP05")) { channel.write("(" + id + "AP05)"); diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index 4c6f0e004..1875e4ac5 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest { Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new Tk103Protocol()); + verifyNothing(decoder, text( + "(087073005534BP00HSO")); + verifyNothing(decoder, text( "(027028258309BQ86,0,05550c21b10d1d0f431008bd114c0ea5078400010007a100423932,161117005322,01000001)")); -- cgit v1.2.3 From b0068d87ddf894fc2f7d2688bd4c4ad88c891a2e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 Nov 2016 19:54:14 +1300 Subject: Implement Maestro protocol decoder --- setup/default.xml | 1 + src/org/traccar/protocol/MaestroProtocol.java | 47 +++++++++ .../traccar/protocol/MaestroProtocolDecoder.java | 107 +++++++++++++++++++++ .../protocol/MaestroProtocolDecoderTest.java | 30 ++++++ 4 files changed, 185 insertions(+) create mode 100644 src/org/traccar/protocol/MaestroProtocol.java create mode 100644 src/org/traccar/protocol/MaestroProtocolDecoder.java create mode 100644 test/org/traccar/protocol/MaestroProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/setup/default.xml b/setup/default.xml index 869c077cf..7df352c4d 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -441,5 +441,6 @@ 5126 5127 5128 + 5129 diff --git a/src/org/traccar/protocol/MaestroProtocol.java b/src/org/traccar/protocol/MaestroProtocol.java new file mode 100644 index 000000000..5e0b69916 --- /dev/null +++ b/src/org/traccar/protocol/MaestroProtocol.java @@ -0,0 +1,47 @@ +/* + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.bootstrap.ServerBootstrap; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; +import org.traccar.BaseProtocol; +import org.traccar.TrackerServer; + +import java.util.List; + +public class MaestroProtocol extends BaseProtocol { + + public MaestroProtocol() { + super("maestro"); + } + + @Override + public void initTrackerServers(List serverList) { + serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(160)); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new MaestroProtocolDecoder(MaestroProtocol.this)); + } + }); + } + +} diff --git a/src/org/traccar/protocol/MaestroProtocolDecoder.java b/src/org/traccar/protocol/MaestroProtocolDecoder.java new file mode 100644 index 000000000..06ec2473d --- /dev/null +++ b/src/org/traccar/protocol/MaestroProtocolDecoder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2016 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.protocol; + +import org.jboss.netty.channel.Channel; +import org.traccar.BaseProtocolDecoder; +import org.traccar.DeviceSession; +import org.traccar.helper.DateBuilder; +import org.traccar.helper.Parser; +import org.traccar.helper.PatternBuilder; +import org.traccar.helper.UnitsConverter; +import org.traccar.model.Position; + +import java.net.SocketAddress; +import java.util.regex.Pattern; + +public class MaestroProtocolDecoder extends BaseProtocolDecoder { + + public MaestroProtocolDecoder(MaestroProtocol protocol) { + super(protocol); + } + + private static final Pattern PATTERN = new PatternBuilder() + .text("@") + .number("(d+),") // imei + .number("d+,") // index + .expression("[^,]+,") // profile + .expression("([01]),") // validity + .number("(d+.d+),") // battery + .number("(d+),") // gsm + .expression("([01]),") // starter + .expression("([01]),") // ignition + .number("(dd)/(dd)/(dd),") // date + .number("(dd):(dd):(dd),") // time + .number("(-?d+.d+),") // longitude + .number("(-?d+.d+),") // latitude + .number("(d+.?d*),") // altitude + .number("(d+.?d*),") // speed + .number("(d+.?d*),") // course + .number("(d+),") // satellites + .number("(d+.?d*),") // hdop + .number("(d+.?d*)") // odometer + .number(",(d+)").optional() // adc + .any() + .compile(); + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + Parser parser = new Parser(PATTERN, (String) msg); + if (!parser.matches()) { + return null; + } + + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + position.setValid(parser.nextInt() == 1); + + position.set(Position.KEY_BATTERY, parser.nextDouble()); + position.set(Position.KEY_GSM, parser.nextInt()); + position.set(Position.KEY_CHARGE, parser.nextInt() == 1); + position.set(Position.KEY_IGNITION, parser.nextInt() == 1); + + DateBuilder dateBuilder = new DateBuilder() + .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + position.setTime(dateBuilder.getDate()); + + position.setLatitude(parser.nextDouble()); + position.setLongitude(parser.nextDouble()); + position.setAltitude(parser.nextDouble()); + position.setSpeed(UnitsConverter.knotsFromMph(parser.nextDouble())); + position.setCourse(parser.nextDouble()); + + position.set(Position.KEY_SATELLITES, parser.nextInt()); + position.set(Position.KEY_HDOP, parser.nextDouble()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1609.34); + + if (parser.hasNext()) { + position.set(Position.PREFIX_ADC + 1, parser.nextInt()); + } + + return position; + } + +} diff --git a/test/org/traccar/protocol/MaestroProtocolDecoderTest.java b/test/org/traccar/protocol/MaestroProtocolDecoderTest.java new file mode 100644 index 000000000..b480ad9b2 --- /dev/null +++ b/test/org/traccar/protocol/MaestroProtocolDecoderTest.java @@ -0,0 +1,30 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class MaestroProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + MaestroProtocolDecoder decoder = new MaestroProtocolDecoder(new MaestroProtocol()); + + verifyPosition(decoder, text( + "@353893040202807,705,UPV-02,1,13.2,17,0,0,16/09/11,11:42:49,0.352705,32.647918,1210.5,0.000000,35.33,11,0.8,0.000,0!\0")); + + verifyPosition(decoder, text( + "@353893040202807,705,UPV-02,1,13.4,18,0,0,16/09/11,11:43:30,0.352808,32.647990,1211.0,0.000000,80.96,11,0.8,0.000,0!\0")); + + verifyPosition(decoder, text( + "@353893040202807,601,UPV-02,0,13.4,10,0,0,16/11/04,17:21:14,0.352793,32.647927,0,0,0,0,99,0.000,0!\0")); + + verifyPosition(decoder, text( + "@123451234512345,531,M2MGTW,1,12.5,30,0,0,11/10/10,09:09:09,22.222222,114.141414,45.6,0.0,160.0,8,1,20!")); + + verifyPosition(decoder, text( + "@123451234512345,702,M2MGTW,1,14.7,30,0,1,11/10/10,09:09:09,22.222222,114.141414,45.6,25.12,160.0,8,1,25!")); + + } + +} -- cgit v1.2.3 From 0999fa040f093c37d1e7759a3a61b4227c2a6175 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 Nov 2016 20:05:21 +1300 Subject: Run slow test only on CI server --- test/org/traccar/protocol/At2000ProtocolDecoderTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/At2000ProtocolDecoderTest.java b/test/org/traccar/protocol/At2000ProtocolDecoderTest.java index 14c6920d0..e2b848b45 100644 --- a/test/org/traccar/protocol/At2000ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/At2000ProtocolDecoderTest.java @@ -3,11 +3,15 @@ package org.traccar.protocol; import org.junit.Test; import org.traccar.ProtocolTest; +import static org.junit.Assume.assumeTrue; + public class At2000ProtocolDecoderTest extends ProtocolTest { @Test public void testDecode() throws Exception { + assumeTrue(Boolean.parseBoolean(System.getenv("CI"))); + At2000ProtocolDecoder decoder = new At2000ProtocolDecoder(new At2000Protocol()); verifyNothing(decoder, binary( -- cgit v1.2.3 From 8177dcd0d19053ab5f2d3dcfff959bc4fa3986bd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 Nov 2016 23:41:02 +1300 Subject: Refactor upro protocol decoder --- src/org/traccar/protocol/UproProtocol.java | 4 +- src/org/traccar/protocol/UproProtocolDecoder.java | 104 ++++++++++++++------- .../traccar/protocol/UproProtocolDecoderTest.java | 41 ++++---- 3 files changed, 92 insertions(+), 57 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/UproProtocol.java b/src/org/traccar/protocol/UproProtocol.java index ae6cac603..c00f859ee 100644 --- a/src/org/traccar/protocol/UproProtocol.java +++ b/src/org/traccar/protocol/UproProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.traccar.protocol; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; @@ -37,7 +36,6 @@ public class UproProtocol extends BaseProtocol { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#')); - pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); pipeline.addLast("objectDecoder", new UproProtocolDecoder(UproProtocol.this)); } diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java index 24a0f5dcd..e47dd8595 100644 --- a/src/org/traccar/protocol/UproProtocolDecoder.java +++ b/src/org/traccar/protocol/UproProtocolDecoder.java @@ -15,6 +15,8 @@ */ package org.traccar.protocol; +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; @@ -25,6 +27,8 @@ import org.traccar.helper.PatternBuilder; import org.traccar.model.Position; import java.net.SocketAddress; +import java.nio.charset.StandardCharsets; +import java.text.ParseException; import java.util.regex.Pattern; public class UproProtocolDecoder extends BaseProtocolDecoder { @@ -33,19 +37,17 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { super(protocol); } - private static final Pattern PATTERN = new PatternBuilder() + private static final Pattern PATTERN_HEADER = new PatternBuilder() .text("*") .expression("..20") .expression("([01])") // ack .number("(d+),") // device id .expression("(.)") // type .expression("(.)") // subtype - .expression("(.*)") // content - .expression("#?") // delimiter + .any() .compile(); private static final Pattern PATTERN_LOCATION = new PatternBuilder() - .text("A") .number("(dd)(dd)(dd)") // time .number("(dd)(dd)(dddd)") // latitude .number("(ddd)(dd)(dddd)") // longitude @@ -88,7 +90,19 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - Parser parser = new Parser(PATTERN, (String) msg); + ChannelBuffer buf = (ChannelBuffer) msg; + + if (buf.getByte(buf.readerIndex()) != '*') { + throw new ParseException(null, 0); + } + + int headerIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '&'); + if (headerIndex < 0) { + headerIndex = buf.writerIndex(); + } + String header = buf.readBytes(headerIndex - buf.readerIndex()).toString(StandardCharsets.US_ASCII); + + Parser parser = new Parser(PATTERN_HEADER, header); if (!parser.matches()) { return null; } @@ -111,37 +125,57 @@ public class UproProtocolDecoder extends BaseProtocolDecoder { channel.write("*MG20Y" + type + subtype + "#"); } - String[] data = parser.next().split("&"); - for (int i = 0; i < data.length; i++) { - if (i != 0) { - switch (data[i].charAt(0)) { - case 'A': - decodeLocation(position, data[i]); - break; - case 'B': - position.set(Position.KEY_STATUS, data[i].substring(1)); - break; - case 'C': - long odometer = 0; - for (int j = 1; j < data[i].length(); j++) { - odometer <<= 4; - odometer += data[i].charAt(j) - '0'; - } - position.set(Position.KEY_ODOMETER, odometer * 2 * 1852 / 3600); - break; - case 'P': - position.set(Position.KEY_MCC, Integer.parseInt(data[i].substring(1, 5))); - position.set(Position.KEY_MNC, Integer.parseInt(data[i].substring(5, 9))); - position.set(Position.KEY_LAC, Integer.parseInt(data[i].substring(9, 13), 16)); - position.set(Position.KEY_CID, Integer.parseInt(data[i].substring(13, 17), 16)); - break; - case 'S': - position.set("obd", data[i]); - break; - default: - break; - } + while (buf.readable()) { + + buf.readByte(); // skip delimiter + + byte dataType = buf.readByte(); + + int delimiterIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '&'); + if (delimiterIndex < 0) { + delimiterIndex = buf.writerIndex(); } + + ChannelBuffer data = buf.readBytes(delimiterIndex - buf.readerIndex()); + + switch (dataType) { + case 'A': + decodeLocation(position, data.toString(StandardCharsets.US_ASCII)); + break; + case 'B': + position.set(Position.KEY_STATUS, data.toString(StandardCharsets.US_ASCII)); + break; + case 'C': + long odometer = 0; + while (data.readable()) { + odometer <<= 4; + odometer += data.readByte() - (byte) '0'; + } + position.set(Position.KEY_ODOMETER, odometer * 2 * 1852 / 3600); + break; + case 'P': + position.set(Position.KEY_MCC, + Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII))); + position.set(Position.KEY_MNC, + Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII))); + position.set(Position.KEY_LAC, + Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII), 16)); + position.set(Position.KEY_CID, + Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII), 16)); + break; + case 'Q': + position.set("obd-pid", ChannelBuffers.hexDump(data)); + break; + case 'R': + position.set("odb-travel", ChannelBuffers.hexDump(data)); + break; + case 'S': + position.set("obd-traffic", ChannelBuffers.hexDump(data)); + break; + default: + break; + } + } if (position.getLatitude() != 0 && position.getLongitude() != 0) { diff --git a/test/org/traccar/protocol/UproProtocolDecoderTest.java b/test/org/traccar/protocol/UproProtocolDecoderTest.java index 711fe39b6..3af62da08 100644 --- a/test/org/traccar/protocol/UproProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UproProtocolDecoderTest.java @@ -10,39 +10,42 @@ public class UproProtocolDecoderTest extends ProtocolTest { UproProtocolDecoder decoder = new UproProtocolDecoder(new UproProtocol()); - verifyPosition(decoder, text( - "*MG201693502000035441,BA&A1213073325458307036690710000151116&P0730000032ce4fb3&D1&B0000000000&C005799?7&S3,20161115120025,07035.54659E,3324.87721N,3000,0,0,0,0,847,599,8,40,0,19,20&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0&T0107#")); + verifyPosition(decoder, binary( + "2a4d473230303639333530323030303033353537332c42412641303834313237333332363334353230373033383933373630303030303235313131362642303130303030303030302647303036323030264d393930264e3235264f3035303026433030313a363b363926510411058c0c125c0d0a2fff4237ee614d66454c140826555f50000000000300000000000000000026543139333723")); - verifyPosition(decoder, text( - "*MG201693502000034964,AB&A0800253335360507036975710000091116&P0730000032d2a94d&B0000000000&N13&Z12&U_P\0\0\0\u0004\0\0\0\0\0\0\0\0\0\0#"), + verifyPosition(decoder, buffer( + "*MG201693502000035441,BA&A1213073325458307036690710000151116&P0730000032ce4fb3&D1&B0000000000&C005799?7&S3,20161115120025,07035.54659E,3324.87721N,3000,0,0,0,0,847,599,8,40,0,19,20&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0&T0107")); + + verifyPosition(decoder, buffer( + "*MG201693502000034964,AB&A0800253335360507036975710000091116&P0730000032d2a94d&B0000000000&N13&Z12&U_P\0\0\0\u0004\0\0\0\0\0\0\0\0\0\0"), position("2016-11-09 08:00:25.000", true, -33.58934, -70.61626)); - verifyNothing(decoder, text( - "*MG20113800138000,AH#")); + verifyNothing(decoder, buffer( + "*MG20113800138000,AH")); - verifyPosition(decoder, text( - "*MG201693502000034964,AB&A0200183324418107033792800009051116&B0000000000&N15&Z94&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0#")); + verifyPosition(decoder, buffer( + "*MG201693502000034964,AB&A0200183324418107033792800009051116&B0000000000&N15&Z94&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); - verifyPosition(decoder, text( - "*MG201693502000034964,AB&A0200543324412007033805910000051116&P0730000032d66785&B0000000000&N15&Z92&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0#")); + verifyPosition(decoder, buffer( + "*MG201693502000034964,AB&A0200543324412007033805910000051116&P0730000032d66785&B0000000000&N15&Z92&U_P\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); - verifyPosition(decoder, text( - "*AI2000905447674,BA&A2003064913201201845107561627121016&B0100000000&C05>8=961&F0333&K023101002154A7#")); + verifyPosition(decoder, buffer( + "*AI2000905447674,BA&A2003064913201201845107561627121016&B0100000000&C05>8=961&F0333&K023101002154A7")); - verifyPosition(decoder, text( - "*AI200905300036,AH&A0317264913209801844913060000251115&B0500000000&C0;4?72:9&F0000#"), + verifyPosition(decoder, buffer( + "*AI200905300036,AH&A0317264913209801844913060000251115&B0500000000&C0;4?72:9&F0000"), position("2015-11-25 03:17:26.000", false, 49.22016, 18.74855)); - verifyPosition(decoder, text( + verifyPosition(decoder, buffer( "*AI2000905300036,AS&A1647304913209801844913060000251115&B0400000000&C0;4?72:9&F0000")); - verifyPosition(decoder, text( + verifyPosition(decoder, buffer( "*AI2000905300036,AC1&A1648014913209801844913060000251115&B0400000000&C0;4?72:9&F0000")); - verifyPosition(decoder, text( - "*AI2000905300036,AB1&A1702464913231101844949860000251115&B0500000000&C0;4?72:9&F0000#")); + verifyPosition(decoder, buffer( + "*AI2000905300036,AB1&A1702464913231101844949860000251115&B0500000000&C0;4?72:9&F0000")); - verifyPosition(decoder, text( + verifyPosition(decoder, buffer( "*AI2000905300036,AD1&A1703054913231101844949860000251115&B0500000000&C0;4?72:9&F0000")); } -- cgit v1.2.3 From b09d0e98541edc7122d992e85547741ffd57f72a Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sat, 26 Nov 2016 19:33:54 +0700 Subject: Implement polyline geofence --- src/org/traccar/geofence/GeofenceGeometry.java | 29 +++++++ src/org/traccar/geofence/GeofencePolygon.java | 29 ------- src/org/traccar/geofence/GeofencePolyline.java | 92 ++++++++++++++++++++++ src/org/traccar/helper/DistanceCalculator.java | 16 ++++ src/org/traccar/model/Geofence.java | 5 ++ .../org/traccar/geofence/GeofencePolylineTest.java | 54 +++++++++++++ .../org/traccar/helper/DistanceCalculatorTest.java | 9 +++ 7 files changed, 205 insertions(+), 29 deletions(-) create mode 100644 src/org/traccar/geofence/GeofencePolyline.java create mode 100644 test/org/traccar/geofence/GeofencePolylineTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/geofence/GeofenceGeometry.java b/src/org/traccar/geofence/GeofenceGeometry.java index 6b5b0acb7..d61e357ce 100644 --- a/src/org/traccar/geofence/GeofenceGeometry.java +++ b/src/org/traccar/geofence/GeofenceGeometry.java @@ -25,4 +25,33 @@ public abstract class GeofenceGeometry { public abstract void fromWkt(String wkt) throws ParseException; + public static class Coordinate { + + public static final double DEGREE360 = 360; + + private double lat; + private double lon; + + public double getLat() { + return lat; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public double getLon() { + return lon; + } + + // Need not to confuse algorithm by the abrupt reset of longitude + public double getLon360() { + return lon + DEGREE360; + } + + public void setLon(double lon) { + this.lon = lon; + } + } + } diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index 03638d6c9..48326dc10 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -27,35 +27,6 @@ public class GeofencePolygon extends GeofenceGeometry { fromWkt(wkt); } - private static class Coordinate { - - public static final double DEGREE360 = 360; - - private double lat; - private double lon; - - public double getLat() { - return lat; - } - - public void setLat(double lat) { - this.lat = lat; - } - - public double getLon() { - return lon; - } - - // Need not to confuse algorithm by the abrupt reset of longitude - public double getLon360() { - return lon + DEGREE360; - } - - public void setLon(double lon) { - this.lon = lon; - } - } - private ArrayList coordinates; private double[] constant; diff --git a/src/org/traccar/geofence/GeofencePolyline.java b/src/org/traccar/geofence/GeofencePolyline.java new file mode 100644 index 000000000..60d7b0605 --- /dev/null +++ b/src/org/traccar/geofence/GeofencePolyline.java @@ -0,0 +1,92 @@ +package org.traccar.geofence; + +import java.text.ParseException; +import java.util.ArrayList; + +import org.traccar.helper.DistanceCalculator; + +public class GeofencePolyline extends GeofenceGeometry { + + private ArrayList coordinates; + private double distance; + + public GeofencePolyline() { + } + + public GeofencePolyline(String wkt, double distance) throws ParseException { + fromWkt(wkt); + this.distance = distance; + } + + @Override + public boolean containsPoint(double latitude, double longitude) { + double longitude360 = longitude + Coordinate.DEGREE360; + for (int i = 1; i < coordinates.size(); i++) { + if (DistanceCalculator.distanceToInterval( + latitude, longitude360, coordinates.get(i - 1).getLat(), coordinates.get(i - 1).getLon360(), + coordinates.get(i).getLat(), coordinates.get(i).getLon360()) <= distance) { + return true; + } + } + return false; + } + + @Override + public String toWkt() { + StringBuilder buf = new StringBuilder(); + buf.append("LINESTRING ("); + for (Coordinate coordinate : coordinates) { + buf.append(String.valueOf(coordinate.getLat())); + buf.append(" "); + buf.append(String.valueOf(coordinate.getLon())); + buf.append(", "); + } + return buf.substring(0, buf.length() - 2) + ")"; + } + + @Override + public void fromWkt(String wkt) throws ParseException { + if (coordinates == null) { + coordinates = new ArrayList<>(); + } else { + coordinates.clear(); + } + + if (!wkt.startsWith("LINESTRING")) { + throw new ParseException("Mismatch geometry type", 0); + } + String content = wkt.substring(wkt.indexOf("(") + 1, wkt.indexOf(")")); + if (content.isEmpty()) { + throw new ParseException("No content", 0); + } + String[] commaTokens = content.split(","); + if (commaTokens.length < 2) { + throw new ParseException("Not valid content", 0); + } + + for (String commaToken : commaTokens) { + String[] tokens = commaToken.trim().split("\\s"); + if (tokens.length != 2) { + throw new ParseException("Here must be two coordinates: " + commaToken, 0); + } + Coordinate coordinate = new Coordinate(); + try { + coordinate.setLat(Double.parseDouble(tokens[0])); + } catch (NumberFormatException e) { + throw new ParseException(tokens[0] + " is not a double", 0); + } + try { + coordinate.setLon(Double.parseDouble(tokens[1])); + } catch (NumberFormatException e) { + throw new ParseException(tokens[1] + " is not a double", 0); + } + coordinates.add(coordinate); + } + + } + + public void setDistance(double distance) { + this.distance = distance; + } + +} diff --git a/src/org/traccar/helper/DistanceCalculator.java b/src/org/traccar/helper/DistanceCalculator.java index 3452597ab..ceeee4be4 100644 --- a/src/org/traccar/helper/DistanceCalculator.java +++ b/src/org/traccar/helper/DistanceCalculator.java @@ -33,4 +33,20 @@ public final class DistanceCalculator { return d * 1000; } + public static double distanceToInterval( + double pointLat, double pointLon, double lat1, double lon1, double lat2, double lon2) { + double d0 = distance(pointLat, pointLon, lat1, lon1); + double d1 = distance(lat1, lon1, lat2, lon2); + double d2 = distance(lat2, lon2, pointLat, pointLon); + if (Math.pow(d0, 2) > Math.pow(d1, 2) + Math.pow(d2, 2)) { + return d2; + } + if (Math.pow(d2, 2) > Math.pow(d1, 2) + Math.pow(d0, 2)) { + return d0; + } + double halfP = (d0 + d1 + d2) * 0.5; + double area = Math.sqrt(halfP * (halfP - d0) * (halfP - d1) * (halfP - d2)); + return 2 * area / d1; + } + } diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java index ecfd3101c..326c45b5f 100644 --- a/src/org/traccar/model/Geofence.java +++ b/src/org/traccar/model/Geofence.java @@ -17,9 +17,11 @@ package org.traccar.model; import java.text.ParseException; +import org.traccar.Context; import org.traccar.geofence.GeofenceCircle; import org.traccar.geofence.GeofenceGeometry; import org.traccar.geofence.GeofencePolygon; +import org.traccar.geofence.GeofencePolyline; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -27,6 +29,7 @@ public class Geofence extends Extensible { public static final String TYPE_GEOFENCE_CILCLE = "geofenceCircle"; public static final String TYPE_GEOFENCE_POLYGON = "geofencePolygon"; + public static final String TYPE_GEOFENCE_POLYLINE = "geofencePolyline"; private String name; @@ -60,6 +63,8 @@ public class Geofence extends Extensible { geometry = new GeofenceCircle(area); } else if (area.startsWith("POLYGON")) { geometry = new GeofencePolygon(area); + } else if (area.startsWith("LINESTRING")) { + geometry = new GeofencePolyline(area, Context.getConfig().getDouble("geofence.polylineDistance", 25)); } else { throw new ParseException("Unknown geometry type", 0); } diff --git a/test/org/traccar/geofence/GeofencePolylineTest.java b/test/org/traccar/geofence/GeofencePolylineTest.java new file mode 100644 index 000000000..df939d8ba --- /dev/null +++ b/test/org/traccar/geofence/GeofencePolylineTest.java @@ -0,0 +1,54 @@ +package org.traccar.geofence; + +import java.text.ParseException; + +import org.junit.Assert; +import org.junit.Test; + +public class GeofencePolylineTest { + + @Test + public void testPolylineWKT() { + String test = "LINESTRING (55.75474 37.61823, 55.75513 37.61888, 55.7535 37.6222, 55.75315 37.62165)"; + GeofenceGeometry geofenceGeometry = new GeofencePolyline(); + try { + geofenceGeometry.fromWkt(test); + } catch (ParseException e){ + Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); + } + Assert.assertEquals(geofenceGeometry.toWkt(), test); + } + + @Test + public void testContainsPolyline1Interval() { + String test = "LINESTRING (56.83777 60.59833, 56.83766 60.5968)"; + + try { + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 35); + Assert.assertTrue(geofenceGeometry.containsPoint(56.83801, 60.59748)); + + ((GeofencePolyline) geofenceGeometry).setDistance(15); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83801, 60.59748)); + + } catch (ParseException e){ + Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); + } + } + + + @Test + public void testContainsPolyline3Intervals() { + String test = "LINESTRING (56.836 60.6126, 56.8393 60.6114, 56.83887 60.60811, 56.83782 60.5988)"; + + try { + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 15); + Assert.assertTrue(geofenceGeometry.containsPoint(56.83847, 60.60458)); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83764, 60.59725)); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83861, 60.60822)); + + } catch (ParseException e){ + Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); + } + } + +} diff --git a/test/org/traccar/helper/DistanceCalculatorTest.java b/test/org/traccar/helper/DistanceCalculatorTest.java index 7bbb4e3b1..2ce54c583 100644 --- a/test/org/traccar/helper/DistanceCalculatorTest.java +++ b/test/org/traccar/helper/DistanceCalculatorTest.java @@ -10,5 +10,14 @@ public class DistanceCalculatorTest { Assert.assertEquals( DistanceCalculator.distance(0.0, 0.0, 0.05, 0.05), 7863.0, 10.0); } + + @Test + public void testDistanceToInterval() { + Assert.assertEquals(DistanceCalculator.distanceToInterval( + 56.83801, 60.59748, 56.83777, 60.59833, 56.83766, 60.5968), 33.0, 5.0); + + Assert.assertEquals(DistanceCalculator.distanceToInterval( + 56.83753, 60.59508, 56.83777, 60.59833, 56.83766, 60.5968), 105.0, 5.0); + } } -- cgit v1.2.3 From 5ea4572553a84126b7e9f06c822e1a183413a558 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sun, 27 Nov 2016 10:18:13 +0700 Subject: - Rename function - Fix formatting --- src/org/traccar/geofence/GeofencePolyline.java | 2 +- src/org/traccar/helper/DistanceCalculator.java | 2 +- .../org/traccar/geofence/GeofencePolylineTest.java | 25 ++++++++-------------- .../org/traccar/helper/DistanceCalculatorTest.java | 6 +++--- 4 files changed, 14 insertions(+), 21 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/geofence/GeofencePolyline.java b/src/org/traccar/geofence/GeofencePolyline.java index e99987207..cadc69da6 100644 --- a/src/org/traccar/geofence/GeofencePolyline.java +++ b/src/org/traccar/geofence/GeofencePolyline.java @@ -38,7 +38,7 @@ public class GeofencePolyline extends GeofenceGeometry { public boolean containsPoint(double latitude, double longitude) { double longitude360 = longitude + Coordinate.DEGREE360; for (int i = 1; i < coordinates.size(); i++) { - if (DistanceCalculator.distanceToInterval( + if (DistanceCalculator.distanceToLine( latitude, longitude360, coordinates.get(i - 1).getLat(), coordinates.get(i - 1).getLon360(), coordinates.get(i).getLat(), coordinates.get(i).getLon360()) <= distance) { return true; diff --git a/src/org/traccar/helper/DistanceCalculator.java b/src/org/traccar/helper/DistanceCalculator.java index 873e84977..88d4ef8a4 100644 --- a/src/org/traccar/helper/DistanceCalculator.java +++ b/src/org/traccar/helper/DistanceCalculator.java @@ -34,7 +34,7 @@ public final class DistanceCalculator { return d * 1000; } - public static double distanceToInterval( + public static double distanceToLine( double pointLat, double pointLon, double lat1, double lon1, double lat2, double lon2) { double d0 = distance(pointLat, pointLon, lat1, lon1); double d1 = distance(lat1, lon1, lat2, lon2); diff --git a/test/org/traccar/geofence/GeofencePolylineTest.java b/test/org/traccar/geofence/GeofencePolylineTest.java index df939d8ba..e281c3dd6 100644 --- a/test/org/traccar/geofence/GeofencePolylineTest.java +++ b/test/org/traccar/geofence/GeofencePolylineTest.java @@ -12,7 +12,7 @@ public class GeofencePolylineTest { String test = "LINESTRING (55.75474 37.61823, 55.75513 37.61888, 55.7535 37.6222, 55.75315 37.62165)"; GeofenceGeometry geofenceGeometry = new GeofencePolyline(); try { - geofenceGeometry.fromWkt(test); + geofenceGeometry.fromWkt(test); } catch (ParseException e){ Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); } @@ -22,33 +22,26 @@ public class GeofencePolylineTest { @Test public void testContainsPolyline1Interval() { String test = "LINESTRING (56.83777 60.59833, 56.83766 60.5968)"; - try { - GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 35); - Assert.assertTrue(geofenceGeometry.containsPoint(56.83801, 60.59748)); - - ((GeofencePolyline) geofenceGeometry).setDistance(15); - Assert.assertTrue(!geofenceGeometry.containsPoint(56.83801, 60.59748)); - + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 35); + Assert.assertTrue(geofenceGeometry.containsPoint(56.83801, 60.59748)); + ((GeofencePolyline) geofenceGeometry).setDistance(15); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83801, 60.59748)); } catch (ParseException e){ Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); } } - @Test public void testContainsPolyline3Intervals() { String test = "LINESTRING (56.836 60.6126, 56.8393 60.6114, 56.83887 60.60811, 56.83782 60.5988)"; - try { - GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 15); - Assert.assertTrue(geofenceGeometry.containsPoint(56.83847, 60.60458)); - Assert.assertTrue(!geofenceGeometry.containsPoint(56.83764, 60.59725)); - Assert.assertTrue(!geofenceGeometry.containsPoint(56.83861, 60.60822)); - + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 15); + Assert.assertTrue(geofenceGeometry.containsPoint(56.83847, 60.60458)); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83764, 60.59725)); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83861, 60.60822)); } catch (ParseException e){ Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); } } - } diff --git a/test/org/traccar/helper/DistanceCalculatorTest.java b/test/org/traccar/helper/DistanceCalculatorTest.java index 2ce54c583..22e41c9a3 100644 --- a/test/org/traccar/helper/DistanceCalculatorTest.java +++ b/test/org/traccar/helper/DistanceCalculatorTest.java @@ -12,11 +12,11 @@ public class DistanceCalculatorTest { } @Test - public void testDistanceToInterval() { - Assert.assertEquals(DistanceCalculator.distanceToInterval( + public void testDistanceToLine() { + Assert.assertEquals(DistanceCalculator.distanceToLine( 56.83801, 60.59748, 56.83777, 60.59833, 56.83766, 60.5968), 33.0, 5.0); - Assert.assertEquals(DistanceCalculator.distanceToInterval( + Assert.assertEquals(DistanceCalculator.distanceToLine( 56.83753, 60.59508, 56.83777, 60.59833, 56.83766, 60.5968), 105.0, 5.0); } -- cgit v1.2.3 From f933147c0cba53df96448a64a2ba58dda4da1659 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sun, 27 Nov 2016 16:01:24 +0700 Subject: - Remove try-catch frome tests - Fixed longitude normalizing for geofences near 180 longitude - Added more tests - Other fixes --- src/org/traccar/geofence/GeofenceGeometry.java | 7 ---- src/org/traccar/geofence/GeofencePolygon.java | 44 +++++++++++++++------ src/org/traccar/geofence/GeofencePolyline.java | 5 +-- test/org/traccar/geofence/GeofenceCircleTest.java | 14 +------ test/org/traccar/geofence/GeofencePolygonTest.java | 36 +++++++++++------ .../org/traccar/geofence/GeofencePolylineTest.java | 46 +++++++++++----------- 6 files changed, 82 insertions(+), 70 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/geofence/GeofenceGeometry.java b/src/org/traccar/geofence/GeofenceGeometry.java index d61e357ce..857ba3414 100644 --- a/src/org/traccar/geofence/GeofenceGeometry.java +++ b/src/org/traccar/geofence/GeofenceGeometry.java @@ -27,8 +27,6 @@ public abstract class GeofenceGeometry { public static class Coordinate { - public static final double DEGREE360 = 360; - private double lat; private double lon; @@ -44,11 +42,6 @@ public abstract class GeofenceGeometry { return lon; } - // Need not to confuse algorithm by the abrupt reset of longitude - public double getLon360() { - return lon + DEGREE360; - } - public void setLon(double lon) { this.lon = lon; } diff --git a/src/org/traccar/geofence/GeofencePolygon.java b/src/org/traccar/geofence/GeofencePolygon.java index 48326dc10..2048ba26d 100644 --- a/src/org/traccar/geofence/GeofencePolygon.java +++ b/src/org/traccar/geofence/GeofencePolygon.java @@ -32,10 +32,13 @@ public class GeofencePolygon extends GeofenceGeometry { private double[] constant; private double[] multiple; + private boolean needNormalize = false; + private void precalc() { if (coordinates == null) { return; } + int polyCorners = coordinates.size(); int i; int j = polyCorners - 1; @@ -50,38 +53,55 @@ public class GeofencePolygon extends GeofenceGeometry { constant = new double[polyCorners]; multiple = new double[polyCorners]; + boolean hasNegative = false; + boolean hasPositive = false; + for (i = 0; i < polyCorners; i++) { + if (coordinates.get(i).getLon() > 90) { + hasPositive = true; + } else if (coordinates.get(i).getLon() < -90) { + hasNegative = true; + } + } + needNormalize = hasPositive && hasNegative; for (i = 0; i < polyCorners; j = i++) { - if (coordinates.get(j).getLon360() == coordinates.get(i).getLon360()) { + if (normalizeLon(coordinates.get(j).getLon()) == normalizeLon(coordinates.get(i).getLon())) { constant[i] = coordinates.get(i).getLat(); multiple[i] = 0; } else { constant[i] = coordinates.get(i).getLat() - - (coordinates.get(i).getLon360() * coordinates.get(j).getLat()) - / (coordinates.get(j).getLon360() - coordinates.get(i).getLon360()) - + (coordinates.get(i).getLon360() * coordinates.get(i).getLat()) - / (coordinates.get(j).getLon360() - coordinates.get(i).getLon360()); + - (normalizeLon(coordinates.get(i).getLon()) * coordinates.get(j).getLat()) + / (normalizeLon(coordinates.get(j).getLon()) - normalizeLon(coordinates.get(i).getLon())) + + (normalizeLon(coordinates.get(i).getLon()) * coordinates.get(i).getLat()) + / (normalizeLon(coordinates.get(j).getLon()) - normalizeLon(coordinates.get(i).getLon())); multiple[i] = (coordinates.get(j).getLat() - coordinates.get(i).getLat()) - / (coordinates.get(j).getLon360() - coordinates.get(i).getLon360()); + / (normalizeLon(coordinates.get(j).getLon()) - normalizeLon(coordinates.get(i).getLon())); } } } + private double normalizeLon(double lon) { + if (needNormalize && lon < -90) { + return lon + 360; + } + return lon; + } + @Override public boolean containsPoint(double latitude, double longitude) { int polyCorners = coordinates.size(); int i; int j = polyCorners - 1; - double longitude360 = longitude + Coordinate.DEGREE360; + double longitudeNorm = normalizeLon(longitude); boolean oddNodes = false; for (i = 0; i < polyCorners; j = i++) { - if (coordinates.get(i).getLon360() < longitude360 - && coordinates.get(j).getLon360() >= longitude360 - || coordinates.get(j).getLon360() < longitude360 - && coordinates.get(i).getLon360() >= longitude360) { - oddNodes ^= longitude360 * multiple[i] + constant[i] < latitude; + if (normalizeLon(coordinates.get(i).getLon()) < longitudeNorm + && normalizeLon(coordinates.get(j).getLon()) >= longitudeNorm + || normalizeLon(coordinates.get(j).getLon()) < longitudeNorm + && normalizeLon(coordinates.get(i).getLon()) >= longitudeNorm) { + oddNodes ^= longitudeNorm * multiple[i] + constant[i] < latitude; } } return oddNodes; diff --git a/src/org/traccar/geofence/GeofencePolyline.java b/src/org/traccar/geofence/GeofencePolyline.java index cadc69da6..d84f512e3 100644 --- a/src/org/traccar/geofence/GeofencePolyline.java +++ b/src/org/traccar/geofence/GeofencePolyline.java @@ -36,11 +36,10 @@ public class GeofencePolyline extends GeofenceGeometry { @Override public boolean containsPoint(double latitude, double longitude) { - double longitude360 = longitude + Coordinate.DEGREE360; for (int i = 1; i < coordinates.size(); i++) { if (DistanceCalculator.distanceToLine( - latitude, longitude360, coordinates.get(i - 1).getLat(), coordinates.get(i - 1).getLon360(), - coordinates.get(i).getLat(), coordinates.get(i).getLon360()) <= distance) { + latitude, longitude, coordinates.get(i - 1).getLat(), coordinates.get(i - 1).getLon(), + coordinates.get(i).getLat(), coordinates.get(i).getLon()) <= distance) { return true; } } diff --git a/test/org/traccar/geofence/GeofenceCircleTest.java b/test/org/traccar/geofence/GeofenceCircleTest.java index 52c214b53..133ca1db8 100644 --- a/test/org/traccar/geofence/GeofenceCircleTest.java +++ b/test/org/traccar/geofence/GeofenceCircleTest.java @@ -8,29 +8,19 @@ import org.junit.Test; public class GeofenceCircleTest { @Test - public void testCircleWKT() { + public void testCircleWkt() throws ParseException { String test = "CIRCLE (55.75414 37.6204, 100)"; GeofenceGeometry geofenceGeometry = new GeofenceCircle(); - try { geofenceGeometry.fromWkt(test); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } Assert.assertEquals(geofenceGeometry.toWkt(), test); } @Test - public void testContainsCircle() { + public void testContainsCircle() throws ParseException { String test = "CIRCLE (55.75414 37.6204, 100)"; GeofenceGeometry geofenceGeometry = new GeofenceCircle(); - try { geofenceGeometry.fromWkt(test); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } - Assert.assertTrue(geofenceGeometry.containsPoint(55.75477, 37.62025)); - Assert.assertTrue(!geofenceGeometry.containsPoint(55.75545, 37.61921)); } } diff --git a/test/org/traccar/geofence/GeofencePolygonTest.java b/test/org/traccar/geofence/GeofencePolygonTest.java index e3d6aaa29..361e7b70f 100644 --- a/test/org/traccar/geofence/GeofencePolygonTest.java +++ b/test/org/traccar/geofence/GeofencePolygonTest.java @@ -8,31 +8,43 @@ import org.junit.Test; public class GeofencePolygonTest { @Test - public void testPolygonWKT() { + public void testPolygonWkt() throws ParseException { String test = "POLYGON ((55.75474 37.61823, 55.75513 37.61888, 55.7535 37.6222, 55.75315 37.62165))"; GeofenceGeometry geofenceGeometry = new GeofencePolygon(); - try { geofenceGeometry.fromWkt(test); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } Assert.assertEquals(geofenceGeometry.toWkt(), test); } @Test - public void testContainsPolygon() { + public void testContainsPolygon() throws ParseException { String test = "POLYGON ((55.75474 37.61823, 55.75513 37.61888, 55.7535 37.6222, 55.75315 37.62165))"; GeofenceGeometry geofenceGeometry = new GeofencePolygon(); - try { geofenceGeometry.fromWkt(test); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } - Assert.assertTrue(geofenceGeometry.containsPoint(55.75476, 37.61915)); - Assert.assertTrue(!geofenceGeometry.containsPoint(55.75545, 37.61921)); } + + @Test + public void testContainsPolygon180() throws ParseException { + String test = "POLYGON ((66.9494 179.838, 66.9508 -179.8496, 66.8406 -180.0014))"; + GeofenceGeometry geofenceGeometry = new GeofencePolygon(); + geofenceGeometry.fromWkt(test); + Assert.assertTrue(geofenceGeometry.containsPoint(66.9015, -180.0096)); + Assert.assertTrue(geofenceGeometry.containsPoint(66.9015, 179.991)); + Assert.assertTrue(!geofenceGeometry.containsPoint(66.8368, -179.8792)); + + } + + @Test + public void testContainsPolygon0() throws ParseException { + String test = "POLYGON ((51.1966 -0.6207, 51.1897 0.4147, 50.9377 0.5136, 50.8675 -0.6082))"; + GeofenceGeometry geofenceGeometry = new GeofencePolygon(); + geofenceGeometry.fromWkt(test); + Assert.assertTrue(geofenceGeometry.containsPoint(51.0466, -0.0165)); + Assert.assertTrue(geofenceGeometry.containsPoint(51.0466, 0.018)); + Assert.assertTrue(!geofenceGeometry.containsPoint(50.9477, 0.5836)); + + } } diff --git a/test/org/traccar/geofence/GeofencePolylineTest.java b/test/org/traccar/geofence/GeofencePolylineTest.java index e281c3dd6..71aeb4081 100644 --- a/test/org/traccar/geofence/GeofencePolylineTest.java +++ b/test/org/traccar/geofence/GeofencePolylineTest.java @@ -8,40 +8,38 @@ import org.junit.Test; public class GeofencePolylineTest { @Test - public void testPolylineWKT() { + public void testPolylineWkt() throws ParseException { String test = "LINESTRING (55.75474 37.61823, 55.75513 37.61888, 55.7535 37.6222, 55.75315 37.62165)"; GeofenceGeometry geofenceGeometry = new GeofencePolyline(); - try { - geofenceGeometry.fromWkt(test); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } + geofenceGeometry.fromWkt(test); Assert.assertEquals(geofenceGeometry.toWkt(), test); } @Test - public void testContainsPolyline1Interval() { + public void testContainsPolyline1Interval() throws ParseException { String test = "LINESTRING (56.83777 60.59833, 56.83766 60.5968)"; - try { - GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 35); - Assert.assertTrue(geofenceGeometry.containsPoint(56.83801, 60.59748)); - ((GeofencePolyline) geofenceGeometry).setDistance(15); - Assert.assertTrue(!geofenceGeometry.containsPoint(56.83801, 60.59748)); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 35); + Assert.assertTrue(geofenceGeometry.containsPoint(56.83801, 60.59748)); + ((GeofencePolyline) geofenceGeometry).setDistance(15); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83801, 60.59748)); } @Test - public void testContainsPolyline3Intervals() { + public void testContainsPolyline3Intervals() throws ParseException { String test = "LINESTRING (56.836 60.6126, 56.8393 60.6114, 56.83887 60.60811, 56.83782 60.5988)"; - try { - GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 15); - Assert.assertTrue(geofenceGeometry.containsPoint(56.83847, 60.60458)); - Assert.assertTrue(!geofenceGeometry.containsPoint(56.83764, 60.59725)); - Assert.assertTrue(!geofenceGeometry.containsPoint(56.83861, 60.60822)); - } catch (ParseException e){ - Assert.assertTrue("ParseExceprion: " + e.getMessage(), true); - } + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 15); + Assert.assertTrue(geofenceGeometry.containsPoint(56.83847, 60.60458)); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83764, 60.59725)); + Assert.assertTrue(!geofenceGeometry.containsPoint(56.83861, 60.60822)); + + } + + @Test + public void testContainsPolylineNear180() throws ParseException { + String test = "LINESTRING (66.9494 179.838, 66.9508 -179.8496)"; + GeofenceGeometry geofenceGeometry = new GeofencePolyline(test, 25); + Assert.assertTrue(geofenceGeometry.containsPoint(66.95, 180.0)); + Assert.assertTrue(!geofenceGeometry.containsPoint(66.96, 180.0)); + Assert.assertTrue(!geofenceGeometry.containsPoint(66.9509, -179.83)); } } -- cgit v1.2.3 From e24b3588647fc1597f31b9bcd26ed9b7378f9f5b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 29 Nov 2016 02:52:19 +1300 Subject: Fix MiniFinder speed decoding --- src/org/traccar/protocol/MiniFinderProtocolDecoder.java | 5 +++-- test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java index 33396cebb..1b49bccb0 100644 --- a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java +++ b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2014 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import java.net.SocketAddress; @@ -86,7 +87,7 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(parser.nextDouble()); position.setLongitude(parser.nextDouble()); - position.setSpeed(parser.nextDouble()); + position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextDouble()); if (position.getCourse() > 360) { diff --git a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java index 2b5bbd574..ccefee049 100644 --- a/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MiniFinderProtocolDecoderTest.java @@ -19,6 +19,9 @@ public class MiniFinderProtocolDecoderTest extends ProtocolTest { verifyNothing(decoder, text( "!1,860719027585011")); + verifyPosition(decoder, text( + "!D,28/11/16,00:04:09,42.926067,-85.747589,124,236,140001,179.8,60,11,16,0;")); + verifyPosition(decoder, text( "!C,30/1/16,1:1:6,31.259157,30.020910,0,0,100001,25.32,100,0.03,0.01,0")); -- cgit v1.2.3 From 3593df6595cb1af169098ea2e7594fc3480648d0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 30 Nov 2016 03:09:20 +1300 Subject: Implement GPS103 custom command --- src/org/traccar/protocol/Gps103Protocol.java | 1 + src/org/traccar/protocol/Gps103ProtocolEncoder.java | 2 ++ test/org/traccar/protocol/Gps103ProtocolEncoderTest.java | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gps103Protocol.java b/src/org/traccar/protocol/Gps103Protocol.java index e3beb34e5..a4d563bfc 100644 --- a/src/org/traccar/protocol/Gps103Protocol.java +++ b/src/org/traccar/protocol/Gps103Protocol.java @@ -32,6 +32,7 @@ public class Gps103Protocol extends BaseProtocol { public Gps103Protocol() { super("gps103"); setSupportedCommands( + Command.TYPE_CUSTOM, Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC, Command.TYPE_POSITION_STOP, diff --git a/src/org/traccar/protocol/Gps103ProtocolEncoder.java b/src/org/traccar/protocol/Gps103ProtocolEncoder.java index afe87cf8c..36801b401 100644 --- a/src/org/traccar/protocol/Gps103ProtocolEncoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolEncoder.java @@ -42,6 +42,8 @@ public class Gps103ProtocolEncoder extends StringProtocolEncoder implements Stri protected Object encodeCommand(Command command) { switch (command.getType()) { + case Command.TYPE_CUSTOM: + return formatCommand(command, "**,imei:{%s},{%s}", Command.KEY_UNIQUE_ID, Command.KEY_DATA); case Command.TYPE_POSITION_STOP: return formatCommand(command, "**,imei:{%s},A", Command.KEY_UNIQUE_ID); case Command.TYPE_POSITION_SINGLE: diff --git a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java index f8652bc9a..54c520c21 100644 --- a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java @@ -8,7 +8,7 @@ import org.traccar.model.Command; public class Gps103ProtocolEncoderTest extends ProtocolTest { @Test - public void testEncode() throws Exception { + public void testEncodePositionPeriodic() throws Exception { Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder(); @@ -21,4 +21,18 @@ public class Gps103ProtocolEncoderTest extends ProtocolTest { } + @Test + public void testEncodeCustom() throws Exception { + + Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_CUSTOM); + command.set(Command.KEY_DATA, "H,080"); + + Assert.assertEquals("**,imei:123456789012345,H,080", encoder.encodeCommand(command)); + + } + } -- cgit v1.2.3 From e17b26a28a23af4d8a2c7e33d94105a22d566193 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 30 Nov 2016 03:16:55 +1300 Subject: Add GL200 unit test cases --- test/org/traccar/protocol/Gl200ProtocolDecoderTest.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index fa8373898..c493d5172 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,6 +10,12 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol()); + verifyAttributes(decoder, text( + "+RESP:GTSTR,400201,862365030034957,GL500,0,0,2,23.1,5,2,0.2,0,36.0,0.623089,51.582744,20161129174625,0234,0015,03C3,3550,,,,20161129174625,0026$")); + + verifyNothing(decoder, text( + "+RESP:GTSTR,400201,862365030034957,GL500,0,1,2,21.8,100,0,,,,,,,0234,0015,03C3,3550,,,,20161129174009,0023$")); + verifyAttributes(decoder, text( "+RESP:GTINF,210102,A10000499AEF9B,,41,,0,0,0,15.0,9,3.87,0,1,1,0,0,20161101140211,72,,,,,20161101140211,00A3$")); -- cgit v1.2.3 From 477cd54b15fe35c45d006639eeeb485d6c29d79d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Dec 2016 05:35:19 +1300 Subject: Implement trips unit test --- src/org/traccar/reports/Trips.java | 39 +++++++++++++------ test/org/traccar/reports/TripsTest.java | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 11 deletions(-) create mode 100644 test/org/traccar/reports/TripsTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/reports/Trips.java b/src/org/traccar/reports/Trips.java index d4e25f5e5..a52d48f16 100644 --- a/src/org/traccar/reports/Trips.java +++ b/src/org/traccar/reports/Trips.java @@ -46,7 +46,8 @@ public final class Trips { private Trips() { } - private static TripReport calculateTrip(ArrayList positions, int startIndex, int endIndex) { + private static TripReport calculateTrip( + ArrayList positions, int startIndex, int endIndex, boolean ignoreOdometer) { Position startTrip = positions.get(startIndex); Position endTrip = positions.get(endIndex); @@ -79,8 +80,6 @@ public final class Trips { trip.setEndTime(endTrip.getFixTime()); trip.setEndAddress(endTrip.getAddress()); - boolean ignoreOdometer = Context.getDeviceManager() - .lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, true); trip.setDistance(ReportUtils.calculateDistance(startTrip, endTrip, !ignoreOdometer)); trip.setDuration(tripDuration); trip.setAverageSpeed(speedSum / (endIndex - startIndex)); @@ -90,15 +89,14 @@ public final class Trips { return trip; } - private static Collection detectTrips(long deviceId, Date from, Date to) throws SQLException { - double speedThreshold = Context.getConfig().getDouble("event.motion.speedThreshold", 0.01); - long minimalTripDuration = Context.getConfig().getLong("report.trip.minimalTripDuration", 300) * 1000; - double minimalTripDistance = Context.getConfig().getLong("report.trip.minimalTripDistance", 500); - long minimalParkingDuration = Context.getConfig().getLong("report.trip.minimalParkingDuration", 300) * 1000; - boolean greedyParking = Context.getConfig().getBoolean("report.trip.greedyParking"); + protected static Collection detectTrips( + double speedThreshold, double minimalTripDistance, + long minimalTripDuration, long minimalParkingDuration, boolean greedyParking, boolean ignoreOdometer, + Collection positionCollection) { + Collection result = new ArrayList<>(); - ArrayList positions = new ArrayList<>(Context.getDataManager().getPositions(deviceId, from, to)); + ArrayList positions = new ArrayList<>(positionCollection); if (positions != null && !positions.isEmpty()) { int previousStartParkingIndex = 0; int startParkingIndex = -1; @@ -150,7 +148,8 @@ public final class Trips { if ((parkingDuration >= minimalParkingDuration || isLast) && previousEndParkingIndex < startParkingIndex) { if (!tripFiltered) { - result.add(calculateTrip(positions, previousEndParkingIndex, startParkingIndex)); + result.add(calculateTrip( + positions, previousEndParkingIndex, startParkingIndex, ignoreOdometer)); } previousEndParkingIndex = endParkingIndex; skipped = false; @@ -161,9 +160,26 @@ public final class Trips { } } } + return result; } + private static Collection detectTrips(long deviceId, Date from, Date to) throws SQLException { + double speedThreshold = Context.getConfig().getDouble("event.motion.speedThreshold", 0.01); + long minimalTripDuration = Context.getConfig().getLong("report.trip.minimalTripDuration", 300) * 1000; + double minimalTripDistance = Context.getConfig().getLong("report.trip.minimalTripDistance", 500); + long minimalParkingDuration = Context.getConfig().getLong("report.trip.minimalParkingDuration", 300) * 1000; + boolean greedyParking = Context.getConfig().getBoolean("report.trip.greedyParking"); + + boolean ignoreOdometer = Context.getDeviceManager() + .lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, true); + + return detectTrips( + speedThreshold, minimalTripDistance, minimalTripDuration, + minimalParkingDuration, greedyParking, ignoreOdometer, + Context.getDataManager().getPositions(deviceId, from, to)); + } + public static Collection getObjects(long userId, Collection deviceIds, Collection groupIds, Date from, Date to) throws SQLException { ArrayList result = new ArrayList<>(); @@ -217,4 +233,5 @@ public final class Trips { transformer.write(); } } + } diff --git a/test/org/traccar/reports/TripsTest.java b/test/org/traccar/reports/TripsTest.java new file mode 100644 index 000000000..7b860b63d --- /dev/null +++ b/test/org/traccar/reports/TripsTest.java @@ -0,0 +1,69 @@ +package org.traccar.reports; + +import org.junit.Test; +import org.traccar.model.Position; +import org.traccar.reports.model.TripReport; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.TimeZone; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + +public class TripsTest { + + private Date date(String time) throws ParseException { + DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat.parse(time); + } + + private Position position(String time, double speed, double totalDistance) throws ParseException { + + Position position = new Position(); + + if (time != null) { + position.setTime(date(time)); + } + position.setValid(true); + position.setSpeed(speed); + position.set(Position.KEY_TOTAL_DISTANCE, totalDistance); + + return position; + } + + @Test + public void testDetectTripsSimple() throws ParseException { + + Collection data = Arrays.asList( + position("2016-01-01 00:00:00.000", 0, 0), + position("2016-01-01 00:01:00.000", 0, 0), + position("2016-01-01 00:02:00.000", 10, 0), + position("2016-01-01 00:03:00.000", 10, 1000), + position("2016-01-01 00:04:00.000", 10, 2000), + position("2016-01-01 00:05:00.000", 0, 3000), + position("2016-01-01 00:06:00.000", 0, 3000)); + + Collection result = Trips.detectTrips(0.01, 500, 300000, 300000, false, false, data); + + assertNotNull(result); + assertFalse(result.isEmpty()); + + TripReport item = result.iterator().next(); + + assertEquals(date("2016-01-01 00:02:00.000"), item.getStartTime()); + assertEquals(date("2016-01-01 00:05:00.000"), item.getEndTime()); + assertEquals(180000, item.getDuration()); + assertEquals(10, item.getAverageSpeed(), 0.01); + assertEquals(10, item.getMaxSpeed(), 0.01); + assertEquals(3000, item.getDistance(), 0.01); + + } + +} -- cgit v1.2.3 From 700f39377da8801377508357292862b18fafd16a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Dec 2016 06:36:01 +1300 Subject: Add CalAmp unit test case --- test/org/traccar/protocol/CalAmpProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java index 8d7d5f9fe..b6fb5bd0e 100644 --- a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java +++ b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class CalAmpProtocolDecoderTest extends ProtocolTest { CalAmpProtocolDecoder decoder = new CalAmpProtocolDecoder(new CalAmpProtocol()); + verifyPosition(decoder, binary( + "83092701131797081078220107010200dc583d4d3f583d4d3f19c70502cd1d512d00005f180000008500ec0800101eff980f090100313102000000000000000000")); + verifyPosition(decoder, binary( "8305133303910501010102004557E5AB2457E3B3E01FD828DBFE9E3465000028C90000004201310704001EFFA12F0B22081BCA05000000000000000F87000E8E2F00EA029E0000082D")); -- cgit v1.2.3 From 09a1cbffdf19154a3fc990f0d0562677f29e39d8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Dec 2016 07:53:49 +1300 Subject: Implement G737IC extra data --- src/org/traccar/model/Position.java | 1 + .../traccar/protocol/GoSafeProtocolDecoder.java | 34 ++++++++++++++++------ .../protocol/GoSafeProtocolDecoderTest.java | 3 ++ 3 files changed, 29 insertions(+), 9 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index b2965c89c..8ca2588e2 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -59,6 +59,7 @@ public class Position extends Message { public static final String KEY_MOTION = "motion"; public static final String KEY_ARMED = "armed"; public static final String KEY_ACCURACY = "accuracy"; + public static final String KEY_GEOFENCE = "geofence"; public static final String KEY_DTCS = "dtcs"; public static final String KEY_OBD_SPEED = "obdSpeed"; diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java index a258e922c..1ae527160 100644 --- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -90,13 +90,14 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { .groupBegin() .text("DTT:") .number("(x+);") // status - .expression("[^;]*;") - .number("x+;") // geo-fence 0-119 - .number("x+;") // geo-fence 120-155 - .number("x+,?") // event status + .number("(x+)?;") // io + .number("(x+);") // geo-fence 0-119 + .number("(x+);") // geo-fence 120-155 + .number("(x+)") // event status + .number("(?:;(x+))?,?") // packet type .groupEnd("?") .groupBegin() - .text("ETD:").expression("[^,]*,?") + .text("ETD:").expression("([^,]+),?") .groupEnd("?") .groupBegin() .text("OBD:") @@ -108,6 +109,9 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { .groupBegin() .text("TRU:").expression("[^,]*,?") .groupEnd("?") + .groupBegin() + .text("TAG:").expression("([^,]+),?") + .groupEnd("?") .compile(); private static final Pattern PATTERN_OLD = new PatternBuilder() @@ -122,7 +126,7 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { .number("([EW])(d+.d+);") // longitude .number("(d+)?;") // speed .number("(d+);") // course - .number("(d+.?d*)").optional() // hdop + .number("(d+.?d*)").optional() // hdop .number("(dd)(dd)(dd)") // date .any() .compile(); @@ -162,16 +166,28 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_POWER, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); - String status = parser.next(); - if (status != null) { - position.set(Position.KEY_IGNITION, BitUtil.check(Integer.parseInt(status, 16), 13)); + if (parser.hasNext(6)) { + long status = parser.nextLong(16); + position.set(Position.KEY_IGNITION, BitUtil.check(status, 13)); position.set(Position.KEY_STATUS, status); + position.set("ioStatus", parser.next()); + position.set(Position.KEY_GEOFENCE, parser.next() + parser.next()); + position.set("eventStatus", parser.next()); + position.set("packetType", parser.next()); + } + + if (parser.hasNext()) { + position.set("eventData", parser.next()); } if (parser.hasNext()) { position.set("obd", parser.next()); } + if (parser.hasNext()) { + position.set("tagData", parser.next()); + } + return position; } diff --git a/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java b/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java index fb0dec4fb..35cf5fcb2 100644 --- a/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class GoSafeProtocolDecoderTest extends ProtocolTest { GoSafeProtocolDecoder decoder = new GoSafeProtocolDecoder(new GoSafeProtocol()); + verifyPositions(decoder, text( + "*GS26,356449061139936,022918011216,,SYS:G737IC;V1.13;V1.0.5,GPS:A;9;N42.651728;W70.623520;0;0;48;1.50,ADC:4.08,DTT:3900C;;0;0;0;1,#")); + verifyNotNull(decoder, text( "*GS56,356449063230915,052339180916,,SYS:G7S;V1.08;V1.2,GPS:V;4;N24.730006;E46.637816;14;0;630,GSM:;;420;4;5655;507A;-70,COT:75242;2-8-17,ADC:13.22;0.08,DTT:23004;;0;0;0;1#")); -- cgit v1.2.3 From 6782f2ee534494aa24dc73299f71e4227077e037 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 2 Dec 2016 03:43:46 +1300 Subject: Decode H02 cell info --- src/org/traccar/protocol/H02ProtocolDecoder.java | 19 +++++++++++++++++++ test/org/traccar/protocol/H02ProtocolDecoderTest.java | 3 +++ 2 files changed, 22 insertions(+) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 2b7d00969..2c7852d16 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -167,6 +167,12 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .number("(?:(dd)(dd)(dd))?,") // date (ddmmyy) .any() .number("(x{8})") // status + .groupBegin() + .number(", *(x+),") // mcc + .number(" *(x+),") // mnc + .number(" *(x+),") // lac + .number(" *(x+)") // cid + .groupEnd("?") .any() .compile(); @@ -237,6 +243,19 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { processStatus(position, parser.nextLong(16)); + if (parser.hasNext(4)) { + int mcc = parser.nextInt(16); + int mnc = parser.nextInt(16); + int lac = parser.nextInt(16); + int cid = parser.nextInt(16); + if (mcc != 0 && mnc != 0 && lac != 0 && cid != 0) { + position.set(Position.KEY_MCC, mcc); + position.set(Position.KEY_MNC, mnc); + position.set(Position.KEY_LAC, lac); + position.set(Position.KEY_CID, cid); + } + } + return position; } diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index b2e336076..d1b2d3198 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class H02ProtocolDecoderTest extends ProtocolTest { H02ProtocolDecoder decoder = new H02ProtocolDecoder(new H02Protocol()); + verifyPosition(decoder, buffer( + "*HQ,353588020068342,V1,084436,A,3257.01525,N,00655.03865,W,57.78,40,011216,FFFBFFFF,25c,a, 154,b04c#")); + verifyNothing(decoder, buffer( "*HQ,356803210091319,BS,,2d4,a,1b63,1969,26,1b63,10b2,31,0,0,25,,ffffffff,60#")); -- cgit v1.2.3 From b39ade422f42d5423db203dab87886d3f8f63dd1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 2 Dec 2016 05:06:11 +1300 Subject: Add GPS103 power cut alarm --- src/org/traccar/protocol/Gps103ProtocolDecoder.java | 2 ++ test/org/traccar/protocol/Gps103ProtocolDecoderTest.java | 3 +++ 2 files changed, 5 insertions(+) (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 57dc784d3..d929ae917 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -119,6 +119,8 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { return Position.ALARM_POWER_OFF; case "door alarm": return Position.ALARM_DOOR; + case "ac alarm": + return Position.ALARM_POWER_CUT; default: return null; } diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 2640051fb..93817b575 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Gps103ProtocolDecoderTest extends ProtocolTest { Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new Gps103Protocol()); + verifyAttributes(decoder, text( + "imei:862106021237716,ac alarm,1611291645,,F,204457.000,A,1010.2783,N,06441.0274,W,0.00,,;")); + verifyAttributes(decoder, text( "imei:359710049057798,OBD,161003192752,1785,,,0,54,96.47%,75,20.00%,1892,0.00,P0134,P0571,,;")); -- cgit v1.2.3 From caaf1a62e66ba617ff6a4a5a456811825dc563cb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 3 Dec 2016 12:25:53 +1300 Subject: Add GoSafe unit test case --- test/org/traccar/protocol/GoSafeProtocolDecoderTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java b/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java index 35cf5fcb2..b8f98d8b9 100644 --- a/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GoSafeProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class GoSafeProtocolDecoderTest extends ProtocolTest { GoSafeProtocolDecoder decoder = new GoSafeProtocolDecoder(new GoSafeProtocol()); + verifyPositions(decoder, text( + "*GS56,357330051092344,123918301116,10,GPS:L;9;N47.582920;W122.238720;0;0;102;0.99,GSM:0;0;310;410;A7DB;385C;-86,COT:76506,ADC:0.82;3.77,DTT:2184;;0;0;10000;0$000000000000,86,GPS:A;6;N47.582912;W122.238840;0;0;88;2.20,COT:76506,ADC:0.00;3.75,DTT:0;;0;0;40;0$000000000000,86,GPS:A;6;N47.582912;W122.238840;0;0;88;2.20,COT:76506,ADC:0.00;3.74,DTT:0;;0;0;40;0$000000000000,93,GPS:A;6;N47.582912;W122.238840;0;0;88;2.20,COT:76506,ADC:0.00;3.73,DTT:8000;;0;0;80000;0$000000000000,13,GPS:L;6;N47.582912;W122.238840;0;0;88;2.20,COT:76506,ADC:11.09;3.79,DTT:2004;;0;0;80000;0$000000000000,90,GPS:L;6;N47.582912;W122.238840;0;0;88;2.20,COT:76506,ADC:11.13;3.79,DTT:23004;;0;0;10000;0$000000000000,,GPS:L;6;N47.582912;W122.238840;0;0;88;2.20,GSM:5;2;310;410;A7DB;385C;-89,COT:76506,ADC:14.12;3.81,DTT:23184;;0;0;0;6#")); + verifyPositions(decoder, text( "*GS26,356449061139936,022918011216,,SYS:G737IC;V1.13;V1.0.5,GPS:A;9;N42.651728;W70.623520;0;0;48;1.50,ADC:4.08,DTT:3900C;;0;0;0;1,#")); -- cgit v1.2.3 From 6936e7aa6404419c5a9380c5e62489abcd58ce0d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 5 Dec 2016 07:55:25 +1300 Subject: Implement OIGO MG protocol --- src/org/traccar/helper/UnitsConverter.java | 9 ++ src/org/traccar/protocol/OigoProtocolDecoder.java | 97 ++++++++++++++++++++-- .../traccar/protocol/OigoProtocolDecoderTest.java | 15 ++++ 3 files changed, 113 insertions(+), 8 deletions(-) (limited to 'test/org/traccar') diff --git a/src/org/traccar/helper/UnitsConverter.java b/src/org/traccar/helper/UnitsConverter.java index 00b00861e..e0d94c6dc 100644 --- a/src/org/traccar/helper/UnitsConverter.java +++ b/src/org/traccar/helper/UnitsConverter.java @@ -21,6 +21,7 @@ public final class UnitsConverter { private static final double KNOTS_TO_MPH_RATIO = 0.868976; private static final double KNOTS_TO_MPS_RATIO = 1.94384; private static final double KNOTS_TO_CPS_RATIO = 0.0194384449; + private static final double METERS_TO_FEET_RATIO = 0.3048; private UnitsConverter() { } @@ -53,4 +54,12 @@ public final class UnitsConverter { return value * KNOTS_TO_CPS_RATIO; } + public static double feetFromMeters(double value) { + return value / METERS_TO_FEET_RATIO; + } + + public static double metersFromFeet(double value) { + return value * METERS_TO_FEET_RATIO; + } + } diff --git a/src/org/traccar/protocol/OigoProtocolDecoder.java b/src/org/traccar/protocol/OigoProtocolDecoder.java index 15a215c4f..3a4134eda 100644 --- a/src/org/traccar/protocol/OigoProtocolDecoder.java +++ b/src/org/traccar/protocol/OigoProtocolDecoder.java @@ -34,15 +34,12 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { super(protocol); } - public static final int MSG_LOCATION = 0x00; - public static final int MSG_REMOTE_START = 0x10; - public static final int MSG_ACKNOWLEDGEMENT = 0xE0; + public static final int MSG_AR_LOCATION = 0x00; + public static final int MSG_AR_REMOTE_START = 0x10; - @Override - protected Object decode( - Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + public static final int MSG_ACKNOWLEDGEMENT = 0xE0; - ChannelBuffer buf = (ChannelBuffer) msg; + private Position decodeArMessage(Channel channel, SocketAddress remoteAddress, ChannelBuffer buf) { buf.skipBytes(1); // header buf.readUnsignedShort(); // length @@ -67,7 +64,7 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { break; } - if (deviceSession == null || type != MSG_LOCATION) { + if (deviceSession == null || type != MSG_AR_LOCATION) { return null; } @@ -154,4 +151,88 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder { return position; } + private double convertCoordinate(long value) { + boolean negative = value < 0; + value = Math.abs(value); + double minutes = (value % 100000) * 0.001; + double degrees = value / 100000 + minutes / 60; + return negative ? -degrees : degrees; + } + + private Position decodeMgMessage(Channel channel, SocketAddress remoteAddress, ChannelBuffer buf) { + + buf.readUnsignedByte(); // tag + int flags = buf.getUnsignedByte(buf.readerIndex()); + + DeviceSession deviceSession; + if (BitUtil.check(flags, 6)) { + buf.readUnsignedByte(); // flags + deviceSession = getDeviceSession(channel, remoteAddress); + } else { + String imei = ChannelBuffers.hexDump(buf.readBytes(8)).substring(1); + deviceSession = getDeviceSession(channel, remoteAddress, imei); + } + + if (deviceSession == null) { + return null; + } + + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + buf.skipBytes(8); // imsi + + int date = buf.readUnsignedShort(); + + DateBuilder dateBuilder = new DateBuilder() + .setDate(2010 + BitUtil.from(date, 12), BitUtil.between(date, 8, 12), BitUtil.to(date, 8)) + .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), 0); + + position.setValid(true); + position.setLatitude(convertCoordinate(buf.readInt())); + position.setLongitude(convertCoordinate(buf.readInt())); + + position.setAltitude(UnitsConverter.metersFromFeet(buf.readShort())); + position.setCourse(buf.readUnsignedShort()); + position.setSpeed(UnitsConverter.knotsFromMph(buf.readUnsignedByte())); + + position.set(Position.KEY_POWER, buf.readUnsignedByte() * 100 + "mV"); + position.set(Position.PREFIX_IO + 1, buf.readUnsignedByte()); + + dateBuilder.setSecond(buf.readUnsignedByte()); + position.setTime(dateBuilder.getDate()); + + position.set(Position.KEY_GSM, buf.readUnsignedByte()); + + int index = buf.readUnsignedByte(); + + position.set(Position.KEY_VERSION, buf.readUnsignedByte()); + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); + position.set(Position.KEY_ODOMETER, (long) (buf.readUnsignedInt() * 1609.34)); + + if (channel != null && BitUtil.check(flags, 7)) { + ChannelBuffer response = ChannelBuffers.dynamicBuffer(); + response.writeByte(MSG_ACKNOWLEDGEMENT); + response.writeByte(index); + response.writeByte(0x00); + channel.write(response, remoteAddress); + } + + return position; + } + + @Override + protected Object decode( + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { + + ChannelBuffer buf = (ChannelBuffer) msg; + + if (buf.getUnsignedByte(buf.readerIndex()) == 0x7e) { + return decodeArMessage(channel, remoteAddress,buf); + } else { + return decodeMgMessage(channel, remoteAddress,buf); + } + } + } diff --git a/test/org/traccar/protocol/OigoProtocolDecoderTest.java b/test/org/traccar/protocol/OigoProtocolDecoderTest.java index 14c34ae7c..452e40a78 100644 --- a/test/org/traccar/protocol/OigoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OigoProtocolDecoderTest.java @@ -10,6 +10,21 @@ public class OigoProtocolDecoderTest extends ProtocolTest { OigoProtocolDecoder decoder = new OigoProtocolDecoder(new OigoProtocol()); + verifyPosition(decoder, binary( + "0103537820628365110310410790660962521813380026EE4EFF8593AA0065003E00794C020600100500000000")); + + verifyPosition(decoder, binary( + "0E03537820628344660204043255862749531B100E0026EE3AFF8593A3FFFE00BF00044C20090710C300000000")); + + verifyPosition(decoder, binary( + "00035378206638500203340201271426226b190203001ac000ff72eedd00370097238b4c34116a130b000094d9")); + + verifyPosition(decoder, binary( + "1d035378206638500203340201271426226b19020c001ab144ff72f74d005f0097298a4c1d066d130b000094de")); + + verifyPosition(decoder, binary( + "00035378206638500203340201271426226b191016001c04e5ff760081013d002900814c1a0f5e130b00009576")); + verifyPosition(decoder, binary( "7e004200000014631000258257000000ffff02d0690e000220690e0002200696dbd204bdfde31a070000b307101135de106e05f500000000010908010402200104ffff8001")); -- cgit v1.2.3 From a9260f9e470add52f1fe3df35ea93e0d547c3fe7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 5 Dec 2016 08:06:57 +1300 Subject: Add Granit unit test case --- test/org/traccar/protocol/GranitProtocolDecoderTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/GranitProtocolDecoderTest.java b/test/org/traccar/protocol/GranitProtocolDecoderTest.java index 1e6a5e611..1fea1d98c 100644 --- a/test/org/traccar/protocol/GranitProtocolDecoderTest.java +++ b/test/org/traccar/protocol/GranitProtocolDecoderTest.java @@ -12,6 +12,9 @@ public class GranitProtocolDecoderTest extends ProtocolTest { GranitProtocolDecoder decoder = new GranitProtocolDecoder(new GranitProtocol()); + verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN, + "2b444441547e84003b6d0401b10e9217445800b051398f35d34a313b000072000000010b000080b051398f35d34a313b000072000000010b0000f0b051390f33314c303b900371000000010b0000f0b05139cd31e54c2f3cd0016f000000010b0000f0b051396831204d303d950071000000010b0000f0b051397530aa4d323c610171000000010b00000a002a30420d0a")); + verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN, "2b525243427e1a003e2934757c57b8b03c38d279b4e61e9bd7006b000000001c00002a4533")); @@ -28,6 +31,7 @@ public class GranitProtocolDecoderTest extends ProtocolTest { //ERROR WRONG CHECKSUM_1 verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN, "4552524f522057524f4e4720434845434b53554d5f31")); + } } -- cgit v1.2.3