diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-06-04 11:18:42 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-06-04 11:18:42 +1200 |
commit | 6396a2ec497fad786444be13884ad569526dafce (patch) | |
tree | af3c87da19c7c6cf0452e777d77709fc0e903e56 /src/org/traccar/protocol | |
parent | 824a01c093700929ec3d2e581fef5e252f64e129 (diff) | |
download | trackermap-server-6396a2ec497fad786444be13884ad569526dafce.tar.gz trackermap-server-6396a2ec497fad786444be13884ad569526dafce.tar.bz2 trackermap-server-6396a2ec497fad786444be13884ad569526dafce.zip |
Implement new Totem protocol format
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index bf24706c6..1e07e7ed5 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2013 - 2016 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,6 +136,13 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { .number("(dd)") // battery .number("(dd)") // external power .number("(dddd)") // adc 1 + .groupBegin() + .number("(dddd)") // adc 2 + .number("(dddd)") // adc 3 + .number("(dddd)") // adc 4 + .number("(dddd)") // temperature 1 + .number("(dddd)") // temperature 2 + .groupEnd("?") .number("(xxxx)") // lac .number("(xxxx)") // cid .number("(dd)") // satellites @@ -271,7 +278,14 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_BATTERY, parser.nextDouble() / 10); position.set(Position.KEY_POWER, parser.nextDouble()); + position.set(Position.PREFIX_ADC + 1, parser.next()); + position.set(Position.PREFIX_ADC + 2, parser.next()); + position.set(Position.PREFIX_ADC + 3, parser.next()); + position.set(Position.PREFIX_ADC + 4, parser.next()); + position.set(Position.PREFIX_TEMP + 1, parser.next()); + position.set(Position.PREFIX_TEMP + 2, parser.next()); + position.set(Position.KEY_LAC, parser.nextInt(16)); position.set(Position.KEY_CID, parser.nextInt(16)); position.set(Position.KEY_SATELLITES, parser.nextInt()); |