|
@@ -0,0 +1,5267 @@
|
|
|
+package com.example.administrator.wingcool_gt9_apk;
|
|
|
+
|
|
|
+import android.Manifest;
|
|
|
+import android.app.Activity;
|
|
|
+import android.app.PendingIntent;
|
|
|
+import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
+import android.content.IntentFilter;
|
|
|
+import android.content.pm.ActivityInfo;
|
|
|
+import android.content.pm.PackageManager;
|
|
|
+import android.content.res.Configuration;
|
|
|
+import android.content.res.Resources;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.hardware.usb.UsbConstants;
|
|
|
+import android.hardware.usb.UsbDevice;
|
|
|
+import android.hardware.usb.UsbDeviceConnection;
|
|
|
+import android.hardware.usb.UsbEndpoint;
|
|
|
+import android.hardware.usb.UsbInterface;
|
|
|
+import android.hardware.usb.UsbManager;
|
|
|
+import android.hardware.usb.UsbRequest;
|
|
|
+import android.net.Uri;
|
|
|
+import android.os.Build;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.os.Environment;
|
|
|
+import android.os.Handler;
|
|
|
+import android.os.Message;
|
|
|
+import android.os.SystemClock;
|
|
|
+import android.support.annotation.NonNull;
|
|
|
+import android.support.annotation.RequiresApi;
|
|
|
+import android.support.v4.app.ActivityCompat;
|
|
|
+import android.support.v4.content.ContextCompat;
|
|
|
+import android.support.v7.app.AppCompatActivity;
|
|
|
+import android.util.DisplayMetrics;
|
|
|
+import android.util.Log;
|
|
|
+import android.view.Gravity;
|
|
|
+import android.view.KeyEvent;
|
|
|
+import android.view.View;
|
|
|
+import android.view.ViewGroup;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.EditText;
|
|
|
+import android.widget.GridLayout;
|
|
|
+import android.widget.TableLayout;
|
|
|
+import android.widget.TableRow;
|
|
|
+import android.widget.TextView;
|
|
|
+import android.widget.Toast;
|
|
|
+
|
|
|
+import org.w3c.dom.Text;
|
|
|
+
|
|
|
+import java.io.BufferedReader;
|
|
|
+import java.io.File;
|
|
|
+import java.io.FileInputStream;
|
|
|
+import java.io.FileReader;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.io.InputStreamReader;
|
|
|
+import java.io.RandomAccessFile;
|
|
|
+import java.io.Reader;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Locale;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
+
|
|
|
+public class SensorTest extends AppCompatActivity
|
|
|
+ implements OpenDevicesReceiver.OpenDevicesListener, View.OnClickListener {
|
|
|
+ private Context mAlertContext;
|
|
|
+ //MainActivity mMainAct = new MainActivity();
|
|
|
+ private byte[] mRawdataBytes = new byte[52 * 75 * 2 + 64 * 2];
|
|
|
+ private int[] mManualRefInt = new int[52 * 75 + 64];
|
|
|
+ private int[] datatemp = new int[52 * 75 + 64];
|
|
|
+ private short[] iDataShow = new short[52 * 75 + 64];
|
|
|
+ private int[] iRawDataMaxVal = new int[52 * 75 + 64];
|
|
|
+ private int[] iRawDataMinVal = new int[52 * 75 + 64];
|
|
|
+ private byte[] byOverMaxCount = new byte[52 * 75 + 64];
|
|
|
+ private byte[] byLessMinCount = new byte[52 * 75 + 64];
|
|
|
+ private byte[] byOverAdjCount = new byte[52 * 75 + 64];
|
|
|
+ private byte[] byConfigBak = new byte[2048];
|
|
|
+ private static final int RAWDATA_MESSAGE = 0;
|
|
|
+ private static final int LOG1_MESSAG = 1;
|
|
|
+ private static final int CLEAR_MESSAGE= 2;
|
|
|
+ private static final int LOG2_MESSAGE = 3;
|
|
|
+ private static final int CONNECTED_SUCCESS = 4;
|
|
|
+ private static final int DIFF_MESSAGE = 5;
|
|
|
+ private static final int MANUALDIFF_MESSAGE = 6;
|
|
|
+ private static final int TEST_DATA_MESSAGE = 7;
|
|
|
+ private static final int STYLUS_DATA_MESSAGE = 8;
|
|
|
+
|
|
|
+ private static final int PERMISSION_REQUEST_CODE = 3;
|
|
|
+
|
|
|
+ private static final int NEXT_COMMAND_DELAY_TIME = 150; //下一个USB命令发送前延时时间
|
|
|
+ private static final String USB_ACTION = "com.host2device";
|
|
|
+ private static final String ACTION_USB_PERMISSION = "com.host2device.USB_PERMISSION";
|
|
|
+ private ExecutorService mThreadPool;
|
|
|
+ private UsbManager mUsbManager;
|
|
|
+ private OpenDevicesReceiver daOpenDevicesReceiver;
|
|
|
+ private UsbDeviceConnection mUsbDeviceConnection;
|
|
|
+ private UsbRequest mUsbRequest = new UsbRequest();
|
|
|
+ private UsbEndpoint mUsbEndpointOut;
|
|
|
+ private UsbEndpoint mUsbEndpointIn;
|
|
|
+ private int iProductId;
|
|
|
+ private byte byProductType = 0;
|
|
|
+ private static final byte GT9 = 0x01;
|
|
|
+ private static final byte GT7 = 0x02;
|
|
|
+ private static final byte GT29336 = 0x03;
|
|
|
+ private static final byte GT2931 = 0x04;
|
|
|
+
|
|
|
+ private Button btn_ImportFileButton;
|
|
|
+ private Button btn_Test;
|
|
|
+
|
|
|
+
|
|
|
+ private byte[] mBytes = new byte[2048];
|
|
|
+
|
|
|
+ private EditText edt_RowNum;
|
|
|
+ private EditText edt_ColNum;
|
|
|
+ private EditText edt_Maximum;
|
|
|
+ private EditText edt_Minimum;
|
|
|
+ private EditText edt_TestiInformation; //显示测试过程信息
|
|
|
+
|
|
|
+ private boolean isReceiverMessage = true;
|
|
|
+ private boolean isNeedFindDevice = true;
|
|
|
+
|
|
|
+ private UsbInterface mUsbInterface;
|
|
|
+ private Context mContext;
|
|
|
+
|
|
|
+ private byte showAddressHigh;
|
|
|
+ private byte showAddressLow; //需要显示的 address
|
|
|
+ private int colnum;
|
|
|
+ private int rownum;
|
|
|
+ private int iMaximum; //存放外部输入的最大值测试阈值
|
|
|
+ private int iMinimum; //存放外部输入的最小值测试阈值
|
|
|
+ private byte byMaximumOverCount; //最大值超过阈值的次数
|
|
|
+ private byte byMinimumOverCount; //最小值超过阈值的次数
|
|
|
+ private byte byTestCount; //统计测试的帧数
|
|
|
+ private byte byReTestCount; //重新测试的测试,最多测试4次输出判定结果
|
|
|
+ private boolean bTestMaxResult,bTestMinResult; //测试结果pass或者fail;
|
|
|
+ private TextView tvMaximum; //显示最大值
|
|
|
+ private TextView tvMinimum; //显示最小值
|
|
|
+ private TextView tvDataContent; //显示当前处于何种数值模式:原始值、差值、基准……
|
|
|
+ private TextView tvMAD; //显示最大相邻偏差
|
|
|
+ private TextView mtextView;
|
|
|
+ private TextView edit_search;
|
|
|
+ private byte byDisplayFrame = 0; //间隔显示帧数
|
|
|
+ private byte byDisplayFrameCount = 0; //用于间隔显示计数
|
|
|
+
|
|
|
+ public String stTestLog; //最大最小值测试信息存放字符串
|
|
|
+ String stTestLogShow= ""; //最大最小值测试信息合并起来存放字符串
|
|
|
+
|
|
|
+ public String Update_log; //短路测试信息存放字符串
|
|
|
+ String updateLogShow= ""; //短路测试信息合并起来存放字符串
|
|
|
+
|
|
|
+ private byte showFlag = 0; //
|
|
|
+ private static final byte RAWDATA_FLAG = 0x01; //rawdata
|
|
|
+ private static final byte MANUALDATA_FLAG = 0x02; //manualdiff and manualreff
|
|
|
+ private static final byte DIFFDATA_1BYTE_FLAG = 0x03; //1 byte diffdata(GT9xxx)
|
|
|
+ private static final byte DIFFDATA_2BYTES_FLAG = 0x04; //2 bytes diffdata
|
|
|
+ private static final byte REFFDATA_FLAG = 0x05; //reffdata
|
|
|
+ private static final byte TESTING_FLAG = 0x06; //testing
|
|
|
+ private static final byte TEST_END_FLAG = 0x07; //test end
|
|
|
+ private static final byte STYLUSDATA_FLAG = 0x08; //stylus data
|
|
|
+ private static final byte STOP_FLAG = 0x09; //stop
|
|
|
+
|
|
|
+ private byte btTestStep = 0; //1.maximum and minimum test 2.change to normal mode 3.shorttest
|
|
|
+ private boolean bSaveShortTestResult = false;
|
|
|
+ private String strSaveRawdata1 = " ", strSaveRawdata2 = " ", strSaveRawdata3 = " ", strSaveRawdata4 = " ", strSaveRawdata5 = " ", strSaveRawdata6 = " ", strSaveRawdata7 = " ", strSaveRawdata8 = " ";
|
|
|
+ private String strSaveRawdata9 = " ", strSaveRawdata10 = " ", strSaveRawdata11 = " ", strSaveRawdata12 = " ", strSaveRawdata13 = " ", strSaveRawdata14 = " ", strSaveRawdata15 = " ", strSaveRawdata16 = " ";
|
|
|
+ private String strSaveRawDataMaxArray = " ", strSaveRawDataMinArray = " ", strSaveRawDataTestFlagArray = " ";
|
|
|
+ private int[] iSaveFrameRawDataMaxValue = new int[16];
|
|
|
+ private int[] iSaveFrameRawDataMinValue = new int[16];
|
|
|
+
|
|
|
+ private boolean bShowDataFlag = false;
|
|
|
+
|
|
|
+ private EditText edtShortCircuitInfo; //the info of short circuit test
|
|
|
+
|
|
|
+ private GridLayout textGridLayout;
|
|
|
+
|
|
|
+ private static final byte gt9110h_short_dsp_code[] = {
|
|
|
+ 0x02,0x0c,(byte)0xb7,(byte)0x8f,0x08,0x7e,0x00,0x7f,0x71,0x7d,0x00,0x7b,0x01,0x7a,(byte)0xa5,0x79,
|
|
|
+ (byte)0xc1,0x12,0x09,0x1f,(byte)0xe5,0x08,0x70,0x03,0x02,0x01,(byte)0xbb,(byte)0xd3,(byte)0x94,0x04,0x40,0x03,
|
|
|
+ 0x02,0x01,(byte)0xbb,(byte)0xe4,(byte)0xf5,0x0a,(byte)0xf5,0x09,0x74,0x54,0x25,0x09,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,
|
|
|
+ (byte)0x88,(byte)0xf5,(byte)0x83,(byte)0xe0,0x25,0x0a,(byte)0xf5,0x0a,0x05,0x09,(byte)0xe5,0x09,(byte)0xb4,0x08,(byte)0xe9,(byte)0xe5,
|
|
|
+ 0x08,0x25,0x0a,(byte)0xf5,0x0a,(byte)0x90,(byte)0x88,0x5d,(byte)0xe0,(byte)0xf4,0x04,0x65,0x0a,0x60,0x07,(byte)0x90,
|
|
|
+ (byte)0x88,0x01,0x74,0x10,(byte)0xf0,0x22,(byte)0x90,0x42,0x5d,(byte)0xe0,(byte)0xf5,0x0c,(byte)0x90,0x42,0x62,(byte)0xe0,
|
|
|
+ (byte)0xf5,0x0d,0x12,0x0e,0x67,(byte)0xc2,0x0a,0x12,0x15,0x39,(byte)0xc2,0x08,(byte)0xe4,(byte)0xf5,0x09,(byte)0xe5,
|
|
|
+ 0x09,(byte)0xc3,(byte)0x95,0x08,0x40,0x03,0x02,0x00,(byte)0xff,(byte)0xe5,0x09,0x25,(byte)0xe0,0x24,0x54,(byte)0xf5,
|
|
|
+ (byte)0x82,(byte)0xe4,0x34,(byte)0x88,(byte)0xf5,(byte)0x83,(byte)0xe0,(byte)0xf5,0x0b,(byte)0xe5,0x09,0x25,(byte)0xe0,0x24,0x55,(byte)0xf5,
|
|
|
+ (byte)0x82,(byte)0xe4,0x34,(byte)0x88,(byte)0xf5,(byte)0x83,(byte)0xe0,(byte)0xf5,0x0a,0x24,0x00,0x12,0x01,(byte)0xfc,0x12,0x01,
|
|
|
+ (byte)0xbc,0x12,0x03,0x04,0x24,(byte)0xc1,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa5,(byte)0xf5,(byte)0x83,(byte)0xe5,0x0b,0x12,
|
|
|
+ 0x03,0x03,0x24,(byte)0xc2,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa5,(byte)0xf5,(byte)0x83,(byte)0xe5,0x0a,0x12,0x03,0x03,
|
|
|
+ 0x24,(byte)0xc3,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa5,(byte)0xf5,(byte)0x83,(byte)0xe5,0x0f,(byte)0xf0,(byte)0xe5,0x10,0x12,0x02,
|
|
|
+ 0x33,(byte)0xf0,0x12,0x01,(byte)0xea,0x12,0x01,(byte)0xbc,0x12,0x03,0x04,0x24,(byte)0xc5,(byte)0xf5,(byte)0x82,(byte)0xe4,
|
|
|
+ 0x34,(byte)0xa5,0x12,0x02,0x64,(byte)0x95,0x10,(byte)0x90,(byte)0x88,0x04,(byte)0xe0,(byte)0x95,0x0f,0x50,0x03,0x12,
|
|
|
+ 0x02,(byte)0xdb,0x12,0x02,0x35,0x12,0x01,(byte)0xf9,(byte)0xe4,(byte)0xf0,0x05,0x09,0x02,0x00,0x6f,(byte)0x90,
|
|
|
+ (byte)0x88,0x5c,(byte)0xe0,(byte)0xff,(byte)0xf4,0x70,0x03,0x02,0x01,(byte)0xbb,(byte)0xef,(byte)0xd3,(byte)0x94,0x0e,0x40,0x03,
|
|
|
+ 0x02,0x01,(byte)0xbb,(byte)0x8f,0x0a,(byte)0xe4,0x2f,0x12,0x01,(byte)0xfc,0x12,0x01,(byte)0xd3,(byte)0x90,(byte)0xa5,(byte)0xd9,
|
|
|
+ (byte)0xe5,0x0a,(byte)0xf0,(byte)0xa3,(byte)0xe5,0x0f,(byte)0xf0,(byte)0xa3,(byte)0xe5,0x10,(byte)0xf0,(byte)0xe4,(byte)0xf5,0x09,(byte)0xe5,0x09,
|
|
|
+ (byte)0x90,0x0f,(byte)0xcb,(byte)0x93,(byte)0xf5,0x0b,0x12,0x02,0x45,(byte)0xe0,0x60,0x30,(byte)0xe5,0x0b,0x65,0x0a,
|
|
|
+ 0x60,0x2a,(byte)0xe4,0x12,0x01,(byte)0xea,0x12,0x01,(byte)0xd3,(byte)0xe5,0x09,0x25,(byte)0xe0,0x24,(byte)0xdc,(byte)0xf5,
|
|
|
+ (byte)0x82,(byte)0xe4,0x34,(byte)0xa5,0x12,0x02,0x64,(byte)0x95,0x10,(byte)0x90,(byte)0x88,0x04,(byte)0xe0,(byte)0x95,0x0f,0x50,
|
|
|
+ 0x03,0x12,0x02,(byte)0xdb,0x12,0x02,0x35,0x12,0x01,(byte)0xf9,(byte)0xe4,(byte)0xf0,0x05,0x09,(byte)0xe5,0x09,
|
|
|
+ (byte)0xc3,(byte)0x94,0x2a,0x40,(byte)0xb9,(byte)0xe4,(byte)0xf5,0x0f,(byte)0xf5,0x10,(byte)0x90,(byte)0xa6,0x30,(byte)0xf0,(byte)0xa3,(byte)0xf0,
|
|
|
+ (byte)0xf5,0x09,0x74,(byte)0xc1,0x25,0x09,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa5,(byte)0xf5,(byte)0x83,(byte)0xe0,0x25,0x10,
|
|
|
+ (byte)0xf5,0x10,(byte)0xe4,0x35,0x0f,(byte)0xf5,0x0f,0x05,0x09,(byte)0xe5,0x09,(byte)0xb4,0x71,(byte)0xe4,(byte)0xc3,(byte)0xe4,
|
|
|
+ (byte)0x95,0x10,(byte)0xfe,(byte)0xe4,(byte)0x95,0x0f,(byte)0x90,(byte)0xa6,0x30,(byte)0xf0,(byte)0xa3,(byte)0xce,(byte)0xf0,(byte)0x90,0x42,0x5d,
|
|
|
+ (byte)0xe5,0x0c,(byte)0xf0,(byte)0xe5,0x0d,0x12,0x02,0x4f,0x12,0x15,0x0d,0x22,0x74,0x02,(byte)0xf0,(byte)0xc2,
|
|
|
+ 0x0a,(byte)0x85,0x0a,0x11,0x12,0x16,0x5c,(byte)0x8f,0x0e,0x7d,0x01,0x12,0x0f,(byte)0xf5,(byte)0x8e,0x0f,
|
|
|
+ (byte)0x8f,0x10,0x22,0x74,0x02,(byte)0xf0,(byte)0xc2,0x0a,(byte)0x85,0x0a,0x11,0x12,0x16,0x5c,(byte)0x8f,0x0e,
|
|
|
+ 0x7d,0x01,0x12,0x0f,(byte)0xf5,(byte)0x8e,0x0f,(byte)0x8f,0x10,0x22,0x25,0x0a,(byte)0xff,(byte)0xe4,0x34,0x32,
|
|
|
+ (byte)0xfe,(byte)0xef,0x64,0x03,(byte)0xf5,(byte)0x82,(byte)0x8e,(byte)0x83,(byte)0xe4,(byte)0xf0,0x25,0x0b,(byte)0xff,(byte)0xe4,0x34,0x32,
|
|
|
+ (byte)0xfe,(byte)0xef,0x64,0x03,(byte)0xf5,(byte)0x82,(byte)0x8e,(byte)0x83,0x22,(byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0xf0,0x34,(byte)0x8e,(byte)0xf5,
|
|
|
+ (byte)0x83,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,0x22,0x7e,0x00,0x7f,0x06,0x7d,0x00,0x7b,0x01,0x7a,
|
|
|
+ (byte)0x80,0x79,(byte)0xb3,0x22,(byte)0x90,0x42,0x0e,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0x90,0x42,0x02,(byte)0xe0,0x54,
|
|
|
+ (byte)0xfe,(byte)0xf0,0x22,(byte)0xa3,(byte)0xf0,(byte)0x90,0x32,0x42,(byte)0xe4,(byte)0xf0,(byte)0xa3,(byte)0xf0,(byte)0x90,0x42,(byte)0x82,0x22,
|
|
|
+ (byte)0x90,0x0f,(byte)0xcb,(byte)0x93,(byte)0xff,0x24,0x4f,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0x80,(byte)0xf5,(byte)0x83,0x22,(byte)0x90,
|
|
|
+ 0x42,0x62,(byte)0xf0,(byte)0x90,0x42,0x7d,0x74,0x02,(byte)0xf0,0x22,(byte)0x90,0x42,0x0e,(byte)0xe0,0x44,0x01,
|
|
|
+ (byte)0xf0,0x7f,0x01,0x22,(byte)0xf5,(byte)0x83,(byte)0xe5,0x0f,(byte)0xf0,(byte)0xe5,0x10,(byte)0xa3,(byte)0xf0,(byte)0xc3,(byte)0x90,(byte)0x88,
|
|
|
+ 0x05,(byte)0xe0,0x22,0x74,0x31,0x2f,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0x80,(byte)0xf5,(byte)0x83,0x22,(byte)0xf5,(byte)0x82,
|
|
|
+ (byte)0xe4,0x35,(byte)0x83,(byte)0xf5,(byte)0x83,(byte)0xe4,(byte)0xf0,(byte)0xa3,(byte)0xf0,0x22,(byte)0xa3,(byte)0xa3,(byte)0xa3,0x75,(byte)0xf0,0x02,
|
|
|
+ 0x02,0x09,0x13,0x74,0x08,0x2c,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0x88,(byte)0xf5,(byte)0x83,0x22,0x74,0x32,
|
|
|
+ 0x2c,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0x88,(byte)0xf5,(byte)0x83,0x22,0x13,0x13,0x13,0x54,0x1f,0x24,(byte)0xb3,
|
|
|
+ (byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0x80,(byte)0xf5,(byte)0x83,(byte)0xef,(byte)0xf0,0x22,(byte)0x85,0x0c,(byte)0x82,(byte)0x85,0x0b,(byte)0x83,
|
|
|
+ (byte)0xa3,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,(byte)0xff,(byte)0xe5,0x08,0x25,(byte)0xe0,0x22,(byte)0xfd,(byte)0xe4,0x34,0x32,(byte)0xfc,
|
|
|
+ (byte)0xed,0x64,0x03,(byte)0xf5,(byte)0x82,(byte)0x8c,(byte)0x83,(byte)0xee,(byte)0xf0,0x0f,0x22,(byte)0xd2,0x08,(byte)0x90,(byte)0x88,0x01,
|
|
|
+ (byte)0xe0,0x44,0x01,(byte)0xf0,0x22,(byte)0xee,0x54,0x7f,(byte)0xfe,(byte)0xc3,(byte)0x90,(byte)0x88,0x52,(byte)0xe0,(byte)0x9f,(byte)0x90,
|
|
|
+ (byte)0x88,0x51,(byte)0xe0,(byte)0x9e,0x22,(byte)0xf8,(byte)0xeb,0x4f,(byte)0xff,(byte)0xea,0x4e,(byte)0xfe,(byte)0xe9,0x4d,(byte)0xfd,(byte)0xe8,
|
|
|
+ 0x4c,(byte)0xfc,0x22,(byte)0xf0,(byte)0xe5,0x09,0x75,(byte)0xf0,0x06,(byte)0xa4,0x22,(byte)0xe0,(byte)0xf8,(byte)0xa3,(byte)0xe0,(byte)0xf9,
|
|
|
+ (byte)0xa3,(byte)0xe0,(byte)0xfa,(byte)0xa3,(byte)0xe0,(byte)0xfb,(byte)0xe8,0x22,(byte)0x90,0x41,(byte)0xfe,(byte)0xe0,0x44,0x02,(byte)0xf0,(byte)0xa3,
|
|
|
+ 0x74,0x0f,(byte)0xf0,0x22,(byte)0x90,0x41,(byte)0xfe,(byte)0xe0,0x44,0x01,(byte)0xf0,0x22,(byte)0xf5,(byte)0x82,(byte)0xe4,0x3e,
|
|
|
+ (byte)0xf5,(byte)0x83,(byte)0xec,(byte)0xf0,(byte)0xa3,(byte)0xed,(byte)0xf0,0x22,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,(byte)0xff,0x75,(byte)0xf0,0x06,
|
|
|
+ (byte)0xed,(byte)0xa4,0x22,0x54,0x07,(byte)0xff,0x74,0x01,(byte)0xc8,(byte)0xef,(byte)0xc8,0x08,0x22,0x25,(byte)0xe0,0x24,
|
|
|
+ 0x31,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa5,0x22,0x25,(byte)0xe0,0x24,(byte)0x85,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa5,
|
|
|
+ 0x22,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,(byte)0xff,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,0x22,(byte)0xe4,(byte)0xf5,0x0f,(byte)0xf5,0x10,
|
|
|
+ (byte)0x90,0x42,0x5d,(byte)0xe0,(byte)0xf5,0x0a,(byte)0x90,0x42,0x62,(byte)0xe0,(byte)0xf5,0x0b,0x12,0x0e,0x67,(byte)0xc2,
|
|
|
+ 0x0a,0x12,0x15,0x39,(byte)0xe4,(byte)0x90,(byte)0x88,0x02,(byte)0xf0,(byte)0xf5,0x08,(byte)0xe5,0x08,(byte)0x90,0x0f,(byte)0xcb,
|
|
|
+ (byte)0x93,0x12,0x02,0x45,(byte)0xe0,0x70,0x03,0x02,0x04,(byte)0x94,(byte)0xc2,0x08,(byte)0x90,0x0f,(byte)0xdf,(byte)0xe4,
|
|
|
+ (byte)0x93,0x24,0x00,0x12,0x01,(byte)0xfc,0x74,0x02,(byte)0xf0,(byte)0xaf,0x08,0x12,0x14,(byte)0xb5,(byte)0xe5,0x08,
|
|
|
+ (byte)0x90,0x0f,(byte)0xcb,(byte)0x93,(byte)0xf5,0x0c,(byte)0x90,(byte)0x88,0x02,(byte)0xe0,0x75,(byte)0xf0,(byte)0x95,(byte)0xa4,0x24,0x60,
|
|
|
+ (byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0xf0,0x34,(byte)0x88,(byte)0xaf,(byte)0x82,(byte)0xf5,0x0f,(byte)0x8f,0x10,(byte)0xf5,(byte)0x83,(byte)0xe0,0x44,
|
|
|
+ (byte)0x80,(byte)0xf0,(byte)0xe5,0x0c,0x54,0x7f,(byte)0xff,(byte)0xe0,0x54,(byte)0x80,0x4f,(byte)0xf0,(byte)0xd2,0x0a,(byte)0x85,0x0c,
|
|
|
+ 0x11,0x12,0x04,(byte)0xae,(byte)0xe5,0x0d,(byte)0xf0,(byte)0xa3,(byte)0xe5,0x0e,(byte)0xf0,(byte)0x85,0x10,(byte)0x82,(byte)0x85,0x0f,
|
|
|
+ (byte)0x83,(byte)0xe5,0x08,0x12,0x02,(byte)0x8a,(byte)0xe5,0x0d,(byte)0xf0,(byte)0xe5,0x0e,0x12,0x02,0x33,(byte)0xf0,(byte)0xfe,
|
|
|
+ 0x7f,0x54,(byte)0xfd,(byte)0xe5,0x10,0x24,0x03,(byte)0xfb,(byte)0xe4,0x35,0x0f,(byte)0xfa,(byte)0xc9,(byte)0xeb,(byte)0xc9,0x7b,
|
|
|
+ 0x01,0x12,0x09,0x1f,(byte)0xe5,0x08,0x04,(byte)0xf5,0x09,(byte)0xe5,0x09,(byte)0xc3,(byte)0x94,0x2a,0x50,0x37,
|
|
|
+ (byte)0xe5,0x09,0x12,0x02,0x40,(byte)0xe0,0x60,0x2b,(byte)0xd2,0x0a,(byte)0x8f,0x11,0x12,0x04,(byte)0xae,(byte)0xa3,
|
|
|
+ (byte)0xa3,0x75,(byte)0xf0,0x02,(byte)0xe5,0x09,0x12,0x09,0x13,(byte)0xe5,0x0d,(byte)0xf0,(byte)0xa3,(byte)0xe5,0x0e,0x12,
|
|
|
+ 0x02,0x6c,(byte)0x95,0x0e,(byte)0x90,(byte)0x88,0x04,(byte)0xe0,(byte)0x95,0x0d,0x50,0x03,0x12,0x02,(byte)0xdb,0x12,
|
|
|
+ 0x02,0x35,(byte)0xf0,0x05,0x09,(byte)0x80,(byte)0xc2,(byte)0xd2,0x0a,(byte)0xe5,0x10,0x24,0x57,(byte)0xf5,0x12,(byte)0xe4,
|
|
|
+ 0x35,0x0f,(byte)0xf5,0x11,(byte)0x85,0x08,0x13,0x12,0x0b,0x48,(byte)0xaf,0x10,(byte)0xae,0x0f,0x12,0x11,
|
|
|
+ (byte)0xd9,(byte)0x85,0x10,(byte)0x82,(byte)0x85,0x0f,(byte)0x83,(byte)0xa3,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,(byte)0xff,(byte)0xe5,0x08,0x25,
|
|
|
+ (byte)0xe0,0x24,(byte)0xa1,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa4,0x12,0x02,0x0f,0x30,0x08,0x06,(byte)0x90,(byte)0x88,
|
|
|
+ 0x02,(byte)0xe0,0x04,(byte)0xf0,0x05,0x08,(byte)0xe5,0x08,(byte)0xc3,(byte)0x94,0x2a,0x50,0x03,0x02,0x03,(byte)0x8b,
|
|
|
+ (byte)0x90,0x42,0x5d,(byte)0xe5,0x0a,(byte)0xf0,(byte)0xe5,0x0b,0x12,0x02,0x4f,0x02,0x15,0x0d,0x12,0x16,
|
|
|
+ 0x5c,(byte)0x8f,0x0c,0x7d,0x01,0x12,0x0f,(byte)0xf5,(byte)0x8e,0x0d,(byte)0x8f,0x0e,(byte)0x85,0x10,(byte)0x82,(byte)0x85,
|
|
|
+ 0x0f,(byte)0x83,(byte)0xa3,0x22,(byte)0xe4,(byte)0xf5,0x0b,(byte)0xf5,0x0c,(byte)0x90,0x42,0x5d,(byte)0xe0,(byte)0xf5,0x09,(byte)0x90,
|
|
|
+ 0x42,0x62,(byte)0xe0,(byte)0xf5,0x0a,0x12,0x0e,0x67,(byte)0xc2,0x0a,0x12,0x15,0x39,(byte)0xe4,(byte)0x90,(byte)0x88,
|
|
|
+ 0x03,(byte)0xf0,(byte)0xf5,0x08,(byte)0xe5,0x08,0x30,(byte)0xe0,0x03,0x02,0x05,(byte)0xf1,0x74,0x31,0x25,0x08,
|
|
|
+ 0x12,0x02,0x76,(byte)0xe0,0x70,0x03,0x02,0x05,(byte)0xf1,(byte)0xc2,0x08,(byte)0xad,0x08,(byte)0x90,(byte)0x88,0x03,
|
|
|
+ (byte)0xe0,0x75,(byte)0xf0,0x41,(byte)0xa4,0x24,(byte)0xd2,(byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0xf0,0x34,(byte)0xa0,(byte)0xaf,(byte)0x82,(byte)0xf5,
|
|
|
+ 0x0b,(byte)0x8f,0x0c,(byte)0xf5,(byte)0x83,(byte)0xe0,0x54,0x7f,(byte)0xf0,(byte)0xed,0x54,0x7f,(byte)0xff,(byte)0xe0,0x54,(byte)0x80,
|
|
|
+ 0x4f,(byte)0xf0,(byte)0xed,(byte)0xc3,0x13,(byte)0xfc,0x24,0x2c,0x12,0x01,(byte)0xfc,0x74,0x02,(byte)0xf0,(byte)0xed,(byte)0xc3,
|
|
|
+ (byte)0x94,0x10,0x50,0x1a,(byte)0x90,0x32,0x46,(byte)0xc0,(byte)0x83,(byte)0xc0,(byte)0x82,0x74,0x01,0x7e,0x00,(byte)0xc8,
|
|
|
+ (byte)0xed,(byte)0xc8,0x08,(byte)0x80,0x05,(byte)0xc3,0x33,(byte)0xce,0x33,(byte)0xce,(byte)0xd8,(byte)0xf9,(byte)0x80,0x1c,(byte)0x90,0x32,
|
|
|
+ 0x44,(byte)0xc0,(byte)0x83,(byte)0xc0,(byte)0x82,(byte)0xed,0x24,(byte)0xf0,(byte)0xff,0x74,0x01,0x7e,0x00,(byte)0xc8,(byte)0xef,(byte)0xc8,
|
|
|
+ 0x08,(byte)0x80,0x05,(byte)0xc3,0x33,(byte)0xce,0x33,(byte)0xce,(byte)0xd8,(byte)0xf9,(byte)0xff,(byte)0xe0,0x4e,(byte)0xfe,(byte)0xa3,(byte)0xe0,
|
|
|
+ 0x4f,(byte)0xff,(byte)0xd0,(byte)0x82,(byte)0xd0,(byte)0x83,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0xcf,(byte)0xec,(byte)0xcf,0x7d,0x01,
|
|
|
+ 0x12,0x0f,(byte)0xf5,(byte)0x85,0x0c,(byte)0x82,(byte)0x85,0x0b,(byte)0x83,(byte)0xa3,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0x85,
|
|
|
+ 0x0c,(byte)0x82,(byte)0x85,0x0b,(byte)0x83,(byte)0xe5,0x08,0x12,0x02,(byte)0x8a,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0x90,
|
|
|
+ 0x32,0x44,0x12,0x08,(byte)0xe2,0x00,0x00,0x00,0x00,(byte)0xc2,0x0a,(byte)0xe5,0x0c,0x24,0x03,(byte)0xf5,
|
|
|
+ 0x12,(byte)0xe4,0x35,0x0b,(byte)0xf5,0x11,(byte)0x85,0x08,0x13,0x12,0x0b,0x48,(byte)0xaf,0x0c,(byte)0xae,0x0b,
|
|
|
+ 0x12,0x12,0x1b,0x12,0x02,(byte)0xba,0x24,(byte)0xf5,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa4,0x12,0x02,0x0f,
|
|
|
+ 0x12,0x02,(byte)0xba,0x24,(byte)0xf7,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0xa4,0x12,0x02,0x0f,0x30,0x08,0x06,
|
|
|
+ (byte)0x90,(byte)0x88,0x03,(byte)0xe0,0x04,(byte)0xf0,(byte)0xe5,0x08,(byte)0xc3,0x13,0x24,0x2c,0x12,0x01,(byte)0xfc,(byte)0xe4,
|
|
|
+ (byte)0xf0,0x05,0x08,(byte)0xe5,0x08,(byte)0xc3,(byte)0x94,0x1d,0x50,0x03,0x02,0x04,(byte)0xe4,(byte)0x90,0x42,0x5d,
|
|
|
+ (byte)0xe5,0x09,(byte)0xf0,(byte)0x90,0x42,0x62,(byte)0xe5,0x0a,0x12,0x02,0x52,0x02,0x15,0x0d,(byte)0x90,0x50,
|
|
|
+ (byte)0x96,0x74,(byte)0xaa,(byte)0xf0,(byte)0x90,0x41,(byte)0x83,(byte)0xe0,0x44,0x08,(byte)0xf0,0x7d,0x48,0x7f,0x01,0x12,
|
|
|
+ 0x13,(byte)0xf9,(byte)0x90,0x42,0x51,0x74,0x03,(byte)0xf0,(byte)0xc2,(byte)0xaf,0x12,0x16,(byte)0xa5,(byte)0x90,0x42,0x3a,
|
|
|
+ (byte)0xe4,(byte)0xf0,(byte)0xa3,0x04,(byte)0xf0,(byte)0x90,0x50,(byte)0x8b,0x74,0x14,(byte)0xf0,(byte)0x90,0x50,(byte)0x8a,(byte)0xf0,0x12,
|
|
|
+ 0x09,(byte)0x86,(byte)0x90,0x60,0x2f,0x74,0x07,(byte)0xf0,0x7f,0x3b,0x12,0x16,(byte)0xc9,(byte)0xe4,(byte)0x90,(byte)0x88,
|
|
|
+ 0x04,(byte)0xf0,(byte)0xa3,(byte)0xf0,(byte)0x90,(byte)0x88,0x53,(byte)0xf0,(byte)0xfe,0x7f,0x0a,(byte)0xfd,0x7b,0x01,0x7a,(byte)0x88,
|
|
|
+ 0x79,0x54,0x12,0x09,0x1f,(byte)0x90,(byte)0x88,0x5c,0x74,(byte)0xff,(byte)0xf0,(byte)0x90,0x50,(byte)0x96,(byte)0xe0,(byte)0xb4,
|
|
|
+ (byte)0xaa,0x03,0x00,(byte)0x80,(byte)0xf6,0x12,0x0d,(byte)0xe2,(byte)0x90,(byte)0x88,0x04,(byte)0xe0,0x70,0x02,(byte)0xa3,(byte)0xe0,
|
|
|
+ 0x60,0x03,(byte)0xd3,(byte)0x80,0x01,(byte)0xc3,0x40,0x08,(byte)0x90,(byte)0x88,0x01,0x74,0x10,(byte)0xf0,(byte)0x80,0x4d,
|
|
|
+ (byte)0xe4,(byte)0x90,(byte)0x88,0x00,(byte)0xf0,0x12,0x0c,0x04,0x7e,0x00,0x7f,0x48,0x7d,0x00,0x7b,0x01,
|
|
|
+ 0x7a,(byte)0xa4,0x79,(byte)0xa1,0x12,0x09,0x1f,0x7e,0x00,0x7f,0x48,0x7d,0x00,0x7b,0x01,0x7a,
|
|
|
+ (byte)0xa5,0x79,0x31,0x12,0x09,0x1f,(byte)0xe4,(byte)0x90,(byte)0x88,0x01,(byte)0xf0,(byte)0x90,(byte)0x88,0x53,(byte)0xe0,(byte)0xff,
|
|
|
+ 0x12,0x00,0x03,0x12,0x03,0x6b,0x12,0x04,(byte)0xc4,0x12,0x0a,0x73,(byte)0x90,(byte)0x88,0x00,(byte)0xe0,
|
|
|
+ 0x44,0x08,(byte)0xf0,0x12,0x07,0x55,(byte)0x90,(byte)0x88,0x00,(byte)0xe0,0x44,(byte)0x80,(byte)0xf0,(byte)0x90,(byte)0x88,0x00,
|
|
|
+ 0x74,(byte)0x88,(byte)0xf0,(byte)0x90,0x41,(byte)0xef,0x74,0x0f,(byte)0xf0,(byte)0x90,0x41,(byte)0xee,(byte)0xe0,0x44,0x02,(byte)0xf0,
|
|
|
+ (byte)0xe0,(byte)0xff,0x54,0x01,(byte)0xf4,0x54,0x01,(byte)0xfe,(byte)0xef,0x54,(byte)0xfe,0x4e,(byte)0xf0,(byte)0xe0,(byte)0xff,0x54,
|
|
|
+ 0x01,(byte)0xf4,0x54,0x01,(byte)0xfe,(byte)0xef,0x54,(byte)0xfe,0x4e,(byte)0xf0,(byte)0xe0,0x54,(byte)0xfd,(byte)0xf0,0x70,(byte)0xfe,
|
|
|
+ 0x60,(byte)0xfc,0x60,0x40,0x70,0x3e,0x12,0x16,0x00,0x12,0x16,0x19,0x12,0x16,(byte)0xd5,(byte)0xe4,
|
|
|
+ (byte)0xff,0x12,0x16,(byte)0x8c,0x12,0x15,(byte)0xe5,0x12,0x16,(byte)0xb1,(byte)0xe4,(byte)0xfb,(byte)0xfd,(byte)0xfc,(byte)0xff,(byte)0xfe,
|
|
|
+ 0x12,0x12,0x5d,(byte)0xe4,(byte)0xfb,(byte)0xfd,(byte)0xfc,(byte)0xff,(byte)0xfe,0x12,0x10,(byte)0xfa,(byte)0xe4,(byte)0xfb,(byte)0xfd,(byte)0xfc,
|
|
|
+ (byte)0xff,(byte)0xfe,0x12,0x12,(byte)0xde,(byte)0xe4,(byte)0xff,(byte)0xfe,0x12,0x14,(byte)0x89,0x12,0x16,0x19,0x12,0x16,
|
|
|
+ 0x00,0x12,0x16,(byte)0xd5,0x22,(byte)0x90,0x42,0x5d,(byte)0xe0,(byte)0x90,(byte)0x80,(byte)0xa8,(byte)0xf0,(byte)0x90,0x42,0x62,
|
|
|
+ (byte)0xe0,(byte)0x90,(byte)0x80,(byte)0xa9,(byte)0xf0,0x12,0x0e,0x67,(byte)0xc2,0x0a,0x12,0x15,0x39,0x12,0x02,0x53,
|
|
|
+ (byte)0xe4,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,(byte)0xff,(byte)0xc3,(byte)0x94,0x1e,0x40,0x03,0x02,
|
|
|
+ 0x08,0x79,(byte)0xef,0x12,0x03,0x57,0x12,0x02,(byte)0x83,0x12,0x02,0x73,(byte)0xe0,0x70,0x03,0x02,
|
|
|
+ 0x08,0x70,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,(byte)0xa3,(byte)0xf0,(byte)0x90,0x32,0x44,(byte)0xc0,(byte)0x83,(byte)0xc0,(byte)0x82,0x12,
|
|
|
+ 0x03,0x0b,(byte)0xc0,(byte)0xe0,(byte)0xe9,(byte)0xc0,(byte)0xe0,(byte)0xe4,0x7f,0x01,(byte)0xfe,(byte)0xfd,(byte)0xfc,(byte)0x90,(byte)0x80,(byte)0xa7,
|
|
|
+ (byte)0xe0,(byte)0xf9,(byte)0xf8,0x12,0x08,(byte)0xc3,(byte)0xd0,(byte)0xe0,(byte)0xf9,(byte)0xd0,(byte)0xe0,0x12,0x02,(byte)0xf5,(byte)0xd0,(byte)0x82,
|
|
|
+ (byte)0xd0,(byte)0x83,0x12,0x08,(byte)0xd6,(byte)0x90,0x42,(byte)0x81,(byte)0xe0,0x54,0x3f,(byte)0xf0,0x12,0x08,(byte)0x8b,(byte)0x90,
|
|
|
+ (byte)0x80,(byte)0xaa,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0x90,0x32,0x44,0x12,0x08,(byte)0xe2,0x00,0x00,0x00,
|
|
|
+ 0x00,0x12,0x08,(byte)0x8b,(byte)0x90,(byte)0x80,(byte)0xac,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0xd3,(byte)0x94,0x00,(byte)0xee,
|
|
|
+ 0x64,(byte)0x80,(byte)0x94,(byte)0x80,0x40,0x1c,(byte)0x90,(byte)0x80,(byte)0xab,(byte)0xe0,0x24,(byte)0xb5,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xaa,
|
|
|
+ (byte)0xe0,0x34,(byte)0xff,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xad,(byte)0xe0,0x24,(byte)0xb5,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xac,(byte)0xe0,0x34,
|
|
|
+ (byte)0xff,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xaa,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,(byte)0xff,(byte)0xa3,(byte)0xe0,(byte)0xfc,(byte)0xa3,(byte)0xe0,(byte)0xfd,
|
|
|
+ 0x12,0x14,0x2a,(byte)0xa3,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xaa,0x12,0x03,0x61,(byte)0xfd,
|
|
|
+ 0x75,(byte)0xf0,0x06,(byte)0xa4,0x24,(byte)0xa8,0x12,0x02,0x09,(byte)0x90,(byte)0x80,(byte)0xac,0x12,0x03,0x38,0x24,
|
|
|
+ (byte)0xaa,0x12,0x02,0x09,(byte)0x90,(byte)0x80,(byte)0xae,0x12,0x03,0x38,0x24,(byte)0xac,0x12,0x02,0x09,0x12,
|
|
|
+ 0x02,(byte)0xe5,0x50,0x09,(byte)0x90,(byte)0x88,0x01,(byte)0xe0,0x44,0x08,(byte)0xf0,(byte)0x80,0x07,(byte)0xe4,(byte)0x90,(byte)0x80,
|
|
|
+ (byte)0xae,(byte)0xf0,(byte)0xa3,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xae,0x12,0x03,0x61,0x12,0x03,0x57,0x12,0x02,0x0f,
|
|
|
+ (byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,0x04,(byte)0xf0,0x02,0x07,0x75,(byte)0x90,(byte)0x80,(byte)0xa8,(byte)0xe0,(byte)0x90,0x42,0x5d,
|
|
|
+ (byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xa9,(byte)0xe0,0x12,0x02,0x4f,0x02,0x15,0x0d,(byte)0x90,(byte)0x80,(byte)0xa7,(byte)0xe0,(byte)0xc3,
|
|
|
+ 0x13,(byte)0xff,0x12,0x0d,0x5c,0x22,(byte)0xbb,0x01,0x0c,(byte)0xe5,(byte)0x82,0x29,(byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0x83,
|
|
|
+ 0x3a,(byte)0xf5,(byte)0x83,(byte)0xe0,0x22,0x50,0x06,(byte)0xe9,0x25,(byte)0x82,(byte)0xf8,(byte)0xe6,0x22,(byte)0xbb,(byte)0xfe,0x06,
|
|
|
+ (byte)0xe9,0x25,(byte)0x82,(byte)0xf8,(byte)0xe2,0x22,(byte)0xe5,(byte)0x82,0x29,(byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0x83,0x3a,(byte)0xf5,(byte)0x83,
|
|
|
+ (byte)0xe4,(byte)0x93,0x22,(byte)0xe8,0x60,0x0f,(byte)0xef,(byte)0xc3,0x33,(byte)0xff,(byte)0xee,0x33,(byte)0xfe,(byte)0xed,0x33,(byte)0xfd,
|
|
|
+ (byte)0xec,0x33,(byte)0xfc,(byte)0xd8,(byte)0xf1,0x22,(byte)0xec,(byte)0xf0,(byte)0xa3,(byte)0xed,(byte)0xf0,(byte)0xa3,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,
|
|
|
+ (byte)0xf0,0x22,(byte)0xa8,(byte)0x82,(byte)0x85,(byte)0x83,(byte)0xf0,(byte)0xd0,(byte)0x83,(byte)0xd0,(byte)0x82,0x12,0x08,(byte)0xf9,0x12,0x08,
|
|
|
+ (byte)0xf9,0x12,0x08,(byte)0xf9,0x12,0x08,(byte)0xf9,(byte)0xe4,0x73,(byte)0xe4,(byte)0x93,(byte)0xa3,(byte)0xc5,(byte)0x83,(byte)0xc5,(byte)0xf0,
|
|
|
+ (byte)0xc5,(byte)0x83,(byte)0xc8,(byte)0xc5,(byte)0x82,(byte)0xc8,(byte)0xf0,(byte)0xa3,(byte)0xc5,(byte)0x83,(byte)0xc5,(byte)0xf0,(byte)0xc5,(byte)0x83,(byte)0xc8,(byte)0xc5,
|
|
|
+ (byte)0x82,(byte)0xc8,0x22,(byte)0xa4,0x25,(byte)0x82,(byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0xf0,0x35,(byte)0x83,(byte)0xf5,(byte)0x83,0x22,(byte)0xef,
|
|
|
+ 0x4e,0x60,0x12,(byte)0xef,0x60,0x01,0x0e,(byte)0xed,(byte)0xbb,0x01,0x0b,(byte)0x89,(byte)0x82,(byte)0x8a,(byte)0x83,(byte)0xf0,
|
|
|
+ (byte)0xa3,(byte)0xdf,(byte)0xfc,(byte)0xde,(byte)0xfa,0x22,(byte)0x89,(byte)0xf0,0x50,0x07,(byte)0xf7,0x09,(byte)0xdf,(byte)0xfc,(byte)0xa9,(byte)0xf0,
|
|
|
+ 0x22,(byte)0xbb,(byte)0xfe,(byte)0xfc,(byte)0xf3,0x09,(byte)0xdf,(byte)0xfc,(byte)0xa9,(byte)0xf0,0x22,(byte)0xbb,0x01,0x06,(byte)0x89,(byte)0x82,
|
|
|
+ (byte)0x8a,(byte)0x83,(byte)0xe0,0x22,0x50,0x02,(byte)0xe7,0x22,(byte)0xbb,(byte)0xfe,0x02,(byte)0xe3,0x22,(byte)0x89,(byte)0x82,(byte)0x8a,
|
|
|
+ (byte)0x83,(byte)0xe4,(byte)0x93,0x22,(byte)0xf8,(byte)0xbb,0x01,0x0d,(byte)0xe5,(byte)0x82,0x29,(byte)0xf5,(byte)0x82,(byte)0xe5,(byte)0x83,0x3a,
|
|
|
+ (byte)0xf5,(byte)0x83,(byte)0xe8,(byte)0xf0,0x22,0x50,0x06,(byte)0xe9,0x25,(byte)0x82,(byte)0xc8,(byte)0xf6,0x22,(byte)0xbb,(byte)0xfe,0x05,
|
|
|
+ (byte)0xe9,0x25,(byte)0x82,(byte)0xc8,(byte)0xf2,0x22,(byte)0x90,0x40,0x13,(byte)0xe0,0x54,(byte)0xfd,(byte)0xf0,(byte)0xe0,0x54,(byte)0xfb,
|
|
|
+ (byte)0xf0,(byte)0x90,0x30,0x10,0x74,0x0f,(byte)0xf0,(byte)0x90,0x30,(byte)0xaa,(byte)0xe0,0x54,(byte)0xf0,0x44,0x07,(byte)0xf0,
|
|
|
+ (byte)0x90,0x42,0x7d,0x74,0x02,(byte)0xf0,(byte)0x90,0x42,(byte)0x82,(byte)0xe4,(byte)0xf0,(byte)0x90,0x32,0x42,(byte)0xf0,(byte)0xa3,
|
|
|
+ (byte)0xf0,(byte)0xa3,0x12,0x08,(byte)0xe2,0x15,0x55,0x55,0x55,(byte)0x90,0x30,0x15,0x74,0x01,(byte)0xf0,(byte)0x90,
|
|
|
+ 0x30,0x13,0x74,0x07,(byte)0xf0,(byte)0x90,0x30,0x0c,0x74,0x03,(byte)0xf0,(byte)0x90,0x42,0x5f,0x74,0x01,
|
|
|
+ (byte)0xf0,(byte)0x90,0x30,(byte)0xab,(byte)0xe0,0x44,0x40,(byte)0xf0,(byte)0x90,0x30,0x06,0x74,0x0f,(byte)0xf0,(byte)0x90,0x30,
|
|
|
+ 0x0b,(byte)0xe0,0x54,(byte)0xf0,(byte)0xf0,(byte)0x90,0x30,0x1b,0x74,0x04,(byte)0xf0,(byte)0x90,0x30,0x11,0x74,0x1d,
|
|
|
+ 0x12,0x16,0x7f,(byte)0x90,0x42,0x56,(byte)0xe4,(byte)0xf0,(byte)0x90,0x42,0x5a,(byte)0xf0,(byte)0x90,0x42,0x62,0x74,
|
|
|
+ 0x04,(byte)0xf0,(byte)0x90,0x42,0x77,0x74,0x2b,(byte)0xf0,(byte)0x90,0x30,0x1c,(byte)0xe4,(byte)0xf0,(byte)0x90,0x60,0x2f,
|
|
|
+ (byte)0xe0,0x54,(byte)0xc7,0x44,0x08,(byte)0xf0,(byte)0xe0,0x54,(byte)0xf8,(byte)0xf0,(byte)0x90,0x37,0x33,(byte)0xe0,0x54,(byte)0xdf,
|
|
|
+ (byte)0xf0,(byte)0x90,0x42,0x5b,(byte)0xe4,(byte)0xf0,(byte)0x90,0x42,0x60,(byte)0xf0,(byte)0xa3,(byte)0xf0,(byte)0x90,0x42,0x5e,0x04,
|
|
|
+ (byte)0xf0,(byte)0x90,0x42,0x7a,(byte)0xf0,(byte)0x90,0x42,0x79,(byte)0xf0,(byte)0x90,0x42,0x7f,(byte)0xe4,(byte)0xf0,(byte)0x90,0x42,
|
|
|
+ 0x7e,0x04,(byte)0xf0,(byte)0x90,0x42,(byte)0x80,(byte)0xe0,0x54,(byte)0xdf,(byte)0xf0,(byte)0x90,0x37,0x33,(byte)0xe0,0x54,(byte)0xfb,
|
|
|
+ (byte)0xf0,(byte)0xe0,0x44,0x01,(byte)0xf0,(byte)0xe0,0x44,0x02,(byte)0xf0,0x7f,(byte)0xfa,0x12,0x16,0x31,0x7f,0x08,
|
|
|
+ 0x12,0x10,0x4f,0x7f,0x0b,0x12,0x0f,0x3c,(byte)0x90,0x30,0x22,(byte)0xe4,(byte)0xf0,(byte)0x90,0x40,0x48,
|
|
|
+ 0x04,(byte)0xf0,0x22,(byte)0x90,0x42,0x5d,(byte)0xe0,(byte)0x90,(byte)0x80,(byte)0xa8,(byte)0xf0,(byte)0x90,0x42,0x62,(byte)0xe0,(byte)0x90,
|
|
|
+ (byte)0x80,(byte)0xa9,(byte)0xf0,0x12,0x0e,0x67,(byte)0xc2,0x0a,0x12,0x15,0x39,(byte)0x90,0x42,0x7d,0x74,0x01,
|
|
|
+ (byte)0xf0,(byte)0xe4,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,(byte)0xff,(byte)0xc3,(byte)0x94,0x2a,0x40,0x03,
|
|
|
+ 0x02,0x0b,0x2c,(byte)0xef,0x12,0x03,0x4d,0x12,0x02,(byte)0x83,(byte)0xef,0x12,0x02,0x40,(byte)0xe0,0x60,
|
|
|
+ 0x72,(byte)0xc2,0x0a,(byte)0x8f,0x11,0x12,0x16,0x5c,(byte)0x90,(byte)0x80,(byte)0xa7,(byte)0xef,(byte)0xf0,(byte)0x90,0x42,(byte)0x81,
|
|
|
+ (byte)0xe0,0x54,0x3f,(byte)0xf0,0x12,0x0b,0x3e,(byte)0x90,(byte)0x80,(byte)0xaa,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,0x7f,(byte)0xff,
|
|
|
+ 0x12,0x14,(byte)0xb5,0x7f,(byte)0xff,0x12,0x14,(byte)0xe1,(byte)0x90,(byte)0x80,(byte)0xa7,(byte)0xe0,(byte)0xff,0x12,0x0b,0x3e,
|
|
|
+ (byte)0x90,(byte)0x80,(byte)0xac,(byte)0xf0,(byte)0xfc,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0xfd,(byte)0x90,(byte)0x80,(byte)0xaa,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,
|
|
|
+ (byte)0xff,0x12,0x14,0x2a,(byte)0x90,(byte)0x80,(byte)0xae,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,0x12,0x02,(byte)0xe5,0x50,
|
|
|
+ 0x09,(byte)0x90,(byte)0x88,0x01,(byte)0xe0,0x44,0x08,(byte)0xf0,(byte)0x80,0x07,(byte)0xe4,(byte)0x90,(byte)0x80,(byte)0xae,(byte)0xf0,(byte)0xa3,
|
|
|
+ (byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xae,(byte)0xe0,(byte)0xfe,(byte)0xa3,(byte)0xe0,(byte)0xff,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,0x12,0x03,0x4d,
|
|
|
+ 0x12,0x02,0x0f,(byte)0x90,(byte)0x80,(byte)0xa6,(byte)0xe0,0x04,(byte)0xf0,0x02,0x0a,(byte)0x96,(byte)0x90,(byte)0x80,(byte)0xa8,(byte)0xe0,
|
|
|
+ (byte)0x90,0x42,0x5d,(byte)0xf0,(byte)0x90,(byte)0x80,(byte)0xa9,(byte)0xe0,0x12,0x02,0x4f,0x02,0x15,0x0d,0x12,0x0d,
|
|
|
+ 0x5c,(byte)0xef,0x24,0x3c,(byte)0xff,(byte)0xe4,0x3e,0x22,0x7e,0x00,0x7f,0x3c,0x7d,0x00,(byte)0xaa,0x11,
|
|
|
+ (byte)0xa9,0x12,0x7b,0x01,0x12,0x09,0x1f,(byte)0xe4,(byte)0xf5,0x14,0x74,0x31,0x25,0x14,0x12,0x02,
|
|
|
+ 0x76,(byte)0xe0,0x70,0x03,0x02,0x0b,(byte)0xeb,0x20,0x0a,0x06,(byte)0xe5,0x13,0x65,0x14,0x60,0x7b,
|
|
|
+ 0x20,0x0a,0x0c,(byte)0xe5,0x14,(byte)0xc3,(byte)0x95,0x13,0x50,0x05,(byte)0xe5,0x14,0x30,(byte)0xe0,0x6c,0x20,
|
|
|
+ 0x0a,0x1c,(byte)0x90,(byte)0x88,0x5e,(byte)0xe0,0x30,(byte)0xe0,0x15,(byte)0xe5,0x13,0x54,(byte)0xfe,(byte)0xff,(byte)0xe5,0x14,
|
|
|
+ 0x54,(byte)0xfe,0x6f,(byte)0x90,0x42,(byte)0x83,0x70,0x03,(byte)0xf0,(byte)0x80,0x03,0x74,0x01,(byte)0xf0,(byte)0xaf,0x14,
|
|
|
+ 0x12,0x12,(byte)0x9e,0x7d,0x01,0x12,0x0f,(byte)0xf5,(byte)0x85,0x12,(byte)0x82,(byte)0x85,0x11,(byte)0x83,0x75,(byte)0xf0,
|
|
|
+ 0x02,(byte)0xe5,0x14,0x12,0x09,0x13,(byte)0xee,(byte)0xf0,(byte)0xef,0x12,0x02,0x6b,(byte)0x9f,(byte)0x90,(byte)0x88,0x04,
|
|
|
+ (byte)0xe0,(byte)0x9e,0x50,0x16,(byte)0xd2,0x08,(byte)0x90,(byte)0x88,0x01,(byte)0xe0,(byte)0xff,0x30,0x0a,0x04,0x7e,0x04,
|
|
|
+ (byte)0x80,0x02,0x7e,0x02,(byte)0xef,0x4e,(byte)0x90,(byte)0x88,0x01,(byte)0xf0,(byte)0x90,0x42,0x7d,(byte)0xe0,0x54,(byte)0xfd,
|
|
|
+ (byte)0xf0,(byte)0x90,0x32,0x44,0x12,0x08,(byte)0xe2,0x00,0x00,0x00,0x00,0x05,0x14,(byte)0xe5,0x14,(byte)0xc3,
|
|
|
+ (byte)0x94,0x1e,0x50,0x03,0x02,0x0b,0x5a,(byte)0x90,(byte)0x88,0x5e,(byte)0xe0,0x30,(byte)0xe0,0x05,(byte)0x90,0x42,
|
|
|
+ (byte)0x83,(byte)0xe4,(byte)0xf0,0x22,(byte)0x90,0x41,0x07,(byte)0xe4,(byte)0xf0,(byte)0x90,0x41,0x06,0x74,0x06,(byte)0xf0,(byte)0x90,
|
|
|
+ 0x41,0x05,(byte)0xe4,(byte)0xf0,(byte)0x90,0x41,0x04,0x74,0x0f,(byte)0xf0,(byte)0x90,0x42,0x0b,0x74,0x05,(byte)0xf0,
|
|
|
+ (byte)0x90,0x42,0x0a,(byte)0xe0,0x44,0x02,(byte)0xf0,(byte)0xe0,0x44,0x01,(byte)0xf0,(byte)0xa3,0x74,0x08,(byte)0xf0,(byte)0x90,
|
|
|
+ 0x42,0x0a,(byte)0xe0,0x44,0x02,(byte)0xf0,(byte)0x90,0x41,0x09,0x74,0x03,(byte)0xf0,(byte)0x90,0x42,0x02,(byte)0xe0,
|
|
|
+ 0x44,0x02,(byte)0xf0,(byte)0x90,0x42,0x0e,(byte)0xe0,0x44,0x02,(byte)0xf0,(byte)0x90,0x42,0x06,(byte)0xe0,0x54,(byte)0xfd,
|
|
|
+ (byte)0xf0,0x12,0x03,0x18,(byte)0x90,0x42,0x03,(byte)0xf0,(byte)0x90,0x42,0x07,(byte)0xf0,(byte)0x90,0x42,0x0f,(byte)0xf0,
|
|
|
+ (byte)0x90,(byte)0x80,(byte)0xb3,0x74,0x01,(byte)0xf0,(byte)0xfb,0x7a,(byte)0x80,0x79,(byte)0xb3,(byte)0xf5,0x17,0x7f,0x03,0x12,
|
|
|
+ 0x11,(byte)0x94,(byte)0xe4,(byte)0x90,(byte)0x80,(byte)0xb3,(byte)0xf0,0x12,0x02,0x1d,0x75,0x17,0x01,0x7f,0x04,0x12,
|
|
|
+ 0x11,(byte)0x94,(byte)0xe4,(byte)0x90,(byte)0x80,(byte)0xb3,(byte)0xf0,0x12,0x02,0x1d,0x75,0x17,0x01,0x7f,0x05,0x12,
|
|
|
+ 0x11,(byte)0x94,(byte)0x90,(byte)0x80,(byte)0xb3,0x74,0x60,(byte)0xf0,0x12,0x02,0x1d,0x75,0x17,0x01,0x7f,0x19,
|
|
|
+ 0x12,0x11,(byte)0x94,0x12,0x02,0x17,0x12,0x09,0x1f,0x12,0x02,0x1d,0x75,0x17,0x06,0x7f,
|
|
|
+ 0x13,0x12,0x11,(byte)0x94,0x02,0x15,(byte)0x84,(byte)0xc2,(byte)0xaf,0x12,0x16,(byte)0xa5,0x78,(byte)0xff,(byte)0xe4,(byte)0xf6,
|
|
|
+ (byte)0xd8,(byte)0xfd,(byte)0x90,(byte)0x80,0x00,0x7f,0x00,0x7e,0x50,(byte)0xe4,(byte)0xf0,(byte)0xa3,(byte)0xdf,(byte)0xfc,(byte)0xde,(byte)0xfa,
|
|
|
+ 0x75,(byte)0xa0,(byte)0xbe,0x75,(byte)0x89,0x00,0x75,(byte)0x81,(byte)0xff,0x02,0x0d,0x17,0x02,0x06,0x0e,(byte)0xe4,
|
|
|
+ (byte)0x93,(byte)0xa3,(byte)0xf8,(byte)0xe4,(byte)0x93,(byte)0xa3,0x40,0x03,(byte)0xf6,(byte)0x80,0x01,(byte)0xf2,0x08,(byte)0xdf,(byte)0xf4,(byte)0x80,
|
|
|
+ 0x29,(byte)0xe4,(byte)0x93,(byte)0xa3,(byte)0xf8,0x54,0x07,0x24,0x0c,(byte)0xc8,(byte)0xc3,0x33,(byte)0xc4,0x54,0x0f,0x44,
|
|
|
+ 0x20,(byte)0xc8,(byte)0x83,0x40,0x04,(byte)0xf4,0x56,(byte)0x80,0x01,0x46,(byte)0xf6,(byte)0xdf,(byte)0xe4,(byte)0x80,0x0b,0x01,
|
|
|
+ 0x02,0x04,0x08,0x10,0x20,0x40,(byte)0x80,(byte)0x90,0x16,0x6e,(byte)0xe4,0x7e,0x01,(byte)0x93,0x60,(byte)0xbc,
|
|
|
+ (byte)0xa3,(byte)0xff,0x54,0x3f,0x30,(byte)0xe5,0x09,0x54,0x1f,(byte)0xfe,(byte)0xe4,(byte)0x93,(byte)0xa3,0x60,0x01,0x0e,
|
|
|
+ (byte)0xcf,0x54,(byte)0xc0,0x25,(byte)0xe0,0x60,(byte)0xa8,0x40,(byte)0xb8,(byte)0xe4,(byte)0x93,(byte)0xa3,(byte)0xfa,(byte)0xe4,(byte)0x93,(byte)0xa3,
|
|
|
+ (byte)0xf8,(byte)0xe4,(byte)0x93,(byte)0xa3,(byte)0xc8,(byte)0xc5,(byte)0x82,(byte)0xc8,(byte)0xca,(byte)0xc5,(byte)0x83,(byte)0xca,(byte)0xf0,(byte)0xa3,(byte)0xc8,(byte)0xc5,
|
|
|
+ (byte)0x82,(byte)0xc8,(byte)0xca,(byte)0xc5,(byte)0x83,(byte)0xca,(byte)0xdf,(byte)0xe9,(byte)0xde,(byte)0xe7,(byte)0x80,(byte)0xbe,(byte)0xef,0x54,0x0f,(byte)0xff,
|
|
|
+ (byte)0x90,0x30,0x38,(byte)0xe0,0x54,(byte)0xf0,0x4f,(byte)0xf0,(byte)0xa3,0x74,0x01,(byte)0xf0,(byte)0x90,0x30,0x18,0x74,
|
|
|
+ (byte)0xc0,(byte)0xf0,(byte)0xa3,(byte)0xe4,(byte)0xf0,(byte)0x90,(byte)0x80,0x30,0x04,(byte)0xf0,(byte)0x90,(byte)0x88,0x06,(byte)0xe0,(byte)0xfe,(byte)0xa3,
|
|
|
+ (byte)0xe0,(byte)0xff,0x12,0x15,0x60,(byte)0x90,0x30,0x03,(byte)0xe4,(byte)0xf0,0x30,(byte)0xff,(byte)0xfd,(byte)0x90,0x30,0x03,
|
|
|
+ 0x74,0x01,(byte)0xf0,0x7f,(byte)0x96,0x12,0x16,0x31,(byte)0xe4,(byte)0xf5,0x1b,(byte)0xf5,0x1c,(byte)0xfd,0x7c,(byte)0xc0,
|
|
|
+ 0x7b,(byte)0xc8,(byte)0xfa,(byte)0xeb,0x25,(byte)0xe0,(byte)0xff,(byte)0xea,0x33,(byte)0xfe,(byte)0xed,0x2f,(byte)0xf5,(byte)0x82,(byte)0xec,0x3e,
|
|
|
+ (byte)0xf5,(byte)0x83,(byte)0xe0,(byte)0xa2,(byte)0xe7,0x13,(byte)0xfe,(byte)0xa3,(byte)0xe0,0x13,0x25,0x1c,(byte)0xf5,0x1c,(byte)0xee,0x35,
|
|
|
+ 0x1b,(byte)0xf5,0x1b,0x0b,(byte)0xbb,0x00,0x01,0x0a,(byte)0xba,0x01,(byte)0xd8,(byte)0xbb,0x08,(byte)0xd5,(byte)0xe5,0x1c,
|
|
|
+ (byte)0xae,0x1b,0x78,0x05,(byte)0xce,(byte)0xa2,(byte)0xe7,0x13,(byte)0xce,0x13,(byte)0xd8,(byte)0xf8,(byte)0xf5,0x1c,(byte)0x8e,0x1b,
|
|
|
+ (byte)0xff,0x22,(byte)0xe4,(byte)0xfe,(byte)0xfd,(byte)0xfc,0x12,0x02,(byte)0x93,(byte)0xe0,0x2d,(byte)0xfd,0x0c,(byte)0xbc,0x2a,(byte)0xf6,
|
|
|
+ (byte)0xe4,(byte)0xfc,0x12,0x02,(byte)0x9e,(byte)0xe0,0x2d,(byte)0xfd,0x0c,(byte)0xbc,0x1e,(byte)0xf6,(byte)0xed,0x70,0x02,0x7e,
|
|
|
+ 0x01,(byte)0x90,(byte)0x88,0x50,(byte)0xe0,0x2d,0x60,0x02,0x7e,0x01,(byte)0xee,0x60,0x16,(byte)0xe4,(byte)0xfc,0x12,
|
|
|
+ 0x02,(byte)0x93,(byte)0xec,(byte)0xf0,0x0c,(byte)0xbc,0x2a,(byte)0xf7,(byte)0xe4,(byte)0xfc,0x12,0x02,(byte)0x9e,(byte)0xec,(byte)0xf0,0x0c,
|
|
|
+ (byte)0xbc,0x1e,(byte)0xf7,0x7c,0x2a,(byte)0x90,(byte)0x80,0x4f,(byte)0xe4,(byte)0xf0,(byte)0xa3,(byte)0xdc,(byte)0xfc,0x7c,0x1e,(byte)0x90,
|
|
|
+ (byte)0x80,0x31,(byte)0xe4,(byte)0xf0,(byte)0xa3,(byte)0xdc,(byte)0xfc,(byte)0xe4,(byte)0xfc,0x12,0x02,(byte)0x93,(byte)0xe0,(byte)0xff,(byte)0xc3,(byte)0x94,
|
|
|
+ 0x2a,0x50,0x09,0x74,0x4f,0x2f,0x12,0x02,0x47,0x74,0x01,(byte)0xf0,0x0c,(byte)0xbc,0x2a,(byte)0xe9,
|
|
|
+ (byte)0xe4,(byte)0xfc,0x12,0x02,(byte)0x9e,(byte)0xe0,(byte)0xff,(byte)0xc3,(byte)0x94,0x1e,0x50,0x06,0x12,0x02,0x73,0x74,
|
|
|
+ 0x01,(byte)0xf0,0x0c,(byte)0xbc,0x1e,(byte)0xec,0x22,(byte)0x90,0x42,0x56,(byte)0xe4,(byte)0xf0,(byte)0x90,0x42,0x5a,(byte)0xf0,
|
|
|
+ (byte)0x90,0x42,0x60,(byte)0xf0,(byte)0xa3,(byte)0xf0,(byte)0x90,0x42,0x5d,0x74,0x03,(byte)0xf0,(byte)0x90,0x42,0x62,0x04,
|
|
|
+ (byte)0xf0,(byte)0x90,0x30,0x16,(byte)0xe4,(byte)0xf0,(byte)0xa3,0x74,0x75,(byte)0xf0,(byte)0x90,0x30,0x09,0x74,0x06,(byte)0xf0,
|
|
|
+ (byte)0x90,0x42,0x7d,0x74,0x01,(byte)0xf0,(byte)0x90,0x30,0x1f,(byte)0xe0,0x44,0x01,(byte)0xf0,(byte)0x90,0x37,0x33,
|
|
|
+ (byte)0xe0,0x44,0x04,(byte)0xf0,(byte)0x90,0x30,0x1e,0x74,0x05,(byte)0xf0,(byte)0x90,0x32,0x42,(byte)0xe4,(byte)0xf0,(byte)0xa3,
|
|
|
+ (byte)0xf0,(byte)0xa3,0x12,0x08,(byte)0xe2,0x00,0x00,0x00,0x00,(byte)0x90,0x42,(byte)0x82,(byte)0xe4,(byte)0xf0,(byte)0x90,0x42,
|
|
|
+ 0x5f,0x04,(byte)0xf0,(byte)0x90,0x42,(byte)0x81,(byte)0xe0,0x44,0x01,(byte)0xf0,0x7f,(byte)0xff,0x12,0x14,(byte)0xb5,0x7f,
|
|
|
+ (byte)0xff,0x02,0x14,(byte)0xe1,(byte)0xcb,(byte)0xef,(byte)0xcb,(byte)0xca,(byte)0xee,(byte)0xca,(byte)0xe4,(byte)0xf5,0x3b,(byte)0xf5,0x3a,(byte)0xf5,
|
|
|
+ 0x39,(byte)0xf5,0x38,(byte)0x8b,(byte)0x82,(byte)0x8a,(byte)0x83,(byte)0xe4,(byte)0x93,(byte)0xff,0x60,0x47,(byte)0xc3,(byte)0x94,0x30,0x40,
|
|
|
+ 0x3b,(byte)0xef,(byte)0xd3,(byte)0x94,0x39,0x50,0x35,(byte)0xaf,0x3b,(byte)0xae,0x3a,(byte)0xad,0x39,(byte)0xac,0x38,0x78,
|
|
|
+ 0x04,0x12,0x08,(byte)0xc3,(byte)0x8f,0x3b,(byte)0x8e,0x3a,(byte)0x8d,0x39,(byte)0x8c,0x38,(byte)0xe4,(byte)0x93,0x24,(byte)0xd0,
|
|
|
+ (byte)0xff,(byte)0xe4,0x34,(byte)0xff,(byte)0xfe,(byte)0xe4,(byte)0xfc,(byte)0xfd,(byte)0xe5,0x3b,0x2f,(byte)0xf5,0x3b,(byte)0xe5,0x3a,0x3e,
|
|
|
+ (byte)0xf5,0x3a,(byte)0xed,0x35,0x39,(byte)0xf5,0x39,(byte)0xec,0x35,0x38,(byte)0xf5,0x38,0x0b,(byte)0xbb,0x00,0x01,
|
|
|
+ 0x0a,(byte)0x80,(byte)0xb0,(byte)0xaf,0x3b,(byte)0xae,0x3a,(byte)0xad,0x39,(byte)0xac,0x38,0x22,(byte)0xef,(byte)0xb4,0x0c,0x00,
|
|
|
+ 0x50,0x4b,(byte)0x90,0x0f,0x49,(byte)0xf8,0x28,0x28,0x73,0x02,0x0f,0x6d,0x02,0x0f,0x6d,0x02,
|
|
|
+ 0x0f,0x6d,0x02,0x0f,0x6d,0x02,0x0f,0x6d,0x02,0x0f,0x6d,0x02,0x0f,0x6d,0x02,0x0f,
|
|
|
+ 0x73,0x02,0x0f,0x79,0x02,0x0f,0x7f,0x02,0x0f,(byte)0x85,0x02,0x0f,(byte)0x8b,0x7c,0x0f,0x7d,
|
|
|
+ (byte)0xe0,(byte)0x80,0x1e,0x7c,0x07,0x7d,(byte)0xf0,(byte)0x80,0x18,0x7c,0x07,0x7d,(byte)0xf8,(byte)0x80,0x12,0x7c,
|
|
|
+ 0x07,0x7d,(byte)0xfc,(byte)0x80,0x0c,0x7c,0x07,0x7d,(byte)0xfe,(byte)0x80,0x06,(byte)0x80,0x00,0x7c,0x07,0x7d,
|
|
|
+ (byte)0xff,(byte)0x90,0x37,0x26,(byte)0xec,(byte)0xf0,(byte)0xa3,(byte)0xed,(byte)0xf0,0x22,0x47,0x54,0x39,0x30,0x30,0x36,
|
|
|
+ 0x40,0x42,0x35,0x2d,0x41,0x70,0x72,0x20,0x30,0x36,0x20,0x32,0x30,0x31,0x37,0x2d,
|
|
|
+ 0x31,0x37,0x3a,0x35,0x39,0x3a,0x31,0x36,0x00,0x30,0x34,0x2f,0x30,0x36,0x2f,0x31,
|
|
|
+ 0x37,0x00,0x31,0x37,0x3a,0x35,0x39,0x3a,0x31,0x36,0x00,0x00,0x01,0x02,0x03,0x04,
|
|
|
+ 0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,
|
|
|
+ 0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,
|
|
|
+ 0x25,0x26,0x27,0x28,0x29,(byte)0x8f,0x15,(byte)0x8d,0x16,(byte)0xe4,(byte)0xf5,0x17,(byte)0xf5,0x18,(byte)0xf5,0x19,
|
|
|
+ (byte)0xf5,0x1a,0x12,0x0d,0x5c,(byte)0x8e,0x17,(byte)0x8f,0x18,(byte)0xe5,0x16,0x60,0x0f,(byte)0x90,0x30,0x1e,
|
|
|
+ 0x74,(byte)0x86,(byte)0xf0,(byte)0xaf,0x15,0x12,0x0d,0x5c,(byte)0x8e,0x19,(byte)0x8f,0x1a,(byte)0xd3,(byte)0xe5,0x18,(byte)0x95,
|
|
|
+ 0x1a,(byte)0xe5,0x19,0x64,(byte)0x80,(byte)0xf8,(byte)0xe5,0x17,0x64,(byte)0x80,(byte)0x98,0x40,0x0c,(byte)0xe5,0x18,(byte)0x95,
|
|
|
+ 0x1a,(byte)0xff,(byte)0xe5,0x17,(byte)0x95,0x19,(byte)0xfe,(byte)0x80,0x0b,(byte)0xc3,(byte)0xe5,0x1a,(byte)0x95,0x18,(byte)0xff,(byte)0xe5,
|
|
|
+ 0x19,(byte)0x95,0x17,(byte)0xfe,(byte)0x8e,0x17,(byte)0x8f,0x18,(byte)0x90,0x30,0x1e,0x74,0x05,(byte)0xf0,0x22,(byte)0xef,
|
|
|
+ (byte)0xb4,0x09,0x00,0x50,0x46,(byte)0x90,0x10,0x5c,(byte)0xf8,0x28,0x28,0x73,0x02,0x10,0x77,0x02,
|
|
|
+ 0x10,0x77,0x02,0x10,0x77,0x02,0x10,0x77,0x02,0x10,0x7d,0x02,0x10,(byte)0x83,0x02,0x10,
|
|
|
+ (byte)0x89,0x02,0x10,(byte)0x8f,0x02,0x10,(byte)0x95,0x7c,0x00,0x7d,(byte)0xe0,(byte)0x80,0x22,0x7c,0x00,0x7d,
|
|
|
+ (byte)0xf0,(byte)0x80,0x1c,0x7c,0x00,0x7d,(byte)0xf8,(byte)0x80,0x16,0x7c,0x00,0x7d,(byte)0xfc,(byte)0x80,0x10,0x7c,
|
|
|
+ 0x00,0x7d,(byte)0xfe,(byte)0x80,0x0a,0x7c,0x00,0x7d,(byte)0xff,(byte)0x80,0x04,0x7c,0x0f,0x7d,(byte)0xff,(byte)0x90,
|
|
|
+ 0x37,0x24,(byte)0xec,(byte)0xf0,(byte)0xa3,(byte)0xed,(byte)0xf0,0x22,(byte)0x8b,0x22,(byte)0x8a,0x23,(byte)0x89,0x24,(byte)0xe4,(byte)0xf5,
|
|
|
+ 0x2a,(byte)0xf5,0x2b,(byte)0xe5,0x29,0x15,0x29,(byte)0xae,0x28,0x70,0x02,0x15,0x28,0x4e,0x60,0x33,
|
|
|
+ (byte)0xab,0x25,(byte)0xaa,0x26,(byte)0xa9,0x27,0x12,0x09,0x4b,(byte)0xff,(byte)0xab,0x22,(byte)0xaa,0x23,(byte)0xa9,0x24,
|
|
|
+ 0x05,0x2b,(byte)0xe5,0x2b,(byte)0xac,0x2a,0x70,0x02,0x05,0x2a,0x14,(byte)0xf5,(byte)0x82,(byte)0x8c,(byte)0x83,(byte)0xef,
|
|
|
+ 0x12,0x09,0x64,(byte)0xef,0x60,(byte)0xcd,0x74,0x01,0x25,0x27,(byte)0xf5,0x27,(byte)0xe4,0x35,0x26,(byte)0xf5,
|
|
|
+ 0x26,(byte)0x80,(byte)0xc0,(byte)0xab,0x22,(byte)0xaa,0x23,(byte)0xa9,0x24,0x22,(byte)0x8e,0x08,(byte)0x8f,0x09,(byte)0x8c,0x0a,
|
|
|
+ (byte)0x8d,0x0b,(byte)0xd2,(byte)0xb5,(byte)0xc2,(byte)0xb2,(byte)0xc2,(byte)0xb1,0x7f,0x3b,0x12,0x16,(byte)0x8c,(byte)0xe4,(byte)0xff,0x12,
|
|
|
+ 0x16,(byte)0x8c,(byte)0xaf,0x08,0x12,0x16,(byte)0x8c,(byte)0xaf,0x09,0x12,0x16,(byte)0x8c,0x7f,0x08,(byte)0xd2,(byte)0xb0,
|
|
|
+ (byte)0xc2,(byte)0xb0,(byte)0xdf,(byte)0xfa,(byte)0xc2,(byte)0xb5,(byte)0x85,0x0b,(byte)0x82,(byte)0x85,0x0a,(byte)0x83,0x7e,(byte)0x80,0x7f,0x04,
|
|
|
+ (byte)0xd2,(byte)0xb0,(byte)0xa2,(byte)0xb4,0x33,(byte)0xa2,(byte)0xb7,0x33,(byte)0xc2,(byte)0xb0,(byte)0xdf,(byte)0xf4,0x12,0x16,(byte)0xd5,(byte)0xde,
|
|
|
+ (byte)0xed,(byte)0xdb,(byte)0xe9,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,0x22,(byte)0x8f,0x1d,(byte)0x8d,0x1e,(byte)0x90,0x42,0x0e,(byte)0xe0,
|
|
|
+ 0x54,(byte)0xfe,(byte)0xf0,(byte)0xe4,(byte)0xf5,0x1f,(byte)0xe5,0x1f,(byte)0xc3,(byte)0x95,0x1e,0x50,0x36,0x7f,(byte)0xe1,0x12,
|
|
|
+ 0x13,0x25,(byte)0xe5,0x1d,0x25,0x1f,(byte)0xff,0x12,0x13,0x25,0x12,0x02,0x2b,0x12,0x13,(byte)0x92,
|
|
|
+ 0x74,(byte)0xb2,0x25,0x1f,(byte)0xf5,(byte)0x82,(byte)0xe4,0x34,(byte)0x80,(byte)0xf5,(byte)0x83,(byte)0xef,(byte)0xf0,0x12,0x02,0x5a,
|
|
|
+ 0x12,0x16,0x31,(byte)0x90,0x42,0x02,0x12,0x02,0x5d,0x12,0x16,0x31,0x12,0x02,0x24,0x05,
|
|
|
+ 0x1f,(byte)0x80,(byte)0xc3,0x22,(byte)0x8b,0x14,(byte)0x8a,0x15,(byte)0x89,0x16,(byte)0xcd,(byte)0xef,(byte)0xcd,0x12,0x13,0x1c,
|
|
|
+ (byte)0xcf,(byte)0xed,(byte)0xcf,0x12,0x13,0x25,(byte)0xe4,(byte)0xfd,(byte)0xed,(byte)0xc3,(byte)0x95,0x17,0x50,0x15,(byte)0xab,0x14,
|
|
|
+ (byte)0xaa,0x15,(byte)0xa9,0x16,(byte)0x8d,(byte)0x82,0x75,(byte)0x83,0x00,0x12,0x08,(byte)0x96,(byte)0xff,0x12,0x13,0x25,
|
|
|
+ 0x0d,(byte)0x80,(byte)0xe5,0x12,0x02,0x2b,0x12,0x02,0x5a,0x12,0x16,0x31,(byte)0x90,0x42,0x02,0x12,
|
|
|
+ 0x02,0x5d,0x12,0x16,0x31,0x12,0x02,0x24,0x22,(byte)0xe4,(byte)0xf5,0x11,(byte)0xf5,0x12,(byte)0x8e,0x13,
|
|
|
+ (byte)0x8f,0x14,(byte)0x8f,(byte)0x82,(byte)0x8e,(byte)0x83,(byte)0xe5,(byte)0x82,0x24,(byte)0x93,0x12,0x02,0x7e,(byte)0xfd,0x05,0x14,
|
|
|
+ (byte)0xe5,0x14,(byte)0xaa,0x13,0x70,0x02,0x05,0x13,0x14,(byte)0xf5,(byte)0x82,(byte)0x8a,(byte)0x83,(byte)0xe0,0x25,0x12,
|
|
|
+ (byte)0xf5,0x12,(byte)0xe4,0x35,0x11,(byte)0xf5,0x11,0x0d,(byte)0xbd,(byte)0x95,(byte)0xe3,(byte)0xc3,(byte)0xe4,(byte)0x95,0x12,(byte)0xfd,
|
|
|
+ (byte)0xe4,(byte)0x95,0x11,(byte)0xfc,(byte)0xef,0x24,(byte)0x93,0x12,0x03,0x2c,0x22,(byte)0xe4,(byte)0xf5,0x0d,(byte)0xf5,0x0e,
|
|
|
+ (byte)0x8e,0x0f,(byte)0x8f,0x10,(byte)0x8f,(byte)0x82,(byte)0x8e,(byte)0x83,(byte)0xe5,(byte)0x82,0x24,0x3f,0x12,0x02,0x7e,(byte)0xfd,
|
|
|
+ 0x05,0x10,(byte)0xe5,0x10,(byte)0xaa,0x0f,0x70,0x02,0x05,0x0f,0x14,(byte)0xf5,(byte)0x82,(byte)0x8a,(byte)0x83,(byte)0xe0,
|
|
|
+ 0x25,0x0e,(byte)0xf5,0x0e,(byte)0xe4,0x35,0x0d,(byte)0xf5,0x0d,0x0d,(byte)0xbd,0x41,(byte)0xe3,(byte)0xc3,(byte)0xe4,(byte)0x95,
|
|
|
+ 0x0e,(byte)0xfd,(byte)0xe4,(byte)0x95,0x0d,(byte)0xfc,(byte)0xef,0x24,0x3f,0x12,0x03,0x2c,0x22,(byte)0x8e,0x08,(byte)0x8f,
|
|
|
+ 0x09,(byte)0x8c,0x0a,(byte)0x8d,0x0b,(byte)0xd2,(byte)0xb5,(byte)0xc2,(byte)0xb2,(byte)0xc2,(byte)0xb1,0x7f,0x03,0x12,0x16,(byte)0x8c,
|
|
|
+ (byte)0xe4,(byte)0xff,0x12,0x16,(byte)0x8c,(byte)0xaf,0x08,0x12,0x16,(byte)0x8c,(byte)0xaf,0x09,0x12,0x16,(byte)0x8c,(byte)0x85,
|
|
|
+ 0x0b,(byte)0x82,(byte)0x85,0x0a,(byte)0x83,0x7f,(byte)0x80,0x7e,0x08,(byte)0xd2,(byte)0xb0,(byte)0xa2,(byte)0xb4,0x33,(byte)0xc2,(byte)0xb0,
|
|
|
+ (byte)0xde,(byte)0xf7,0x12,0x16,(byte)0xd5,(byte)0xdf,(byte)0xf0,(byte)0xdb,(byte)0xec,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,0x22,(byte)0x8f,0x15,
|
|
|
+ (byte)0xe5,0x15,0x30,(byte)0xe0,0x07,(byte)0x90,0x42,0x7d,(byte)0xe0,0x44,0x02,(byte)0xf0,(byte)0x90,0x32,0x44,(byte)0xc0,
|
|
|
+ (byte)0x83,(byte)0xc0,(byte)0x82,0x12,0x03,0x0b,(byte)0xc0,(byte)0xe0,(byte)0xe9,(byte)0xc0,(byte)0xe0,(byte)0xe4,0x7f,0x01,(byte)0xfe,(byte)0xfd,
|
|
|
+ (byte)0xfc,(byte)0xa9,0x15,(byte)0xc8,(byte)0xe9,(byte)0xc8,0x12,0x08,(byte)0xc3,(byte)0xd0,(byte)0xe0,(byte)0xf9,(byte)0xd0,(byte)0xe0,0x12,0x02,
|
|
|
+ (byte)0xf5,(byte)0xd0,(byte)0x82,(byte)0xd0,(byte)0x83,0x12,0x08,(byte)0xd6,(byte)0xe5,0x15,(byte)0xc3,0x13,(byte)0xff,0x22,(byte)0x8e,0x08,
|
|
|
+ (byte)0x8f,0x09,(byte)0x8c,0x0a,(byte)0x8d,0x0b,(byte)0xd2,(byte)0xb5,(byte)0xc2,(byte)0xb2,0x12,0x16,(byte)0xb1,(byte)0xc2,(byte)0xb1,0x7f,
|
|
|
+ 0x02,0x12,0x16,(byte)0x8c,(byte)0xe4,(byte)0xff,0x12,0x16,(byte)0x8c,(byte)0xaf,0x0a,0x12,0x16,(byte)0x8c,(byte)0xaf,0x0b,
|
|
|
+ 0x12,0x16,(byte)0x8c,(byte)0x85,0x09,(byte)0x82,(byte)0x85,0x08,(byte)0x83,(byte)0xe0,(byte)0xa3,(byte)0xff,0x12,0x16,(byte)0x8c,(byte)0xdb,
|
|
|
+ (byte)0xf8,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,0x12,0x15,(byte)0xe5,0x12,0x16,(byte)0xbd,0x22,(byte)0x90,0x42,0x0e,(byte)0xe0,
|
|
|
+ 0x54,(byte)0xfe,(byte)0xf0,0x7f,(byte)0xe0,0x12,0x03,0x18,0x12,0x03,0x24,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0xe4,
|
|
|
+ (byte)0xfe,(byte)0xef,(byte)0x90,0x42,0x02,0x30,(byte)0xe7,0x06,(byte)0xe0,0x44,0x01,(byte)0xf0,(byte)0x80,0x04,(byte)0xe0,0x54,
|
|
|
+ (byte)0xfe,(byte)0xf0,(byte)0x90,0x42,0x0e,(byte)0xe0,0x44,0x01,(byte)0xf0,(byte)0xef,0x25,(byte)0xe0,(byte)0xff,(byte)0xe0,0x54,(byte)0xfe,
|
|
|
+ (byte)0xf0,0x0e,(byte)0xbe,0x08,(byte)0xdc,0x12,0x03,0x24,0x22,(byte)0xd3,0x10,(byte)0xaf,0x01,(byte)0xc3,(byte)0xc0,(byte)0xd0,
|
|
|
+ (byte)0x8e,0x3c,(byte)0x8f,0x3d,0x12,0x15,(byte)0xc6,(byte)0xef,0x60,(byte)0xfa,(byte)0x85,0x3d,(byte)0x82,(byte)0x85,0x3c,(byte)0x83,
|
|
|
+ (byte)0xe0,0x70,0x03,(byte)0xd3,(byte)0x80,0x01,(byte)0xc3,(byte)0x92,0x0c,0x30,0x0c,0x09,(byte)0x85,0x3d,(byte)0x82,(byte)0x85,
|
|
|
+ 0x3c,(byte)0x83,0x74,0x01,(byte)0xf0,0x12,0x16,(byte)0xcf,(byte)0xa2,0x0c,(byte)0xe4,0x33,(byte)0xff,(byte)0xd0,(byte)0xd0,(byte)0x92,
|
|
|
+ (byte)0xaf,0x22,(byte)0xe4,(byte)0xff,(byte)0xfe,(byte)0x90,0x41,(byte)0xfe,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0x90,0x42,0x0e,(byte)0xe0,
|
|
|
+ 0x44,0x01,(byte)0xf0,(byte)0xee,0x25,(byte)0xe0,(byte)0xfe,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0x90,0x42,0x17,(byte)0xe0,(byte)0xc4,
|
|
|
+ 0x13,0x13,0x13,0x54,0x01,0x30,(byte)0xe0,0x01,0x0e,0x0f,(byte)0xef,(byte)0xc3,(byte)0x94,0x08,0x40,(byte)0xdc,
|
|
|
+ 0x12,0x03,0x24,(byte)0xcf,(byte)0xee,(byte)0xcf,0x22,0x75,0x25,(byte)0xff,0x75,0x26,0x0f,0x75,0x27,(byte)0x9a,
|
|
|
+ 0x75,0x28,0x00,0x75,0x29,0x1f,0x7b,0x01,0x7a,(byte)0x80,0x79,0x10,0x12,0x10,(byte)0xa8,0x7e,
|
|
|
+ 0x0f,0x7f,(byte)0xb9,0x12,0x0e,(byte)0xd4,(byte)0x90,(byte)0x80,0x02,0x12,0x08,(byte)0xd6,0x7e,0x0f,0x7f,(byte)0xc2,
|
|
|
+ 0x12,0x0e,(byte)0xd4,(byte)0x90,(byte)0x80,0x06,0x02,0x08,(byte)0xd6,(byte)0xce,(byte)0xed,(byte)0xce,(byte)0xef,0x14,0x60,0x09,
|
|
|
+ 0x04,0x70,0x26,(byte)0x90,0x40,0x33,(byte)0xe4,(byte)0xf0,0x22,(byte)0x90,0x42,0x53,(byte)0xe0,0x54,(byte)0xdf,(byte)0xf0,
|
|
|
+ (byte)0x90,0x42,0x6c,(byte)0xe4,(byte)0xf0,(byte)0x90,0x42,0x69,(byte)0xf0,(byte)0xa3,0x12,0x16,0x7f,(byte)0xcf,(byte)0xee,(byte)0xcf,
|
|
|
+ 0x12,0x14,0x5b,(byte)0x90,0x40,0x33,0x74,0x01,(byte)0xf0,0x22,(byte)0xc3,(byte)0xef,(byte)0x9d,(byte)0xfb,(byte)0xee,(byte)0x9c,
|
|
|
+ (byte)0xfa,(byte)0xc3,(byte)0xef,(byte)0x9d,(byte)0xec,0x64,(byte)0x80,(byte)0xf8,(byte)0xee,0x64,(byte)0x80,(byte)0x98,0x50,0x07,(byte)0xc3,(byte)0xe4,
|
|
|
+ (byte)0x9b,(byte)0xfb,(byte)0xe4,(byte)0x9a,(byte)0xfa,(byte)0xd3,(byte)0xef,(byte)0x94,0x00,(byte)0xee,0x64,(byte)0x80,(byte)0x94,(byte)0x80,0x40,0x04,
|
|
|
+ (byte)0xca,0x44,(byte)0x80,(byte)0xca,(byte)0xce,(byte)0xea,(byte)0xce,(byte)0xcf,(byte)0xeb,(byte)0xcf,0x22,(byte)0xcd,(byte)0xef,(byte)0xcd,(byte)0xed,0x54,
|
|
|
+ 0x03,0x75,(byte)0xf0,0x10,(byte)0xa4,(byte)0xff,(byte)0x90,0x42,(byte)0x80,(byte)0xe0,(byte)0xfa,(byte)0xa3,(byte)0xe0,0x54,(byte)0xcf,(byte)0xfb,
|
|
|
+ (byte)0xea,0x45,(byte)0xf0,(byte)0xfe,(byte)0xeb,0x4f,(byte)0xff,(byte)0x90,0x42,(byte)0x80,(byte)0xee,(byte)0xf0,(byte)0xa3,(byte)0xef,(byte)0xf0,(byte)0xed,
|
|
|
+ 0x13,0x13,0x54,0x3f,(byte)0x90,0x42,0x6b,(byte)0xf0,0x22,(byte)0x8e,0x08,(byte)0x8f,0x09,(byte)0xd2,(byte)0xb5,(byte)0xc2,
|
|
|
+ (byte)0xb2,0x12,0x16,(byte)0xb1,(byte)0xc2,(byte)0xb1,0x7f,0x20,0x12,0x16,(byte)0x8c,(byte)0xe4,(byte)0xff,0x12,0x16,(byte)0x8c,
|
|
|
+ (byte)0xaf,0x08,0x12,0x16,(byte)0x8c,(byte)0xaf,0x09,0x12,0x16,(byte)0x8c,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,0x12,0x15,
|
|
|
+ (byte)0xe5,0x12,0x16,(byte)0xbd,0x22,(byte)0x8f,0x11,0x12,0x02,0x17,0x12,0x09,0x1f,(byte)0xe5,0x11,(byte)0xf4,
|
|
|
+ 0x60,0x11,(byte)0xe5,0x11,0x12,0x03,0x43,(byte)0x80,0x02,(byte)0xc3,0x33,(byte)0xd8,(byte)0xfc,(byte)0xff,(byte)0xe5,0x11,
|
|
|
+ 0x12,0x02,(byte)0xa9,0x12,0x02,0x1d,0x75,0x17,0x06,0x7f,0x07,0x12,0x11,(byte)0x94,0x02,0x15,
|
|
|
+ (byte)0x84,(byte)0x8f,0x12,0x12,0x02,0x17,0x12,0x09,0x1f,(byte)0xe5,0x12,(byte)0xf4,0x60,0x11,(byte)0xe5,0x12,
|
|
|
+ 0x12,0x03,0x43,(byte)0x80,0x02,(byte)0xc3,0x33,(byte)0xd8,(byte)0xfc,(byte)0xff,(byte)0xe5,0x12,0x12,0x02,(byte)0xa9,0x12,
|
|
|
+ 0x02,0x1d,0x75,0x17,0x06,0x7f,0x0d,0x12,0x11,(byte)0x94,0x02,0x15,(byte)0x84,(byte)0x90,0x30,0x1f,
|
|
|
+ (byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0x90,0x37,0x33,(byte)0xe0,0x54,(byte)0xfb,(byte)0xf0,(byte)0x90,0x30,0x39,(byte)0xe4,(byte)0xf0,
|
|
|
+ (byte)0x90,0x30,0x05,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0xe0,0x54,(byte)0xfb,(byte)0xf0,(byte)0x90,0x42,0x5f,0x74,0x03,
|
|
|
+ (byte)0xf0,(byte)0x90,0x42,(byte)0x81,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,0x22,(byte)0xe4,(byte)0xff,(byte)0xa2,0x0a,(byte)0xe4,0x33,(byte)0xfe,
|
|
|
+ (byte)0xef,(byte)0xc3,0x13,0x24,0x2c,0x12,0x02,(byte)0xcb,(byte)0xbf,0x1e,(byte)0xf0,(byte)0xe4,(byte)0xff,(byte)0xa2,0x0a,(byte)0xe4,
|
|
|
+ 0x33,(byte)0xfe,(byte)0xef,(byte)0x90,0x0f,(byte)0xcb,(byte)0x93,0x24,0x00,0x12,0x02,(byte)0xcb,(byte)0xbf,0x2a,(byte)0xee,0x22,
|
|
|
+ (byte)0xcd,(byte)0xef,(byte)0xcd,(byte)0xcc,(byte)0xee,(byte)0xcc,(byte)0xd3,(byte)0xed,(byte)0x94,(byte)0xfa,(byte)0xec,(byte)0x94,0x00,0x40,0x0f,0x7f,
|
|
|
+ (byte)0xfa,0x12,0x16,0x31,0x74,0x06,0x2d,(byte)0xfd,0x74,(byte)0xff,0x3c,(byte)0xfc,(byte)0x80,(byte)0xe8,(byte)0xcf,(byte)0xed,
|
|
|
+ (byte)0xcf,0x02,0x16,0x31,0x12,0x13,0x1c,0x7f,0x02,0x12,0x13,0x25,0x7f,0x01,0x12,0x13,
|
|
|
+ 0x25,0x12,0x02,0x2b,0x12,0x02,0x5a,0x12,0x16,0x31,(byte)0x90,0x42,0x02,0x12,0x02,0x5d,
|
|
|
+ 0x12,0x16,0x31,0x12,0x02,0x24,0x22,(byte)0xd3,0x10,(byte)0xaf,0x01,(byte)0xc3,(byte)0x90,0x40,(byte)0xa4,(byte)0xe0,
|
|
|
+ (byte)0xf5,0x34,(byte)0x85,(byte)0xdd,0x35,(byte)0x85,(byte)0xde,0x36,(byte)0x85,(byte)0xdf,0x37,(byte)0x92,(byte)0xaf,(byte)0xaf,0x37,(byte)0xae,
|
|
|
+ 0x36,(byte)0xad,0x35,(byte)0xac,0x34,0x22,(byte)0xd3,0x10,(byte)0xaf,0x01,(byte)0xc3,(byte)0xc0,(byte)0xd0,(byte)0x90,0x40,(byte)0xdf,
|
|
|
+ 0x74,0x0d,(byte)0xf0,(byte)0x90,0x40,(byte)0xfd,(byte)0xe0,(byte)0xb4,0x0d,0x04,0x7f,0x01,(byte)0x80,0x02,0x7f,0x00,
|
|
|
+ (byte)0xd0,(byte)0xd0,(byte)0x92,(byte)0xaf,0x22,(byte)0xc2,(byte)0xb1,0x7f,0x05,0x12,0x16,(byte)0x8c,0x7f,0x07,(byte)0xd2,(byte)0xb0,
|
|
|
+ (byte)0xc2,(byte)0xb0,(byte)0xdf,(byte)0xfa,(byte)0xd2,(byte)0xb0,(byte)0xa2,(byte)0xb4,(byte)0x92,0x0a,(byte)0xc2,(byte)0xb0,0x20,0x0a,(byte)0xe6,0x22,
|
|
|
+ (byte)0xd2,(byte)0xb5,(byte)0xc2,(byte)0xb2,0x12,0x16,(byte)0xb1,(byte)0xc2,(byte)0xb1,0x7f,0x60,0x12,0x16,(byte)0x8c,(byte)0xc2,(byte)0xb0,
|
|
|
+ (byte)0xd2,(byte)0xb1,0x12,0x15,(byte)0xe5,0x12,0x16,(byte)0xbd,0x22,(byte)0xc2,(byte)0xb1,0x7f,0x05,0x12,0x16,(byte)0x8c,
|
|
|
+ 0x7f,0x08,(byte)0xd2,(byte)0xb0,(byte)0xa2,(byte)0xb4,0x33,(byte)0xc2,(byte)0xb0,(byte)0xdf,(byte)0xf7,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,(byte)0xff,
|
|
|
+ 0x22,(byte)0x90,0x40,(byte)0xa7,(byte)0xe0,(byte)0xfe,(byte)0x90,0x40,(byte)0xa7,(byte)0xe0,(byte)0xc3,(byte)0x9e,(byte)0xc3,(byte)0x9f,0x40,0x03,
|
|
|
+ (byte)0xd3,(byte)0x80,0x01,(byte)0xc3,0x50,(byte)0xf0,0x22,(byte)0xd3,0x10,(byte)0xaf,0x01,(byte)0xc3,(byte)0x90,0x40,(byte)0xa6,(byte)0xe0,
|
|
|
+ (byte)0xf5,0x3e,(byte)0x85,(byte)0xdf,0x3f,(byte)0x92,(byte)0xaf,(byte)0xae,0x3e,(byte)0xaf,0x3f,0x22,(byte)0xa2,0x0a,(byte)0x92,0x0b,
|
|
|
+ (byte)0x90,0x42,(byte)0x82,0x74,0x01,(byte)0xf0,(byte)0xaf,0x11,0x12,0x14,(byte)0xe1,0x7f,0x0c,0x22,0x01,0x20,
|
|
|
+ 0x00,0x4a,(byte)0x80,0x00,0x42,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,(byte)0xf0,
|
|
|
+ (byte)0x90,0x42,0x53,(byte)0xe0,0x54,(byte)0xfe,(byte)0xf0,(byte)0xe0,0x54,(byte)0xfd,(byte)0xf0,0x22,(byte)0xef,0x7f,0x08,0x33,
|
|
|
+ (byte)0x92,(byte)0xb6,(byte)0xd2,(byte)0xb0,(byte)0xc2,(byte)0xb0,(byte)0xdf,(byte)0xf7,0x22,(byte)0xd3,0x10,(byte)0xaf,0x01,(byte)0xc3,(byte)0xc0,(byte)0xd0,
|
|
|
+ (byte)0xd0,(byte)0xd0,(byte)0x92,(byte)0xaf,0x22,(byte)0x90,0x40,0x4b,0x74,0x03,(byte)0xf0,(byte)0x90,0x40,0x4a,(byte)0xe4,(byte)0xf0,
|
|
|
+ 0x22,(byte)0xc2,(byte)0xb1,0x7f,0x06,0x12,0x16,(byte)0x8c,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,0x22,(byte)0xc2,(byte)0xb1,0x7f,
|
|
|
+ 0x04,0x12,0x16,(byte)0x8c,(byte)0xc2,(byte)0xb0,(byte)0xd2,(byte)0xb1,0x22,(byte)0x90,0x40,(byte)0xe3,(byte)0xef,(byte)0xf0,0x22,(byte)0x90,
|
|
|
+ 0x40,(byte)0xdf,(byte)0xe4,(byte)0xf0,0x22,(byte)0xf0,(byte)0xa3,0x22,
|
|
|
+ };
|
|
|
+
|
|
|
+ private byte GT9xxxShortConfig[] = {
|
|
|
+ //短路阀值设置
|
|
|
+ //0x00,0x32,0x00,0x96,0x00,0x14,
|
|
|
+ 0x00,0x32,0x00,(byte)0x96,
|
|
|
+ //需要把配置中的通道配置读取出来 此处先写入固定值!
|
|
|
+ //驱动通道
|
|
|
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,
|
|
|
+ //感应通道
|
|
|
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
|
|
|
+ //其它
|
|
|
+ (byte)0x9E,0x00,0x14,0x00,
|
|
|
+ };
|
|
|
+
|
|
|
+ private byte GT7xxxShortConfig[] = {
|
|
|
+ 0x24,0x27,0x26,0x25,0x28,0x2A,0x29,0x2B,0x2C,0x2E,0x2D,0x34,0x2F,0x30,0x31,0x35,0x33,0x32,
|
|
|
+ 0x36,0x37,0x39,0x38,0x3C,0x3A,0x3D,0x3B,0x3E,0x47,0x45,0x44,0x46,0x42,0x41,0x43,0x3F,0x40,
|
|
|
+ 0x03,0x00,0x01,0x06,0x05,0x02,0x08,0x04,0x07,0x09,0x0B,0x0A,0x10,0x0D,0x0C,0x11,0x0F,0x0E,
|
|
|
+ 0x12,0x14,0x13,0x15,0x16,0x17,0x18,0x19,0x1A,0x23,0x22,0x21,0x1E,0x1F,0x1B,0x1C,0x20,0x1D,
|
|
|
+ (byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,0x27,0x2A,0x29,0x28,0x2B,0x26,0x24,0x25,0x23,0x21,0x22,0x20,0x1E,0x1F,
|
|
|
+ 0x1D,0x1C,0x1A,0x1B,0x18,0x19,0x17,0x16,0x11,0x12,0x14,0x13,0x15,0x0E,0x0F,0x10,0x0B,0x0C,
|
|
|
+ 0x0D,0x08,0x09,0x0A,0x06,0x04,0x07,0x02,0x05,0x03,0x01,0x00,(byte)0xFF,(byte)0xFF,0x00,0x00,0x64,0x00,
|
|
|
+ 0x20,0x03,0x20,0x03,0x20,0x03,(byte)0xC8,0x00,(byte)0xF4,0x01,(byte)0xF4,0x01,(byte)0xF4,0x01,(byte)0xF4,0x01,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x04,0x00,0x06,0x00,0x44,0x00,0x59,0x00,0x4B,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,(byte)0xE2,0x0A,
|
|
|
+ };
|
|
|
+
|
|
|
+ //GT7 配置界面显示和短路通道上报map
|
|
|
+ private byte DrvMap[] = {
|
|
|
+ 66,65,63,64,61,62,60,59,57,58,56,54,55,53,51,52,50,45,48,47,46,49,
|
|
|
+ 66,65,62,64,60,63,59,61,56,57,58,53,54,55,50,51,52,45,46,48,47,49,
|
|
|
+ };
|
|
|
+
|
|
|
+ private byte SenMap[] = {
|
|
|
+ 0,3,2,1,4,6,5,7,8,10,9,12,13,14,17,16,11,15,18,19,21,20,23,25,22,
|
|
|
+ 24,26,43,44,41,40,42,38,37,39,36,1,2,5,0,7,4,3,8,6,9,11,10,14,13,
|
|
|
+ 17,16,12,15,18,20,19,21,22,23,24,25,26,41,42,44,39,40,43,38,37,36,
|
|
|
+ };
|
|
|
+
|
|
|
+ private byte[] bypCfgDrv = new byte[52];
|
|
|
+ private byte[] bypCfgSen = new byte[76];
|
|
|
+
|
|
|
+ private byte[] bypDrvShortFlag = new byte[52];
|
|
|
+ private byte[] bypSenShortFlag = new byte[76];
|
|
|
+
|
|
|
+ private TextView tvAllTestResult; //the result of all tests
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
+ setContentView(R.layout.activity_sensor_test);
|
|
|
+ mAlertContext = SensorTest.this;
|
|
|
+ //ConstantsActivity.activityList.add(this);
|
|
|
+ //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
|
|
+ //switchLanguage(ConstantsActivity.langae);
|
|
|
+ InitButton();
|
|
|
+ InitEditText();
|
|
|
+ InitListener();
|
|
|
+ InitData();
|
|
|
+ initTextView();
|
|
|
+ openDevices();
|
|
|
+
|
|
|
+ // 检查是否有读取外部存储的权限
|
|
|
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
|
|
|
+ != PackageManager.PERMISSION_GRANTED) {
|
|
|
+ // 如果没有权限,请求权限
|
|
|
+ ActivityCompat.requestPermissions(this,
|
|
|
+ new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
|
|
+ PERMISSION_REQUEST_CODE);
|
|
|
+ } else {
|
|
|
+ // 如果已经有权限,读取文件
|
|
|
+ readFile();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //核心设置的代码
|
|
|
+ protected void switchLanguage(String language) {
|
|
|
+ Resources resources = getResources();
|
|
|
+ Configuration config = resources.getConfiguration();
|
|
|
+ DisplayMetrics dm = resources.getDisplayMetrics();
|
|
|
+ switch (language) {
|
|
|
+ case "zh":
|
|
|
+ config.locale = Locale.CHINESE;
|
|
|
+ resources.updateConfiguration(config, dm);
|
|
|
+ break;
|
|
|
+ case "en":
|
|
|
+ config.locale = Locale.ENGLISH;
|
|
|
+ resources.updateConfiguration(config, dm);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ config.locale = Locale.US;
|
|
|
+ resources.updateConfiguration(config, dm);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onConfigurationChanged(Configuration newConfig) {
|
|
|
+ super.onConfigurationChanged(newConfig);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void InitButton(){
|
|
|
+ btn_Test = (Button) findViewById(R.id.testting);
|
|
|
+
|
|
|
+ //选择文件
|
|
|
+ btn_ImportFileButton = (Button) findViewById(R.id.importtestpara);
|
|
|
+ btn_ImportFileButton.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ //ActivityCompat.requestPermissions( Config.this, new String[]{android
|
|
|
+ // .Manifest.permission.READ_EXTERNAL_STORAGE}, 2);
|
|
|
+ Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
|
|
+ intent.setType("*/*");//设置类型,我这里是任意类型,任意后缀的可以这样写。
|
|
|
+ intent.addCategory(Intent.CATEGORY_OPENABLE);
|
|
|
+ startActivityForResult(intent, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private void InitEditText(){
|
|
|
+ edt_RowNum = (EditText) findViewById(R.id.inputrownum);
|
|
|
+ edt_ColNum = (EditText) findViewById(R.id.inputcolnum);
|
|
|
+ edt_Maximum = (EditText) findViewById(R.id.inputmaximum);
|
|
|
+ edt_Minimum = (EditText) findViewById(R.id.inputminimum);
|
|
|
+ edt_TestiInformation = (EditText) findViewById(R.id.maxandmintestinfo); //显示测试过程信息
|
|
|
+ edt_TestiInformation.setKeyListener(null);
|
|
|
+
|
|
|
+ edtShortCircuitInfo = (EditText) findViewById(R.id.shortcircuitinfo);
|
|
|
+ edtShortCircuitInfo.setKeyListener(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void InitListener(){
|
|
|
+ btn_Test.setOnClickListener(this);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void InitData(){
|
|
|
+ btn_Test.setEnabled(false);
|
|
|
+
|
|
|
+ textGridLayout = (GridLayout)findViewById(R.id.AllGridLayout);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void onActivityResult ( int requestCode, int resultCode, Intent data){
|
|
|
+ if (resultCode == Activity.RESULT_OK) {
|
|
|
+
|
|
|
+ int permission_write = ContextCompat.checkSelfPermission(SensorTest.this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
|
|
+ int permission_read = ContextCompat.checkSelfPermission(SensorTest.this, Manifest.permission.READ_EXTERNAL_STORAGE);
|
|
|
+
|
|
|
+ if ((permission_write != PackageManager.PERMISSION_GRANTED)
|
|
|
+ ||(permission_read != PackageManager.PERMISSION_GRANTED))
|
|
|
+ {
|
|
|
+
|
|
|
+ ActivityCompat.requestPermissions(SensorTest.this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
|
|
+ android.Manifest.permission.READ_EXTERNAL_STORAGE}, 3);
|
|
|
+ }
|
|
|
+
|
|
|
+ StringBuffer buffer = new StringBuffer();
|
|
|
+ String configString = "";
|
|
|
+ Uri uri = data.getData();
|
|
|
+ String fileString = "";
|
|
|
+ if (requestCode == 1 && resultCode == Activity.RESULT_OK) { //U 盘 文 件
|
|
|
+
|
|
|
+ //uri = null;
|
|
|
+ //if (data != null){
|
|
|
+ // uri = data.getData();
|
|
|
+ //}
|
|
|
+
|
|
|
+ try {
|
|
|
+ InputStream inputStream = getContentResolver().openInputStream(uri);
|
|
|
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
|
|
|
+ String line;
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+
|
|
|
+ while ((line = reader.readLine()) != null){
|
|
|
+ stringBuilder.append(line);
|
|
|
+ }
|
|
|
+
|
|
|
+ reader.close();
|
|
|
+
|
|
|
+ configString = stringBuilder.toString();
|
|
|
+
|
|
|
+ //edit_search.setText(fileData);
|
|
|
+ edit_search.setText(uri.getPath());
|
|
|
+
|
|
|
+ //edtShortCircuitInfo.setText(configString);
|
|
|
+
|
|
|
+ int i,j,k,l= 0;
|
|
|
+
|
|
|
+ String stringMaxVal,stringMinVal;
|
|
|
+
|
|
|
+ i = configString.indexOf("[Node threshold]");
|
|
|
+
|
|
|
+ j = configString.indexOf("Max=", i);
|
|
|
+
|
|
|
+ k = configString.indexOf("Min=", i);
|
|
|
+
|
|
|
+ l = configString.indexOf("[TEST]", i);
|
|
|
+
|
|
|
+ stringMaxVal = configString.substring(j + 4, k);
|
|
|
+ stringMinVal = configString.substring(k + 4, l);
|
|
|
+
|
|
|
+ //value = value.trim(); //去除空格
|
|
|
+ //configString = configString.replaceAll("0x", ""); //0x转换为没有
|
|
|
+ //editdetail.setText(configString.toString()); //buffer.toString())就是读出的内容字符
|
|
|
+
|
|
|
+ String[] stringMaxValArr = stringMaxVal.split(",");
|
|
|
+ String[] stringMinValArr = stringMinVal.split(",");
|
|
|
+
|
|
|
+ for (i = 0; i < stringMaxValArr.length; i++){
|
|
|
+ iRawDataMaxVal[i] = Integer.parseInt(stringMaxValArr[i], 10);
|
|
|
+ iRawDataMinVal[i] = Integer.parseInt(stringMinValArr[i], 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (IOException c) {
|
|
|
+ edit_search.setText(uri.getPath() + "——" + getResources().getString(R.string.invalidfile));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } //end of if (requestCode == 1)
|
|
|
+ else if (requestCode == 2) { //本 地 文 件
|
|
|
+
|
|
|
+ try {
|
|
|
+ File dir = Environment.getExternalStorageDirectory();
|
|
|
+ //Uri uri = data.getData();
|
|
|
+ File dataFile;
|
|
|
+
|
|
|
+ fileString = dir.getPath() + "/";
|
|
|
+
|
|
|
+ if (uri.getLastPathSegment().indexOf(":") > 0){
|
|
|
+ String[] stringFileNameArr = uri.getLastPathSegment().split(":");
|
|
|
+ fileString += stringFileNameArr[1];
|
|
|
+ }else{
|
|
|
+ fileString += uri.getLastPathSegment();
|
|
|
+ }
|
|
|
+
|
|
|
+ //fileString = dir.getPath() + "/" + uri.getLastPathSegment();
|
|
|
+ //edit_search.setText(dir.getPath() + "/GTxxxx_wingcool_config.cfg");
|
|
|
+
|
|
|
+
|
|
|
+ //fileString = fileString.replaceAll(":", "/"); //将:改为/,以防某些系统文件目录读出是:
|
|
|
+ edit_search.setText(fileString);
|
|
|
+
|
|
|
+ //File dir = Environment.getExternalStorageDirectory();
|
|
|
+ //dataFile = new File(dir.getPath(), "GTxxxx_wingcool_config.cfg");
|
|
|
+ dataFile = new File(fileString);
|
|
|
+
|
|
|
+ FileInputStream fis = new FileInputStream(dataFile);
|
|
|
+ //byte[] bytes = new byte[fis.available()];
|
|
|
+ //fis.read(bytes);
|
|
|
+ //fis.close();
|
|
|
+ //String str = new String(bytes,"utf-8");
|
|
|
+ //edit_search.setText(str);
|
|
|
+
|
|
|
+ //FileInputStream fis = new FileInputStream(uri.getPath().toString());
|
|
|
+ InputStreamReader isr = new InputStreamReader(fis, "UTF-8");//文件编码Unicode,UTF-8,ASCII,GB2312,Big5
|
|
|
+ Reader in = new BufferedReader(isr);
|
|
|
+ int ch;
|
|
|
+ while ((ch = in.read()) > -1) {
|
|
|
+ buffer.append((char) ch);
|
|
|
+ }
|
|
|
+ in.close();
|
|
|
+
|
|
|
+ configString = buffer.toString();
|
|
|
+
|
|
|
+ //edtShortCircuitInfo.setText(configString);
|
|
|
+
|
|
|
+ int i,j,k,l= 0;
|
|
|
+
|
|
|
+ String stringMaxVal,stringMinVal;
|
|
|
+
|
|
|
+ i = configString.indexOf("[Node threshold]");
|
|
|
+
|
|
|
+ j = configString.indexOf("Max=", i);
|
|
|
+
|
|
|
+ k = configString.indexOf("Min=", i);
|
|
|
+
|
|
|
+ l = configString.indexOf("[TEST]", i);
|
|
|
+
|
|
|
+ stringMaxVal = configString.substring(j + 4, k);
|
|
|
+ stringMinVal = configString.substring(k + 4, l);
|
|
|
+
|
|
|
+ //value = value.trim(); //去除空格
|
|
|
+ //configString = configString.replaceAll("0x", ""); //0x转换为没有
|
|
|
+ //editdetail.setText(configString.toString()); //buffer.toString())就是读出的内容字符
|
|
|
+
|
|
|
+ String[] stringMaxValArr = stringMaxVal.split(",");
|
|
|
+ String[] stringMinValArr = stringMinVal.split(",");
|
|
|
+
|
|
|
+ for (i = 0; i < stringMaxValArr.length - 1; i++){
|
|
|
+ iRawDataMaxVal[i] = Integer.parseInt(stringMaxValArr[i], 10);
|
|
|
+ iRawDataMinVal[i] = Integer.parseInt(stringMinValArr[i], 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ edt_TestiInformation.setText( Integer.toString(iRawDataMaxVal[0]) + "," +
|
|
|
+ Integer.toString(iRawDataMaxVal[1]) + "," +
|
|
|
+ Integer.toString(iRawDataMaxVal[2]) + "," +
|
|
|
+ Integer.toString(iRawDataMaxVal[3]) + "," +
|
|
|
+ Integer.toString(iRawDataMaxVal[4]) + "," +
|
|
|
+ Integer.toString(iRawDataMaxVal[stringMaxValArr.length - 3]) + "," +
|
|
|
+ Integer.toString(iRawDataMaxVal[stringMaxValArr.length - 2]) + ",\n" +
|
|
|
+ Integer.toString(iRawDataMinVal[0]) + "," +
|
|
|
+ Integer.toString(iRawDataMinVal[1]) + "," +
|
|
|
+ Integer.toString(iRawDataMinVal[2]) + "," +
|
|
|
+ Integer.toString(iRawDataMinVal[3]) + "," +
|
|
|
+ Integer.toString(iRawDataMinVal[4]) + "," +
|
|
|
+ Integer.toString(iRawDataMinVal[stringMaxValArr.length - 3]) + "," +
|
|
|
+ Integer.toString(iRawDataMinVal[stringMaxValArr.length - 2]) + ",\n" );
|
|
|
+ */
|
|
|
+ } catch (IOException c) {
|
|
|
+ edit_search.setText(uri.getPath() + "——" + getResources().getString(R.string.invalidfile));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } //end of else if (requestCode == 2)
|
|
|
+
|
|
|
+ } //end of if (resultCode == Activity.RESULT_OK)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 打开设备 , 让车机和手机端连起来
|
|
|
+ */
|
|
|
+ public void openDevices() {
|
|
|
+
|
|
|
+ mThreadPool = Executors.newFixedThreadPool(5);
|
|
|
+ mContext = getApplicationContext();
|
|
|
+ mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
|
|
|
+ //列举设备(手机)
|
|
|
+ daOpenDevicesReceiver = new OpenDevicesReceiver(this);
|
|
|
+ mThreadPool.execute(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ SystemClock.sleep(1000);
|
|
|
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_USB_PERMISSION), 0);
|
|
|
+ IntentFilter intentFilter = new IntentFilter(USB_ACTION);
|
|
|
+
|
|
|
+ registerReceiver(daOpenDevicesReceiver, intentFilter);
|
|
|
+ while(isNeedFindDevice) {
|
|
|
+ SystemClock.sleep(100);
|
|
|
+ HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
|
|
|
+ if (deviceList != null) {
|
|
|
+ for (UsbDevice usbDevice : deviceList.values()) {
|
|
|
+ //int productId = usbDevice.getProductId();
|
|
|
+ int vendorId = usbDevice.getVendorId();
|
|
|
+ if ((vendorId == 0x27C0) //之前VID错误了,做兼容
|
|
|
+ ||(vendorId == 0x27C6) //汇顶的VID
|
|
|
+ ||(vendorId == 0x222A) //奕力的VID
|
|
|
+ ||(vendorId == 0x056A)) //8191主动笔和Wacom主动笔
|
|
|
+ {
|
|
|
+ if (mUsbManager.hasPermission(usbDevice)) {
|
|
|
+ initDevice();
|
|
|
+ } else {
|
|
|
+ mUsbManager.requestPermission(usbDevice, pendingIntent);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } //ThreadPool
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化设备(手机) , 当手机进入Accessory模式后 , 手机的PID会变为Google定义的2个常量值其中的一个 ,
|
|
|
+ */
|
|
|
+ private void initDevice() {
|
|
|
+ HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
|
|
|
+ Collection<UsbDevice> values = deviceList.values();
|
|
|
+ if (!values.isEmpty()) {
|
|
|
+ for (UsbDevice usbDevice : values) {
|
|
|
+ //int productId = usbDevice.getProductId();
|
|
|
+ int vendorId = usbDevice.getVendorId();
|
|
|
+ //if (productId == 0x0818 || productId == 0x0001 )
|
|
|
+ if ((vendorId == 0x27C0) //之前VID错误了,做兼容
|
|
|
+ ||(vendorId == 0x27C6) //汇顶的VID
|
|
|
+ ||(vendorId == 0x222A) //奕力的VID
|
|
|
+ ||(vendorId == 0x056A)) //8191主动笔和Wacom主动笔
|
|
|
+ {
|
|
|
+ if (mUsbManager.hasPermission(usbDevice)) {
|
|
|
+
|
|
|
+ UsbInterface usbInterface = usbDevice.getInterface(1);
|
|
|
+
|
|
|
+ for (int i = 0; i < usbInterface.getEndpointCount(); i++) {
|
|
|
+ UsbEndpoint ep = usbInterface.getEndpoint(i);
|
|
|
+
|
|
|
+ if (ep.getDirection() == UsbConstants.USB_DIR_OUT) {
|
|
|
+ //mUsbEndpointIn = ep;
|
|
|
+ mUsbEndpointOut = ep;
|
|
|
+ } else {
|
|
|
+ //mUsbEndpointOut = ep;
|
|
|
+ mUsbEndpointIn = ep;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((null == mUsbEndpointIn) || (null == mUsbEndpointOut)) {
|
|
|
+ mUsbDeviceConnection = mUsbManager.openDevice(usbDevice);
|
|
|
+ if (mUsbDeviceConnection!=null) {
|
|
|
+ int i = mUsbDeviceConnection.controlTransfer(0x00, 0x09,
|
|
|
+ 0x002, 0, null, 0, 100);
|
|
|
+ SystemClock.sleep(1000);
|
|
|
+ if (i >= 0) {
|
|
|
+ //mHandler.sendEmptyMessage(DEBUG_MESSAGE_SUCCESS);
|
|
|
+ } else {
|
|
|
+ //mHandler.sendEmptyMessage(DEBUG_MESSAGE_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ isNeedFindDevice = false;
|
|
|
+ mUsbInterface = usbInterface;
|
|
|
+ mUsbDeviceConnection = mUsbManager.openDevice(usbDevice);
|
|
|
+ mUsbDeviceConnection.claimInterface(mUsbInterface, true);
|
|
|
+ if(null != mUsbEndpointIn){
|
|
|
+ iProductId = usbDevice.getProductId();
|
|
|
+ //if ((iProductId == 0x0819) || (iProductId == 0x8191) || (iProductId == 0x0528))
|
|
|
+ //{
|
|
|
+ // byProductType = GT7;
|
|
|
+ //}
|
|
|
+ if ((iProductId == 0x0829) || (iProductId == 0x0528) || (iProductId == 0x0928))
|
|
|
+ {
|
|
|
+ byProductType = GT29336;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ byProductType = GT2931;
|
|
|
+ }
|
|
|
+ mHandler.sendEmptyMessage(CONNECTED_SUCCESS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(""), 0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private byte iicByteData[]={
|
|
|
+ //0 1 2 3 4 5 6
|
|
|
+ 0x03,0x00,0x0f,0x00,0x00,0x00,0x01,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+
|
|
|
+ };
|
|
|
+ private byte iicWriteData[]={
|
|
|
+ //0 1 2 3 4 5 6
|
|
|
+ 0x03,0x00,0x0f,0x00,0x00,0x00,0x39,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ //发送命令,使得S818可以通过IIC向GT9的固定地址读取任意bytes的数据
|
|
|
+ private boolean iicRead(byte addressHigh,byte addressLow,byte[] wBuffer,int length) {
|
|
|
+
|
|
|
+ int i;
|
|
|
+
|
|
|
+ iicByteData[1] = 0x00; //read GT9 command
|
|
|
+ iicByteData[2] = 0x0f; //no command
|
|
|
+ iicByteData[3] = addressHigh;
|
|
|
+ iicByteData[4] = addressLow;
|
|
|
+ iicByteData[5] = 0x00;
|
|
|
+ iicByteData[6] = 63; //length 一次接收63个数据
|
|
|
+
|
|
|
+ for (int j = 7; j < 64; j++) {
|
|
|
+ iicByteData[j] = 0x00;
|
|
|
+ }
|
|
|
+
|
|
|
+ int address1 = ((addressHigh&0xff)<<8);
|
|
|
+ int address2 = addressLow&0xff;
|
|
|
+ int address = address1|address2;
|
|
|
+
|
|
|
+ int sendTimes = length/63; //预计是向下取整,所以+1
|
|
|
+
|
|
|
+ if ((length % 63) != 0)
|
|
|
+ {
|
|
|
+ sendTimes += 1; //预计是向下取整,所以+1
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int k = 0; k < sendTimes; k++) {
|
|
|
+ int finalOffset = k*63; //每次只能发57bytes数据
|
|
|
+ int offset = k*64;
|
|
|
+
|
|
|
+ if(length - (finalOffset ) < 63) {
|
|
|
+
|
|
|
+ iicByteData[6] = (byte) (length - (finalOffset)); //length
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iicByteData[6] = 63;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送读取命令
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
|
+ if (i != 0x40)
|
|
|
+ return false; //传输失败
|
|
|
+ // SystemClock.sleep(1);
|
|
|
+
|
|
|
+ isReceiverMessage = false; //先关闭循环接收信息
|
|
|
+
|
|
|
+ //接收数据
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointIn, wBuffer, offset, 0x40, 3000);
|
|
|
+
|
|
|
+ if (i != 0x40) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ address = address + 63;
|
|
|
+ iicByteData[3] = (byte)(address>>8);
|
|
|
+ iicByteData[4] = (byte)address;
|
|
|
+ }
|
|
|
+
|
|
|
+ //将report id从数组中去除
|
|
|
+ //byte[] temperBuffer =new byte[length];
|
|
|
+ if(true) {
|
|
|
+ int count1 = 0;
|
|
|
+ for (int k = 0; k < length; k++) {
|
|
|
+ if (k % 63 == 0) {
|
|
|
+ count1++;
|
|
|
+ }
|
|
|
+
|
|
|
+ wBuffer[k] = wBuffer[k + count1];
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ //发送命令,使得S818可以通过IIC向GT9的固定地址写任意bytes的数据
|
|
|
+ private boolean iicWrite(byte addressHigh,byte addressLow,byte[] wBuffer,int offset,int length) {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ iicWriteData[1] = 0x01; //write GT9 command
|
|
|
+ iicWriteData[2] = 0x0f; //no command
|
|
|
+ iicWriteData[3] = addressHigh;
|
|
|
+ iicWriteData[4] = addressLow;
|
|
|
+ iicWriteData[5] = 0x00;
|
|
|
+ iicWriteData[6] = 0x39; //length
|
|
|
+
|
|
|
+ int address1 = ((addressHigh&0xff)<<8);
|
|
|
+ int address2 = addressLow&0xff;
|
|
|
+ int address = address1|address2;
|
|
|
+
|
|
|
+ int sendTimes = length/57 + 1; //预计是向下取整,所以+1
|
|
|
+
|
|
|
+ for (int k = 0; k < sendTimes; k++) {
|
|
|
+ int finalOffset = offset + k*57; //每次只能发57bytes数据
|
|
|
+
|
|
|
+ if(length - (finalOffset -offset) < 57) {
|
|
|
+
|
|
|
+ iicWriteData[6] = (byte) (length - (finalOffset -offset)); //length
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iicWriteData[6] = 0x39;
|
|
|
+ }
|
|
|
+
|
|
|
+ int j;
|
|
|
+ for (j = 7; j < iicWriteData[6] + 7; j++) {
|
|
|
+ iicWriteData[j] = wBuffer[finalOffset + j -7];
|
|
|
+ }
|
|
|
+ for (; j < 64; j++) {
|
|
|
+ iicWriteData[j] = 0;
|
|
|
+ }
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicWriteData, 0, 0x40, 100);
|
|
|
+
|
|
|
+ if (i != 0x40) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ address = address + 57;
|
|
|
+ iicWriteData[3] = (byte)((address & 0xff00) >> 8);
|
|
|
+ iicWriteData[4] = (byte)(address & 0xff);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //发送命令,使得S818可以通过IIC向GT9的固定地址写1byte数据
|
|
|
+ private boolean iicByteWrite(byte addressHigh,byte addressLow,byte subCommand,byte data) {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ iicByteData[1] = 0x01; //write GT9 command
|
|
|
+ iicByteData[2] = subCommand;
|
|
|
+ iicByteData[3] = addressHigh;
|
|
|
+ iicByteData[4] = addressLow;
|
|
|
+ iicByteData[5] = 0x00;
|
|
|
+ iicByteData[6] = 0x01; //length
|
|
|
+
|
|
|
+ iicByteData[7] = data;
|
|
|
+ if ((null == mUsbEndpointIn) || (null == mUsbEndpointOut)){
|
|
|
+ i=0;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
|
+ }
|
|
|
+ // i = 0;
|
|
|
+ if(i == 0x40)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送命令,使得S818可以通过IIC向GT9的固定地址读取1byte数据
|
|
|
+ private byte iicByteRead(byte addressHigh,byte addressLow) {
|
|
|
+
|
|
|
+ iicByteData[1] = 0x00; //read GT9 command
|
|
|
+ iicByteData[2] = 0x0f; //no command
|
|
|
+ iicByteData[3] = addressHigh;
|
|
|
+ iicByteData[4] = addressLow;
|
|
|
+ iicByteData[5] = 0x00; //length
|
|
|
+ iicByteData[6] = 0x01; //lengthlow
|
|
|
+
|
|
|
+ iicByteData[7] = 0x00;
|
|
|
+
|
|
|
+ int i;
|
|
|
+
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
|
+ if (i != 0x40)
|
|
|
+ return 0x77; //用0x77来表示传输失败
|
|
|
+
|
|
|
+ //SystemClock.sleep(12); //加长时间,避免数据显示错乱乱闪
|
|
|
+ SystemClock.sleep(24); //加长时间,避免数据显示错乱乱闪
|
|
|
+
|
|
|
+ isReceiverMessage = false; //先关闭循环接收信息
|
|
|
+
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointIn, mBytes, 0, 0x40, 3000);
|
|
|
+
|
|
|
+ //SystemClock.sleep(12); //加长时间,避免数据显示错乱乱闪
|
|
|
+ SystemClock.sleep(24); //加长时间,避免数据显示错乱乱闪
|
|
|
+
|
|
|
+ if (i == 0x40)
|
|
|
+ return mBytes[1];
|
|
|
+ else
|
|
|
+ return 0x77; //用0x77来表示传输失败
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送命令,使得S8xx可以通过IIC向GT29xx的固定地址读取任意bytes的数据
|
|
|
+ private boolean iicRead32Bits(byte addrfirstbyte,byte addrsecondbyte,byte addrthirdbyte,byte[] wBuffer,int length) {
|
|
|
+
|
|
|
+ int i;
|
|
|
+
|
|
|
+ iicByteData[1] = 0x0f; //7bit:0-read,1-write;other:command
|
|
|
+ //iicByteData[2] = 0x0f; //no command
|
|
|
+ iicByteData[2] = addrfirstbyte;
|
|
|
+ iicByteData[3] = addrsecondbyte;
|
|
|
+ iicByteData[4] = addrthirdbyte;
|
|
|
+ iicByteData[5] = 0x00;
|
|
|
+ iicByteData[6] = 63; //length 一次接收63个数据
|
|
|
+
|
|
|
+ for (int j = 7; j < 64; j++) {
|
|
|
+ iicByteData[j] = 0x00;
|
|
|
+ }
|
|
|
+
|
|
|
+ int address1 = ((addrsecondbyte & 0xff) << 8);
|
|
|
+ int address2 = addrthirdbyte & 0xff;
|
|
|
+ int address = address1 | address2;
|
|
|
+
|
|
|
+ int sendTimes = length/63; //预计是向下取整,所以+1
|
|
|
+
|
|
|
+ if ((length % 63) != 0)
|
|
|
+ {
|
|
|
+ sendTimes += 1; //预计是向下取整,所以+1
|
|
|
+ }
|
|
|
+ //iicByteData[5] = (byte)(length>>8);
|
|
|
+ //iicByteData[6] = (byte)length; //length 一次接收63个数据
|
|
|
+
|
|
|
+ for (int k = 0; k < sendTimes; k++)
|
|
|
+ {
|
|
|
+ int finalOffset = k*63; //每次只能发57bytes数据
|
|
|
+ int offset = k * 64;
|
|
|
+
|
|
|
+ if(length - (finalOffset ) < 63) {
|
|
|
+
|
|
|
+ iicByteData[6] = (byte) (length - (finalOffset)); //length
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iicByteData[6] = 63;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送读取命令
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
|
+ if (i != 0x40)
|
|
|
+ return false; //传输失败
|
|
|
+
|
|
|
+ // SystemClock.sleep(1);
|
|
|
+
|
|
|
+ //接收数据
|
|
|
+ // i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointIn, wBuffer, offset, 0x40, 100);
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointIn, wBuffer, offset, 0x40, 100);
|
|
|
+
|
|
|
+ //if (i != 0x40) {
|
|
|
+ if (i != 0x40) {
|
|
|
+ //editname.setText("IIC Read Failed!!");
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ address = address + 63;
|
|
|
+ iicByteData[3] = (byte)(address>>8);
|
|
|
+ iicByteData[4] = (byte)address;
|
|
|
+ }
|
|
|
+
|
|
|
+ //将report id从数组中去除
|
|
|
+ //byte[] temperBuffer =new byte[length];
|
|
|
+ if(true) {
|
|
|
+ int count1 = 0;
|
|
|
+ for (int k = 0; k < length; k++) {
|
|
|
+ if (k % 63 == 0) {
|
|
|
+ count1++;
|
|
|
+ }
|
|
|
+
|
|
|
+ wBuffer[k] = wBuffer[k + count1];
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送命令,使得S8xx可以通过IIC向GT79xx的固定地址写任意bytes的数据
|
|
|
+ private boolean iicWrite32Bits(byte addrfirstbyte,byte addrsecondbyte,byte addrthirdbyte,byte[] wBuffer,int offset, int length) {
|
|
|
+
|
|
|
+ int i;
|
|
|
+
|
|
|
+ iicWriteData[1] = (byte)0x8f; //7bit:0-read,1-write;other:command
|
|
|
+ //iicWriteData[2] = 0x0f; //no command
|
|
|
+ iicWriteData[2] = addrfirstbyte;
|
|
|
+ iicWriteData[3] = addrsecondbyte;
|
|
|
+ iicWriteData[4] = addrthirdbyte;
|
|
|
+ iicWriteData[5] = 0x00;
|
|
|
+ iicWriteData[6] = 63; //length 一次接收63个数据
|
|
|
+
|
|
|
+ for (int j = 7; j < 64; j++) {
|
|
|
+ iicWriteData[j] = 0x00;
|
|
|
+ }
|
|
|
+
|
|
|
+ int address1 = ((addrsecondbyte&0xff)<<8);
|
|
|
+ int address2 = addrthirdbyte&0xff;
|
|
|
+ int address = address1|address2;
|
|
|
+
|
|
|
+ int sendTimes = length/57 + 1; //预计是向下取整,所以+1
|
|
|
+
|
|
|
+ //iicByteData[5] = (byte)(length>>8);
|
|
|
+ //iicByteData[6] = (byte)length; //length 一次接收63个数据
|
|
|
+
|
|
|
+ for (int k = 0; k < sendTimes; k++) {
|
|
|
+ int finalOffset = offset + k*57; //每次只能发57bytes数据
|
|
|
+
|
|
|
+ if(length - (finalOffset -offset) < 57) {
|
|
|
+
|
|
|
+ iicWriteData[6] = (byte) (length - (finalOffset -offset)); //length
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iicWriteData[6] = 0x39;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int j = 7; j < 64; j++) {
|
|
|
+ iicWriteData[j] = wBuffer[finalOffset + j -7];
|
|
|
+ }
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicWriteData, 0, 0x40, 100);
|
|
|
+
|
|
|
+ if (i != 0x40) {
|
|
|
+ //editname.setText("iicWrite Failed");
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ address = address + 57;
|
|
|
+ //iicWriteData[2] = (byte)((address & 0xFF0000) >> 16);
|
|
|
+ iicWriteData[3] = (byte)(address >> 8);
|
|
|
+ iicWriteData[4] = (byte)address;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送命令,使得S818可以通过IIC向GT9的固定地址写1byte数据
|
|
|
+ private boolean IicWriteOneByte(byte addrfirstbyte,byte addrsecondbyte,byte addrthirdbyte,byte subCommand,byte data) {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ iicByteData[1] = (byte)(0x80 | subCommand); //write GT9 command
|
|
|
+ iicByteData[2] = addrfirstbyte;
|
|
|
+ iicByteData[3] = addrsecondbyte;
|
|
|
+ iicByteData[4] = addrthirdbyte;
|
|
|
+ iicByteData[5] = 0x00;
|
|
|
+ iicByteData[6] = 0x01; //length
|
|
|
+
|
|
|
+ iicByteData[7] = data;
|
|
|
+ if ((null == mUsbEndpointIn) || (null == mUsbEndpointOut)){
|
|
|
+ i=0;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ i = mUsbDeviceConnection.bulkTransfer(mUsbEndpointOut, iicByteData, 0, 0x40, 100);
|
|
|
+ }
|
|
|
+ // i = 0;
|
|
|
+ if(i == 0x40)
|
|
|
+ return true;
|
|
|
+ else
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean changeToDebugMode() {
|
|
|
+ int i;
|
|
|
+ int length = 0;
|
|
|
+ //switch to read data mode
|
|
|
+ if (showFlag == RAWDATA_FLAG) {
|
|
|
+ if (byProductType == GT29336) { //send 0x00 0x00 0x04 0x02 0x06 0x00 to [0x10174],read rawdata
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x02;
|
|
|
+ mBytes[4] = 0x06;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+
|
|
|
+ length = 6;
|
|
|
+ }else {
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x05;
|
|
|
+ mBytes[3] = (byte)0x90;
|
|
|
+ mBytes[4] = (byte)0x81;
|
|
|
+ mBytes[5] = 0x16;
|
|
|
+ mBytes[6] = 0x01;
|
|
|
+
|
|
|
+ length = 7;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (showFlag == DIFFDATA_2BYTES_FLAG)
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) { //send 0x00 0x00 0x04 0x01 0x05 0x00 to [0x10174],read diffdata
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x01;
|
|
|
+ mBytes[4] = 0x05;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+
|
|
|
+ length = 6;
|
|
|
+ }else {
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x05;
|
|
|
+ mBytes[3] = (byte)0x90;
|
|
|
+ mBytes[4] = (byte)0x82;
|
|
|
+ mBytes[5] = 0x17;
|
|
|
+ mBytes[6] = 0x01;
|
|
|
+
|
|
|
+ length = 7;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (i = 0; i < 5; i++) {
|
|
|
+ if (!iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, length)) {
|
|
|
+ SystemClock.sleep(1);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i == 5)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //15ms一次轮询[0x10174],如果是0x80,说明GT29XX进入读数据模式
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(15);
|
|
|
+ iicRead32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes, 1);
|
|
|
+ }while(mBytes[0] != (byte)0x80);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean changeToNormalMode() {
|
|
|
+
|
|
|
+ int i;
|
|
|
+ int length = 0;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) { //switch to normal mode, send 0x00 0x00 0x04 0x00 0x04 0x00 to [0x10174]
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x00;
|
|
|
+ mBytes[4] = 0x04;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+
|
|
|
+ length = 6;
|
|
|
+ }else {
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x05;
|
|
|
+ mBytes[3] = (byte)0x91;
|
|
|
+ mBytes[4] = (byte)0x81;
|
|
|
+ mBytes[5] = 0x17;
|
|
|
+ mBytes[6] = 0x01;
|
|
|
+
|
|
|
+ length = 7;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (i = 0; i < 5; i++) {
|
|
|
+ if (!iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, length)) {
|
|
|
+ SystemClock.sleep(1);
|
|
|
+ continue;
|
|
|
+ }else{
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i == 5)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean getRawdata() {
|
|
|
+
|
|
|
+ byte maddressHigh;
|
|
|
+ byte maddressLow; //rawdata address
|
|
|
+ byte msubcommand = (byte)0x0d; // READ_SYNC
|
|
|
+ byte mdata;
|
|
|
+ int ilength = colnum * rownum * 2;
|
|
|
+
|
|
|
+ if (showFlag == STYLUSDATA_FLAG)
|
|
|
+ {
|
|
|
+ ilength = (colnum + rownum + 2) * 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (showFlag){
|
|
|
+ case RAWDATA_FLAG: //rawdata
|
|
|
+ case TESTING_FLAG: //test
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0xA6, (byte) 0x7C, mRawdataBytes, ilength)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x3D, (byte) 0x70, mRawdataBytes, ilength)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ //case MANUALDATA_FLAG: //manual diffdata
|
|
|
+ //case TEST_END_FLAG: //reffdata
|
|
|
+ case DIFFDATA_2BYTES_FLAG: //diffdata低位在前
|
|
|
+ case DIFFDATA_1BYTE_FLAG: //diffdata
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0xC1, (byte) 0x4C, mRawdataBytes, ilength)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x04, (byte) 0xB2, mRawdataBytes, ilength)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ int tempcol = 0;
|
|
|
+ int i = 0;
|
|
|
+
|
|
|
+ if (showFlag != STYLUSDATA_FLAG) {
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) { //Sen
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum; col++) { //Drv
|
|
|
+
|
|
|
+ int idtemp = (row + tempcol * rownum);
|
|
|
+
|
|
|
+ idtemp = idtemp * 2;
|
|
|
+ //低位在前
|
|
|
+ datatemp[i] = ((mRawdataBytes[idtemp + 1] & 0xFF) << 8) + (mRawdataBytes[idtemp] & 0xFF);
|
|
|
+
|
|
|
+ tempcol++;
|
|
|
+
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ tempcol = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ while(bShowDataFlag == true){ //上一次的数据显示还没结束则一直等待
|
|
|
+ SystemClock.sleep(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (i = 0; i < 75 * 52; i++) {
|
|
|
+ iDataShow[i] = (short)datatemp[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (byProductType == GT29336) { //clear sync flag, [0x010274] = 0
|
|
|
+ if (!IicWriteOneByte((byte) 0x01, (byte) 0x02, (byte) 0x74, (byte) 0x0f, (byte) 0)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (showFlag == RAWDATA_FLAG) //rawdata
|
|
|
+ {
|
|
|
+ if (!IicWriteOneByte((byte) 0x01, (byte) 0x03, (byte) 0x08, (byte) 0x0f, (byte) 0)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else { //diffdata
|
|
|
+ if (!IicWriteOneByte((byte) 0x01, (byte) 0x04, (byte) 0x00, (byte) 0x0f, (byte) 0)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
|
|
+ private void readFile() {
|
|
|
+ // 获取外部存储目录
|
|
|
+ File externalStorageDirectory = Environment.getExternalStorageDirectory();
|
|
|
+ // 构建文件路径
|
|
|
+ File file = new File(externalStorageDirectory, "GT29xx_wingcool.tp");
|
|
|
+ String configString = "";
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
|
|
|
+ String line;
|
|
|
+ while ((line = reader.readLine()) != null) {
|
|
|
+ stringBuilder.append(line).append("\n");
|
|
|
+ }
|
|
|
+ // 将文件内容显示在 TextView 中
|
|
|
+ edit_search.setText(externalStorageDirectory.toString() + "/GT29xx_wingcool.tp");
|
|
|
+
|
|
|
+ int i,j,k,l= 0;
|
|
|
+
|
|
|
+ configString = stringBuilder.toString();
|
|
|
+
|
|
|
+ String stringMaxVal,stringMinVal;
|
|
|
+
|
|
|
+ i = configString.indexOf("[Node threshold]");
|
|
|
+
|
|
|
+ j = configString.indexOf("Max=", i);
|
|
|
+
|
|
|
+ k = configString.indexOf("Min=", i);
|
|
|
+
|
|
|
+ l = configString.indexOf("[TEST]", i);
|
|
|
+
|
|
|
+ stringMaxVal = configString.substring(j + 4, k);
|
|
|
+ stringMinVal = configString.substring(k + 4, l);
|
|
|
+
|
|
|
+ //value = value.trim(); //去除空格
|
|
|
+ //configString = configString.replaceAll("0x", ""); //0x转换为没有
|
|
|
+ //editdetail.setText(configString.toString()); //buffer.toString())就是读出的内容字符
|
|
|
+
|
|
|
+ String[] stringMaxValArr = stringMaxVal.split(",");
|
|
|
+ String[] stringMinValArr = stringMinVal.split(",");
|
|
|
+
|
|
|
+ for (i = 0; i < stringMaxValArr.length - 1; i++){
|
|
|
+ iRawDataMaxVal[i] = Integer.parseInt(stringMaxValArr[i], 10);
|
|
|
+ iRawDataMinVal[i] = Integer.parseInt(stringMinValArr[i], 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ edit_search.setText("Read File Error:" + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void initTextView() {
|
|
|
+ //mtextView = (TextView) findViewById(R.id.textView);
|
|
|
+ tvMaximum = (TextView) findViewById(R.id.maximumshow);
|
|
|
+ tvMinimum = (TextView) findViewById(R.id.minimumshow);
|
|
|
+ tvDataContent = (TextView) findViewById(R.id.datacontentshow);
|
|
|
+ tvMAD = (TextView) findViewById(R.id.madshow);
|
|
|
+
|
|
|
+ edit_search = (TextView) findViewById(R.id.editsearch);
|
|
|
+ //edit_search.setText("/storage/emulated/0/GT29xx_wingcool.tp");
|
|
|
+
|
|
|
+ tvAllTestResult = (TextView) findViewById(R.id.alltestresult);
|
|
|
+ }
|
|
|
+
|
|
|
+ int count = 1000;
|
|
|
+ private void showRawdata() {
|
|
|
+
|
|
|
+ mThreadPool.execute(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+
|
|
|
+ byte syncFlag = 1;
|
|
|
+
|
|
|
+ byte maddressHigh = (byte) 0x81;
|
|
|
+ byte maddressLow = (byte) 0x4E; //SYNC address
|
|
|
+ byte msubcommand = (byte) 0x0f;
|
|
|
+ byte mdata = (byte) 0x00;
|
|
|
+
|
|
|
+ byte addrfirstbyte, addrsecondbyte, addrthirdbyte;
|
|
|
+
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ maddressHigh = (byte) 0x82;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (showFlag == TESTING_FLAG)
|
|
|
+ {
|
|
|
+ btTestStep = 1; //
|
|
|
+
|
|
|
+ //GT29xxShortTestProc();
|
|
|
+
|
|
|
+ //SystemClock.sleep(100);
|
|
|
+
|
|
|
+ //btTestStep = 2;
|
|
|
+
|
|
|
+ showFlag = RAWDATA_FLAG; //先进入读原始值状态
|
|
|
+
|
|
|
+ changeToDebugMode();
|
|
|
+
|
|
|
+ showFlag = TESTING_FLAG; //切回测试模式
|
|
|
+
|
|
|
+ stTestLogShow = "";
|
|
|
+
|
|
|
+ stTestLog = getResources().getString(R.string.startmaxmintest);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ }
|
|
|
+ int checktimes;
|
|
|
+ while(showFlag != TEST_END_FLAG) {
|
|
|
+
|
|
|
+ if(count-- == 0)
|
|
|
+ {
|
|
|
+ count = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ checktimes = 0;
|
|
|
+ while(true) {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x02, (byte) 0x74, mBytes, 1)) { //轮询读取0x010274
|
|
|
+ SystemClock.sleep(1);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+
|
|
|
+ if (showFlag == RAWDATA_FLAG) { //rawdata
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x03, (byte) 0x08, mBytes, 1)) { //轮询读取0x010308
|
|
|
+ SystemClock.sleep(1);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{ //diffdata
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x04, (byte) 0x00, mBytes, 1)) { //轮询读取0x010400
|
|
|
+ SystemClock.sleep(1);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mBytes[0] == (byte)0x80) //读到0x80则跳出去读数据
|
|
|
+ {
|
|
|
+ if (showFlag != TESTING_FLAG) {
|
|
|
+ if (byDisplayFrame == byDisplayFrameCount) {
|
|
|
+ for (int i = 0; i < mRawdataBytes.length; i++) {
|
|
|
+ mRawdataBytes[i] = (byte) 0x00;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (checktimes++ > 20) //轮询了20次没读到0x80,超时跳出去读数据
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (byDisplayFrame == byDisplayFrameCount) {
|
|
|
+
|
|
|
+ if ((showFlag != TESTING_FLAG) && (showFlag != STYLUSDATA_FLAG) && (showFlag != STOP_FLAG) && (count < 999)) { //测试模式、读取主动笔数据和停止时
|
|
|
+ byDisplayFrameCount = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (getRawdata() == true) {
|
|
|
+
|
|
|
+ switch (showFlag) {
|
|
|
+ case RAWDATA_FLAG://rawdata
|
|
|
+ case DIFFDATA_2BYTES_FLAG:// GT7XXX diffdata
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(RAWDATA_MESSAGE);
|
|
|
+
|
|
|
+ break;
|
|
|
+ case MANUALDATA_FLAG://manual diff
|
|
|
+ if (count == 999) //第一帧备份rawdata作为基准
|
|
|
+ {
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ for (int i = 0; i < 44 * 72; i++) {
|
|
|
+ //int j = i / 2;
|
|
|
+ mManualRefInt[i] = iDataShow[i];//((mRawdataBytes[i + 1] & 0xFF) << 8) + (mRawdataBytes[i] & 0xFF);
|
|
|
+ //i++;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < 42 * 30; i++) {
|
|
|
+ //int j = i / 2;
|
|
|
+ mManualRefInt[i] = iDataShow[i];//((mRawdataBytes[i] & 0xFF) << 8) + (mRawdataBytes[i + 1] & 0xFF);
|
|
|
+ //i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(MANUALDIFF_MESSAGE);
|
|
|
+ // mHandler.sendEmptyMessage(RAWDATA_MESSAGE);
|
|
|
+ break;
|
|
|
+ case DIFFDATA_1BYTE_FLAG://diffdata
|
|
|
+ mHandler.sendEmptyMessage(DIFF_MESSAGE);
|
|
|
+ break;
|
|
|
+ case STOP_FLAG: //stop
|
|
|
+ changeToNormalMode();
|
|
|
+ SystemClock.sleep(40);
|
|
|
+ showFlag = TEST_END_FLAG;
|
|
|
+ count = 1000;
|
|
|
+ btTestStep = 0;
|
|
|
+ SystemClock.sleep(10);
|
|
|
+ break;
|
|
|
+ case TESTING_FLAG: //test
|
|
|
+ if (btTestStep == 1) {
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ }
|
|
|
+ else if (btTestStep == 2)
|
|
|
+ {
|
|
|
+ changeToNormalMode();
|
|
|
+ SystemClock.sleep(20);
|
|
|
+
|
|
|
+ //send 0x00 to [0x10174],清除标志
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ iicWrite32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes,0,1);
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x04 0x08 0x00 to [0x10174],通知GT29XX,send cfg
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x04;
|
|
|
+ mBytes[4] = 0x08;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes,0,6);
|
|
|
+
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已准备好,可以send cfg
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes, 1);
|
|
|
+ }while(mBytes[0] != (byte)0x80);
|
|
|
+
|
|
|
+ int iConfigSize = 64 + (int)(byConfigBak[60] & 0xFF) * 256 + (byConfigBak[59] & 0xFF); //the head lend is 64
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ addrfirstbyte = (byte)0x01;
|
|
|
+ addrsecondbyte = (byte)0x3B;
|
|
|
+ addrthirdbyte = (byte)0x74;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ addrfirstbyte = (byte)0x01;
|
|
|
+ addrsecondbyte = (byte)0x21;
|
|
|
+ addrthirdbyte = (byte)0x8C;
|
|
|
+ }
|
|
|
+
|
|
|
+ iicWrite32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, byConfigBak,0,iConfigSize);
|
|
|
+
|
|
|
+ //if (!recallCheck((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, 0, iconfiglen + 64)) {
|
|
|
+ // stMessageLog = "Recall check config error!!";
|
|
|
+ // stMessageLogShow = stMessageLogShow.concat(stMessageLog);iConfigSize
|
|
|
+ //} else {
|
|
|
+ // stMessageLog = "Recall check config success!!";
|
|
|
+ // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ //}
|
|
|
+
|
|
|
+ SystemClock.sleep(8);
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x05 0x09 0x00 to [0x10174],通知GT29XX,cfg发送完毕
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x05;
|
|
|
+ mBytes[4] = 0x09;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes,0,6);
|
|
|
+
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已接收配置
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes, 1);
|
|
|
+ if (mBytes[0] == (byte)0x03)
|
|
|
+ {
|
|
|
+ //stMessageLog = "Config checksum is error!!";
|
|
|
+ //stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }while(mBytes[0] != (byte)0x80);
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x06 0x0A 0x00 to [0x10174],通知GT29XX,流程完成
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x06;
|
|
|
+ mBytes[4] = 0x0A;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes,0,6);
|
|
|
+
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已完成
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes, 1);
|
|
|
+ }while(mBytes[0] != (byte)0x80);
|
|
|
+
|
|
|
+ btTestStep = 3;
|
|
|
+
|
|
|
+ GT29xxShortTestProc();
|
|
|
+
|
|
|
+ SystemClock.sleep(100);
|
|
|
+
|
|
|
+ //btTestStep = 4;
|
|
|
+
|
|
|
+ showFlag = TEST_END_FLAG; //stop
|
|
|
+ count = 1000;
|
|
|
+ btTestStep = 0;
|
|
|
+
|
|
|
+ ActivityCompat.requestPermissions( SensorTest.this, new String[]{android
|
|
|
+ .Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ break;
|
|
|
+ case STYLUSDATA_FLAG: //stylusdata
|
|
|
+ mHandler.sendEmptyMessage(STYLUS_DATA_MESSAGE);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ IicWriteOneByte((byte)0x01, (byte)0x02, (byte)0x74, (byte)0x0f, (byte)0);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ byDisplayFrameCount++;
|
|
|
+
|
|
|
+ IicWriteOneByte((byte)0x01, (byte)0x02, (byte)0x74, (byte)0x0f, (byte)0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } //ThreadPool
|
|
|
+ }); //ThreadPool
|
|
|
+ // return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ Handler mHandler = new Handler() {
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder("");
|
|
|
+ int idtemp;
|
|
|
+ int i = 0;
|
|
|
+ int tempcol = 0;
|
|
|
+ int temprow = 0;
|
|
|
+ boolean flag = false;
|
|
|
+ String dv;
|
|
|
+ int maxdata;
|
|
|
+ int mindata;
|
|
|
+ int itemp; //临时存放
|
|
|
+
|
|
|
+ bShowDataFlag = true; //开始显示
|
|
|
+
|
|
|
+ switch (msg.what) {
|
|
|
+ case RAWDATA_MESSAGE://
|
|
|
+
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
+ maxdata = 0;
|
|
|
+ mindata = 65535;
|
|
|
+ i = 0;
|
|
|
+
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) { //Sen
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum + 1; col++) { //Drv
|
|
|
+
|
|
|
+ TextView textView = new TextView(mContext);
|
|
|
+ GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
+
|
|
|
+ if (col == 0)
|
|
|
+ {
|
|
|
+ dv = Integer.toString(row);
|
|
|
+ //if (row < 10){
|
|
|
+ // dv = "0" + dv;
|
|
|
+ //}
|
|
|
+
|
|
|
+ //stringBuilder.append(dv);
|
|
|
+ //stringBuilder.append("│");
|
|
|
+
|
|
|
+ }else{
|
|
|
+ //idtemp = (row + tempcol * rownum) * 2;
|
|
|
+ //if (byProductType == GT7) //GT7的低位在前
|
|
|
+ {
|
|
|
+ //iDataShow[i] = ((mRawdataBytes[idtemp + 1] & 0xFF) << 8) + (mRawdataBytes[idtemp] & 0xFF);
|
|
|
+
|
|
|
+ if ((showFlag == DIFFDATA_2BYTES_FLAG) && (iDataShow[i] > 50)){ //GT7XXX diffdata
|
|
|
+ textView.setTextColor(Color.parseColor("#FF0000"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //else
|
|
|
+ {
|
|
|
+ //iDataShow[i] = ((mRawdataBytes[idtemp] & 0xFF) << 8) + (mRawdataBytes[idtemp + 1] & 0xFF);
|
|
|
+ }
|
|
|
+
|
|
|
+ dv = Integer.toString(iDataShow[i]);
|
|
|
+
|
|
|
+ //stringBuilder.append(dv + "│");
|
|
|
+
|
|
|
+ tempcol++;
|
|
|
+
|
|
|
+ //获取最大值
|
|
|
+ if (iDataShow[i] > maxdata){
|
|
|
+ maxdata = iDataShow[i];
|
|
|
+ }
|
|
|
+ //获取最小值
|
|
|
+ if (iDataShow[i] < mindata){
|
|
|
+ mindata = iDataShow[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ i++;
|
|
|
+
|
|
|
+ params.width = 50;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ textView.setText(dv);
|
|
|
+ textView.setGravity(Gravity.CENTER);
|
|
|
+ params.setMargins(2,1,2,1);
|
|
|
+
|
|
|
+ textGridLayout.addView(textView,params);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ tempcol = 0;
|
|
|
+ //stringBuilder.append("\n");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //mtextView.setText(stringBuilder.toString());
|
|
|
+ tvMaximum.setText(Integer.toString(maxdata));
|
|
|
+ tvMinimum.setText(Integer.toString(mindata));
|
|
|
+ break;
|
|
|
+
|
|
|
+ case CLEAR_MESSAGE://清除数据
|
|
|
+ mtextView.setText("");
|
|
|
+ break;
|
|
|
+
|
|
|
+ case CONNECTED_SUCCESS: //连接成功
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case DIFF_MESSAGE://
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
+ maxdata = -32767;
|
|
|
+ mindata = 32768;
|
|
|
+ for (int row = 0; row < rownum; row++) { //Sen
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum + 1; col++) { //Drv
|
|
|
+
|
|
|
+ TextView textView = new TextView(mContext);
|
|
|
+ GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
+
|
|
|
+ if (col == 0){
|
|
|
+
|
|
|
+ dv = Integer.toString(row);
|
|
|
+ //if (row < 10){
|
|
|
+ // dv = "0" + dv;
|
|
|
+ //}
|
|
|
+
|
|
|
+ //stringBuilder.append(dv);
|
|
|
+ //stringBuilder.append("│");
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ //idtemp = row + tempcol * rownum;
|
|
|
+ //if (byProductType == GT7) //GT7的低位在前
|
|
|
+ //{
|
|
|
+ // iDataShow[i] = ((mRawdataBytes[idtemp * 2 + 1] & 0xFF) << 8) + (mRawdataBytes[idtemp * 2] & 0xFF);
|
|
|
+ //}else{
|
|
|
+ // iDataShow[i] = ((mRawdataBytes[idtemp * 2] & 0xFF) << 8) + (mRawdataBytes[idtemp * 2 + 1] & 0xFF);
|
|
|
+ //}
|
|
|
+
|
|
|
+ dv = Integer.toString(iDataShow[i]);
|
|
|
+
|
|
|
+ //stringBuilder.append(dv + "│");
|
|
|
+
|
|
|
+ tempcol++;
|
|
|
+
|
|
|
+ //获取最大值
|
|
|
+ if (iDataShow[i] > maxdata){
|
|
|
+ maxdata = iDataShow[i];
|
|
|
+ }
|
|
|
+ //获取最小值
|
|
|
+ if (iDataShow[i] < mindata){
|
|
|
+ mindata = iDataShow[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (iDataShow[i] > 30){
|
|
|
+ textView.setTextColor(Color.parseColor("#FF0000"));
|
|
|
+ }else if (iDataShow[i] < -30){
|
|
|
+ textView.setTextColor(Color.parseColor("#0000FF"));
|
|
|
+ }
|
|
|
+
|
|
|
+ i++;
|
|
|
+
|
|
|
+ params.width = 50;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ textView.setText(dv);
|
|
|
+ textView.setGravity(Gravity.CENTER);
|
|
|
+ params.setMargins(2,1,2,1);
|
|
|
+ //params.width = 45;
|
|
|
+ textGridLayout.addView(textView,params);
|
|
|
+ }
|
|
|
+ tempcol = 0;
|
|
|
+ //stringBuilder.append("\n");
|
|
|
+ }
|
|
|
+ //mtextView.setText(stringBuilder.toString());
|
|
|
+ tvMaximum.setText(Integer.toString(maxdata));
|
|
|
+ tvMinimum.setText(Integer.toString(mindata));
|
|
|
+ break;
|
|
|
+ case MANUALDIFF_MESSAGE:
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+ maxdata = -32767;
|
|
|
+ mindata = 32768;
|
|
|
+ for (int row = 0; row < rownum; row++) { //Sen
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum + 1; col++) { //Drv
|
|
|
+
|
|
|
+ TextView textView = new TextView(mContext);
|
|
|
+ GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
+
|
|
|
+ if (col == 0){
|
|
|
+
|
|
|
+ dv = Integer.toString(row);
|
|
|
+ //if (row < 10){
|
|
|
+ // dv = "0" + dv;
|
|
|
+ //}
|
|
|
+
|
|
|
+ //stringBuilder.append(dv);
|
|
|
+ //stringBuilder.append("│");
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ //idtemp = row + tempcol * rownum;
|
|
|
+ //if (byProductType == GT7) //GT7的低位在前
|
|
|
+ //{
|
|
|
+ // iDataShow[i] = ((mRawdataBytes[idtemp * 2 + 1] & 0xFF) << 8) + (mRawdataBytes[idtemp * 2] & 0xFF);
|
|
|
+ //}else{
|
|
|
+ // iDataShow[i] = ((mRawdataBytes[idtemp * 2] & 0xFF) << 8) + (mRawdataBytes[idtemp * 2 + 1] & 0xFF);
|
|
|
+ //}
|
|
|
+
|
|
|
+ //iDataShow[i] = mManualRefInt[i] - iDataShow[i];
|
|
|
+ dv = Integer.toString(iDataShow[i]);
|
|
|
+
|
|
|
+ //stringBuilder.append(dv + "│");
|
|
|
+
|
|
|
+ tempcol++;
|
|
|
+
|
|
|
+ //获取最大值
|
|
|
+ if (iDataShow[i] > maxdata){
|
|
|
+ maxdata = iDataShow[i];
|
|
|
+ }
|
|
|
+ //获取最小值
|
|
|
+ if (iDataShow[i] < mindata){
|
|
|
+ mindata = iDataShow[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (iDataShow[i] > 30){
|
|
|
+ textView.setTextColor(Color.parseColor("#FF0000"));
|
|
|
+ }else if (iDataShow[i] < -30){
|
|
|
+ textView.setTextColor(Color.parseColor("#0000FF"));
|
|
|
+ }
|
|
|
+
|
|
|
+ i++;
|
|
|
+
|
|
|
+ params.width = 40;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ textView.setText(dv);
|
|
|
+ textView.setGravity(Gravity.CENTER);
|
|
|
+ params.setMargins(2,1,2,1);
|
|
|
+ //params.width = 45;
|
|
|
+ textGridLayout.addView(textView,params);
|
|
|
+ }
|
|
|
+ tempcol = 0;
|
|
|
+ //stringBuilder.append("\n");
|
|
|
+ }
|
|
|
+ //mtextView.setText(stringBuilder.toString());
|
|
|
+ tvMaximum.setText(Integer.toString(maxdata));
|
|
|
+ tvMinimum.setText(Integer.toString(mindata));
|
|
|
+
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ case TEST_DATA_MESSAGE: //
|
|
|
+ if (btTestStep == 1) {
|
|
|
+
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
+ byTestCount++;
|
|
|
+
|
|
|
+ if (byTestCount <= 3)
|
|
|
+ break;
|
|
|
+
|
|
|
+ i = 0;
|
|
|
+ String rawdata_temp_string = " ";
|
|
|
+ int maxvaluetemp = 0;
|
|
|
+ int minvaluetemp = 32700;
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) { //sen
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum; col++) { //drv
|
|
|
+
|
|
|
+ int temp = col * rownum + row; //Rawdata存放和测试阈值存放,行列相反
|
|
|
+
|
|
|
+ rawdata_temp_string += Integer.toString(datatemp[i] & 0xFFFF) + ",";
|
|
|
+
|
|
|
+ if (col == colnum - 1)
|
|
|
+ rawdata_temp_string += "\n";
|
|
|
+
|
|
|
+ //获取最大值
|
|
|
+ if (datatemp[i] > iRawDataMaxVal[temp]) {
|
|
|
+ byOverMaxCount[i]++;
|
|
|
+ }
|
|
|
+ //获取最小值
|
|
|
+ if (datatemp[i] < iRawDataMinVal[temp]) {
|
|
|
+ byLessMinCount[i]++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (byOverMaxCount[i] > 2) {
|
|
|
+ bTestMaxResult = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (byLessMinCount[i] > 2) {
|
|
|
+ bTestMinResult = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (datatemp[i] > maxvaluetemp)
|
|
|
+ {
|
|
|
+ maxvaluetemp = datatemp[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (datatemp[i] < minvaluetemp)
|
|
|
+ {
|
|
|
+ minvaluetemp = datatemp[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ rawdata_temp_string += "\n";
|
|
|
+ /*
|
|
|
+ if (maxdata > iMaximum) //统计最大值大于阈值的次数
|
|
|
+ {
|
|
|
+ byMaximumOverCount++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mindata < iMinimum) //统计最小值小于阈值的次数
|
|
|
+ {
|
|
|
+ byMinimumOverCount++;
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //if (maxdata > mindata * 2) //统计最大值大于阈值的次数
|
|
|
+ //{
|
|
|
+ // byMaximumOverCount++;
|
|
|
+ //}
|
|
|
+
|
|
|
+
|
|
|
+ //if (byTestCount > 3)
|
|
|
+ {
|
|
|
+ stTestLog = getResources().getString(R.string.sampling) + Integer.toString(byTestCount - 3) + getResources().getString(R.string.frame);
|
|
|
+
|
|
|
+ iSaveFrameRawDataMaxValue[byTestCount - 3 - 1] = maxvaluetemp;
|
|
|
+ iSaveFrameRawDataMinValue[byTestCount - 3 - 1] = minvaluetemp;
|
|
|
+
|
|
|
+ switch (byTestCount - 3)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ strSaveRawdata1 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 2:
|
|
|
+ strSaveRawdata2 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 3:
|
|
|
+ strSaveRawdata3 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 4:
|
|
|
+ strSaveRawdata4 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 5:
|
|
|
+ strSaveRawdata5 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 6:
|
|
|
+ strSaveRawdata6 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 7:
|
|
|
+ strSaveRawdata7 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 8:
|
|
|
+ strSaveRawdata8 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 9:
|
|
|
+ strSaveRawdata9 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 10:
|
|
|
+ strSaveRawdata10 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 11:
|
|
|
+ strSaveRawdata11 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 12:
|
|
|
+ strSaveRawdata12 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 13:
|
|
|
+ strSaveRawdata13 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 14:
|
|
|
+ strSaveRawdata14 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 15:
|
|
|
+ strSaveRawdata15 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 16:
|
|
|
+ strSaveRawdata16 = rawdata_temp_string;
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (byTestCount >= 16 + 3) {
|
|
|
+ stTestLogShow = "";
|
|
|
+ strSaveRawDataTestFlagArray = " ";
|
|
|
+ stTestLog = getResources().getString(R.string.maxmintestfinish);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+
|
|
|
+ /*
|
|
|
+ stTestLog = "最大值超过阈值的次数:" + Integer.toString(byMaximumOverCount);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+
|
|
|
+ stTestLog = "最小值超过阈值的次数:" + Integer.toString(byMinimumOverCount);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ stTestLogShow = stTestLogShow.concat("\n");
|
|
|
+ */
|
|
|
+ if (bTestMaxResult == false || bTestMinResult == false) {
|
|
|
+
|
|
|
+ stTestLog = getResources().getString(R.string.maxoutrange);
|
|
|
+ stTestLogShow = stTestLogShow.concat(stTestLog);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((bTestMaxResult == true) && (bTestMinResult == true)) {
|
|
|
+ stTestLog = getResources().getString(R.string.testpass);
|
|
|
+ } else {
|
|
|
+ stTestLog = getResources().getString(R.string.testng);
|
|
|
+ }
|
|
|
+
|
|
|
+ //if (bTestMaxResult == false || bTestMinResult == false)
|
|
|
+ {
|
|
|
+ i = 0;
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) {
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum + 1; col++) {
|
|
|
+
|
|
|
+ TextView textView = new TextView(mContext);
|
|
|
+ GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
+
|
|
|
+ if (col == 0) {
|
|
|
+ dv = Integer.toString(row);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ dv = Integer.toString(datatemp[i]);
|
|
|
+
|
|
|
+ //if ((bypDrvShortFlag[col - 1] == 0x55) || (bypSenShortFlag[row] == 0x55)) {
|
|
|
+ // textView.setTextColor(Color.parseColor("#FF0000")); //红色
|
|
|
+ //}
|
|
|
+
|
|
|
+ if (byOverMaxCount[i] > 2) { //最大值
|
|
|
+ textView.setTextColor(Color.parseColor("#FF0000")); //红色
|
|
|
+ strSaveRawDataTestFlagArray += Integer.toString(0xFF) + ",";
|
|
|
+ }
|
|
|
+ else if (byLessMinCount[i] > 2) { //最小值
|
|
|
+ textView.setTextColor(Color.parseColor("#FFFF00")); //黄色
|
|
|
+ strSaveRawDataTestFlagArray += Integer.toString(0xFF) + ",";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strSaveRawDataTestFlagArray += Integer.toString(0 & 0xFF) + ",";
|
|
|
+ }
|
|
|
+
|
|
|
+ params.width = 50;
|
|
|
+
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ if (bTestMaxResult == false || bTestMinResult == false) {
|
|
|
+ textView.setText(dv);
|
|
|
+ textView.setGravity(Gravity.CENTER);
|
|
|
+ params.setMargins(2, 1, 2, 1);
|
|
|
+ textGridLayout.addView(textView, params);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ strSaveRawDataTestFlagArray += "\n";
|
|
|
+ }
|
|
|
+ strSaveRawDataTestFlagArray += "\n";
|
|
|
+ }
|
|
|
+ //showFlag = STOP_FLAG; //stop
|
|
|
+ btTestStep = 2;
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ }
|
|
|
+ edtShortCircuitInfo.setText("");
|
|
|
+ edt_TestiInformation.setText(stTestLogShow + stTestLog);
|
|
|
+ edt_TestiInformation.setSelection(edt_TestiInformation.getText().length());
|
|
|
+ }
|
|
|
+ else if (3 == btTestStep) {
|
|
|
+ //edt_TestiInformation.setText("");
|
|
|
+ edtShortCircuitInfo.setText(Update_log);
|
|
|
+ edtShortCircuitInfo.setSelection(edtShortCircuitInfo.getText().length());
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ else if (btTestStep == 4){
|
|
|
+ showFlag = TEST_END_FLAG; //stop
|
|
|
+ count = 1000;
|
|
|
+ btTestStep = 0;
|
|
|
+
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ }
|
|
|
+ */
|
|
|
+ break;
|
|
|
+
|
|
|
+ case STYLUS_DATA_MESSAGE:
|
|
|
+ int layindex = 0;
|
|
|
+
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
+ for (int index = 0; index < (rownum + colnum + 2); index++) { //驱动和感应数据之间留有2个空位为0
|
|
|
+
|
|
|
+ if ((index == colnum) || (index == (colnum + 1))) //跳过两个空位
|
|
|
+ {
|
|
|
+ layindex = 0; //开始感应数据的排列
|
|
|
+
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ TextView textView = new TextView(mContext);
|
|
|
+ GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
|
|
+
|
|
|
+ datatemp[index] = ((mRawdataBytes[index * 2 + 1] & 0xFF) << 8) + (mRawdataBytes[index * 2] & 0xFF);
|
|
|
+
|
|
|
+ dv = Integer.toString(datatemp[index]);
|
|
|
+
|
|
|
+ if (datatemp[index] > 80) {
|
|
|
+ textView.setTextColor(Color.parseColor("#FF0000"));
|
|
|
+ }
|
|
|
+
|
|
|
+ layindex++;
|
|
|
+
|
|
|
+ params.width = 40;
|
|
|
+
|
|
|
+ textView.setText(dv);
|
|
|
+ textView.setGravity(Gravity.CENTER);
|
|
|
+ params.setMargins(2,1,2,1);
|
|
|
+
|
|
|
+ if (index < colnum) { //驱动数据排列
|
|
|
+ params.columnSpec = GridLayout.spec(0, 1); //列的位置
|
|
|
+ params.rowSpec = GridLayout.spec(layindex, 1); //行的位置
|
|
|
+ }else{ //感应数据排列
|
|
|
+ params.columnSpec = GridLayout.spec(layindex,1); //列的位置
|
|
|
+ params.rowSpec = GridLayout.spec(0,1); //行的位置
|
|
|
+ }
|
|
|
+ //params.width = 45;
|
|
|
+ textGridLayout.addView(textView, params);
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ } //end of switch (msg.what)
|
|
|
+
|
|
|
+ bShowDataFlag = false; //显示结束
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ //-----------------------------------GT9 short circuit test code start----------------------------------------------------------------------//
|
|
|
+ private int GT9xxxGetRxIndex(int nSensor)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < 30; i++)
|
|
|
+ {
|
|
|
+ if (GT9xxxShortConfig[4 + 42 + i] == nSensor)
|
|
|
+ {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ private int GT9xxxGetTxIndex(int nDriver)
|
|
|
+ {
|
|
|
+ if (nDriver >= 26)
|
|
|
+ {
|
|
|
+ nDriver += 1;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < 42; i++)
|
|
|
+ {
|
|
|
+ if (GT9xxxShortConfig[4 + i] == nDriver)
|
|
|
+ {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean memCmp(byte[] sBuffer,byte[] deBuffer,int offset,int length) {
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ if (sBuffer[i] != deBuffer[offset + i]) {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder("sBuffer[i]=");
|
|
|
+ int v = sBuffer[i] & 0xFF;
|
|
|
+ String hv = Integer.toHexString(v);
|
|
|
+ stringBuilder.append(hv);
|
|
|
+ stringBuilder.append(",dBuffer[offset + i]=");
|
|
|
+
|
|
|
+ v = deBuffer[offset + i]& 0xFF;
|
|
|
+ hv = Integer.toHexString(v);
|
|
|
+ stringBuilder.append(hv);
|
|
|
+ stringBuilder.append(",i=");
|
|
|
+
|
|
|
+ stringBuilder.append(i);
|
|
|
+ stringBuilder.append(",offset=");
|
|
|
+ stringBuilder.append(offset);
|
|
|
+ stringBuilder.append(".\n");
|
|
|
+
|
|
|
+
|
|
|
+ for (int j = 0; j < 129; i++) {
|
|
|
+
|
|
|
+ v = sBuffer[i+j] & 0xFF;
|
|
|
+ hv = Integer.toHexString(v);
|
|
|
+ stringBuilder.append(hv);
|
|
|
+ stringBuilder.append(",");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (ArithmeticException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (ArrayIndexOutOfBoundsException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean recallCheck(byte addressHigh,byte addressLow,byte[] dBuffer,int offset,int length)
|
|
|
+ {
|
|
|
+ byte[] recallBuf =new byte[length+0x3000];
|
|
|
+
|
|
|
+ if (!iicRead(addressHigh, addressLow, recallBuf, length)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!memCmp(recallBuf, dBuffer, offset, length)) { //recallBuf为回读的数据,dBuffer为源数据
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean LoadShortFw() {
|
|
|
+ byte maddressHigh = (byte)0x80;
|
|
|
+ byte maddressLow = (byte)0x40;
|
|
|
+ byte msubcommand =0x04 ; //rst IC
|
|
|
+ byte mdata = (byte)0x00;
|
|
|
+
|
|
|
+ if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
+ Update_log = "[Short-Circuit Test]Touch IC reset failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int k = 0; k < 5; k++)
|
|
|
+ {
|
|
|
+ //nTryTimes--;
|
|
|
+ maddressHigh = (byte)0x41;
|
|
|
+ maddressLow = (byte)0x80; //_rRW_MISCTL__SWRST_B0_
|
|
|
+ msubcommand =0x0f ; //no command
|
|
|
+ mdata = (byte)0x0C;
|
|
|
+
|
|
|
+ iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata);
|
|
|
+ //if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ // return false;
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x40;
|
|
|
+ maddressLow = (byte)0xB0; //_bRW_MISCTL__TMR0_EN
|
|
|
+ mdata = (byte)0x00;
|
|
|
+
|
|
|
+ iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata);
|
|
|
+ //if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ // return false;
|
|
|
+
|
|
|
+ SystemClock.sleep(14);
|
|
|
+ }
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x40;
|
|
|
+ maddressLow = (byte)0x10;
|
|
|
+ msubcommand =0x0f ; //no command
|
|
|
+ mdata = (byte)0x00;
|
|
|
+
|
|
|
+ if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x41;
|
|
|
+ maddressLow = (byte)0x80; //_rRW_MISCTL__SWRST_B0_
|
|
|
+
|
|
|
+ if (0x0C != iicByteRead(maddressHigh,maddressLow))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Hold IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x40;
|
|
|
+ maddressLow = (byte)0xB0; //_rRW_MISCTL__SWRST_B0_
|
|
|
+ if (0x00 != iicByteRead(maddressHigh,maddressLow))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Disable watch dog failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(10);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x40;
|
|
|
+ maddressLow = (byte)0x4B; //_bRW_MISCTL__CACHE_EN
|
|
|
+ mdata = (byte)0x00;
|
|
|
+ msubcommand =0x0f ; //no command
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Clear cache enable failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x41;
|
|
|
+ maddressLow = (byte)0x90; //_rRW_MISCTL__BOOTCTL_B0_
|
|
|
+ mdata = (byte)0x02;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Set _rRW_MISCTL__BOOTCTL_B0_ failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x40;
|
|
|
+ maddressLow = (byte)0x48; //_bRW_MISCTL__SRAM_BANK
|
|
|
+ mdata = (byte)0x00;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Select _bRW_MISCTL__SRAM_BANK failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x40;
|
|
|
+ maddressLow = (byte)0x49; //_bRW_MISCTL__MEM_CD_EN
|
|
|
+ mdata = (byte)0x01;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Enable _bRW_MISCTL__MEM_CD_EN failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0xC0;
|
|
|
+ maddressLow = (byte)0x00; //_bRW_MISCTL__SRAM_BANK 3
|
|
|
+
|
|
|
+ if (!iicWrite(maddressHigh, maddressLow, gt9110h_short_dsp_code, 0, gt9110h_short_dsp_code.length))
|
|
|
+ {
|
|
|
+ Update_log = "Burn 8k short circuit Fw failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(25);
|
|
|
+
|
|
|
+ if (!recallCheck(maddressHigh, maddressLow, gt9110h_short_dsp_code, 0, gt9110h_short_dsp_code.length))
|
|
|
+ {
|
|
|
+ Update_log = "Recall check 8k short circuit FW failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(25);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x50;
|
|
|
+ maddressLow = (byte)0x95; //_rRW_MISCTL__CLR_IC_RUN
|
|
|
+ mdata = (byte)0x00;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Clear IC run flag failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x42;
|
|
|
+ maddressLow = (byte)0x18; //_rRW_MISCTL__BOOT_OPT_B0_
|
|
|
+ mdata = (byte)0x03;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Set _rRW_MISCTL__BOOT_OPT_B0_ failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x41;
|
|
|
+ maddressLow = (byte)0x84; //_bWO_MISCTL__CPU_SWRST_PULSE
|
|
|
+ mdata = (byte)0x01;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Stop reset CPU failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x41;
|
|
|
+ maddressLow = (byte)0x80; //_rRW_MISCTL__SWRST_B0_
|
|
|
+ mdata = (byte)0x08;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Set _rRW_MISCTL__SWRST_B0_ failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean SendShortConfig()
|
|
|
+ {
|
|
|
+ byte maddressHigh;
|
|
|
+ byte maddressLow;
|
|
|
+ byte msubcommand =0x0f ; //no command
|
|
|
+ byte mdata = (byte)0x00;
|
|
|
+
|
|
|
+ //GetDlgItem(IDC_EDIT_CH2CH_SHORT_THR)->GetWindowText(str);
|
|
|
+ int wData = 50;// _ttoi(str);
|
|
|
+ GT9xxxShortConfig[0] = (byte)(wData >> 8);
|
|
|
+ GT9xxxShortConfig[1] = (byte)(wData & 0xFF);
|
|
|
+
|
|
|
+ //GetDlgItem(IDC_EDIT_CH2GND2AVDD_SHORT_THR)->GetWindowText(str);
|
|
|
+ wData = 0x96;// 128;// _ttoi(str);
|
|
|
+ GT9xxxShortConfig[2] = (byte)(wData >> 8);
|
|
|
+ GT9xxxShortConfig[3] = (byte)(wData & 0xFF);
|
|
|
+
|
|
|
+ //GetDlgItem(IDC_EDIT_WAIT_FOR_STABLE)->GetWindowText(str);
|
|
|
+ wData = 20;// _ttoi(str);
|
|
|
+ GT9xxxShortConfig[77] = (byte)(wData >> 8);
|
|
|
+ GT9xxxShortConfig[78] = (byte)(wData & 0xFF);
|
|
|
+
|
|
|
+ for(int i = 4; i < 4 + 42; i++)
|
|
|
+ {
|
|
|
+ GT9xxxShortConfig[i] = bypCfgDrv[i - 4]; //DRV
|
|
|
+ }
|
|
|
+
|
|
|
+ int temp = 4 + 42;
|
|
|
+
|
|
|
+ for(int i = temp; i < temp + 30; i++)
|
|
|
+ {
|
|
|
+ GT9xxxShortConfig[i] = bypCfgSen[i - temp]; //SEN
|
|
|
+ }
|
|
|
+
|
|
|
+ int ichecksum = 0;
|
|
|
+ for (int i = 4; i < 4 + 42 + 30; i++)
|
|
|
+ {
|
|
|
+ int k = GT9xxxShortConfig[i] & 0xFF;
|
|
|
+ ichecksum = ichecksum + k;
|
|
|
+ }
|
|
|
+
|
|
|
+ GT9xxxShortConfig[4 + 42 + 30] = (byte) (256 - ichecksum % 256);
|
|
|
+
|
|
|
+ GT9xxxShortConfig[79] = 0;
|
|
|
+
|
|
|
+ SystemClock.sleep(60);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x50;
|
|
|
+ maddressLow = (byte)0x95; //_rRW_MISCTL__CLR_IC_RUN
|
|
|
+
|
|
|
+ int i;
|
|
|
+ for (i = 0; i < 3; i++)
|
|
|
+ {
|
|
|
+ if ((byte)0xAA == iicByteRead(maddressHigh,maddressLow))
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (3 == i)
|
|
|
+ {
|
|
|
+ Update_log = "Short circuit test init failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x88;
|
|
|
+ maddressLow = (byte)0x04;
|
|
|
+
|
|
|
+ if (!iicWrite(maddressHigh, maddressLow, GT9xxxShortConfig, 0, 80)) {
|
|
|
+
|
|
|
+ Update_log = "Send short circuit config failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(13);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x50;
|
|
|
+ maddressLow = (byte)0x95; //_rRW_MISCTL__CLR_IC_RUN
|
|
|
+ mdata = (byte)0x04;
|
|
|
+
|
|
|
+ if (!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata))
|
|
|
+ {
|
|
|
+ Update_log = "[Short-Circuit Test]Step9 set _rRW_MISCTL__CLR_IC_RUN failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ SystemClock.sleep(1000);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x88;
|
|
|
+ maddressLow = (byte)0x00;
|
|
|
+
|
|
|
+ temp = 1000;
|
|
|
+
|
|
|
+ while(temp > 0)
|
|
|
+ {
|
|
|
+ temp--;
|
|
|
+
|
|
|
+ if ((byte)0x88 == iicByteRead(maddressHigh,maddressLow))
|
|
|
+ {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(20);
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log = "Short circuit test failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private boolean CalculateShort()
|
|
|
+ {
|
|
|
+ byte maddressHigh = (byte)0x88;
|
|
|
+ byte maddressLow = (byte)0x01;
|
|
|
+
|
|
|
+ byte testResult = iicByteRead(maddressHigh,maddressLow);
|
|
|
+
|
|
|
+ byte[] m_diffCode = new byte[144*2];
|
|
|
+ byte[] m_txShortData = new byte[6258];
|
|
|
+ byte[] m_rxShortData = new byte[975];
|
|
|
+
|
|
|
+ byte shortPinNum;
|
|
|
+ int wSelfCode;
|
|
|
+ int[] wTxShortCode = new int[42];
|
|
|
+ int[] wRxShortCode = new int[30];
|
|
|
+
|
|
|
+ int wShortThreshold = 0x32;
|
|
|
+
|
|
|
+ boolean bFailed = false;
|
|
|
+
|
|
|
+ for (int i = 0; i < 46; i++) {
|
|
|
+ bypDrvShortFlag[i] = (byte)255;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < 76; i++) {
|
|
|
+ bypSenShortFlag[i] = (byte)255;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* step3-1 判断是否有短路 */
|
|
|
+ if (0x00 == testResult)
|
|
|
+ {
|
|
|
+ Update_log = getResources().getString(R.string.shorttestfinish);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* step3-2 获取短路的通道个数*/
|
|
|
+ maddressHigh = (byte)0x88;
|
|
|
+ maddressLow = (byte)0x02;
|
|
|
+ byte txShortNum = iicByteRead(maddressHigh,maddressLow);
|
|
|
+
|
|
|
+ maddressHigh = (byte)0x88;
|
|
|
+ maddressLow = (byte)0x03;
|
|
|
+ byte rxShortNum = iicByteRead(maddressHigh,maddressLow);
|
|
|
+
|
|
|
+
|
|
|
+ final byte TX_TO_TX_SHORT = 1;
|
|
|
+ final byte RX_TO_RX_SHORT = 2;
|
|
|
+ final byte TX_TO_RX_SHORT = 4;
|
|
|
+ final byte TRX_TO_GNDAVDD_SHORT = 8;
|
|
|
+
|
|
|
+ int ishortpin1,ishortpin2;
|
|
|
+
|
|
|
+ /* step3-5 输出短路通道号和阻抗*/
|
|
|
+ Update_log = "";
|
|
|
+
|
|
|
+ /* step3-5-1 计算TX与TX的阻抗*/
|
|
|
+ if (TX_TO_TX_SHORT == (testResult & TX_TO_TX_SHORT)
|
|
|
+ || TX_TO_RX_SHORT == (testResult & TX_TO_RX_SHORT))
|
|
|
+ {
|
|
|
+ /* step3-4 逐个获取_ptTxShortResult[i]记为 V2 */
|
|
|
+ maddressHigh = (byte)0x88;
|
|
|
+ maddressLow = (byte)0x60;
|
|
|
+ if(!iicRead(maddressHigh,maddressLow,m_txShortData,txShortNum * 149)) { //读取rawData
|
|
|
+ Update_log = "[Short-Circuit Test]Step3-4-1 cal impedance of Tx&Tx failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < txShortNum; i++)
|
|
|
+ {
|
|
|
+ //初始化数组
|
|
|
+ int offSet = i * 149;
|
|
|
+ shortPinNum = (byte)(m_txShortData[0 + offSet] & 0x7F);
|
|
|
+ wSelfCode = (m_txShortData[1 + offSet] << 8) + m_txShortData[2 + offSet];
|
|
|
+ offSet = offSet + 3;
|
|
|
+ for (int j = shortPinNum; j < 42; j++)
|
|
|
+ {
|
|
|
+ wTxShortCode[j] = (m_txShortData[offSet + (j << 1)] << 8) + m_txShortData[offSet + (j << 1) + 1];
|
|
|
+
|
|
|
+ if (wTxShortCode[j] > wShortThreshold)
|
|
|
+ {
|
|
|
+ int Resistance;
|
|
|
+ if ((j < 15 && shortPinNum < 15)
|
|
|
+ || (j >= 15 && shortPinNum >= 15 && j <= 29 && shortPinNum <= 29)
|
|
|
+ || (j > 29 && shortPinNum > 29))
|
|
|
+ {
|
|
|
+ Resistance = (int)(wSelfCode * 40) / wTxShortCode[j] - 40;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Resistance = (int)(wSelfCode * 60) / wTxShortCode[j] - 60;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
+
|
|
|
+ ishortpin1 = GT9xxxGetTxIndex(shortPinNum & 0x7F);
|
|
|
+ ishortpin2 = GT9xxxGetTxIndex(j);
|
|
|
+
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and Tx"
|
|
|
+ + Integer.toString(ishortpin2) + ": " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+
|
|
|
+ if (Resistance > 800)
|
|
|
+ {
|
|
|
+ //AppendMessage(str, MESSAGE_PAY_ATTENTION);
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //AppendMessage(str, MESSAGE_ERR);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ bFailed = true;
|
|
|
+
|
|
|
+ bypDrvShortFlag[shortPinNum & 0x7F] = 0x55;
|
|
|
+ bypDrvShortFlag[j] = 0x55;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ offSet = offSet + 84;
|
|
|
+
|
|
|
+ for (int j = shortPinNum; j < 30; j++)
|
|
|
+ {
|
|
|
+ wRxShortCode[j] = (m_txShortData[(j << 1) + offSet] << 8) + m_txShortData[(j << 1) + offSet + 1];
|
|
|
+ if (wRxShortCode[j] > wShortThreshold)
|
|
|
+ {
|
|
|
+ int Resistance;
|
|
|
+ if ((j & 0x01) == 0x01)
|
|
|
+ {
|
|
|
+ Resistance = (int)(wSelfCode * 60) / wRxShortCode[j] - 40;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Resistance = (int)(wSelfCode * 60) / wRxShortCode[j] - 60;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
+
|
|
|
+ ishortpin1 = GT9xxxGetTxIndex(shortPinNum & 0x7F);
|
|
|
+ ishortpin2 = GT9xxxGetRxIndex(j);
|
|
|
+
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and Rx"
|
|
|
+ + Integer.toString(ishortpin2) + ": " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+
|
|
|
+ if (Resistance > 800)
|
|
|
+ {
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ bFailed = true;
|
|
|
+
|
|
|
+ bypDrvShortFlag[shortPinNum & 0x7F] = 0x55;
|
|
|
+ bypSenShortFlag[j] = 0x55;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (RX_TO_RX_SHORT == (testResult & RX_TO_RX_SHORT))
|
|
|
+ {
|
|
|
+ maddressHigh = (byte)0xA0;
|
|
|
+ maddressLow = (byte)0xD2;
|
|
|
+ if(!iicRead(maddressHigh,maddressLow,m_rxShortData,rxShortNum * 65)) { //读取rawData
|
|
|
+ Update_log = "[Short-Circuit Test]Step3-4-2 cal impedance of Rx&Rx failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < rxShortNum; i++)
|
|
|
+ {
|
|
|
+ //初始化数组
|
|
|
+ int offSet = i * 65;
|
|
|
+ shortPinNum = (byte)(m_rxShortData[0 + offSet] & 0x7F);
|
|
|
+ wSelfCode = (m_rxShortData[1 + offSet] << 8) + m_rxShortData[2 + offSet];
|
|
|
+ offSet = offSet + 3;
|
|
|
+ for (int j = 0; j < 30; j++)
|
|
|
+ {
|
|
|
+ wRxShortCode[j] = (m_rxShortData[offSet + (j << 1)] << 8) + m_rxShortData[offSet + (j << 1) + 1];
|
|
|
+
|
|
|
+ if (wRxShortCode[j] > wShortThreshold)
|
|
|
+ {
|
|
|
+ int Resistance;
|
|
|
+
|
|
|
+ Resistance = (int)(wSelfCode * 60) / wRxShortCode[j] - 60;
|
|
|
+
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
+
|
|
|
+ ishortpin1 = GT9xxxGetRxIndex(shortPinNum & 0x7F);
|
|
|
+ ishortpin2 = GT9xxxGetRxIndex(j);
|
|
|
+
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ishortpin1) + " and Rx"
|
|
|
+ + Integer.toString(ishortpin2) + ": " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+
|
|
|
+ if (Resistance > 800)
|
|
|
+ {
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ bFailed = true;
|
|
|
+
|
|
|
+ bypSenShortFlag[shortPinNum & 0x7F] = 0x55;
|
|
|
+ bypSenShortFlag[j] = 0x55;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TRX_TO_GNDAVDD_SHORT == (testResult & TRX_TO_GNDAVDD_SHORT))
|
|
|
+ {
|
|
|
+ maddressHigh = (byte)0xA5;
|
|
|
+ maddressLow = (byte)0x31;
|
|
|
+ if(!iicRead(maddressHigh,maddressLow,m_diffCode,144)) { //读取rawData
|
|
|
+ Update_log = "[Short-Circuit Test]cal impedance of TRX to GNDAVDD failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 42 + 30; i++)
|
|
|
+ {
|
|
|
+ int DiffData = (int)(m_diffCode[(i << 1)] << 8) + (int)m_diffCode[(i << 1) + 1];
|
|
|
+
|
|
|
+ int Resistance;
|
|
|
+
|
|
|
+ if ((DiffData & 0x7fff) == 0)
|
|
|
+ DiffData += 1;
|
|
|
+
|
|
|
+ if ((DiffData & 0x8000) == 0x8000)
|
|
|
+ {
|
|
|
+ Resistance = (int)(1 / ((DiffData & 0x7FFF) / 0.9 * 0.7 / 1024 / (3.3 - 0.9) / 40) - 40);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Resistance = (int)(52662.85 / DiffData - 40);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Resistance < 0)
|
|
|
+ Resistance = 0;
|
|
|
+
|
|
|
+ if (i < 42)
|
|
|
+ {
|
|
|
+ ishortpin1 = GT9xxxGetTxIndex(i);
|
|
|
+
|
|
|
+ if ((DiffData & 0x8000) == 0x8000)
|
|
|
+ {
|
|
|
+ if (Resistance < 800)
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and AVDD: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (Resistance < 800)
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ishortpin1) + " and GND: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ishortpin1 = GT9xxxGetRxIndex(i - 42);
|
|
|
+
|
|
|
+ if ((DiffData & 0x8000) == 0x8000)
|
|
|
+ {
|
|
|
+ if (Resistance < 800)
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ishortpin1) + " and AVDD: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (Resistance < 800)
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ishortpin1) + " and GND: " + Integer.toString(Resistance) + "K Ohm\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Resistance > 800)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ bFailed = true;
|
|
|
+
|
|
|
+ if (i < 42) {
|
|
|
+ bypDrvShortFlag[i] = 0x55;
|
|
|
+ }else{
|
|
|
+ bypSenShortFlag[i - 42] = 0x55;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!bFailed)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void GT9xxxShortTestProc()
|
|
|
+ {
|
|
|
+ byte maddressHigh = (byte)0x80;
|
|
|
+ byte maddressLow = (byte)0x40;
|
|
|
+ byte msubcommand =0x04 ; //rst IC
|
|
|
+ byte mdata = (byte)0x00;
|
|
|
+
|
|
|
+ Update_log = "";
|
|
|
+ updateLogShow = "";
|
|
|
+
|
|
|
+ Update_log = getResources().getString(R.string.startshorttest);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ if (!LoadShortFw())
|
|
|
+ {
|
|
|
+ Update_log += ", load FW failed, test is NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
+ Update_log += "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!SendShortConfig())
|
|
|
+ {
|
|
|
+ Update_log += ", send config failed, test is NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
+ Update_log += "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!CalculateShort())
|
|
|
+ {
|
|
|
+ Update_log += getResources().getString(R.string.shorttestng);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
+ Update_log = "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!iicByteWrite(maddressHigh,maddressLow,msubcommand,mdata)) {
|
|
|
+ Update_log = "Reset touch IC failed, short-circuit test NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log += getResources().getString(R.string.testpass);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ }
|
|
|
+
|
|
|
+ //------------------------------------GT9 short circuit test code end------------------------------------------------------------------//
|
|
|
+
|
|
|
+ //------------------------------------GT7 short circuit test code start----------------------------------------------------------------//
|
|
|
+ private int GT7xxxGetRxIndex(byte[] pbyRxAlign, int nSensor)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < 72; i++)
|
|
|
+ {
|
|
|
+ if (pbyRxAlign[i] == nSensor)
|
|
|
+ {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 255;
|
|
|
+ }
|
|
|
+ private int GT7xxxGetTxIndex(byte[] pTxAlign, int nDriver)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < 44; i++)
|
|
|
+ {
|
|
|
+ if (pTxAlign[i] == nDriver)
|
|
|
+ {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void GT7xxxShortTestProc()
|
|
|
+ {
|
|
|
+ byte ShortTestResult = 0;
|
|
|
+
|
|
|
+ Update_log = "";
|
|
|
+ updateLogShow = "";
|
|
|
+
|
|
|
+ Update_log = getResources().getString(R.string.startshorttest);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ iicByteWrite((byte)0x43,(byte)0x7c,(byte)0x0f,(byte)0x00);
|
|
|
+ SystemClock.sleep(15);
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x41,(byte)0x0f,(byte)0x00); //0x8041,command data
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x42,(byte)0x0f,(byte)0xC0); //0x8042,command checksum
|
|
|
+ SystemClock.sleep(15);
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x40,(byte)0x0f,(byte)0x40); //0x8040,0x40:通知FW进入短路测试状态
|
|
|
+
|
|
|
+ SystemClock.sleep(350);
|
|
|
+
|
|
|
+ for (int i = 0; i < 76; i++)
|
|
|
+ {
|
|
|
+ GT7xxxShortConfig[i] = (byte) i;
|
|
|
+
|
|
|
+ if (i > 72)
|
|
|
+ GT7xxxShortConfig[i] = (byte) 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 46; i++)
|
|
|
+ {
|
|
|
+ GT7xxxShortConfig[i + 76] = (byte) i;
|
|
|
+
|
|
|
+ if (i > 44)
|
|
|
+ GT7xxxShortConfig[i + 76] = (byte) 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 46; i++) {
|
|
|
+ bypDrvShortFlag[i] = (byte)255;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < 76; i++) {
|
|
|
+ bypSenShortFlag[i] = (byte)255;
|
|
|
+ }
|
|
|
+
|
|
|
+ byte[] pConfigDrv = new byte[46];
|
|
|
+ byte[] pConfigSen = new byte[76];
|
|
|
+
|
|
|
+ //m_ConfigBak.m_nSenHalfNum = 22;
|
|
|
+ //m_ConfigBak.m_nDrvHalfNum = 22;
|
|
|
+ //m_ConfigBak.m_nSenMaxNum = 72;
|
|
|
+ //m_ConfigBak.m_nDrvMaxNum = 44;
|
|
|
+
|
|
|
+ //if (m_pDlg->m_bBackConfigOKFlag)
|
|
|
+ {
|
|
|
+ int k = 0;
|
|
|
+ for (int i = 0; i < 36; i++) //SenHalfNumber=36
|
|
|
+ {
|
|
|
+ int ch = bypCfgSen[i];
|
|
|
+
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ for (int j = 0; j < 36; j++) //SenHalfNumber=36
|
|
|
+ {
|
|
|
+ if (SenMap[j] == ch)
|
|
|
+ {
|
|
|
+ pConfigSen[k++] = (byte)(j + 36); //SenHalfNumber=36
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 36; i < 72; i++)
|
|
|
+ {
|
|
|
+ int ch = bypCfgSen[i];
|
|
|
+
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if (i < 72)
|
|
|
+ {
|
|
|
+ for (int j = 36; j < 72; j++)
|
|
|
+ {
|
|
|
+ if (SenMap[j] == ch)
|
|
|
+ {
|
|
|
+ pConfigSen[k++] = (byte)(j - 36);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ k = 0;
|
|
|
+ for (int i = 0; i < 22; i++) //DrvHalfNmuber=22
|
|
|
+ {
|
|
|
+ int ch = bypCfgDrv[i];
|
|
|
+
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ for (int j = 0; j < 22; j++) //DrvHalfNmuber=22
|
|
|
+ {
|
|
|
+ if (DrvMap[j] == ch)
|
|
|
+ {
|
|
|
+ pConfigDrv[k++] = (byte)(22 + j); //DrvHalfNmuber=22
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (int i = 23; i < 23 + 44 - 22; i++) //DrvMaxNum=44
|
|
|
+ {
|
|
|
+ int ch = bypCfgDrv[i];
|
|
|
+
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ for (int j = 22; j < 44; j++) //DrvMaxNum=44
|
|
|
+ {
|
|
|
+ if (DrvMap[j] == ch)
|
|
|
+ {
|
|
|
+ pConfigDrv[k++] = (byte)(j - 22); //DrvHalfNmuber=22
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int wCheckSum = 0;
|
|
|
+ for (int i = 0; i < GT7xxxShortConfig.length - 2; i += 2)
|
|
|
+ {
|
|
|
+ wCheckSum += (int)((GT7xxxShortConfig[i + 1]& 0xff) << 8) + (int)(GT7xxxShortConfig[i] & 0xff);
|
|
|
+ }
|
|
|
+ wCheckSum = 0 - wCheckSum;
|
|
|
+ GT7xxxShortConfig[GT7xxxShortConfig.length - 2] = (byte)(wCheckSum & 0xff);
|
|
|
+ GT7xxxShortConfig[GT7xxxShortConfig.length - 1] = (byte)(wCheckSum >> 8);
|
|
|
+
|
|
|
+ int temp = 2000;
|
|
|
+
|
|
|
+ while(temp > 0)
|
|
|
+ {
|
|
|
+ temp--;
|
|
|
+
|
|
|
+ if ((byte)0x01 == iicByteRead((byte)0x80,(byte)0x4A)) //为1则继续往下
|
|
|
+ {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(20);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (temp != 0)
|
|
|
+ {
|
|
|
+ if (iicWrite((byte)0x81, (byte)0x18, GT7xxxShortConfig, 0, GT7xxxShortConfig.length)) //下发正确,继续往下
|
|
|
+ {
|
|
|
+ SystemClock.sleep(8);
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x41,(byte)0x0f,(byte)0x00); //0x8041,command data
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x42,(byte)0x0f,(byte)0xBF); //0x8042,command checksum
|
|
|
+ SystemClock.sleep(15);
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x40,(byte)0x0f,(byte)0x41); //0x8040,0x40:通知FW已完成参数配置
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ temp = 100;
|
|
|
+
|
|
|
+ while(temp > 0)
|
|
|
+ {
|
|
|
+ temp--;
|
|
|
+
|
|
|
+ if ((byte)0x40 == iicByteRead((byte)0x80,(byte)0x4A)) //为0x40则继续往下
|
|
|
+ {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(20);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (temp != 0)
|
|
|
+ {
|
|
|
+ SystemClock.sleep(6000); //6s
|
|
|
+
|
|
|
+ temp = 3000;
|
|
|
+
|
|
|
+ while(temp > 0)
|
|
|
+ {
|
|
|
+ temp--;
|
|
|
+
|
|
|
+ if ((byte)0x43 == iicByteRead((byte)0x80,(byte)0x4A)) //为0x43则继续往下
|
|
|
+ {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(20);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (temp != 0)
|
|
|
+ {
|
|
|
+ ShortTestResult = iicByteRead((byte)0x8A,(byte)0xC0);
|
|
|
+
|
|
|
+ if (ShortTestResult == 0)
|
|
|
+ {
|
|
|
+ iicByteWrite((byte)0x41,(byte)0x80,(byte)0x0f,(byte)0x01); //0x4180 set 0x01
|
|
|
+
|
|
|
+ SystemClock.sleep(500);
|
|
|
+
|
|
|
+ iicByteRead((byte)0x80,(byte)0x00); //read 0x8000
|
|
|
+
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x41,(byte)0x0f,(byte)0x00); //0x8041,command data
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x42,(byte)0x0f,(byte)0x56); //0x8042,command checksum
|
|
|
+
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x40,(byte)0x0f,(byte)0xAA); //0x8040,0xAA:关闭HID-IIC模式
|
|
|
+
|
|
|
+ Update_log = getResources().getString(R.string.shorttestfinish) + getResources().getString(R.string.testpass);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log = "";
|
|
|
+
|
|
|
+ if (ShortTestResult != 0)
|
|
|
+ {
|
|
|
+ byte ShortResisNum = iicByteRead((byte)0x8A,(byte)0xC2);
|
|
|
+ byte[] buf = new byte[128]; //长度要大于64
|
|
|
+ String str;
|
|
|
+
|
|
|
+ for (int i = 0; i < (int)((ShortResisNum & 0xFF) * 4); i += 4)
|
|
|
+ {
|
|
|
+ temp = (int)(0x8AC4 + (byte)i);
|
|
|
+
|
|
|
+ iicRead((byte)((temp&0xff00) >> 8),(byte)(temp&0x00ff),buf,4);
|
|
|
+
|
|
|
+ if ((buf[1] & 0x80) != 0)
|
|
|
+ {
|
|
|
+ int ch = buf[1] & 0x7F;
|
|
|
+ ch = GT7xxxGetTxIndex(pConfigDrv, ch);
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ bypDrvShortFlag[ch] = (byte)0x55;
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(ch) + " and ");
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ int ch = buf[1] & 0xFF;
|
|
|
+
|
|
|
+ ch = GT7xxxGetRxIndex(pConfigSen, ch);
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ bypSenShortFlag[ch] = (byte)0x55;
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(ch) + " and ");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (buf[0] == (byte)0xF0)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("GND:");
|
|
|
+ }
|
|
|
+ else if (buf[0] == (byte)0xF1)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("AVDD:");
|
|
|
+ }
|
|
|
+ else if ((buf[0] & 0x80) != 0)
|
|
|
+ {
|
|
|
+ int ch = buf[0] & 0x7F;
|
|
|
+ ch = GT7xxxGetTxIndex(pConfigDrv, ch);
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ bypDrvShortFlag[ch] = (byte)0x55;
|
|
|
+ Update_log = Update_log.concat("Tx" + Integer.toString(ch) + ": ");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ int ch = buf[0];
|
|
|
+
|
|
|
+ ch = GT7xxxGetRxIndex(pConfigSen, ch);
|
|
|
+ if (ch == 255)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ bypSenShortFlag[ch] = (byte)0x55;
|
|
|
+ Update_log = Update_log.concat("Rx" + Integer.toString(ch) + ": ");
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((int)((buf[2]&0xFF) * 256) + (buf[3]&0xFF) > 800)
|
|
|
+ {
|
|
|
+
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log = Update_log.concat(Integer.toString((int)((buf[2]&0xFF) * 256) + (buf[3]&0xFF)) + "K ohm" + "\n");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log += getResources().getString(R.string.shorttestng);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ SystemClock.sleep(2000);
|
|
|
+
|
|
|
+ iicByteWrite((byte)0x41,(byte)0x80,(byte)0x0f,(byte)0x01); //0x4180 set 0x01
|
|
|
+
|
|
|
+ SystemClock.sleep(500);
|
|
|
+
|
|
|
+ iicByteRead((byte)0x80,(byte)0x00); //read 0x8000
|
|
|
+
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x41,(byte)0x0f,(byte)0x00); //0x8041,command data
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x42,(byte)0x0f,(byte)0x56); //0x8042,command checksum
|
|
|
+
|
|
|
+ iicByteWrite((byte)0x80,(byte)0x40,(byte)0x0f,(byte)0xAA); //0x8040,0xAA:关闭HID-IIC模式
|
|
|
+ }
|
|
|
+
|
|
|
+ //------------------------------------GT7 short circuit test code end------------------------------------------------------------------//
|
|
|
+
|
|
|
+ //------------------------------------GT29xx short circuit test code start-------------------------------------------------------------//
|
|
|
+ int gnDrvMaxNum; //gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+ int gnSenMaxNum; //gnSenMaxNum最大75
|
|
|
+ private int GetDriverChn(int iNumber)
|
|
|
+ {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ gnDrvMaxNum = 52; //gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+
|
|
|
+ for (i = 0; i < gnDrvMaxNum; i++) {
|
|
|
+ if (bypCfgDrv[i] == iNumber)
|
|
|
+ {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ private int GetSensorChn(int iNumber)
|
|
|
+ {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ for (i = 0; i < gnSenMaxNum; i++) {
|
|
|
+ if (bypCfgSen[i] == iNumber)
|
|
|
+ {
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 255;
|
|
|
+ }
|
|
|
+
|
|
|
+ int m_nTestPeriod;
|
|
|
+ private boolean ShortTestrRunCode()
|
|
|
+ {
|
|
|
+ int retry_cnt = 3;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ m_nTestPeriod = 0;
|
|
|
+
|
|
|
+ for (i = 0; i < retry_cnt; i++)
|
|
|
+ {
|
|
|
+ if (i > 0)
|
|
|
+ {
|
|
|
+ if (!IicWriteOneByte((byte)0x01, (byte)0x01, (byte)0x74, (byte)0x04, (byte)0))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //switch to short firmware, send 0x00 0x00 0x04 0x85 0x89 0x00 to [0x10174]
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = (byte)0x85;
|
|
|
+ mBytes[4] = (byte)0x89;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ if (!iicWrite32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes,0,6))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ //wait short ready
|
|
|
+ if (CheckShortTestRunning())
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (i == retry_cnt)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_WAIT_T_ADDR [0x26AE0]
|
|
|
+ if (iicRead32Bits((byte) 0x02, (byte) 0x6A, (byte) 0xE0, mBytes, 2)) {
|
|
|
+ m_nTestPeriod = (mBytes[0] & 0xff) + ((int) (mBytes[1] & 0xff) << 8);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_WAIT_T_ADDR [0x14D7A]
|
|
|
+ if (iicRead32Bits((byte) 0x01, (byte) 0x4D, (byte) 0x7A, mBytes, 2)) {
|
|
|
+ m_nTestPeriod = (mBytes[0] & 0xff) + ((int) (mBytes[1] & 0xff) << 8);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ m_nTestPeriod += 100;
|
|
|
+
|
|
|
+ if (m_nTestPeriod < 800 ||
|
|
|
+ m_nTestPeriod > 30000)
|
|
|
+ {
|
|
|
+ m_nTestPeriod = 2000;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean CheckShortTestRunning()
|
|
|
+ {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ for (i = 0; i < 5; i++)
|
|
|
+ {
|
|
|
+ //read buffer [0x01001E]
|
|
|
+ if (!iicRead32Bits((byte)0x01, (byte)0x00, (byte)0x1E, mBytes, 12))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((mBytes[3] == 'O') && (mBytes[4] == 'S') && (mBytes[5] == 'T'))
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (i == 5)
|
|
|
+ {
|
|
|
+ //01_OST_AA.BB.CC.DD
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ for (i = 0; i < 100; i++)
|
|
|
+ {
|
|
|
+ //read buffer [0x010400]
|
|
|
+ if (!iicRead32Bits((byte)0x01, (byte)0x04, (byte)0x00, mBytes, 1))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mBytes[0] == (byte)0xAA)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ int m_nShortThreshold = 16;
|
|
|
+ int m_nDiffCodeShortThreshold = 16;
|
|
|
+ int m_nAdcReadDelay = 384;
|
|
|
+ private boolean ShortTestSendParam()
|
|
|
+ {
|
|
|
+ byte[] buf_tmp = new byte[64];
|
|
|
+
|
|
|
+ //data store in berlin ram wit little-endian
|
|
|
+ //buf_tmp[0] = (byte)0xAA;
|
|
|
+ //Tx&Tx Rx&Rx Tx&Rx short adc threshold.default=16
|
|
|
+ buf_tmp[0] = (byte)(m_nShortThreshold & 0xff);
|
|
|
+ buf_tmp[1] = (byte)((m_nShortThreshold & 0xff00) >> 8);
|
|
|
+ //diffcode threshold.default=16
|
|
|
+ buf_tmp[2] = (byte)(m_nDiffCodeShortThreshold & 0xff);
|
|
|
+ buf_tmp[3] = (byte)((m_nDiffCodeShortThreshold & 0xff00) >> 8);
|
|
|
+ //adc read delay.default=384
|
|
|
+ buf_tmp[4] = (byte)(m_nAdcReadDelay & 0xff);
|
|
|
+ buf_tmp[5] = (byte)((m_nAdcReadDelay & 0xff00) >> 8);
|
|
|
+
|
|
|
+ for (int i = 0; i < 3; i++)
|
|
|
+ {
|
|
|
+ if (!iicWrite32Bits((byte)0x02, (byte)0x04, (byte)0x02, buf_tmp,0,6))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(30);
|
|
|
+
|
|
|
+ //read BLNB/BLND_SHORT_TEST_CMD_ADDR [0x20402]
|
|
|
+ if (!iicRead32Bits((byte)0x02, (byte)0x04, (byte)0x02, mBytes, 6))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ int j;
|
|
|
+ for (j = 0; j < 6; j++)
|
|
|
+ {
|
|
|
+ if (buf_tmp[j] != mBytes[j])
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (j == 6)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(10);
|
|
|
+
|
|
|
+ //write 0 to BERLIN_SHORT_TEST_CMD_ADDR [0x10400]
|
|
|
+ if (!IicWriteOneByte((byte)0x01, (byte)0x04, (byte)0x00, (byte)0x0F, (byte)0))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean WaitForShortTestFinish()
|
|
|
+ {
|
|
|
+ int i;
|
|
|
+
|
|
|
+ SystemClock.sleep(m_nTestPeriod);
|
|
|
+
|
|
|
+ for (i = 0; i < 100; i++)
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_TEST_STA_ADDR [0x020400]
|
|
|
+ if (!iicRead32Bits((byte) 0x02, (byte) 0x04, (byte) 0x00, mBytes, 1)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_TEST_STA_ADDR [0x13400]
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x34, (byte) 0x00, mBytes, 1)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mBytes[0] == (byte)0x88)
|
|
|
+ break;
|
|
|
+
|
|
|
+ SystemClock.sleep(10);
|
|
|
+ }
|
|
|
+ if (i == 100) //一直检测不到0x88
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean AnalyseTestResult()
|
|
|
+ {
|
|
|
+ boolean ret = true;
|
|
|
+ int ichecksum;
|
|
|
+
|
|
|
+ //gnSenMaxNum最大75,gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+ //byte[] pBuf = new byte[75 * 52 * 2];
|
|
|
+ byte[] ShortResult = new byte[64];
|
|
|
+ //stBerlinShortResult short_res;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_TEST_RES_ADDR [0x020410]
|
|
|
+ if (!iicRead32Bits((byte) 0x02, (byte) 0x04, (byte) 0x10, ShortResult, 8)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_TEST_RES_ADDR [0x13408]
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x34, (byte) 0x08, ShortResult, 8)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ichecksum = 0;
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ int vb = ShortResult[i] & 0xFF;
|
|
|
+ ichecksum = ichecksum + vb;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ichecksum != ((int)(ShortResult[7] & 0xFF) * 256 + (ShortResult[6] & 0xFF)))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //short_res.dxdx_short_flg = mBytes[0] & 0x01;
|
|
|
+ //short_res.sxsx_short_flg = (mBytes[0] >> 1) & 0x01;
|
|
|
+ //short_res.dxsx_short_flg = (mBytes[0] >> 2) & 0x01;
|
|
|
+ //short_res.dxsxgnd_short_flg = (mBytes[0] >> 3) & 0x01;
|
|
|
+ //short_res.dx_short_num = mBytes[1];
|
|
|
+ //short_res.sx_short_num = mBytes[2];
|
|
|
+ //short_res.dxsx_short_num = mBytes[3];
|
|
|
+ //short_res.dxgnd_short_num = mBytes[4];
|
|
|
+ //short_res.sxgnd_short_num = mBytes[5];
|
|
|
+
|
|
|
+ //Tx/Rx & GND/VDD
|
|
|
+ if (((ShortResult[0] & 0x08) >> 3) == 1) {
|
|
|
+ if (!CheckGndVddShortChn())
|
|
|
+ {
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //Tx & Tx
|
|
|
+ if ((ShortResult[0] & 0x01) == 1) {
|
|
|
+ if (!CheckTxTxShortChn(ShortResult[1]))
|
|
|
+ {
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //Rx & Rx
|
|
|
+ if (((ShortResult[0] & 0x02) >> 1) == 1) {
|
|
|
+ if (!CheckRxRxShortChn(ShortResult[2]))
|
|
|
+ {
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //Tx & Rx
|
|
|
+ if (((ShortResult[0] & 0x04) >> 2) == 1) {
|
|
|
+ if (!CheckTxRxShortChn(ShortResult[3]))
|
|
|
+ {
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ int m_drv_gnd_vdd_resistor_threshold = 500;
|
|
|
+ int m_sen_gnd_vdd_resistor_threshold = 500;
|
|
|
+ private boolean CheckGndVddShortChn()
|
|
|
+ {
|
|
|
+ boolean ret = true;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ gnDrvMaxNum = 52; //gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+ gnSenMaxNum = 75; //gnSenMaxNum最大75
|
|
|
+ }else {
|
|
|
+ gnDrvMaxNum = 20; //gnDrvMaxNum最大20
|
|
|
+ gnSenMaxNum = 40; //gnSenMaxNum最大40
|
|
|
+ }
|
|
|
+ //CString str;
|
|
|
+ int nDataLen = (gnDrvMaxNum + gnSenMaxNum) * 2; //gnSenMaxNum最大75,gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_DIFFCODE_ADDR [0x269E0]
|
|
|
+ if (!iicRead32Bits((byte) 0x02, (byte) 0x69, (byte) 0xE0, mBytes, nDataLen)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_DIFFCODE_ADDR [0x14D00]
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) 0x4D, (byte) 0x00, mBytes, nDataLen)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int i, j;
|
|
|
+ for (i = 0; i < gnDrvMaxNum * 2; i += 2)
|
|
|
+ {
|
|
|
+ int chn = i >> 1;
|
|
|
+
|
|
|
+ //must convert it
|
|
|
+ //|max_drv_num_in_die|max_sen_num_in_die|
|
|
|
+ //str = L"";
|
|
|
+ float r = 0;
|
|
|
+ int diff_code = (int)(mBytes[i + 1] & 0xFF) * 256 + (mBytes[i] & 0xFF);
|
|
|
+
|
|
|
+ if ((diff_code & 0x7fff) == 0)
|
|
|
+ {
|
|
|
+ diff_code += 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((diff_code & 0x8000) == 0)//CHN_GND
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = (float) ((150500 / (float) diff_code) - 60);//berlinB
|
|
|
+ }else {
|
|
|
+ r = (float) ((145000 / (float) diff_code) - 15);//berlinD
|
|
|
+ }
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn = GetDriverChn(chn);
|
|
|
+
|
|
|
+ if (r < m_drv_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(chn) + " and GND"
|
|
|
+ + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"TX%d and GND: %dK ohm", chn, (INT)r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str,MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ diff_code &= (~0x8000); //CHN_VDD
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = ((float) (1.25 * 1024 * (3.3 - 1.25) * 99) / (float) diff_code) - 60;//berlinB
|
|
|
+ }else {
|
|
|
+ r = ((float) (1.25 * 1024 * (3.3 - 1.25) * 93) / (float) diff_code) - 20;//berlinD
|
|
|
+ }
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn = GetDriverChn(chn);
|
|
|
+
|
|
|
+ if (r < m_drv_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(chn) + " and AVDD"
|
|
|
+ + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"TX%d and AVDD: %dK ohm", chn, (INT)r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str, MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (; i < nDataLen; i += 2)
|
|
|
+ {
|
|
|
+ int chn = (i >> 1) - gnDrvMaxNum;
|
|
|
+
|
|
|
+ //must convert it
|
|
|
+ //|max_drv_num_in_die|max_sen_num_in_die|
|
|
|
+ //str = L"";
|
|
|
+ float r = 0;
|
|
|
+ int diff_code = (int)(mBytes[i + 1] & 0xFF) * 256 + (mBytes[i] & 0xFF);
|
|
|
+
|
|
|
+ if ((diff_code & 0x7fff) == 0)
|
|
|
+ {
|
|
|
+ diff_code += 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((diff_code & 0x8000) == 0)//CHN_GND
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = (float) ((150500 / (float) diff_code) - 60);//BerlinB
|
|
|
+ }else {
|
|
|
+ r = (float) ((145000 / (float) diff_code) - 15);//BerlinD
|
|
|
+ }
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn = GetSensorChn(chn);
|
|
|
+
|
|
|
+ if (r < m_sen_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(chn) + " and GND"
|
|
|
+ + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"RX%d and GND: %dK ohm", chn, r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str, MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ diff_code &= (~0x8000); //CHN_VDD
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = ((float) (1.25 * 1024 * (3.3 - 1.25) * 99) / (float) diff_code) - 60;//BerlinB
|
|
|
+ }else {
|
|
|
+ r = ((float) (1.25 * 1024 * (3.3 - 1.25) * 93) / (float) diff_code) - 20;//BerlinD
|
|
|
+ }
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn = GetSensorChn(chn);
|
|
|
+
|
|
|
+ if (r < m_sen_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(chn) + " and AVDD"
|
|
|
+ + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"RX%d and AVDD: %dK ohm", chn, (INT)r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str, MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ int m_drv_drv_resistor_threshold = 800;
|
|
|
+ private boolean CheckTxTxShortChn(int nNum)
|
|
|
+ {
|
|
|
+ boolean ret = true;
|
|
|
+ //CString str;
|
|
|
+
|
|
|
+ int nAddr;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ nAddr = 0x049A; //[0x2049A]
|
|
|
+
|
|
|
+ gnDrvMaxNum = 52; //gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+ gnSenMaxNum = 75; //gnSenMaxNum最大75
|
|
|
+ }else {
|
|
|
+ nAddr = 0x344E; //[0x1344E]
|
|
|
+
|
|
|
+ gnDrvMaxNum = 20; //gnDrvMaxNum最大20
|
|
|
+ gnSenMaxNum = 40; //gnSenMaxNum最大40
|
|
|
+ }
|
|
|
+
|
|
|
+ int size = 4 + 2 * gnDrvMaxNum + 2; //BERLIN_SHORT_HEAD是4
|
|
|
+
|
|
|
+ String chn_id1_isRx;
|
|
|
+ String chn_id2_isRx;
|
|
|
+
|
|
|
+ int i;
|
|
|
+ for (i = 0; i < nNum; i++)
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_TxTx_PIN_NUM_ADDR [0x2049A]
|
|
|
+ if (!iicRead32Bits((byte) 0x02, (byte) ((nAddr & 0xff00) >> 8), (byte) (nAddr & 0xff), mBytes, size)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_TxTx_PIN_NUM_ADDR [0x1344E]
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) ((nAddr & 0xff00) >> 8), (byte) (nAddr & 0xff), mBytes, size)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //str = L"";
|
|
|
+ float r = 0;
|
|
|
+
|
|
|
+ int chn_id1 = (int)(mBytes[1] & 0xFF) * 256 + (mBytes[0] & 0xFF);
|
|
|
+ int self_code = (int)(mBytes[3] & 0xFF) * 256 + (mBytes[2] & 0xFF);
|
|
|
+ chn_id1 -= gnSenMaxNum;
|
|
|
+
|
|
|
+ for (int j = 0; j < gnDrvMaxNum; j++)
|
|
|
+ {
|
|
|
+ int temp = 4 + j * 2;
|
|
|
+ int short_code = (int)(mBytes[temp + 1] & 0xFF) * 256 + (mBytes[temp] & 0xFF);
|
|
|
+
|
|
|
+ if (short_code >= m_nShortThreshold)
|
|
|
+ {
|
|
|
+ int chn_id2 = j;// +gnSenMaxNum;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = (float)(1.0 * self_code * 74 / short_code - 74) + 20;//berlinB
|
|
|
+ }else {
|
|
|
+ r = (float)(1.0 * self_code * 70 / short_code - 70) + 59;//berlinD
|
|
|
+ }
|
|
|
+
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn_id1 = GetDriverChn(chn_id1);
|
|
|
+
|
|
|
+ //chn_id2 = GetDriverChn(chn_id2);
|
|
|
+
|
|
|
+ if (r < m_drv_drv_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //TX/RX可以互换,这里要做判断转换
|
|
|
+ chn_id1_isRx = "Tx";
|
|
|
+ if (chn_id1 < 9) //通道序号小于9时
|
|
|
+ {
|
|
|
+ //如果在driver配置里找不到该通道序号,说明改通道用作sensor
|
|
|
+ if (GetDriverChn(chn_id1) == 255) {
|
|
|
+ chn_id1 += 66;
|
|
|
+ chn_id1_isRx = "Rx";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ chn_id2_isRx = "Tx";
|
|
|
+ if (chn_id2 < 9) //通道序号小于9时
|
|
|
+ {
|
|
|
+ //如果在driver配置里找不到该通道序号,说明改通道用作sensor
|
|
|
+ if (GetDriverChn(chn_id2) == 255) {
|
|
|
+ chn_id2 += 66;
|
|
|
+ chn_id2_isRx = "Rx";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]" + chn_id1_isRx + Integer.toString(chn_id1) + " and " + chn_id2_isRx
|
|
|
+ + Integer.toString(chn_id2) + ": " + Integer.toString((int) r) + "K Ohm\n");
|
|
|
+ }else {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(chn_id1) + " and Tx"
|
|
|
+ + Integer.toString(chn_id2) + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"TX%d and TX%d: %dK ohm", chn_id1, chn_id2, (INT)r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str, MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ nAddr += size;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ int m_drv_sen_resistor_threshold = 800;
|
|
|
+ private boolean CheckRxRxShortChn(int nNum)
|
|
|
+ {
|
|
|
+ boolean ret = true;
|
|
|
+ //CString str;
|
|
|
+
|
|
|
+ int nAddr;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ nAddr = 0x1AF2; //[0x21AF2]
|
|
|
+
|
|
|
+ gnDrvMaxNum = 52; //gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+ gnSenMaxNum = 75; //gnSenMaxNum最大75
|
|
|
+ }else {
|
|
|
+ nAddr = 0x37E6; //[0x137E6]
|
|
|
+
|
|
|
+ gnDrvMaxNum = 20; //gnDrvMaxNum最大20
|
|
|
+ gnSenMaxNum = 40; //gnSenMaxNum最大40
|
|
|
+ }
|
|
|
+
|
|
|
+ int size = 4 + 2 * gnSenMaxNum + 2;
|
|
|
+
|
|
|
+ for (int i = 0; i < nNum; i++)
|
|
|
+ {
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_TxTx_PIN_NUM_ADDR [0x21AF2]
|
|
|
+ if (!iicRead32Bits((byte) 0x02, (byte) ((nAddr & 0xff00) >> 8), (byte) (nAddr & 0xff), mBytes, size)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_TxTx_PIN_NUM_ADDR [0x137E6]
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) ((nAddr & 0xff00) >> 8), (byte) (nAddr & 0xff), mBytes, size)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //str = L"";
|
|
|
+ float r = 0;
|
|
|
+
|
|
|
+ int chn_id1 = (int)(mBytes[1] & 0xFF) * 256 + (mBytes[0] & 0xFF);
|
|
|
+ int self_code = (int)(mBytes[3] & 0xFF) * 256 + (mBytes[2] & 0xFF);
|
|
|
+
|
|
|
+ for (int j = 0; j < gnSenMaxNum; j++)
|
|
|
+ {
|
|
|
+ int temp = 4 + j * 2;
|
|
|
+ int short_code = (int)(mBytes[temp + 1] & 0xFF) * 256 + (mBytes[temp] & 0xFF);
|
|
|
+
|
|
|
+ if (short_code >= m_nShortThreshold)
|
|
|
+ {
|
|
|
+ int chn_id2 = j;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = (float)(1.0 * self_code * 74 / short_code - 74) + 20;//berlinB
|
|
|
+ }else {
|
|
|
+ r = (float)(1.0 * self_code * 70 / short_code - 70) + 59;//berlinD
|
|
|
+ }
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn_id1 = GetSensorChn(chn_id1);
|
|
|
+
|
|
|
+ //chn_id2 = GetSensorChn(chn_id2);
|
|
|
+
|
|
|
+ if (r < m_drv_sen_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(chn_id1) + " and Rx"
|
|
|
+ + Integer.toString(chn_id2) + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"RX%d and RX%d: %dK ohm", chn_id1, chn_id2, (INT)r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str, MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ nAddr += size;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private boolean CheckTxRxShortChn(int nNum)
|
|
|
+ {
|
|
|
+ boolean ret = true;
|
|
|
+ //CString str;
|
|
|
+
|
|
|
+ int nAddr;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ nAddr = 0x48A6; //[0x248A6]
|
|
|
+
|
|
|
+ gnDrvMaxNum = 52; //gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
+ gnSenMaxNum = 75; //gnSenMaxNum最大75
|
|
|
+ }else {
|
|
|
+ nAddr = 0x4556; //[0x14556]
|
|
|
+
|
|
|
+ gnDrvMaxNum = 20; //gnDrvMaxNum最大20
|
|
|
+ gnSenMaxNum = 40; //gnSenMaxNum最大40
|
|
|
+ }
|
|
|
+
|
|
|
+ int size = 4 + 2 * gnDrvMaxNum + 2;
|
|
|
+
|
|
|
+ int i;
|
|
|
+ for (i = 0; i < nNum; i++)
|
|
|
+ {
|
|
|
+ //str = L"";
|
|
|
+ float r = 0;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ //read BLNB_SHORT_TxTx_PIN_NUM_ADDR [0x248A6]
|
|
|
+ if (!iicRead32Bits((byte) 0x02, (byte) ((nAddr & 0xff00) >> 8), (byte) (nAddr & 0xff), mBytes, size)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //read BLND_SHORT_TxTx_PIN_NUM_ADDR [0x14556]
|
|
|
+ if (!iicRead32Bits((byte) 0x01, (byte) ((nAddr & 0xff00) >> 8), (byte) (nAddr & 0xff), mBytes, size)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int chn_id1 = (int)(mBytes[1] & 0xFF) * 256 + (mBytes[0] & 0xFF);
|
|
|
+ int self_code = (int)(mBytes[3] & 0xFF) * 256 + (mBytes[2] & 0xFF);
|
|
|
+
|
|
|
+ for (int j = 0; j < gnDrvMaxNum; j++)
|
|
|
+ {
|
|
|
+ int temp = 4 + j * 2;
|
|
|
+ int short_code = (int)(mBytes[temp + 1] & 0xFF) * 256 + (mBytes[temp] & 0xFF);
|
|
|
+
|
|
|
+ if (short_code >= m_nShortThreshold)
|
|
|
+ {
|
|
|
+ int chn_id2 = j;
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ r = (float) (1.0 * self_code * 74 / short_code - 74) + 20;//berlinB
|
|
|
+ }else {
|
|
|
+ r = (float) (1.0 * self_code * 70 / short_code - 70) + 59;//berlinD
|
|
|
+ }
|
|
|
+ r = r >= 0 ? r : 0;
|
|
|
+
|
|
|
+ //chn_id1 = GetSensorChn(chn_id1);
|
|
|
+
|
|
|
+ //chn_id2 = GetDriverChn(chn_id2);
|
|
|
+
|
|
|
+ if (r < m_drv_drv_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
|
|
|
+ {
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(chn_id1) + " and Tx"
|
|
|
+ + Integer.toString(chn_id2) + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
+
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //str.Format(L"RX%d and TX%d: %dK ohm", chn_id1, chn_id2, (INT)r);
|
|
|
+ //m_pDlg->m_editTestLog.AppendMessage(str, MESSAGE_ERR);
|
|
|
+ ret = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ nAddr += size;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ret)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void GT29xxShortTestProc()
|
|
|
+ {
|
|
|
+ byte addrfirstbyte = (byte)0x01;
|
|
|
+ byte addrsecondbyte = (byte)0x01;
|
|
|
+ byte addrthirdbyte = (byte)0x74;
|
|
|
+ byte msubcommand = (byte)0x04; //最高位置1。写命令4 rst IC
|
|
|
+ byte mdata = (byte)0x00;
|
|
|
+
|
|
|
+ Update_log = "";
|
|
|
+ updateLogShow = "";
|
|
|
+
|
|
|
+ Update_log = getResources().getString(R.string.startshorttest);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ bSaveShortTestResult = false;
|
|
|
+
|
|
|
+ if (!ShortTestrRunCode())
|
|
|
+ {
|
|
|
+ Update_log += ", short test run code failed, test is NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ //msubcommand = (byte)0x04 ; //最高位置1。写命令4 rst IC
|
|
|
+ if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ Update_log += "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //return;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x11 ; //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x2A ; //最高位置1,写命令42 ENABLE_ESD_CHECK
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!ShortTestSendParam())
|
|
|
+ {
|
|
|
+ Update_log += ", Short Test Send Param failed, test is NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ //msubcommand = (byte)0x04 ; //最高位置1。写命令4 rst IC
|
|
|
+ if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ Update_log += "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //return;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x11 ; //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x2A ; //最高位置1,写命令42 ENABLE_ESD_CHECK
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!WaitForShortTestFinish())
|
|
|
+ {
|
|
|
+ Update_log += ", Wait For Short Test Finish failed, test is NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ //msubcommand = (byte)0x04 ; //最高位置1。写命令4 rst IC
|
|
|
+ if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ Update_log = "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //return;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x11 ; //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x2A ; //最高位置1,写命令42 ENABLE_ESD_CHECK
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!AnalyseTestResult())
|
|
|
+ {
|
|
|
+ Update_log += getResources().getString(R.string.shorttestng);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+
|
|
|
+ //msubcommand = (byte)0x04 ; //最高位置1。写命令4 rst IC
|
|
|
+ if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ Update_log = "Reset touch IC failed!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //return;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x11 ; //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x2A ; //最高位置1,写命令42 ENABLE_ESD_CHECK
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ Update_log = "Reset touch IC failed, short-circuit test NG!!";
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ //return;
|
|
|
+ }else {
|
|
|
+ Update_log += getResources().getString(R.string.testpass);
|
|
|
+ mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x11; //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
|
|
|
+ mdata = (byte)0x00;
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte)0x2A; //最高位置1,写命令42 ENABLE_ESD_CHECK
|
|
|
+ mdata = (byte)0x00;
|
|
|
+ IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
|
|
|
+
|
|
|
+ bSaveShortTestResult = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //------------------------------------GT29xx short circuit test code end---------------------------------------------------------------//
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(final View view) {
|
|
|
+
|
|
|
+ int checksum;
|
|
|
+ int checksum2;
|
|
|
+ byte addressH;
|
|
|
+ byte addressL;
|
|
|
+ int iConfigSize = 0;
|
|
|
+
|
|
|
+ byte addrfirstbyte, addrsecondbyte, addrthirdbyte;
|
|
|
+
|
|
|
+ switch (view.getId()) {
|
|
|
+
|
|
|
+
|
|
|
+ default: {
|
|
|
+
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ addressH = (byte) 0x80;
|
|
|
+ addressL = (byte) 0x50;
|
|
|
+
|
|
|
+ iicRead(addressH, addressL, mBytes, 444);
|
|
|
+
|
|
|
+ checksum = 0;
|
|
|
+ checksum2 = 0;
|
|
|
+ for (int i = 0; i < 444; i++) {
|
|
|
+ int k = mBytes[i] & 0xFF;
|
|
|
+ if (i < 213) {
|
|
|
+ checksum = checksum + k;
|
|
|
+ } else {
|
|
|
+ checksum2 = checksum2 + k;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((checksum % 256 == 0) && (checksum2 % 256 == 0)) //校验和正确
|
|
|
+ {
|
|
|
+ colnum = (mBytes[381] & 0xFF) + (mBytes[383] & 0xFF); //DRV
|
|
|
+ rownum = (mBytes[380] & 0xFF) + (mBytes[382] & 0xFF); //SEN
|
|
|
+
|
|
|
+ for (int i = 0; i < 44; i++) {
|
|
|
+ bypCfgDrv[i] = mBytes[289 + i];
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 72; i++) {
|
|
|
+ bypCfgSen[i] = mBytes[215 + i];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.cfgerror), Toast.LENGTH_SHORT).show();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x07 0x0B 0x00 to [0x10174],通知GT29XX,要读cfg
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x07;
|
|
|
+ mBytes[4] = 0x0B;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+
|
|
|
+
|
|
|
+ //read [0x10175] = 0x80,config is ready
|
|
|
+ //do {
|
|
|
+ // SystemClock.sleep(30);
|
|
|
+ // iicRead32Bits((byte)0x01, (byte)0x01, (byte)0x75, mBytes, 1);
|
|
|
+ //}while(mBytes[0] != (byte)0x80);
|
|
|
+
|
|
|
+ //read [0x10174] = 0x80,config is ready
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
+
|
|
|
+ //SystemClock.sleep(2);
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ addrfirstbyte = (byte) 0x01;
|
|
|
+ addrsecondbyte = (byte) 0x3B;
|
|
|
+ addrthirdbyte = (byte) 0x74;
|
|
|
+ } else {
|
|
|
+ addrfirstbyte = (byte) 0x01;
|
|
|
+ addrsecondbyte = (byte) 0x21;
|
|
|
+ addrthirdbyte = (byte) 0x8C;
|
|
|
+ }
|
|
|
+
|
|
|
+ //read buffer [0x13B74]/[0X1218C]
|
|
|
+ iicRead32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBytes, 63); //read config head
|
|
|
+
|
|
|
+ iConfigSize = 64 + (int) (mBytes[60] & 0xFF) * 256 + (mBytes[59] & 0xFF); //the head lend is 64
|
|
|
+
|
|
|
+ iicRead32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBytes, iConfigSize); //read config
|
|
|
+
|
|
|
+ SystemClock.sleep(5);
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ for (int i = 0; i < 52; i++) {
|
|
|
+ bypCfgDrv[i] = mBytes[69 + i];
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 75; i++) {
|
|
|
+ bypCfgSen[i] = mBytes[121 + i];
|
|
|
+ }
|
|
|
+
|
|
|
+ colnum = (mBytes[67] & 0xFF); //Drv Num
|
|
|
+ rownum = (mBytes[68] & 0xFF); //Sen Num
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < 20; i++) {
|
|
|
+ bypCfgDrv[i] = mBytes[68 + i];
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 40; i++) {
|
|
|
+ bypCfgSen[i] = mBytes[88 + i];
|
|
|
+ }
|
|
|
+
|
|
|
+ colnum = (mBytes[66] & 0xFF); //Drv Num
|
|
|
+ rownum = (mBytes[67] & 0xFF); //Sen Num
|
|
|
+ }
|
|
|
+
|
|
|
+ //备份配置
|
|
|
+ for (int i = 0; i < iConfigSize; i++) {
|
|
|
+ byConfigBak[i] = mBytes[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x08 0x0C 0x00 to [0x10174],通知GT29XX,通信结束
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x08;
|
|
|
+ mBytes[4] = 0x0C;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+
|
|
|
+ //read [0x10175] = 0x80,config is ready
|
|
|
+ //do {
|
|
|
+ // SystemClock.sleep(30);
|
|
|
+ // iicRead32Bits((byte)0x01, (byte)0x01, (byte)0x75, mBytes, 1);
|
|
|
+ //}while(mBytes[0] != (byte)0x80);
|
|
|
+
|
|
|
+ //read [0x10175] = 0x80,read config is over
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ if(checksum % 256 == 0) //校验和正确
|
|
|
+ {
|
|
|
+ colnum = (mBytes[27] & 0x1F) + (mBytes[28] & 0x1F);
|
|
|
+ rownum = (mBytes[29] & 0x0F) + ((mBytes[29] & 0xFF) >> 4);
|
|
|
+
|
|
|
+ edt_ColNum.setText(Integer.toString(colnum));
|
|
|
+ edt_RowNum.setText(Integer.toString(rownum));
|
|
|
+
|
|
|
+ for (int i = 0; i < 42; i++) {
|
|
|
+ bypCfgDrv[i] = mBytes[142 + i];
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < 30; i++) {
|
|
|
+ bypCfgSen[i] = mBytes[112 + i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.cfgerror), Toast.LENGTH_SHORT).show();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((edt_ColNum.getText().length() == 0) || (edt_RowNum.getText().length() == 0)) {
|
|
|
+ edt_ColNum.setText(Integer.toString(colnum));
|
|
|
+ edt_RowNum.setText(Integer.toString(rownum));
|
|
|
+
|
|
|
+ } else {
|
|
|
+ colnum = (byte) Integer.parseInt(edt_ColNum.getText().toString(), 10);
|
|
|
+ rownum = (byte) Integer.parseInt(edt_RowNum.getText().toString(), 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (colnum == 0) { //DRV
|
|
|
+ colnum = 42;
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ colnum = 44;
|
|
|
+ }
|
|
|
+ edt_ColNum.setText(Integer.toString(colnum));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (rownum == 0) { //SEN
|
|
|
+ rownum = 30;
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ rownum = 72;
|
|
|
+ }
|
|
|
+ edt_RowNum.setText(Integer.toString(rownum));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (showFlag != STYLUSDATA_FLAG) {
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
+
|
|
|
+ textGridLayout.setColumnCount(colnum + 1);
|
|
|
+ textGridLayout.setRowCount(rownum);
|
|
|
+ }
|
|
|
+
|
|
|
+ byDisplayFrame = 0;
|
|
|
+ byDisplayFrameCount = 0;
|
|
|
+ if (byProductType == GT7) //GT7 数据多,要多加时间间隔
|
|
|
+ {
|
|
|
+ byDisplayFrame = 8;
|
|
|
+ byDisplayFrameCount = 8;
|
|
|
+ }
|
|
|
+
|
|
|
+ btn_Test.setEnabled(false);
|
|
|
+
|
|
|
+ switch (view.getId()) {
|
|
|
+ case R.id.testting: //start test
|
|
|
+
|
|
|
+ if (edit_search.getText().length() == 0) {
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.nameandformat), Toast.LENGTH_SHORT).show();
|
|
|
+
|
|
|
+ edt_ColNum.setText("");
|
|
|
+ edt_RowNum.setText("");
|
|
|
+
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ addrfirstbyte = (byte) 0x01;
|
|
|
+ addrsecondbyte = (byte) 0x01;
|
|
|
+ addrthirdbyte = (byte) 0x74;
|
|
|
+
|
|
|
+ byte msubcommand = (byte) 0x12; //最高位置1,写命令18 DISABLE_DIGITER_INTERFACE
|
|
|
+ byte mdata = (byte) 0x00;
|
|
|
+
|
|
|
+ if (!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ SystemClock.sleep(NEXT_COMMAND_DELAY_TIME);
|
|
|
+
|
|
|
+ msubcommand = (byte) 0x2B; //最高位置1,写命令43 DISABLE_ESD_CHECK
|
|
|
+ mdata = (byte) 0x00;
|
|
|
+
|
|
|
+ if (!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //send 0x00 to [0x10174],清除标志
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 1);
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x04 0x08 0x00 to [0x10174],通知GT29XX,send cfg
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x04;
|
|
|
+ mBytes[4] = 0x08;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已准备好,可以send cfg
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
+
|
|
|
+ //配置
|
|
|
+ for (int i = 0; i < iConfigSize; i++) {
|
|
|
+ mBytes[i] = byConfigBak[i];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ mBytes[289] = (byte) ((mBytes[289] & 0xFF) - 4); // disable hopping [289],0x04
|
|
|
+ mBytes[1128] = (byte) ((mBytes[1128] & 0xFF) - 3); // disable NormalizeEn & NormalizeCheckEn [1128],0x03
|
|
|
+ } else {
|
|
|
+ //todo
|
|
|
+ }
|
|
|
+ //配置长度(不含head buffer长度)
|
|
|
+ int iconfiglen = (int) (mBytes[60] & 0xFF) * 256 + (mBytes[59] & 0xFF);
|
|
|
+
|
|
|
+ //计算配置的checksum,不含64字节的head buffer
|
|
|
+ long lchecksum = 0;
|
|
|
+ for (int i = 64; i < (iconfiglen + 64 - 4); i += 2) {
|
|
|
+ int vb = ((mBytes[i + 1] & 0xFF) << 8) + (mBytes[i] & 0xFF);
|
|
|
+ lchecksum = lchecksum + vb;
|
|
|
+ }
|
|
|
+
|
|
|
+ mBytes[iconfiglen + 64 - 4] = (byte) (lchecksum & 0x000000ff);
|
|
|
+ mBytes[iconfiglen + 64 - 3] = (byte) ((lchecksum & 0x0000ff00) >> 8);
|
|
|
+ mBytes[iconfiglen + 64 - 2] = (byte) ((lchecksum & 0x00ff0000) >> 16);
|
|
|
+ mBytes[iconfiglen + 64 - 1] = (byte) ((lchecksum & 0xff000000) >> 24);
|
|
|
+
|
|
|
+ if (byProductType == GT29336) {
|
|
|
+ addrfirstbyte = (byte) 0x01;
|
|
|
+ addrsecondbyte = (byte) 0x3B;
|
|
|
+ addrthirdbyte = (byte) 0x74;
|
|
|
+ } else {
|
|
|
+ addrfirstbyte = (byte) 0x01;
|
|
|
+ addrsecondbyte = (byte) 0x21;
|
|
|
+ addrthirdbyte = (byte) 0x8C;
|
|
|
+ }
|
|
|
+
|
|
|
+ //iicWrite32Bits((byte)0x01, (byte)0x3B, (byte)0x74, mBytes,0,iconfiglen + 64);
|
|
|
+ iicWrite32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBytes, 0, iconfiglen + 64); //read config
|
|
|
+
|
|
|
+ //if (!recallCheck((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, 0, iconfiglen + 64)) {
|
|
|
+ // stMessageLog = "Recall check config error!!";
|
|
|
+ // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ //} else {
|
|
|
+ // stMessageLog = "Recall check config success!!";
|
|
|
+ // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ //}
|
|
|
+
|
|
|
+ SystemClock.sleep(8);
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x05 0x09 0x00 to [0x10174],通知GT29XX,cfg发送完毕
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x05;
|
|
|
+ mBytes[4] = 0x09;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已接收配置
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ if (mBytes[0] == (byte) 0x03) {
|
|
|
+ //stMessageLog = "Config checksum is error!!";
|
|
|
+ //stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
+
|
|
|
+ SystemClock.sleep(15);
|
|
|
+
|
|
|
+ //send 0x00 0x00 0x04 0x06 0x0A 0x00 to [0x10174],通知GT29XX,流程完成
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x06;
|
|
|
+ mBytes[4] = 0x0A;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已完成
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
+
|
|
|
+ /*
|
|
|
+ if (edt_Maximum.getText().length() == 0)
|
|
|
+ {
|
|
|
+ //edt_Maximum.setText(Integer.toString(3500));
|
|
|
+ iMaximum = 3500;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iMaximum = Integer.parseInt(edt_Maximum.getText().toString(),10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (edt_Minimum.getText().length() == 0)
|
|
|
+ {
|
|
|
+ //edt_Minimum.setText(Integer.toString(1750));
|
|
|
+ iMinimum = 1750;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ iMinimum = Integer.parseInt(edt_Minimum.getText().toString(),10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if((iMinimum < (iMaximum / 2)) || (iMinimum > iMaximum))
|
|
|
+ {
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.thresholdlimit), Toast.LENGTH_SHORT).show();
|
|
|
+
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ showFlag = TESTING_FLAG;
|
|
|
+ byTestCount = 0;
|
|
|
+ byMaximumOverCount = 0;
|
|
|
+ byMinimumOverCount = 0;
|
|
|
+ byReTestCount = 0;
|
|
|
+ //count = 1000;
|
|
|
+ showAddressHigh = (byte)0x8b;
|
|
|
+ showAddressLow = (byte)0x98;
|
|
|
+ if (byProductType == GT7)
|
|
|
+ {
|
|
|
+ showAddressHigh = (byte)0xbf;
|
|
|
+ showAddressLow = (byte)0xf0;
|
|
|
+ }
|
|
|
+ if(count == 1000){
|
|
|
+ //tvDataContent.setText("["+getResources().getString(R.string.rawdata)+"]");
|
|
|
+ showRawdata();
|
|
|
+ }
|
|
|
+ */
|
|
|
+ for (int i = 0; i < 52 * 75; i++) {
|
|
|
+ byOverMaxCount[i] = 0;
|
|
|
+ byLessMinCount[i] = 0;
|
|
|
+ byOverAdjCount[i] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ bTestMaxResult = true;
|
|
|
+ bTestMinResult = true;
|
|
|
+
|
|
|
+ showFlag = TESTING_FLAG;
|
|
|
+ byTestCount = 0;
|
|
|
+ byMaximumOverCount = 0;
|
|
|
+ byMinimumOverCount = 0;
|
|
|
+ byReTestCount = 0;
|
|
|
+
|
|
|
+ strSaveRawDataMaxArray = "";
|
|
|
+ strSaveRawDataMinArray = "";
|
|
|
+ //控制行数
|
|
|
+ for (int row = 0; row < rownum; row++) { //sen
|
|
|
+ //控制列数
|
|
|
+ for (int col = 0; col < colnum; col++) { //drv
|
|
|
+
|
|
|
+ int temp = col * rownum + row; //Rawdata存放和测试阈值存放,行列相反
|
|
|
+
|
|
|
+ strSaveRawDataMaxArray += Integer.toString(iRawDataMaxVal[temp] & 0xFFFF) + ",";
|
|
|
+ strSaveRawDataMinArray += Integer.toString(iRawDataMinVal[temp] & 0xFFFF) + ",";
|
|
|
+
|
|
|
+ //if (col == colnum - 1) {
|
|
|
+
|
|
|
+ //}
|
|
|
+ }
|
|
|
+ strSaveRawDataMaxArray += "\n";
|
|
|
+ strSaveRawDataMinArray += "\n";
|
|
|
+ }
|
|
|
+ strSaveRawDataMaxArray += "\n";
|
|
|
+ strSaveRawDataMinArray += "\n";
|
|
|
+
|
|
|
+ tvAllTestResult.setText("");
|
|
|
+
|
|
|
+ if (count == 1000) {
|
|
|
+ //tvDataContent.setText("["+getResources().getString(R.string.rawdata)+"]");
|
|
|
+ showRawdata();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ /*
|
|
|
+ case R.id.stop: //back
|
|
|
+ showFlag = STOP_FLAG;
|
|
|
+
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ //count = 1000;
|
|
|
+ //changeToNormalMode();
|
|
|
+ break;
|
|
|
+ */
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onDestroy() {
|
|
|
+
|
|
|
+ super.onDestroy();
|
|
|
+
|
|
|
+ if (mUsbDeviceConnection != null) {
|
|
|
+ mUsbDeviceConnection.releaseInterface(mUsbInterface);
|
|
|
+ mUsbDeviceConnection.close();
|
|
|
+ mUsbDeviceConnection = null;
|
|
|
+ }
|
|
|
+ mUsbEndpointIn = null;
|
|
|
+ mUsbEndpointOut = null;
|
|
|
+ isReceiverMessage = false;
|
|
|
+ isNeedFindDevice = false;
|
|
|
+ mThreadPool.shutdownNow();
|
|
|
+ // unregisterReceiver(mUsbDetachedReceiver);
|
|
|
+ unregisterReceiver(daOpenDevicesReceiver);
|
|
|
+ }
|
|
|
+
|
|
|
+ //第一次点击事件发生的时间
|
|
|
+ //private long mExitTime;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 点击两次返回退出app
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
|
|
|
+ /*
|
|
|
+ if ((System.currentTimeMillis() - mExitTime) > 2000) {
|
|
|
+ Object mHelperUtils;
|
|
|
+ Toast.makeText(this, "再按一次退出APP", Toast.LENGTH_SHORT).show();
|
|
|
+ //System.currentTimeMillis()系统当前时间
|
|
|
+ mExitTime = System.currentTimeMillis();
|
|
|
+ } else {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
+ */
|
|
|
+ switch (showFlag){
|
|
|
+ case RAWDATA_FLAG: //GT9 rawdata
|
|
|
+ case MANUALDATA_FLAG: //manualdiff
|
|
|
+ case DIFFDATA_1BYTE_FLAG: //diffdata
|
|
|
+ case TESTING_FLAG: //test
|
|
|
+ case DIFFDATA_2BYTES_FLAG: //GT738X rawdata
|
|
|
+ case STYLUSDATA_FLAG: //stylusdata
|
|
|
+ showFlag = STOP_FLAG;
|
|
|
+
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+
|
|
|
+ break;
|
|
|
+ case TEST_END_FLAG: //test end
|
|
|
+ case STOP_FLAG: //stop
|
|
|
+ default:
|
|
|
+ finish();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return super.onKeyDown(keyCode, event);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
|
+ switch (requestCode) {
|
|
|
+ case 1:
|
|
|
+ String filePath;// = Environment.getExternalStorageDirectory() + "/saveconfig/";
|
|
|
+ String fileName;
|
|
|
+ String temp_string;
|
|
|
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
|
+ //创建文件夹
|
|
|
+ if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
|
+
|
|
|
+ StringBuilder configBuilder = new StringBuilder("");
|
|
|
+
|
|
|
+ //1.save config
|
|
|
+ configBuilder.append("[Chip Config]\n");
|
|
|
+ int iConfigSize = 64 + (int)(byConfigBak[60] & 0xFF) * 256 + (byConfigBak[59] & 0xFF); //the head lend is 64
|
|
|
+
|
|
|
+ for (int i = 0; i < iConfigSize; i++) {
|
|
|
+ configBuilder.append("0x" + Integer.toHexString(byConfigBak[i] & 0xFF) + ",");
|
|
|
+ }
|
|
|
+ configBuilder.append("\n\n");
|
|
|
+
|
|
|
+ //2.save Chanel Number
|
|
|
+ configBuilder.append("[Chanel Number]\n");
|
|
|
+ configBuilder.append("SensorNum:" + edt_RowNum.getText() + "\n");
|
|
|
+ configBuilder.append("DriverNum:" + edt_ColNum.getText() + "\n\n");
|
|
|
+
|
|
|
+ //3.save test result
|
|
|
+ configBuilder.append("[Test Result]\n");
|
|
|
+
|
|
|
+ temp_string = "Pass";
|
|
|
+ if (bTestMaxResult == false || bTestMinResult == false)
|
|
|
+ {
|
|
|
+ temp_string = "Failed";
|
|
|
+ }
|
|
|
+ configBuilder.append("MaxMinTest:" + temp_string + "\n");
|
|
|
+
|
|
|
+ temp_string = "Pass";
|
|
|
+ if (bSaveShortTestResult == false)
|
|
|
+ {
|
|
|
+ temp_string = "Failed";
|
|
|
+ }
|
|
|
+ configBuilder.append("ShortTest:" + temp_string + "\n");
|
|
|
+ configBuilder.append(edtShortCircuitInfo.getText() + "\n\n");
|
|
|
+
|
|
|
+ if (bTestMaxResult == false || bTestMinResult == false || bSaveShortTestResult == false)
|
|
|
+ {
|
|
|
+ tvAllTestResult.setTextColor(Color.parseColor("#FF2512"));
|
|
|
+ tvAllTestResult.setText("Fail");
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ tvAllTestResult.setTextColor(Color.parseColor("#88FF56"));
|
|
|
+ tvAllTestResult.setText("PASS");
|
|
|
+ }
|
|
|
+
|
|
|
+ //4.save maxvalue and minvalue of every frame
|
|
|
+ configBuilder.append("Frame Index" + ",");
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
+ configBuilder.append(Integer.toString(i & 0xFF) + ",");
|
|
|
+ }
|
|
|
+ configBuilder.append("\n");
|
|
|
+
|
|
|
+ configBuilder.append("MaxValue:" + ",");
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
+ configBuilder.append(Integer.toString(iSaveFrameRawDataMaxValue[i] & 0xFFFF) + ",");
|
|
|
+ }
|
|
|
+ configBuilder.append("\n");
|
|
|
+
|
|
|
+ configBuilder.append("MinValue:" + ",");
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
+ configBuilder.append(Integer.toString(iSaveFrameRawDataMinValue[i] & 0xFFFF) + ",");
|
|
|
+ }
|
|
|
+ configBuilder.append("\n\n");
|
|
|
+
|
|
|
+ //5.save maxvaluearray & minvaluearray
|
|
|
+ configBuilder.append("[MaximumThresholdArray]\n");
|
|
|
+ configBuilder.append(strSaveRawDataMaxArray);
|
|
|
+ configBuilder.append("[MinimumThresholdArray]\n");
|
|
|
+ configBuilder.append(strSaveRawDataMinArray);
|
|
|
+ configBuilder.append("[MaxMinTestResultFlagArray]\n");
|
|
|
+ configBuilder.append(strSaveRawDataTestFlagArray);
|
|
|
+
|
|
|
+ //6.save rawdataarray
|
|
|
+ configBuilder.append("[Rawdata[0]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata1);
|
|
|
+ configBuilder.append("[Rawdata[1]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata2);
|
|
|
+ configBuilder.append("[Rawdata[2]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata3);
|
|
|
+ configBuilder.append("[Rawdata[3]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata4);
|
|
|
+ configBuilder.append("[Rawdata[4]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata5);
|
|
|
+ configBuilder.append("[Rawdata[5]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata6);
|
|
|
+ configBuilder.append("[Rawdata[6]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata7);
|
|
|
+ configBuilder.append("[Rawdata[7]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata8);
|
|
|
+ configBuilder.append("[Rawdata[8]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata9);
|
|
|
+ configBuilder.append("[Rawdata[9]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata10);
|
|
|
+ configBuilder.append("[Rawdata[10]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata11);
|
|
|
+ configBuilder.append("[Rawdata[11]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata12);
|
|
|
+ configBuilder.append("[Rawdata[12]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata13);
|
|
|
+ configBuilder.append("[Rawdata[13]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata14);
|
|
|
+ configBuilder.append("[Rawdata[14]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata15);
|
|
|
+ configBuilder.append("[Rawdata[15]]\n");
|
|
|
+ configBuilder.append(strSaveRawdata16);
|
|
|
+
|
|
|
+ filePath = Environment.getExternalStorageDirectory() + "/test_result/";
|
|
|
+ //File file = new File(filePath);
|
|
|
+
|
|
|
+ temp_string = "GT";
|
|
|
+ String hv = "";
|
|
|
+ iicRead32Bits((byte)0x01, (byte)0x00, (byte)0x14,mBytes, 23);
|
|
|
+
|
|
|
+ for (int i = 10; i < 15; i++) //Get PID
|
|
|
+ {
|
|
|
+ if (mBytes[i] == 0)
|
|
|
+ break;
|
|
|
+
|
|
|
+ int v = (mBytes[i] - 48) & 0xFF; //ASCII码减去48
|
|
|
+ hv = Integer.toHexString(v);
|
|
|
+ temp_string += hv;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (temp_string.length() < 6)
|
|
|
+ {
|
|
|
+ temp_string = "Null";
|
|
|
+ } else{
|
|
|
+
|
|
|
+ temp_string += "_";
|
|
|
+
|
|
|
+ for (int i = 18; i < 22; i++) //Get version
|
|
|
+ {
|
|
|
+ int v = mBytes[i] & 0xFF;
|
|
|
+ hv = Integer.toHexString(v);
|
|
|
+ if (hv.length() < 2){
|
|
|
+ hv = "0" + hv;
|
|
|
+ }
|
|
|
+
|
|
|
+ temp_string += hv;
|
|
|
+
|
|
|
+ if (i < 21)
|
|
|
+ {
|
|
|
+ temp_string += ".";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ temp_string += "_v" + Integer.toString(byConfigBak[34] & 0xFF) + "_";
|
|
|
+ temp_string += edt_RowNum.getText() + "x" + edt_ColNum.getText() + "_";
|
|
|
+
|
|
|
+
|
|
|
+ if (bTestMaxResult == false || bTestMinResult == false || bSaveShortTestResult == false)
|
|
|
+ {
|
|
|
+ temp_string += "NG_";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ temp_string += "OK_";
|
|
|
+ }
|
|
|
+
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
|
|
|
+ Date date = new Date(System.currentTimeMillis()); //获取当前系统时间
|
|
|
+
|
|
|
+ fileName = temp_string + simpleDateFormat.format(date) + ".csv";//editname.getText().toString();
|
|
|
+ writeTxtToFile(configBuilder.toString().trim(), filePath, fileName);
|
|
|
+
|
|
|
+ //mShow.setText(fileName + getResources().getString(R.string.saveto) + filePath.toString());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
|
+ //创建文件夹
|
|
|
+ if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 3:
|
|
|
+ if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
|
|
|
+ //权限已成功申请
|
|
|
+ readFile();
|
|
|
+ }else{
|
|
|
+ //用户拒绝授权
|
|
|
+ Toast.makeText(this,getResources().getString(R.string.nopermission), Toast.LENGTH_SHORT).show();
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 将字符串写入到文本文件中
|
|
|
+ public void writeTxtToFile(String strcontent, String filePath, String fileName) {
|
|
|
+ // 生成文件夹之后,再生成文件,不然会出错
|
|
|
+ makeFilePath(filePath, fileName);
|
|
|
+
|
|
|
+ String strFilePath = filePath + fileName;
|
|
|
+ // 每次写入时,都换行写
|
|
|
+ String strContent = strcontent + "\r\n";
|
|
|
+ try {
|
|
|
+ File file = new File(strFilePath);
|
|
|
+ if (!file.exists()) {
|
|
|
+ Log.d("TestFile", "Create the file:" + strFilePath);
|
|
|
+ file.getParentFile().mkdirs();
|
|
|
+ file.createNewFile();
|
|
|
+ }
|
|
|
+ RandomAccessFile raf = new RandomAccessFile(file, "rwd");
|
|
|
+ raf.seek(file.length());
|
|
|
+ raf.write(strContent.getBytes());
|
|
|
+ raf.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成文件
|
|
|
+ public File makeFilePath(String filePath, String fileName) {
|
|
|
+ File file = null;
|
|
|
+ makeRootDirectory(filePath);
|
|
|
+ try {
|
|
|
+ file = new File(filePath + fileName);
|
|
|
+ if (!file.exists()) {
|
|
|
+ file.createNewFile();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return file;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成文件夹
|
|
|
+ public static void makeRootDirectory(String filePath) {
|
|
|
+ File file = null;
|
|
|
+ try {
|
|
|
+ file = new File(filePath);
|
|
|
+ if (!file.exists()) {
|
|
|
+ file.mkdir();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|