diff options
author | Ankit Tater <ankit@isuraksha.in> | 2015-10-29 16:34:42 +0530 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-01 18:21:34 +1300 |
commit | 446e31631a5f45059fa65435b05c1c8de4315e6d (patch) | |
tree | 93736611602157ba6fbbfddd5851a71050be363e /src | |
parent | 2243487bd8ce4abaaafd40357b00a35c28242d85 (diff) | |
download | trackermap-server-446e31631a5f45059fa65435b05c1c8de4315e6d.tar.gz trackermap-server-446e31631a5f45059fa65435b05c1c8de4315e6d.tar.bz2 trackermap-server-446e31631a5f45059fa65435b05c1c8de4315e6d.zip |
T800X Protocol Sending Theft alarm and Vibrtae Alarm after 16 sec
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/T800XProtocolDecoder.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/T800XProtocolDecoder.java b/src/org/traccar/protocol/T800XProtocolDecoder.java index fc62e2ef9..e2636c0cd 100644 --- a/src/org/traccar/protocol/T800XProtocolDecoder.java +++ b/src/org/traccar/protocol/T800XProtocolDecoder.java @@ -155,7 +155,11 @@ public class T800XProtocolDecoder extends BaseProtocolDecoder { if(type == MSG_ALARM) { Log.debug("ALARM : "+statusType); - sendLoginResponse(channel, type, index, imei + alarmData); + if(alarmData.equals("08") || alarmData.equals("10")){ + sendAlarmPacketAfter16Sec(channel,type,index, imei + alarmData); + }else{ + sendLoginResponse(channel, type, index, imei + alarmData); + } } // Reserve @@ -235,6 +239,15 @@ public class T800XProtocolDecoder extends BaseProtocolDecoder { return mixPacket; } + private void sendAlarmPacketAfter16Sec(final Channel channel,final int type,final int index,final String alarmData) { + new Timer().schedule(new TimerTask() { + @Override + public void run() { + sendLoginResponse(channel, type, index,alarmData); + } + }, 16001); + } + private static String getBits(int flags) { int hexFlag = Integer.parseInt(Integer.toHexString(flags), 16); @@ -281,7 +294,7 @@ public class T800XProtocolDecoder extends BaseProtocolDecoder { alarmCodeString = "LBA"; }else if (alarmCode.equals("03")) { alarmCodeString = "SOS"; - }else if (alarmCode.equals("08")) { + }else if (alarmCode.equals("08") || alarmCode.equals("10") ) { alarmCodeString = "VIBALM"; } else if (alarmCode.equals("16")) { alarmCodeString = "PWROFF"; |