From e512848dc07145664f3c5d0adff7a9f88b2f17b6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 3 Jan 2017 22:44:00 +1300 Subject: Fix GoSafe protocol decoder --- src/org/traccar/protocol/GoSafeProtocolDecoder.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/protocol/GoSafeProtocolDecoder.java') diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java index 40a0d4d73..deeea2333 100644 --- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 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. @@ -69,13 +69,13 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { .groupEnd() .groupBegin() .text("GSM:") - .number("d+;") // registration - .number("d+;") // gsm signal + .number("d*;") // registration + .number("d*;") // gsm signal .number("(d+);") // mcc .number("(d+);") // mnc .number("(x+);") // lac .number("(x+);") // cid - .number("-d+") // rssi + .number("(-d+)") // rssi .expression("[^,]*,?") .groupEnd("?") .groupBegin() @@ -86,8 +86,8 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { .groupEnd("?") .groupBegin() .text("ADC:") - .number("(d+.d+);") // power - .number("(d+.d+),?") // battery + .number("(d+.d+)") // power + .number("(?:;(d+.d+))?,?") // battery .groupEnd("?") .groupBegin() .text("DTT:") @@ -158,7 +158,7 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext(4)) { position.setNetwork(new Network(CellTower.from( - parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16)))); + parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16), parser.nextInt()))); } if (parser.hasNext()) { position.set(Position.KEY_ODOMETER, parser.nextInt()); -- cgit v1.2.3