diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-01-26 11:21:43 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-01-26 11:21:43 +1300 |
commit | 4889e57de4b9bf88b56e1b75b7940bfd25ccae07 (patch) | |
tree | 5c5b217bd4552707168a16d25756414977ad4025 /src/org | |
parent | ab2ea4acda1547c813ce6a2bfe6e5c63181e22c6 (diff) | |
download | traccar-server-4889e57de4b9bf88b56e1b75b7940bfd25ccae07.tar.gz traccar-server-4889e57de4b9bf88b56e1b75b7940bfd25ccae07.tar.bz2 traccar-server-4889e57de4b9bf88b56e1b75b7940bfd25ccae07.zip |
Fix bug in GlobalSat decoder
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/GlobalSatProtocolDecoder.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 2e0cb4ca6..2c808813a 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2014 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. @@ -41,10 +41,10 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { format1 = "SARY*U!"; if (getServerManager() != null) { Properties p = getServerManager().getProperties(); - if (p.contains("globalsat.format0")) { + if (p.containsKey("globalsat.format0")) { format0 = p.getProperty("globalsat.format0"); } - if (p.contains("globalsat.format1")) { + if (p.containsKey("globalsat.format1")) { format1 = p.getProperty("globalsat.format1"); } } @@ -174,7 +174,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { return position; } - static private Pattern pattern = Pattern.compile( + private static final Pattern pattern = Pattern.compile( "\\$" + "(\\d+)," + // IMEI "\\d+," + // mode @@ -214,7 +214,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { } // Validity - position.setValid(parser.group(index++).compareTo("1") != 0 ? true : false); + position.setValid(parser.group(index++).compareTo("1") != 0); // Time Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); |