diff options
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Gps103ProtocolDecoder.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 2578065c1..6a666fc86 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -43,7 +43,7 @@ public class Gps103ProtocolDecoder extends GenericProtocolDecoder { static private Pattern pattern = Pattern.compile( "imei:" + "([\\d]+)," + // IMEI - "[^,]+," + + "([^,]+)," + // Alarm "(\\d{2})(\\d{2})(\\d{2})[\\d]+," + // Date "[^,]*," + "[FL]," + // F - full / L - low @@ -85,6 +85,7 @@ public class Gps103ProtocolDecoder extends GenericProtocolDecoder { // Create new position Position position = new Position(); + StringBuilder extendedInfo = new StringBuilder("<protocol>gps103</protocol>"); Integer index = 1; @@ -92,6 +93,11 @@ public class Gps103ProtocolDecoder extends GenericProtocolDecoder { String imei = parser.group(index++); position.setDeviceId(getDataManager().getDeviceByImei(imei).getId()); + // Alarm message + extendedInfo.append("<alarm>"); + extendedInfo.append(parser.group(index++)); + extendedInfo.append("</alarm>"); + // Date Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); time.clear(); @@ -128,6 +134,9 @@ public class Gps103ProtocolDecoder extends GenericProtocolDecoder { position.setSpeed(Double.valueOf(parser.group(index++))); position.setCourse(0.0); + // Extended info + position.setExtendedInfo(extendedInfo.toString()); + return position; } |