safedispatch-mobile/libSafeMobile/src/main/java/com/safemobile/lib/AlarmMSG.java

35 lines
1011 B
Java

package com.safemobile.lib;
import java.util.ArrayList;
public class AlarmMSG extends TCPmsg {
public ArrayList<Alarm> alarmList;
public static int count=0;
public AlarmMSG(TCPmsg tcp) {
super(tcp);
alarmList = new ArrayList<Alarm>();
String date4parsing = super.data;
//SM.Debug("SMS date4parsing:"+date4parsing);
String[] tempArr = date4parsing.split(";");
//SM.Debug("SMS tempArr.length:" +tempArr.length);
for(int i =0; i<tempArr.length;i++)
{
String[] tempVeh = tempArr[i].split("&");
if(tempVeh.length<6)
continue;
//int idx, int type, String description, int timeGMT, int ack, int sc_id
Alarm alarm = new Alarm(Integer.parseInt(tempVeh[1]),Integer.parseInt(tempVeh[5]),tempVeh[3],Integer.parseInt(tempVeh[4]),
Integer.parseInt(tempVeh[0]),Integer.parseInt(tempVeh[2]));
alarmList.add(alarm);
//SM.Debug(alarm.toString());
}
count +=this.alarmList.size();
SM.Debug("alarmList size:" +this.alarmList.size() + " total:" +count);
}
}