diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-02-19 00:35:53 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-02-19 00:35:53 +1300 |
commit | 53ecc26dee64e6809fb1544edec3368f99b59e8b (patch) | |
tree | bd484f55494b6acb2390860ef3d43e9e53d81bcc | |
parent | 33a5306bb25af9c6b95858c82bed0c4deacbc537 (diff) | |
download | traccar-server-53ecc26dee64e6809fb1544edec3368f99b59e8b.tar.gz traccar-server-53ecc26dee64e6809fb1544edec3368f99b59e8b.tar.bz2 traccar-server-53ecc26dee64e6809fb1544edec3368f99b59e8b.zip |
Add alarm type to totem (fix #566)
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index bf88523f9..89e154f9f 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.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. @@ -37,7 +37,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { "\\$\\$" + // Header "\\p{XDigit}{2}" + // Length "(\\d+)\\|" + // IMEI - ".." + // Alarm Type + "(..)" + // Alarm Type "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.\\d+," + // Time (HHMMSS.SS) "([AV])," + // Validity @@ -69,7 +69,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { "\\$\\$" + // Header "\\p{XDigit}{2}" + // Length "(\\d+)\\|" + // IMEI - ".." + // Alarm Type + "(..)" + // Alarm Type "(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY) "(\\d{2})(\\d{2})(\\d{2})\\|" + // Time (HHMMSS) "([AV])\\|" + // Validity @@ -95,7 +95,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { "\\$\\$" + // Header "\\p{XDigit}{2}" + // Length "(\\d+)\\|" + // IMEI - ".." + // Alarm Type + "(..)" + // Alarm Type "(\\d{2})(\\d{2})(\\d{2})" + // Date (YYMMDD) "(\\d{2})(\\d{2})(\\d{2})" + // Time (HHMMSS) "(\\p{XDigit}{4})" + // IO Status @@ -172,6 +172,9 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { return null; } + // Alarm type + extendedInfo.set("alarm", parser.group(index++)); + if (format == MessageFormat.first || format == MessageFormat.second) { // Time |