package kr.co.icontrols.ilp300_700.admin.setting;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.widget.RelativeLayout;

import kr.co.icontrols.ilp300_700.MainActivity;
import kr.co.icontrols.ilp300_700.R;
import kr.co.icontrols.ilp300_700.global.Configure;
import kr.co.icontrols.ilp300_700.global.Configure.ConfigValue;
import kr.co.icontrols.ilp300_700.global.Configure.SetValue;
import kr.co.icontrols.ilp300_700.global.DataClasses.POSITION;
import kr.co.icontrols.ilp300_700.global.Declare;
import kr.co.icontrols.ilp300_700.global.Enumeration.DATAINPUTSTEP;
import kr.co.icontrols.ilp300_700.global.Global;
import kr.co.icontrols.ilp300_700.global.ID;
import kr.co.icontrols.wallpadsupport.WpadImageView;
import kr.co.icontrols.wallpadsupport.WpadScreen;
import kr.co.icontrols.wallpadsupport.WpadTextView;

public class AdminSet_Setting_OnePassRSSIIndex extends WpadScreen {

    String TAG = "AdminSet_Setting_OnePassRSSIIndex";

    boolean bLOG = true;   // true, false
    boolean bLOG_DEBUG = false;   // true, false
    boolean bLOG_INFO = true;   // true, false
    Context mContext;
    WpadImageView Image_Background;
    WpadTextView Text_Title;
    WpadTextView Text_Guide;
    WpadTextView Text_Line_01_Item;
    WpadTextView Text_Line_02_Item;
    WpadTextView Text_Line_03_Item;
    WpadTextView Text_Line_04_Item;
    WpadTextView Text_Line_01_Input;
    WpadTextView Text_Line_02_Input;
    WpadTextView Text_Line_03_Input;

    int TextColor_Normal = Color.WHITE;
    int TextColor_Highlight = Color.GREEN;
    int nFontSize_Guide = 14;
    int nFontSize_Instruction = 28;
    boolean bFontNonBold = false;
    boolean bFontBold = true;

    String strText_Title = "원패스 RSSI 테이블";
    String strText_Guide = " * : 행 이동\n경비실 : 설정";
    String strText_Line_01_Item = "RSSI 1";
    String strText_Line_02_Item = "RSSI 2";
    String strText_Line_03_Item = "RSSI 3";
    String strText_Line_04_Item = "1: ↓       범위 : 0 ~ 20       3: ↑";
    String strText_Line_01_Input = "";
    String strText_Line_02_Input = "";
    String strText_Line_03_Input = "";

    int[] naRSSI = new int[] { 10, 10, 10 };
    int MIN_RSSI = 0;
    int MAX_RSSI = 20;

    public AdminSet_Setting_OnePassRSSIIndex(Context context, RelativeLayout layout) {
        super(context, layout);
        try {
            LOG("------------------ [START - AdminSet_Setting_OnePassRSSIIndex] -------------------");

            mContext = context;
            Initialize();

            Image_Background = new WpadImageView(context, 0, Declare.DeviceInfo.getScreenSizeFullW(ConfigValue.DEVICE_MODELTYPE), Declare.DeviceInfo.getScreenSizeFullH(ConfigValue.DEVICE_MODELTYPE), R.drawable.bg_back, 0, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.IMAGES.BACKGROUND);
            ViewRegistration(layout, Image_Background, 0, 0);

            Text_Title = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.TITLE).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.TITLE).H, Gravity.CENTER, Color.WHITE, nFontSize_Instruction, bFontBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.TITLE);
            ViewRegistration(layout, Text_Title, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.TITLE).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.TITLE).Y);
            Text_Title.setText(strText_Title);

            Text_Guide = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.GUIDE).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.GUIDE).H, Gravity.LEFT, Color.parseColor("#7d7d7d"), nFontSize_Guide, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.GUIDE);
            ViewRegistration(layout, Text_Guide, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.GUIDE).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.GUIDE).Y);
            Text_Guide.setText(strText_Guide);

            Text_Line_01_Item = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Item).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Item).H, Gravity.LEFT, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Item);
            ViewRegistration(layout, Text_Line_01_Item, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Item).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Item).Y);
            Text_Line_01_Item.setText(strText_Line_01_Item);

            Text_Line_02_Item = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Item).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Item).H, Gravity.LEFT, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Item);
            ViewRegistration(layout, Text_Line_02_Item, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Item).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Item).Y);
            Text_Line_02_Item.setText(strText_Line_02_Item);

            Text_Line_03_Item = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Item).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Item).H, Gravity.LEFT, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Item);
            ViewRegistration(layout, Text_Line_03_Item, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Item).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Item).Y);
            Text_Line_03_Item.setText(strText_Line_03_Item);

            Text_Line_04_Item = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Item).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Item).H, Gravity.CENTER, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Item);
            ViewRegistration(layout, Text_Line_04_Item, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Item).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Item).Y);
            Text_Line_04_Item.setText(strText_Line_04_Item);

            Text_Line_01_Input = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Input).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Input).H, Gravity.LEFT, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Input);
            ViewRegistration(layout, Text_Line_01_Input, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Input).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Input).Y);
            Text_Line_01_Input.setText("[ " + strText_Line_01_Input + " ]");

            Text_Line_02_Input = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Input).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Input).H, Gravity.LEFT, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Input);
            ViewRegistration(layout, Text_Line_02_Input, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Input).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Input).Y);
            Text_Line_02_Input.setText("[ " + strText_Line_02_Input + " ]");

            Text_Line_03_Input = new WpadTextView(context, false, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Input).W, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Input).H, Gravity.LEFT, Color.WHITE, nFontSize_Instruction, bFontNonBold, ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Input);
            ViewRegistration(layout, Text_Line_03_Input, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Input).X, getPosition(ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Input).Y);
            Text_Line_03_Input.setText("[ " + strText_Line_03_Input + " ]");

            UpdateScreen();

            if (ConfigValue.eFirstBoot != SetValue.TRUE) {
                ((MainActivity) mContext).setAutoScreenChange(ID.SCREENS.Main, MainActivity.nAdminScreenTimeout);
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] AdminSet_Setting_OnePassRSSIIndex(Context context, RelativeLayout layout)");
            e.printStackTrace();
        }
    }

    private void LOG(String log) {
        if (bLOG) Log.v(TAG, log);
    }

    private void LOG_DEBUG(String log) {
        if (bLOG_DEBUG) Log.d(TAG, log);
    }

    private void LOG_INFO(String log) {
        if (bLOG_INFO) Log.i(TAG, log);
    }

    protected void Initialize() {
        try {
            Global.DataInputStep = DATAINPUTSTEP.INPUT_01;

            naRSSI = getOnepassRSSI();

            strText_Line_01_Input = Integer.toString(naRSSI[0]);
            strText_Line_02_Input = Integer.toString(naRSSI[1]);
            strText_Line_03_Input = Integer.toString(naRSSI[2]);

        } catch (Exception e) {
            Log.e(TAG, "[Exception] Initialize() : " + e);
            e.printStackTrace();
        }
    }

    private int[] getOnepassRSSI() {
        int[] naResult = { 10, 10, 10 };
        try {
            Log.i(TAG, "[getOnepassRSSI] ConfigValue.strOnePassRSSI [" + ConfigValue.strOnePassRSSI + "]");
            String[] strParsed = ConfigValue.strOnePassRSSI.split("/");
            if (strParsed.length != 3) {
                Log.i(TAG, "[getOnepassRSSI] strParsed length is not 3. return dafault values.");
                return naResult;
            }

            for (int i = 0; i < naResult.length; i++) {
                naResult[i] = Integer.parseInt(strParsed[i]);
            }

        } catch (Exception e) {
            Log.e(TAG, "[Exception] getOnepassRSSI()");
            e.printStackTrace();
        }
        return naResult;
    }

    @Override
    protected void onClose() {
        try {
            LOG("------------------ [onClose - AdminSet_Setting_OnePassRSSIIndex] -------------------");
        } catch (Exception e) {
            Log.e(TAG, "[Exception] onClose() : " + e);
            e.printStackTrace();
        }
        super.onClose();
    }

    @Override
    protected void onBrReceive(Intent intent) {
        try {
            LOG("[onBrReceive] Intent : " + intent);
        } catch (Exception e) {
            Log.e(TAG, "[Exception] onBrReceive(Intent intent)");
            e.printStackTrace();
        }
        super.onBrReceive(intent);
    }

    @Override
    protected void onKeyDown(int keyCode, KeyEvent event) {
        try {
            LOG("[onKeyDown] keyCode [" + keyCode + "]");
            if (keyCode == Declare.Button.NUMBER_01) {
                ctrlRSSIIndex(false);
                UpdateScreen();
            }
            else if (keyCode == Declare.Button.NUMBER_03) {
                ctrlRSSIIndex(true);
                UpdateScreen();
            }
            else if (keyCode == Declare.Button.STAR) {
                if (Global.DataInputStep == DATAINPUTSTEP.INPUT_01) {
                    Global.DataInputStep = DATAINPUTSTEP.INPUT_02;
                }
                else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_02) {
                    Global.DataInputStep = DATAINPUTSTEP.INPUT_03;
                }
                else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_03) {
                    Global.DataInputStep = DATAINPUTSTEP.INPUT_01;
                }
                UpdateScreen();
            }
            else if (keyCode == Declare.Button.GUARD) {
                // 설정정보를 저장하는 기능을 정의한다.
                if (!setOnepassRSSI(naRSSI)) {
                    MainActivity.mSound.PlayMent_lobby(R.raw.trylater);
                } else {
                    MainActivity.mSound.PlayMent_lobby(R.raw.setting);
                }
                super.setChangeScreen(ID.SCREENS.AdminSet_Setting);
            }
            else if (keyCode == Declare.Button.CANCEL || keyCode == Declare.Button.TACT_CANCEL) {
                if (ConfigValue.eFirstBoot != SetValue.TRUE) {
                    super.setChangeScreen(ID.SCREENS.AdminSet_Setting);
                }
                else {
                    Initialize();
                    MainActivity.mSound.PlayMent_lobby(R.raw.retryinput);
                    UpdateScreen();
                }
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] onKeyDown(int keyCode, KeyEvent event)");
            e.printStackTrace();
        }
        super.onKeyDown(keyCode, event);
    }

    private void ctrlRSSIIndex(boolean bUp) {
        try {
            if (bUp) {
                if (Global.DataInputStep == DATAINPUTSTEP.INPUT_01) {
                    if (naRSSI[0] < MAX_RSSI) naRSSI[0]++;
                    else if (naRSSI[0] == MAX_RSSI) naRSSI[0] = MAX_RSSI;
                    strText_Line_01_Input = Integer.toString(naRSSI[0]);
                }
                else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_02) {
                    if (naRSSI[1] < MAX_RSSI) naRSSI[1]++;
                    else if (naRSSI[1] == MAX_RSSI) naRSSI[1] = MAX_RSSI;
                    strText_Line_02_Input = Integer.toString(naRSSI[1]);
                }
                else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_03) {
                    if (naRSSI[2] < MAX_RSSI) naRSSI[2]++;
                    else if (naRSSI[2] == MAX_RSSI) naRSSI[2] = MAX_RSSI;
                    strText_Line_03_Input = Integer.toString(naRSSI[2]);
                }
            }
            else {
                if (Global.DataInputStep == DATAINPUTSTEP.INPUT_01) {
                    if (naRSSI[0] > MIN_RSSI) naRSSI[0]--;
                    else if (naRSSI[0] == MIN_RSSI) naRSSI[0] = MIN_RSSI;
                    strText_Line_01_Input = Integer.toString(naRSSI[0]);
                }
                else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_02) {
                    if (naRSSI[1] > MIN_RSSI) naRSSI[1]--;
                    else if (naRSSI[1] == MIN_RSSI) naRSSI[1] = MIN_RSSI;
                    strText_Line_02_Input = Integer.toString(naRSSI[1]);
                }
                else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_03) {
                    if (naRSSI[2] > MIN_RSSI) naRSSI[2]--;
                    else if (naRSSI[2] == MIN_RSSI) naRSSI[2] = MIN_RSSI;
                    strText_Line_03_Input = Integer.toString(naRSSI[2]);
                }
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] ctrlRSSIIndex(boolean bUp)");
            e.printStackTrace();
        }
    }

    protected void UpdateScreen() {
        try {
//            LOG("[updateScreen] Start!!");
            if (Global.DataInputStep == DATAINPUTSTEP.INPUT_01) {
                Text_Line_01_Input.setText("[ " + strText_Line_01_Input + " ]");
                Text_Line_01_Item.setTextColor(TextColor_Highlight);
                Text_Line_02_Item.setTextColor(TextColor_Normal);
                Text_Line_03_Item.setTextColor(TextColor_Normal);
                Text_Line_04_Item.setTextColor(TextColor_Normal);
                Text_Line_01_Input.setTextColor(TextColor_Highlight);
                Text_Line_02_Input.setTextColor(TextColor_Normal);
                Text_Line_03_Input.setTextColor(TextColor_Normal);
            }
            else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_02) {
                Text_Line_02_Input.setText("[ " + strText_Line_02_Input + " ]");
                Text_Line_01_Item.setTextColor(TextColor_Normal);
                Text_Line_02_Item.setTextColor(TextColor_Highlight);
                Text_Line_03_Item.setTextColor(TextColor_Normal);
                Text_Line_04_Item.setTextColor(TextColor_Normal);
                Text_Line_01_Input.setTextColor(TextColor_Normal);
                Text_Line_02_Input.setTextColor(TextColor_Highlight);
                Text_Line_03_Input.setTextColor(TextColor_Normal);
            }
            else if (Global.DataInputStep == DATAINPUTSTEP.INPUT_03) {
                Text_Line_03_Input.setText("[ " + strText_Line_03_Input + " ]");
                Text_Line_01_Item.setTextColor(TextColor_Normal);
                Text_Line_02_Item.setTextColor(TextColor_Normal);
                Text_Line_03_Item.setTextColor(TextColor_Highlight);
                Text_Line_04_Item.setTextColor(TextColor_Normal);
                Text_Line_01_Input.setTextColor(TextColor_Normal);
                Text_Line_02_Input.setTextColor(TextColor_Normal);
                Text_Line_03_Input.setTextColor(TextColor_Highlight);
            }
            else {
                Text_Line_01_Item.setTextColor(TextColor_Normal);
                Text_Line_02_Item.setTextColor(TextColor_Normal);
                Text_Line_03_Item.setTextColor(TextColor_Normal);
                Text_Line_04_Item.setTextColor(TextColor_Normal);
                Text_Line_01_Input.setTextColor(TextColor_Normal);
                Text_Line_02_Input.setTextColor(TextColor_Normal);
                Text_Line_03_Input.setTextColor(TextColor_Normal);
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] updateScreen() : " + e);
            e.printStackTrace();
        }
    }

    private POSITION getPosition(int nID) {
//        LOG("[getPosition] Start!!");
        POSITION position = new POSITION();
        position.SetPosition(0, 0, 480, 272);
        try {
            switch (nID) {
                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.IMAGES.BACKGROUND:
                    position.SetPosition(0, 0, 480, 272);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.TITLE:
                    position.SetPosition(0, 24, 480, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.GUIDE:
                    position.SetPosition(382, 10, 98, 55);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Item:
                    position.SetPosition(30, 73, 165, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Item:
                    position.SetPosition(30, 122, 165, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Item:
                    position.SetPosition(30, 171, 165, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Item:
                    position.SetPosition(0, 220, 480, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_01_Input:
                    position.SetPosition(205, 73, 245, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_02_Input:
                    position.SetPosition(205, 122, 245, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_03_Input:
                    position.SetPosition(205, 171, 245, 40);
                    return position;

                case ID.SCREENS.ADMINSET_SETTING_BASICINFO.ELEMENTS.TEXTS.LINE_04_Input:
                    position.SetPosition(205, 220, 245, 40);
                    return position;

                default:
                    return position;
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] getPosition() : " + e);
            e.printStackTrace();
            return position;
        }
    }

    // DB SET
    private boolean setOnepassRSSI(int[] naValues) {
        try {
            if (naValues == null) return false;

            ConfigValue.strOnePassRSSI = naValues[0] + "/" + naValues[1] + "/" + naValues[2];
            Log.d(TAG, "[setOnepassRSSI] ConfigValue.strOnePassRSSI [" + ConfigValue.strOnePassRSSI + "]");
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, Configure.ConfigValKey.OnePassRSSI, Configure.ConfigValue.strOnePassRSSI)) return false;

            Global.checkRFReaderErrorMode();

            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setOnepassRSSI(byte[] haValues)");
            e.printStackTrace();
            return false;
        }
    }




}
