From 446e31631a5f45059fa65435b05c1c8de4315e6d Mon Sep 17 00:00:00 2001 From: Ankit Tater Date: Thu, 29 Oct 2015 16:34:42 +0530 Subject: T800X Protocol Sending Theft alarm and Vibrtae Alarm after 16 sec --- src/org/traccar/protocol/T800XProtocolDecoder.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') 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"; -- cgit v1.2.3