From 810faf1d9b5420a5a5b80e90f024c96c018e7844 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 13 Mar 2016 10:58:22 +1300 Subject: Add ignition support for Tramigo (fix #1771) --- src/org/traccar/protocol/TramigoProtocolDecoder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java index 10bab3d6c..1fd427ecf 100644 --- a/src/org/traccar/protocol/TramigoProtocolDecoder.java +++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 - 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2014 - 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. @@ -130,6 +130,12 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { position.setTime(DateUtil.correctYear( dateFormat.parse(matcher.group(1) + " " + Calendar.getInstance().get(Calendar.YEAR)))); + if (sentence.contains("Ignition on detected")) { + position.set(Event.KEY_IGNITION, true); + } else if (sentence.contains("Ignition off detected")) { + position.set(Event.KEY_IGNITION, false); + } + return position; } -- cgit v1.2.3