From a7431f4cccd273c6e56e5a099c71f2a4b5b76197 Mon Sep 17 00:00:00 2001 From: jcardus Date: Thu, 30 Sep 2021 19:20:41 -0300 Subject: Update MobilogixProtocolDecoder.java We are losing data from the events with two digits like T21 and T22 (ignition on and off). Also included the event code --- src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar/protocol') diff --git a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java index 8677ba9ec..efefaf627 100644 --- a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java @@ -39,7 +39,7 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder { .text("[") .number("(dddd)-(dd)-(dd) ") // date (yyyymmdd) .number("(dd):(dd):(dd),") // time (hhmmss) - .number("Td,") // type + .number("Td+,") // type .number("d+,") // device type .expression("[^,]+,") // protocol version .expression("([^,]+),") // serial number @@ -80,6 +80,7 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(getProtocolName()); + position.set(Position.KEY_EVENT, type); position.setTime(parser.nextDateTime()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); -- cgit v1.2.3 From f643887684f3dff65a954fba1ada36e8b81db9d3 Mon Sep 17 00:00:00 2001 From: jcardus Date: Tue, 12 Oct 2021 01:31:56 +0100 Subject: use key instead of event --- src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/org/traccar/protocol') diff --git a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java index efefaf627..ac75841a4 100644 --- a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java @@ -80,13 +80,13 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder { Position position = new Position(getProtocolName()); - position.set(Position.KEY_EVENT, type); position.setTime(parser.nextDateTime()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } + position.set(Position.KEY_TYPE, type); position.setDeviceId(deviceSession.getDeviceId()); int status = parser.nextHexInt(); -- cgit v1.2.3