From 67f512fb2b481ebca78dab2163733ca2c3cef55a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 25 Nov 2015 22:05:43 +1300 Subject: Implement TK103 alarm messages support --- src/org/traccar/protocol/Tk103ProtocolDecoder.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/org/traccar') 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()); -- cgit v1.2.3