From a8af4b7d0b7eec1e3076bd51bc2e81c6df0626ac Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 22 Jan 2022 18:27:02 -0800 Subject: Update Armoli frame decoder --- src/main/java/org/traccar/protocol/ArmoliProtocol.java | 2 +- src/main/java/org/traccar/protocol/ArmoliProtocolDecoder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/ArmoliProtocol.java b/src/main/java/org/traccar/protocol/ArmoliProtocol.java index 7ee4289b0..dec8c6fe0 100644 --- a/src/main/java/org/traccar/protocol/ArmoliProtocol.java +++ b/src/main/java/org/traccar/protocol/ArmoliProtocol.java @@ -28,7 +28,7 @@ public class ArmoliProtocol extends BaseProtocol { addServer(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { - pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, '\r')); + pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, ";\r", ";")); pipeline.addLast(new StringEncoder()); pipeline.addLast(new StringDecoder()); pipeline.addLast(new ArmoliProtocolDecoder(ArmoliProtocol.this)); diff --git a/src/main/java/org/traccar/protocol/ArmoliProtocolDecoder.java b/src/main/java/org/traccar/protocol/ArmoliProtocolDecoder.java index b1140d79c..400e4ad89 100644 --- a/src/main/java/org/traccar/protocol/ArmoliProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/ArmoliProtocolDecoder.java @@ -78,7 +78,7 @@ public class ArmoliProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); position.set( Position.KEY_RESULT, - sentence.substring(sentence.indexOf(',') + 1, sentence.length() - 2)); + sentence.substring(sentence.indexOf(',') + 1, sentence.length() - 1)); return position; } } else if (channel != null && (type == 'Q' || type == 'L')) { -- cgit v1.2.3