From dd6a607b66d0a0f794448e8ac148288a7bba484d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 27 May 2019 06:47:20 -0700 Subject: Update Avema protocol decoder --- .../java/org/traccar/protocol/AvemaProtocolDecoder.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/AvemaProtocolDecoder.java b/src/main/java/org/traccar/protocol/AvemaProtocolDecoder.java index 16a31162a..37836ad5f 100644 --- a/src/main/java/org/traccar/protocol/AvemaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/AvemaProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2018 - 2019 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. @@ -48,17 +48,19 @@ public class AvemaProtocolDecoder extends BaseProtocolDecoder { .number("(d+),") // event .number("(d+.d+),") // odometer .number("(d+),") // input - .number("(d+.d+)V,") // adc 1 - .number("(d+.d+)V,") // adc 2 + .number("(d+.d+)V?,") // adc 1 + .number("(d+.d+)V?,") // adc 2 .number("(d+),") // output .number("(d),") // roaming .number("(d+),") // rssi .number("d,") // communication system - .number("(ddd)") // mcc - .number("(dd),") // mnc + .number("(ddd)-?") // mcc + .number("(d+),") // mnc .number("(x+),") // lac .number("(x+),") // cid + .number("(d+.d+),").optional() // battery .number("([^,]+)?") // rfid + .any() .compile(); @Override @@ -99,6 +101,7 @@ public class AvemaProtocolDecoder extends BaseProtocolDecoder { position.setNetwork(new Network(CellTower.from( parser.nextInt(), parser.nextInt(), parser.nextHexInt(), parser.nextHexInt(), rssi))); + position.set(Position.KEY_BATTERY, parser.nextDouble()); position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next()); return position; -- cgit v1.2.3