aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-10-18 14:30:42 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-10-18 14:30:42 +1300
commit92fa5f43ccf7471c3afa7c18bbef868ba76afd35 (patch)
tree1e384848fa1603ef492e9efefb1964bff893866c /src
parent61d4c1f15b645aa06c84905933108437e1ade92a (diff)
downloadtrackermap-server-92fa5f43ccf7471c3afa7c18bbef868ba76afd35.tar.gz
trackermap-server-92fa5f43ccf7471c3afa7c18bbef868ba76afd35.tar.bz2
trackermap-server-92fa5f43ccf7471c3afa7c18bbef868ba76afd35.zip
More flexible match for GPS103
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index 36060f841..4ef14b29b 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -276,11 +276,11 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
String sentence = (String) msg;
- if (sentence.contains("##")) {
+ if (sentence.contains("imei:") && sentence.length() <= 25) {
if (channel != null) {
channel.writeAndFlush(new NetworkMessage("LOAD", remoteAddress));
- Matcher matcher = Pattern.compile("##,imei:(\\d+),A").matcher(sentence);
- if (matcher.matches()) {
+ Matcher matcher = Pattern.compile("imei:(\\d+),").matcher(sentence);
+ if (matcher.find()) {
getDeviceSession(channel, remoteAddress, matcher.group(1));
}
}