diff options
author | Anton Tananaev <anton@traccar.org> | 2023-11-17 07:32:33 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-11-17 07:32:33 -0800 |
commit | e62f2e19b8f07af2a37f5e2cfe4c380c31b5c7db (patch) | |
tree | 43bfd002e2675414b2284a527b67aebde3002da8 /src/main/java/org/traccar | |
parent | 962371fe50c9f2189ee5452def16c6fbd09a63f5 (diff) | |
download | trackermap-server-e62f2e19b8f07af2a37f5e2cfe4c380c31b5c7db.tar.gz trackermap-server-e62f2e19b8f07af2a37f5e2cfe4c380c31b5c7db.tar.bz2 trackermap-server-e62f2e19b8f07af2a37f5e2cfe4c380c31b5c7db.zip |
Support Rinho Telematics protocol
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/TaipProtocolDecoder.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java index 787ed1599..831910ab6 100644 --- a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2021 Anton Tananaev (anton@traccar.org) + * Copyright 2013 - 2023 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. @@ -83,7 +83,7 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { .or() .groupBegin() .number("(xx)") // input - .number("(xx)") // satellites + .number("xx") // satellites / outputs .number("(ddd)") // battery .number("(x{8})") // odometer .number("[01]") // gps power @@ -95,12 +95,14 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { .number("[01]") // modem power .number("[0-5]") // gsm status .number("(dd)") // rssi + .groupBegin() .number("([-+]dddd)") // temperature 1 .number("xx") // seconds from last .number("([-+]dddd)") // temperature 2 .number("xx") // seconds from last .groupEnd("?") .groupEnd("?") + .groupEnd("?") .groupEnd() .any() .compile(); @@ -216,17 +218,18 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_HDOP, parser.nextInt()); } - if (parser.hasNext(4)) { + if (parser.hasNext(3)) { position.set(Position.KEY_INPUT, parser.nextHexInt(0)); - position.set(Position.KEY_SATELLITES, parser.nextHexInt(0)); position.set(Position.KEY_BATTERY, parser.nextInt(0)); position.set(Position.KEY_ODOMETER, parser.nextLong(16, 0)); } - if (parser.hasNext(4)) { + if (parser.hasNext(3)) { valid = parser.nextInt() > 0; position.set(Position.KEY_PDOP, parser.nextInt()); position.set(Position.KEY_RSSI, parser.nextInt()); + } + if (parser.hasNext(2)) { position.set(Position.PREFIX_TEMP + 1, parser.nextInt() * 0.01); position.set(Position.PREFIX_TEMP + 2, parser.nextInt() * 0.01); } |