aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--database/changelog-3.5.xml7
-rw-r--r--debug.xml9
-rw-r--r--src/org/traccar/Context.java6
-rw-r--r--src/org/traccar/DetectorHandler.java122
-rw-r--r--src/org/traccar/ServerManager.java26
-rw-r--r--src/org/traccar/geocode/GoogleReverseGeocoder.java4
-rw-r--r--src/org/traccar/model/Command.java7
-rw-r--r--src/org/traccar/model/Server.java10
-rw-r--r--src/org/traccar/model/User.java10
-rw-r--r--src/org/traccar/protocol/AplicomProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java51
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java10
-rw-r--r--src/org/traccar/protocol/MeitrackProtocol.java3
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolEncoder.java7
-rw-r--r--test/org/traccar/DetectorHandlerTest.java20
-rw-r--r--test/org/traccar/protocol/Gl200ProtocolDecoderTest.java6
-rw-r--r--test/org/traccar/protocol/Gps103ProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/MeitrackProtocolEncoderTest.java7
-rw-r--r--web/app/model/Server.js3
-rw-r--r--web/app/model/User.js3
-rw-r--r--web/app/view/Devices.js1
21 files changed, 109 insertions, 208 deletions
diff --git a/database/changelog-3.5.xml b/database/changelog-3.5.xml
index 3d1fa6b41..cbd0287b0 100644
--- a/database/changelog-3.5.xml
+++ b/database/changelog-3.5.xml
@@ -33,9 +33,14 @@
<column name="groupid" type="INT" />
</addColumn>
+ <dropColumn tableName="users" columnName="language" />
+ <dropColumn tableName="server" columnName="language" />
+
+ <dropNotNullConstraint tableName="users" columnName="map" columnDataType="VARCHAR(128)" />
<dropDefaultValue tableName="users" columnName="map" />
- <dropDefaultValue tableName="users" columnName="language" />
+ <dropNotNullConstraint tableName="users" columnName="distanceunit" columnDataType="VARCHAR(128)" />
<dropDefaultValue tableName="users" columnName="distanceunit" />
+ <dropNotNullConstraint tableName="users" columnName="speedunit" columnDataType="VARCHAR(128)" />
<dropDefaultValue tableName="users" columnName="speedunit" />
<addColumn tableName="users">
diff --git a/debug.xml b/debug.xml
index c1a348376..cadfdd9f2 100644
--- a/debug.xml
+++ b/debug.xml
@@ -62,7 +62,6 @@
map = :map,
bingKey = :bingKey,
mapUrl = :mapUrl,
- language = :language,
distanceUnit = :distanceUnit,
speedUnit = :speedUnit,
latitude = :latitude,
@@ -87,8 +86,8 @@
</entry>
<entry key='database.insertUser'>
- INSERT INTO users (name, email, hashedPassword, salt, admin)
- VALUES (:name, :email, :hashedPassword, :salt, :admin);
+ INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelveHourFormat)
+ VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelveHourFormat);
</entry>
<entry key='database.updateUser'>
@@ -97,7 +96,6 @@
email = :email,
admin = :admin,
map = :map,
- language = :language,
distanceUnit = :distanceUnit,
speedUnit = :speedUnit,
latitude = :latitude,
@@ -181,7 +179,7 @@
<entry key='database.insertPosition'>
INSERT INTO positions (deviceId, protocol, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, attributes)
- VALUES (:deviceId, :protocol, :now, :time, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes);
+ VALUES (:deviceId, :protocol, :now, :deviceTime, :fixTime, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes);
</entry>
<entry key='database.selectLatestPositions'>
@@ -194,7 +192,6 @@
<!-- PROTOCOL CONFIG -->
- <!--<entry key='detector.port'>5000</entry>-->
<entry key='gps103.port'>5001</entry>
<entry key='tk103.port'>5002</entry>
<entry key='gl100.port'>5003</entry>
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 55561b921..e87f78d20 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -148,7 +148,11 @@ public final class Context {
reverseGeocoder = new FactualReverseGeocoder(url, key, cacheSize);
break;
default:
- reverseGeocoder = new GoogleReverseGeocoder(cacheSize);
+ if (key != null) {
+ reverseGeocoder = new GoogleReverseGeocoder(key, cacheSize);
+ } else {
+ reverseGeocoder = new GoogleReverseGeocoder(cacheSize);
+ }
break;
}
}
diff --git a/src/org/traccar/DetectorHandler.java b/src/org/traccar/DetectorHandler.java
deleted file mode 100644
index 223985906..000000000
--- a/src/org/traccar/DetectorHandler.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2015 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;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipeline;
-import org.jboss.netty.channel.MessageEvent;
-import org.jboss.netty.channel.SimpleChannelHandler;
-import org.jboss.netty.handler.codec.frame.FrameDecoder;
-import org.jboss.netty.handler.codec.string.StringDecoder;
-import org.traccar.helper.Log;
-
-import java.lang.reflect.Method;
-import java.net.SocketAddress;
-import java.util.List;
-
-public class DetectorHandler extends SimpleChannelHandler {
-
- private final List<TrackerServer> serverList;
-
- private boolean showFailed;
-
- DetectorHandler(List<TrackerServer> serverList) {
- this.serverList = serverList;
- }
-
- public void checkPipeline(String protocol, ChannelPipeline pipeline, ChannelBuffer buf) throws Exception {
- Object tmp = buf.duplicate();
-
- // Frame decoder
- FrameDecoder frameDecoder = (FrameDecoder) pipeline.get("frameDecoder");
- if (frameDecoder != null) {
- try {
- Method method = frameDecoder.getClass().getDeclaredMethod(
- "decode", ChannelHandlerContext.class, Channel.class, ChannelBuffer.class);
- method.setAccessible(true);
- tmp = method.invoke(frameDecoder, null, null, tmp);
- } catch (NoSuchMethodException error) {
- Method method = frameDecoder.getClass().getSuperclass().getDeclaredMethod(
- "decode", ChannelHandlerContext.class, Channel.class, ChannelBuffer.class);
- method.setAccessible(true);
- tmp = method.invoke(frameDecoder, null, null, tmp);
- }
- }
-
- // String decoder
- if (pipeline.get("stringDecoder") != null) {
- StringDecoder stringDecoder = new StringDecoder();
- if (tmp != null) {
- try {
- Method method = stringDecoder.getClass().getDeclaredMethod(
- "decode", ChannelHandlerContext.class, Channel.class, Object.class);
- method.setAccessible(true);
- tmp = method.invoke(stringDecoder, null, null, tmp);
- } catch (NoSuchMethodException error) {
- Method method = stringDecoder.getClass().getSuperclass().getDeclaredMethod(
- "decode", ChannelHandlerContext.class, Channel.class, Object.class);
- method.setAccessible(true);
- tmp = method.invoke(stringDecoder, null, null, tmp);
- }
- }
- }
-
- // Protocol decoder
- BaseProtocolDecoder protocolDecoder = (BaseProtocolDecoder) pipeline.get("objectDecoder");
- if (tmp != null) {
- try {
- Method method = protocolDecoder.getClass().getDeclaredMethod(
- "decode", ChannelHandlerContext.class, Channel.class, SocketAddress.class, Object.class);
- method.setAccessible(true);
- tmp = method.invoke(protocolDecoder, null, null, null, tmp);
- } catch (NoSuchMethodException error) {
- Method method = protocolDecoder.getClass().getSuperclass().getDeclaredMethod(
- "decode", ChannelHandlerContext.class, Channel.class, SocketAddress.class, Object.class);
- method.setAccessible(true);
- tmp = method.invoke(protocolDecoder, null, null, null, tmp);
- }
- }
-
- if (tmp != null) {
- Log.info("Protocol " + protocol + " possible match");
- } else if (showFailed) {
- Log.info("Protocol " + protocol + " no match");
- }
- }
-
- @Override
- public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
-
- if (e.getMessage() instanceof ChannelBuffer) {
- ChannelBuffer buf = (ChannelBuffer) e.getMessage();
-
- for (TrackerServer server : serverList) {
- try {
- if (!server.getProtocol().equals("detector")) {
- checkPipeline(server.getProtocol(), server.getPipelineFactory().getPipeline(), buf);
- }
- } catch (Exception error) {
- if (showFailed) {
- Log.info("Protocol " + server.getProtocol() + " error");
- }
- }
- }
- }
- }
-
-}
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 08557a5d6..2fa44831f 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -68,8 +68,6 @@ public class ServerManager {
initProtocolServer((BaseProtocol) protocolClass.newInstance());
}
}
-
- initProtocolDetector();
}
public void start() {
@@ -88,30 +86,8 @@ public class ServerManager {
GlobalTimer.release();
}
- private boolean isProtocolEnabled(String protocol) {
- return Context.getConfig().hasKey(protocol + ".port");
- }
-
- private void initProtocolDetector() {
- String protocol = "detector";
- if (isProtocolEnabled(protocol)) {
- serverList.add(new TrackerServer(new ServerBootstrap(), protocol) {
- @Override
- protected void addSpecificHandlers(ChannelPipeline pipeline) {
- pipeline.addLast("detectorHandler", new DetectorHandler(serverList));
- }
- });
- serverList.add(new TrackerServer(new ConnectionlessBootstrap(), protocol) {
- @Override
- protected void addSpecificHandlers(ChannelPipeline pipeline) {
- pipeline.addLast("detectorHandler", new DetectorHandler(serverList));
- }
- });
- }
- }
-
private void initProtocolServer(final Protocol protocol) {
- if (isProtocolEnabled(protocol.getName())) {
+ if (Context.getConfig().hasKey(protocol.getName() + ".port")) {
protocol.initTrackerServers(serverList);
}
}
diff --git a/src/org/traccar/geocode/GoogleReverseGeocoder.java b/src/org/traccar/geocode/GoogleReverseGeocoder.java
index f1c27c5d3..be863718b 100644
--- a/src/org/traccar/geocode/GoogleReverseGeocoder.java
+++ b/src/org/traccar/geocode/GoogleReverseGeocoder.java
@@ -29,6 +29,10 @@ public class GoogleReverseGeocoder extends JsonReverseGeocoder {
super("http://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f", cacheSize);
}
+ public GoogleReverseGeocoder(String key, int cacheSize) {
+ super("http://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&key=" + key, cacheSize);
+ }
+
@Override
public Address parseAddress(JsonObject json) {
JsonArray results = json.getJsonArray("results");
diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java
index dd541e643..eda5f61d1 100644
--- a/src/org/traccar/model/Command.java
+++ b/src/org/traccar/model/Command.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 com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Command extends Extensible {
+ public static final String TYPE_CUSTOM = "custom";
public static final String TYPE_POSITION_SINGLE = "positionSingle";
public static final String TYPE_POSITION_PERIODIC = "positionPeriodic";
public static final String TYPE_POSITION_STOP = "positionStop";
@@ -31,12 +32,14 @@ public class Command extends Extensible {
public static final String TYPE_REQUEST_PHOTO = "requestPhoto";
public static final String TYPE_REBOOT_DEVICE = "rebootDevice";
public static final String TYPE_MOVEMENT_ALARM = "movementAlarm";
+ public static final String TYPE_SEND_SMS = "sendSms";
public static final String KEY_UNIQUE_ID = "uniqueId";
public static final String KEY_FREQUENCY = "frequency";
public static final String KEY_TIMEZONE = "timezone";
public static final String KEY_DEVICE_PASSWORD = "devicePassword";
public static final String KEY_RADIUS = "radius";
+ public static final String KEY_PHONE_NUMBER = "phoneNumber";
+ public static final String KEY_MESSAGE = "message";
- public static final String TYPE_CUSTOM = "CUSTOM";
}
diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java
index f03a0aa60..270fd61fa 100644
--- a/src/org/traccar/model/Server.java
+++ b/src/org/traccar/model/Server.java
@@ -77,16 +77,6 @@ public class Server {
this.mapUrl = mapUrl;
}
- private String language;
-
- public String getLanguage() {
- return language;
- }
-
- public void setLanguage(String language) {
- this.language = language;
- }
-
private String distanceUnit;
public String getDistanceUnit() {
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index e58311834..f22a2e632 100644
--- a/src/org/traccar/model/User.java
+++ b/src/org/traccar/model/User.java
@@ -80,16 +80,6 @@ public class User {
this.map = map;
}
- private String language;
-
- public String getLanguage() {
- return language;
- }
-
- public void setLanguage(String language) {
- this.language = language;
- }
-
private String distanceUnit;
public String getDistanceUnit() {
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java
index a3d34cf3c..c2eb8a1f5 100644
--- a/src/org/traccar/protocol/AplicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java
@@ -222,7 +222,7 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder {
int event = buf.readUnsignedByte();
position.set(Event.KEY_EVENT, event);
- buf.readUnsignedByte();
+ position.set("event-info", buf.readUnsignedByte());
if ((selector & 0x0008) != 0) {
position.setValid((buf.readUnsignedByte() & 0x40) != 0);
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 574f9a8c3..7d0c58c57 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -158,6 +158,22 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.text("$").optional()
.compile();
+ 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
+ .expression("[^,]*,") // device name
+ .number("d+,") // ignition off duration
+ .expression(PATTERN_LOCATION.pattern())
+ .number("(d{5}:dd:dd)?,") // hour meter
+ .number("(d{1,7}.d)?,") // odometer
+ .number("(dddd)(dd)(dd)") // date
+ .number("(dd)(dd)(dd)").optional(2) // time
+ .text(",")
+ .number("(xxxx)") // count number
+ .text("$").optional()
+ .compile();
+
private static final Pattern PATTERN = new PatternBuilder()
.text("+").expression("(?:RESP|BUFF):GT...,")
.number("(?:[0-9A-Z]{2}xxxx)?,") // protocol version
@@ -376,6 +392,37 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return positions;
}
+ private Object decodeIgn(Channel channel, SocketAddress remoteAddress, String sentence) {
+ Parser parser = new Parser(PATTERN_IGN, sentence);
+ if (!parser.matches()) {
+ return null;
+ }
+
+ Position position = new Position();
+ position.setProtocol(getProtocolName());
+
+ if (!identify(parser.next(), channel, remoteAddress)) {
+ return null;
+ }
+ position.setDeviceId(getDeviceId());
+
+ decodeLocation(position, parser);
+
+ position.set(Event.KEY_HOURS, parser.next());
+ position.set(Event.KEY_ODOMETER, parser.next());
+
+ if (parser.hasNext(6)) {
+ DateBuilder dateBuilder = new DateBuilder()
+ .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt())
+ .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt());
+ if (!position.getOutdated() && position.getFixTime().after(dateBuilder.getDate())) {
+ position.setTime(dateBuilder.getDate());
+ }
+ }
+
+ return position;
+ }
+
private Object decodeOther(Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN, sentence);
if (!parser.matches()) {
@@ -469,6 +516,10 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
case "FRI":
result = decodeFri(channel, remoteAddress, sentence);
break;
+ case "IGN":
+ case "IGF":
+ result = decodeIgn(channel, remoteAddress, sentence);
+ break;
default:
result = decodeOther(channel, remoteAddress, sentence);
break;
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index e2aed6309..ce5a54141 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -87,11 +87,13 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // odometer
.number("(d+.d+)?,") // fuel instant
.number("(?:d+.d+)?,") // fuel average
+ .number("(d+),") // hours
.number("(d+),") // speed
- .number("d+,") // power load
- .number("(d+.d+%),") // throttle
+ .number("d+.?d*%,") // power load
+ .number("(d+),") // temperature
+ .number("(d+.?d*%),") // throttle
.number("(d+),") // rpm
- .number("(d+.d+%),") // battery
+ .number("(d+.d+),") // battery
.number("[^,]*,") // dtc 1
.number("[^,]*,") // dtc 2
.number("[^,]*,") // dtc 3
@@ -166,7 +168,9 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
position.set(Event.KEY_ODOMETER, parser.nextInt());
position.set(Event.KEY_FUEL, parser.next());
+ position.set(Event.KEY_HOURS, parser.next());
position.set(Event.KEY_OBD_SPEED, parser.next());
+ position.set(Event.PREFIX_TEMP + 1, parser.next());
position.set(Event.KEY_THROTTLE, parser.next());
position.set(Event.KEY_RPM, parser.next());
position.set(Event.KEY_BATTERY, parser.next());
diff --git a/src/org/traccar/protocol/MeitrackProtocol.java b/src/org/traccar/protocol/MeitrackProtocol.java
index e5b5ddf2b..a004d5cb6 100644
--- a/src/org/traccar/protocol/MeitrackProtocol.java
+++ b/src/org/traccar/protocol/MeitrackProtocol.java
@@ -36,7 +36,8 @@ public class MeitrackProtocol extends BaseProtocol {
Command.TYPE_ENGINE_RESUME,
Command.TYPE_ALARM_ARM,
Command.TYPE_ALARM_DISARM,
- Command.TYPE_REQUEST_PHOTO);
+ Command.TYPE_REQUEST_PHOTO,
+ Command.TYPE_SEND_SMS);
}
@Override
diff --git a/src/org/traccar/protocol/MeitrackProtocolEncoder.java b/src/org/traccar/protocol/MeitrackProtocolEncoder.java
index 381935c58..04cb39637 100644
--- a/src/org/traccar/protocol/MeitrackProtocolEncoder.java
+++ b/src/org/traccar/protocol/MeitrackProtocolEncoder.java
@@ -20,6 +20,8 @@ import org.traccar.helper.Checksum;
import org.traccar.helper.Log;
import org.traccar.model.Command;
+import java.util.Map;
+
public class MeitrackProtocolEncoder extends StringProtocolEncoder {
private Object formatCommand(Command command, char dataId, String content) {
@@ -33,6 +35,8 @@ public class MeitrackProtocolEncoder extends StringProtocolEncoder {
@Override
protected Object encodeCommand(Command command) {
+ Map<String, Object> attributes = command.getAttributes();
+
switch (command.getType()) {
case Command.TYPE_POSITION_SINGLE:
return formatCommand(command, 'Q', "A10");
@@ -46,6 +50,9 @@ public class MeitrackProtocolEncoder extends StringProtocolEncoder {
return formatCommand(command, 'M', "C01,0,22022");
case Command.TYPE_REQUEST_PHOTO:
return formatCommand(command, 'D', "D03,1,camera_picture.jpg");
+ case Command.TYPE_SEND_SMS:
+ return formatCommand(command, 'f', "C02,0,"
+ + attributes.get(Command.KEY_PHONE_NUMBER) + "," + attributes.get(Command.KEY_MESSAGE));
default:
Log.warning(new UnsupportedOperationException(command.getType()));
break;
diff --git a/test/org/traccar/DetectorHandlerTest.java b/test/org/traccar/DetectorHandlerTest.java
deleted file mode 100644
index 4bac79d53..000000000
--- a/test/org/traccar/DetectorHandlerTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.traccar;
-
-import org.junit.Test;
-
-public class DetectorHandlerTest {
-
- @Test
- public void testCheckPipeline() throws Exception {
-
- /*ChannelPipeline pipeline = Channels.pipeline();
- pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r\n", "\n", ";"));
- pipeline.addLast("stringDecoder", new StringDecoder());
- pipeline.addLast("stringEncoder", new StringEncoder());
- pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(null));
-
- DetectorHandler.checkPipeline("gps103", pipeline, ChannelBuffers.copiedBuffer(
- "imei:869039001186913,tracker,1308282156,0,F,215630.000,A,5602.11015,N,9246.30767,E,1.4,,175.9,;", Charset.defaultCharset()));*/
- }
-
-}
diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
index bf7e3f175..8f0ca230b 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());
+ verifyPosition(decoder, text(
+ "+RESP:GTIGN,060228,862894020180553,,9860,0,0.2,189,420.0,-63.158195,-17.800608,20160309022951,0736,0003,6AD4,3471,00,,881.2,20160308222956,129A$"));
+
+ verifyPosition(decoder, text(
+ "+BUFF:GTIGF,060228,862894020180553,,1958,0,0.0,240,390.3,-63.089213,-17.764712,20160309122854,0736,0003,6AB8,5A23,00,,936.8,20160309082858,1368$"));
+
verifyPositions(decoder, text(
"+RESP:GTFRI,060228,862894020180553,,,10,1,1,20.0,147,329.7,-62.899703,-17.720434,20160309113548,0736,0003,6AAE,3381,00,913.3,,,,0,220101,,,,20160309073554,132B$"));
diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
index ab59ba331..aecbe2ef1 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:359710049028435,OBD,160316053657,70430,,,0,49,60.00%,46,19.22%,859,0.00,U1108,,,;"));
+
verifyPosition(decoder, text(
"359769031878322imei:359769031878322,tracker,1602160718,2,F,221811.000,A,1655.2193,S,14546.6722,E,0.00,,"));
diff --git a/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java b/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java
index 64812c1da..3e0a870d0 100644
--- a/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java
@@ -18,6 +18,13 @@ public class MeitrackProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("@@Q25,123456789012345,A10*68\r\n", encoder.encodeCommand(command));
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_SEND_SMS);
+ command.set(Command.KEY_PHONE_NUMBER, "15360853789");
+ command.set(Command.KEY_MESSAGE, "Meitrack");
+
+ Assert.assertEquals("@@f48,123456789012345,C02,0,15360853789,Meitrack*B0\r\n", encoder.encodeCommand(command));
+
}
}
diff --git a/web/app/model/Server.js b/web/app/model/Server.js
index 796ff58d6..3f6e466d9 100644
--- a/web/app/model/Server.js
+++ b/web/app/model/Server.js
@@ -37,9 +37,6 @@ Ext.define('Traccar.model.Server', {
name: 'mapUrl',
type: 'string'
}, {
- name: 'language',
- type: 'string'
- }, {
name: 'distanceUnit',
type: 'string'
}, {
diff --git a/web/app/model/User.js b/web/app/model/User.js
index 237a4d269..35b849187 100644
--- a/web/app/model/User.js
+++ b/web/app/model/User.js
@@ -37,9 +37,6 @@ Ext.define('Traccar.model.User', {
name: 'map',
type: 'string'
}, {
- name: 'language',
- type: 'string'
- }, {
name: 'distanceUnit',
type: 'string'
}, {
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index b464ed561..e43dcd2bc 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -67,6 +67,7 @@ Ext.define('Traccar.view.Devices', {
html: Strings.sharedSearch
}, {
xtype: 'textfield',
+ flex: 1,
listeners: {
change: function () {
var tree, expr;