diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-04-27 05:20:24 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-04-27 14:20:54 +1200 |
commit | be6226d7039be781be4ce710e98ca85fd39bb3b9 (patch) | |
tree | 237db4f0a32ccefa3afa8e0573dff36e1fab1b26 /src/org | |
parent | c45005432548a3607e82f5645c498d20b3728857 (diff) | |
download | traccar-server-be6226d7039be781be4ce710e98ca85fd39bb3b9.tar.gz traccar-server-be6226d7039be781be4ce710e98ca85fd39bb3b9.tar.bz2 traccar-server-be6226d7039be781be4ce710e98ca85fd39bb3b9.zip |
Aquila reset alarm flag
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/AquilaProtocolDecoder.java | 9 |
1 files changed, 8 insertions, 1 deletions
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(); |