From 5012663d8688fa521fa7de02116f42ddbb57e7fb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 28 Feb 2017 08:32:46 +1300 Subject: Additional T55 attributes --- src/org/traccar/protocol/T55ProtocolDecoder.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') 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 { -- cgit v1.2.3