diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-09 13:51:51 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-09 13:51:51 +1200 |
commit | fde6001ce081dad7976a96246b8eca50ed62fa22 (patch) | |
tree | 6cca84ec8c56ead4f646716002f8937b2dbaf230 /src/org/traccar/protocol/Ev603ProtocolDecoder.java | |
parent | 58c407feec28c66062b21d7a93fb8b491a255ca4 (diff) | |
download | traccar-server-fde6001ce081dad7976a96246b8eca50ed62fa22.tar.gz traccar-server-fde6001ce081dad7976a96246b8eca50ed62fa22.tar.bz2 traccar-server-fde6001ce081dad7976a96246b8eca50ed62fa22.zip |
Extend EV603 protocol support
Diffstat (limited to 'src/org/traccar/protocol/Ev603ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Ev603ProtocolDecoder.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java index 36a08f394..8686088cb 100644 --- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java @@ -34,13 +34,13 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ }
private static final Pattern pattern = Pattern.compile(
- "!A," + // Type
+ "!.," + // Type
"(\\d{2})\\/(\\d{2})\\/(\\d{2})," + // Date dd/mm/YY
"(\\d{2}):(\\d{2}):(\\d{2})," + // Time hh:mm:ss
- "(-?\\d+\\.\\d+)," + // Latitude (DDMM.MMMM)
- "(-?\\d+\\.\\d+)," + // Longitude (DDDMM.MMMM)
- "(\\d+\\.\\d+)," + // Speed
- "(\\d+\\.?\\d+)," + // Course
+ "(-?\\d+\\.\\d+)," + // Latitude
+ "(-?\\d+\\.\\d+)," + // Longitude
+ "(\\d+\\.?\\d*)," + // Speed
+ "(\\d+\\.?\\d*)," + // Course
".*");
@Override
@@ -52,10 +52,11 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ // Detect device ID
if (sentence.startsWith("!1,")) {
+
identify(sentence.substring(3), channel);
- }
- else if (sentence.startsWith("!A,")) {
+ } else {
+
// Parse message
Matcher parser = pattern.matcher(sentence);
if (!hasDeviceId() || !parser.matches()) {
|