diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-28 08:32:46 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-28 08:32:46 +1300 |
commit | 5012663d8688fa521fa7de02116f42ddbb57e7fb (patch) | |
tree | 9ae38a32d186d2bd667f72d26aaeb39849e6b42f /src/org/traccar/protocol/T55ProtocolDecoder.java | |
parent | 9120ff19ab2bdd466ae5c30632efd1917faa71b1 (diff) | |
download | trackermap-server-5012663d8688fa521fa7de02116f42ddbb57e7fb.tar.gz trackermap-server-5012663d8688fa521fa7de02116f42ddbb57e7fb.tar.bz2 trackermap-server-5012663d8688fa521fa7de02116f42ddbb57e7fb.zip |
Additional T55 attributes
Diffstat (limited to 'src/org/traccar/protocol/T55ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/T55ProtocolDecoder.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index faf9c4b7d..a41da427a 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,9 +50,10 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { .expression("[^,]+") .number(",(d+)") // satellites .number(",(d+)") // imei - .number(",([01])") // ignition + .expression(",([01])") // ignition .number(",(d+)") // fuel .number(",(d+)").optional(5) // battery + .number("((?:,d+)+)?") // parameters .any() .compile(); @@ -139,6 +140,13 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_BATTERY, parser.nextInt()); } + if (parser.hasNext()) { + String[] parameters = parser.next().split(","); + for (int i = 1; i < parameters.length; i++) { + position.set(Position.PREFIX_IO + i, parameters[i]); + } + } + if (deviceSession != null) { return position; } else { |