// Path: secu3droid/src/org/secu3/android/api/io/Secu3Manager.java
// public enum SECU3_TASK {
// 	SECU3_NONE, SECU3_READ_SENSORS, SECU3_RAW_SENSORS, SECU3_READ_PARAMS, SECU3_READ_ERRORS, SECU3_READ_FW_INFO, SECU3_START_SENSOR_LOGGING, SECU3_STOP_SENSOR_LOGGING, SECU3_START_RAW_LOGGING, SECU3_STOP_RAW_LOGGING, SECU3_SET_LOG_MARKER_1, SECU3_SET_LOG_MARKER_2, SECU3_SET_LOG_MARKER_3
// }
// 
// Path: secu3droid/src/org/secu3/android/api/utils/CustomNumberPickerDialog.java
// public interface OnNumberPickerDialogAcceptListener {
// 	void onNumberPickerDialogAccept (int itemId);
// }		
// 
// Path: secu3droid/src/org/secu3/android/parameters/items/BaseParamItem.java
// public interface OnParamItemChangeListener {
// 	void onParamItemChange (BaseParamItem item);
// }


import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import org.secu3.android.api.io.*;
import org.secu3.android.api.io.Secu3Manager.SECU3_TASK;
import org.secu3.android.api.utils.*;
import org.secu3.android.api.utils.CustomNumberPickerDialog.OnNumberPickerDialogAcceptListener;
import org.secu3.android.parameters.*;
import org.secu3.android.parameters.items.*;
import org.secu3.android.parameters.items.BaseParamItem.OnParamItemChangeListener;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.text.InputType;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
	private CustomNumberPickerDialog dialog = null;	
	private ReceiveMessages receiver = null;
	
	private SparseArray<Secu3Packet> Skeletons = null;
	private PacketUtils packetUtils = null;
	
	private int protocol_version = SettingsActivity.PROTOCOL_UNKNOWN;
		    
	public class ReceiveMessages extends BroadcastReceiver 
	{
		public IntentFilter intentFilter = null;
		
		public ReceiveMessages() {
			intentFilter = new IntentFilter();
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_STATUS_ONLINE);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_PROGRESS);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_RECEIVE_PACKET);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_RECEIVE_PARAMETER);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_RECEIVE_SKELETON_PACKET);
		}
		
		@Override
		public void onReceive(Context context, Intent intent) 
		{    
			update(intent);	   	    
		}
	}

    private void paramsRead() {
    	progressBar.setVisibility(ProgressBar.VISIBLE);
// Path: secu3droid/src/org/secu3/android/api/io/Secu3Manager.java
// public enum SECU3_TASK {
// 	SECU3_NONE, SECU3_READ_SENSORS, SECU3_RAW_SENSORS, SECU3_READ_PARAMS, SECU3_READ_ERRORS, SECU3_READ_FW_INFO, SECU3_START_SENSOR_LOGGING, SECU3_STOP_SENSOR_LOGGING, SECU3_START_RAW_LOGGING, SECU3_STOP_RAW_LOGGING, SECU3_SET_LOG_MARKER_1, SECU3_SET_LOG_MARKER_2, SECU3_SET_LOG_MARKER_3
// }
// 
// Path: secu3droid/src/org/secu3/android/api/utils/CustomNumberPickerDialog.java
// public interface OnNumberPickerDialogAcceptListener {
// 	void onNumberPickerDialogAccept (int itemId);
// }		
// 
// Path: secu3droid/src/org/secu3/android/parameters/items/BaseParamItem.java
// public interface OnParamItemChangeListener {
// 	void onParamItemChange (BaseParamItem item);
// }


// Path: secu3droid/src/org/secu3/android/ParamActivity.java
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import org.secu3.android.api.io.*;
import org.secu3.android.api.io.Secu3Manager.SECU3_TASK;
import org.secu3.android.api.utils.*;
import org.secu3.android.api.utils.CustomNumberPickerDialog.OnNumberPickerDialogAcceptListener;
import org.secu3.android.parameters.*;
import org.secu3.android.parameters.items.*;
import org.secu3.android.parameters.items.BaseParamItem.OnParamItemChangeListener;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.text.InputType;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

	private CustomNumberPickerDialog dialog = null;	
	private ReceiveMessages receiver = null;
	
	private SparseArray<Secu3Packet> Skeletons = null;
	private PacketUtils packetUtils = null;
	
	private int protocol_version = SettingsActivity.PROTOCOL_UNKNOWN;
		    
	public class ReceiveMessages extends BroadcastReceiver 
	{
		public IntentFilter intentFilter = null;
		
		public ReceiveMessages() {
			intentFilter = new IntentFilter();
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_STATUS_ONLINE);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_PROGRESS);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_RECEIVE_PACKET);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_RECEIVE_PARAMETER);
			intentFilter.addAction(Secu3Service.EVENT_SECU3_SERVICE_RECEIVE_SKELETON_PACKET);
		}
		
		@Override
		public void onReceive(Context context, Intent intent) 
		{    
			update(intent);	   	    
		}
	}

    private void paramsRead() {
    	progressBar.setVisibility(ProgressBar.VISIBLE);
    	startService(new Intent (Secu3Service.ACTION_SECU3_SERVICE_SET_TASK,Uri.EMPTY,this,Secu3Service.class).putExtra(Secu3Service.ACTION_SECU3_SERVICE_SET_TASK_PARAM, SECU3_TASK.SECU3_READ_PARAMS.ordinal()));