From b5cfcc219cc9ab4c37077c4901f6e559e1519b13 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 17 Oct 2020 17:31:38 -0700 Subject: Support Bofan PT500 --- src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java index 0afec67ad..ff92b51f1 100644 --- a/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org) * Copyright 2012 Luis Parada (luis.parada@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,8 +55,8 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { .expression("([EW]),") .number("(d+.d+)?,") // speed .number("(d+.d+)?,") // course - .number("(dd)(dd)(dd),,,") // date (ddmmyy) - .expression("./") + .number("(dd)(dd)(dd),,,?") // date (ddmmyy) + .expression(".?/") .expression("([01])+,") // input .expression("([01])+/") // output .expression("([^/]+)?/") // adc @@ -108,7 +108,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() - .setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setValid(parser.next().equals("A")); position.setLatitude(parser.nextCoordinate()); @@ -116,7 +116,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(parser.nextDouble(0)); position.setCourse(parser.nextDouble(0)); - dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); + dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); position.set(Position.KEY_INPUT, parser.next()); -- cgit v1.2.3