diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-25 22:05:43 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-25 22:06:41 +1300 |
commit | 67f512fb2b481ebca78dab2163733ca2c3cef55a (patch) | |
tree | 04bb23ec5ce1446dcbfbd1dc8ad44e26e627298b /src/org | |
parent | 2c399889e9b61c8e3580c046a70b556e1ab628e3 (diff) | |
download | trackermap-server-67f512fb2b481ebca78dab2163733ca2c3cef55a.tar.gz trackermap-server-67f512fb2b481ebca78dab2163733ca2c3cef55a.tar.bz2 trackermap-server-67f512fb2b481ebca78dab2163733ca2c3cef55a.zip |
Implement TK103 alarm messages support
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolDecoder.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index 6fa4edb06..e8d0d210d 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -154,6 +154,11 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { } position.setDeviceId(getDeviceId()); + int alarm = sentence.indexOf("BO01"); + if (alarm != -1) { + position.set(Event.KEY_ALARM, Integer.parseInt(sentence.substring(alarm + 4, alarm + 5))); + } + DateBuilder dateBuilder = new DateBuilder(); if (parser.next() == null) { dateBuilder.setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()); |