From be6226d7039be781be4ce710e98ca85fd39bb3b9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 27 Apr 2018 05:20:24 +1200 Subject: Aquila reset alarm flag --- src/org/traccar/protocol/AquilaProtocolDecoder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/AquilaProtocolDecoder.java b/src/org/traccar/protocol/AquilaProtocolDecoder.java index 8e9dd278a..9963ead34 100644 --- a/src/org/traccar/protocol/AquilaProtocolDecoder.java +++ b/src/org/traccar/protocol/AquilaProtocolDecoder.java @@ -17,6 +17,7 @@ package org.traccar.protocol; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; +import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; @@ -269,7 +270,8 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { return null; } - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + String id = parser.next(); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id); if (deviceSession == null) { return null; } @@ -297,6 +299,11 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { if (parser.nextInt() == 1) { position.set(Position.KEY_ALARM, Position.ALARM_SOS); + if (channel != null) { + String password = Context.getIdentityManager().lookupAttributeString( + position.getDeviceId(), getProtocolName() + ".language", "aquila123", true); + channel.write("#set$" + id + "@" + password + "#EMR_MODE:0*"); + } } Network network = new Network(); -- cgit v1.2.3