package kr.co.icontrols.ilp300_700.global;

import android.content.Context;
import android.util.Log;

import kr.co.icontrols.ilp300_700.MainActivity;
import kr.co.icontrols.ilp300_700.call.CallManager.CALLTYPE;
import kr.co.icontrols.ilp300_700.database.DBManager;
import kr.co.icontrols.ilp300_700.global.DataClasses.ConfigValueTable;
import kr.co.icontrols.ilp300_700.global.DataClasses.DeviceSettingInfo;
import kr.co.icontrols.ilp300_700.global.DataClasses.DeviceSetting_LineInfo;
import kr.co.icontrols.ilp300_700.global.DataClasses.ElevDisableFloorTable;
import kr.co.icontrols.ilp300_700.global.DataClasses.LineInfoTable;
import kr.co.icontrols.ilp300_700.global.DataClasses.SubInfoTable;

public class Configure {

    // 로비폰 설정정보와 관련된 변수를 정의한다.
    static String TAG = "Configure";

    // set_setup_info.request로 수신한 정보를 설정하는 함수
    public static boolean bRebootRequied = false;

    static boolean bLOG = true;   // true, false
    static boolean bLOG_DEBUG = false;   // true, false
    static boolean bLOG_INFO = true;   // true, false

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

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

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

    public static void initUserConfigValues() {
        try {
            // 비밀번호, 음량, 벨소리
            ConfigValue.strPublicAccessPW = "1234";
            ConfigValue.strAdminAccessPW = "2486";
            ConfigValue.strAdminPW = "2580";
            ConfigValue.nVolumeLevel_Talk = 5;
            ConfigValue.nVolumeLevel_System = 5;
            ConfigValue.nZigBeeSensitivity = 0;
            ConfigValue.nBLEStrength = 10;
            ConfigValue.nOnePassAvailableTime = 5;
            ConfigValue.nOnePassInOutBlockTime = 5;
            ConfigValue.nSmartKeyInOutBlockTime = 5;
            ConfigValue.eAccessPWSelected = SetValue.PublicAccessPW_Selected;
            ConfigValue.eAdminAccessPWEnable = SetValue.FALSE;
            ConfigValue.eCallMelody_Resi = SetValue.Bell_1;
            ConfigValue.eCallMelody_Guard = SetValue.Bell_2;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] initUserConfigValues()");
            e.printStackTrace();
        }
    }

    public static void setDefaultConfigValues() {
        try {
            ConfigValue.eFirstBoot = SetValue.TRUE;
            ConfigValue.strSitecode = "12345678";
            ConfigValue.strDevice_Dong = "100";
            ConfigValue.strDevice_ID = "10";
            ConfigValue.strGuard_Dong = "100";
            ConfigValue.strGuard_ID = "10";
            ConfigValue.strDeviceIPAddress = "10.0.0.10";
            ConfigValue.strMainServerIPAddress = "10.0.1.1";
            ConfigValue.strSubnetmask = "255.255.0.0";
            ConfigValue.strGatewayIPAddress = "10.0.0.254";
            ConfigValue.strDNSIPAddress = "10.0.1.1";
            ConfigValue.strMonitoringPCIPAddress = "10.0.1.10";
            ConfigValue.strKeyServerIPAddress = "10.0.1.10";
            ConfigValue.strFingerprintServer = "10.0.1.10:10000";
            ConfigValue.strGuardIPAddress = "10.0.128.10";
            ConfigValue.strPublicAccessPW = "1234";
            ConfigValue.strAdminAccessPW = "2486";
            ConfigValue.strAdminPW = "2580";
            ConfigValue.nMainServerPortNum = 10000;
            ConfigValue.nSmartAutodoorServerPortNum = 12000;
            ConfigValue.nHearBeatTime = 5;
            ConfigValue.nStatusBeatTime = 720;
            ConfigValue.nVolumeLevel_Talk = 5;
            ConfigValue.nVolumeLevel_System = 5;
            ConfigValue.nDoorOpenDuration = 5;
            ConfigValue.nECOTime = 0;
            ConfigValue.nFireSensorDoorOpenDelay = 0;
            ConfigValue.nZigBeeSensitivity = 0;
            ConfigValue.nBLEStrength = 0;
            ConfigValue.strLineInfo = "NONE";
            ConfigValue.strMainLPID = "10";
            ConfigValue.strSubIDs = "NONE";
            ConfigValue.strElevDisableFloorsInfo = "NONE";   // 엘리베이터 비연동층 정보
            ConfigValue.strDeviceReset = "NONE";   // "/"로 구분한다.
            ConfigValue.strLogSave = "NONE";   // 경로에 "/"가 포함되므로, "#"으로 구분한다.
            ConfigValue.strOnePassRSSI = "10/10/10";   // "/"구분한다 (총 세개의 값, 1/10/5)
            ConfigValue.eDeviceType = SetValue.Lobby;
            ConfigValue.eMainSub = SetValue.Main;
            ConfigValue.eLPRole = SetValue.LPRole_Lobby;
            ConfigValue.eCardReaderType = SetValue.CardReaderType_Standard;
            ConfigValue.eAccessPWSelected = SetValue.PublicAccessPW_Selected;
            ConfigValue.eAdminAccessPWEnable = SetValue.FALSE;
            ConfigValue.eRFAccessLevel = SetValue.Level_Line;
            ConfigValue.eCallLevel = SetValue.Level_Line;
            ConfigValue.eCallMelody_Resi = SetValue.Bell_1;
            ConfigValue.eCallMelody_Guard = SetValue.Bell_2;
            ConfigValue.eLogSend = SetValue.FALSE;
            ConfigValue.eLanguage = SetValue.Korean;
            ConfigValue.eParcelLink = SetValue.FALSE;
            ConfigValue.eExternalOnePassLink = SetValue.FALSE;
            ConfigValue.eMainServerType = SetValue.Server_Separated;
            ConfigValue.eMoviePlay = SetValue.FALSE;
            ConfigValue.eFireSensorDetected = SetValue.FALSE;
            ConfigValue.eACULinkEnable = SetValue.FALSE;
            ConfigValue.eCamPowerCtrl = SetValue.CamPower_Calling;
            ConfigValue.eIPExpansion = SetValue.FALSE;
            ConfigValue.eHouseDivision = SetValue.FALSE;
            ConfigValue.eSmartAutodoorLink = SetValue.FALSE;
            ConfigValue.eInsideSensorLink = SetValue.FALSE;
            ConfigValue.eFingerPrintLink = SetValue.FALSE;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setDefaultConfigValues()");
            e.printStackTrace();
        }
    }

    public static boolean setDBDefaultConfigValues() {
        try {
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FirstBoot, DefaultConfigValue.eFirstBoot)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Sitecode, DefaultConfigValue.strSitecode)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Device_Dong, DefaultConfigValue.strDevice_Dong)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Device_ID, DefaultConfigValue.strDevice_ID)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Guard_Dong, DefaultConfigValue.strGuard_Dong)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Guard_ID, DefaultConfigValue.strGuard_ID)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceIPAddress, DefaultConfigValue.strDeviceIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerIPAddress, DefaultConfigValue.strMainServerIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Subnetmask, DefaultConfigValue.strSubnetmask)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.GatewayIPAddress, DefaultConfigValue.strGatewayIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DNSIPAddress, DefaultConfigValue.strDNSIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MonitoringPCIPAddress, DefaultConfigValue.strMonitoringPCIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.KeyServerIPAddress, DefaultConfigValue.strKeyServerIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FingerprintServer, DefaultConfigValue.strFingerprintServer)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.GuardIPAddress, DefaultConfigValue.strGuardIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.PublicAccessPW, DefaultConfigValue.strPublicAccessPW)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminAccessPW, DefaultConfigValue.strAdminAccessPW)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminPW, DefaultConfigValue.strAdminPW)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerPortNum, DefaultConfigValue.nMainServerPortNum)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartAutodoorServerPortNum, DefaultConfigValue.nSmartAutodoorServerPortNum)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.HearBeatTime, DefaultConfigValue.nHearBeatTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.StatusBeatTime, DefaultConfigValue.nStatusBeatTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.VolumeLevel_Talk, DefaultConfigValue.nVolumeLevel_Talk)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.VolumeLevel_System, DefaultConfigValue.nVolumeLevel_System)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DoorOpenDuration, DefaultConfigValue.nDoorOpenDuration)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ECOTime, DefaultConfigValue.nECOTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FireSensorDoorOpenDelay, DefaultConfigValue.nFireSensorDoorOpenDelay)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ZigBeeSensitivity, DefaultConfigValue.nZigBeeSensitivity)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.BLEStrength, DefaultConfigValue.nBLEStrength)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassAvailableTime, DefaultConfigValue.nOnePassAvailableTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassInOutBlockTime, DefaultConfigValue.nOnePassInOutBlockTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartKeyInOutBlockTime, DefaultConfigValue.nSmartKeyInOutBlockTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LineInfo, DefaultConfigValue.strLineInfo)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainLPID, DefaultConfigValue.strMainLPID)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SubIDs, DefaultConfigValue.strSubIDs)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ElevDisableFloorsInfo, DefaultConfigValue.strElevDisableFloorsInfo)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceReset, DefaultConfigValue.strDeviceReset)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LogSave, DefaultConfigValue.strLogSave)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassRSSI, DefaultConfigValue.strOnePassRSSI)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceType, DefaultConfigValue.eDeviceType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainSub, DefaultConfigValue.eMainSub)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LPRole, DefaultConfigValue.eLPRole)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CardReaderType, DefaultConfigValue.eCardReaderType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AccessPWSelected, DefaultConfigValue.eAccessPWSelected)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminAccessPWEnable, DefaultConfigValue.eAdminAccessPWEnable)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.RFAccessLevel, DefaultConfigValue.eRFAccessLevel)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallLevel, DefaultConfigValue.eCallLevel)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallMelody_Resi, DefaultConfigValue.eCallMelody_Resi)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallMelody_Guard, DefaultConfigValue.eCallMelody_Guard)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LogSend, DefaultConfigValue.eLogSend)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Language, DefaultConfigValue.eLanguage)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ParcelLink, DefaultConfigValue.eParcelLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ExternalOnePassLink, DefaultConfigValue.eExternalOnePassLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerType, DefaultConfigValue.eMainServerType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MoviePlay, DefaultConfigValue.eMoviePlay)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FireSensorDetected, DefaultConfigValue.eFireSensorDetected)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ACULinkEnable, DefaultConfigValue.eACULinkEnable)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CamPowerCtrl, DefaultConfigValue.eCamPowerCtrl)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.IPExpansion, DefaultConfigValue.eIPExpansion)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.HouseDivision, DefaultConfigValue.eHouseDivision)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartAutodoorLink, DefaultConfigValue.eSmartAutodoorLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.InsideSensorLink, DefaultConfigValue.eInsideSensorLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FingerPrintLink, DefaultConfigValue.eFingerPrintLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_APP, DefaultConfigValue.strVer_APP)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_BSP, DefaultConfigValue.strVer_BSP)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_EBOOT, DefaultConfigValue.strVer_EBOOT)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOIP, DefaultConfigValue.strVer_MOIP)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_SETTING, DefaultConfigValue.strVer_SETTING)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_ADDITIONAL, DefaultConfigValue.strVer_ADDITIONAL)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOVIE, DefaultConfigValue.strVer_MOVIE)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOVIESETTING, DefaultConfigValue.strVer_MOVIESETTING)) return false;
            LOG("setDBDefaultConfigValues() DONE!!");
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setDBDefaultConfigValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean setDBConfigValues() {
        try {
            if (!setLineInfoDBValues()) return false;
            if (!setSubIDsDBValues()) return false;
            if (!setElevDisableDBValues()) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FirstBoot, ConfigValue.eFirstBoot)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Sitecode, ConfigValue.strSitecode)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Device_Dong, ConfigValue.strDevice_Dong)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Device_ID, ConfigValue.strDevice_ID)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Guard_Dong, ConfigValue.strGuard_Dong)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Guard_ID, ConfigValue.strGuard_ID)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceIPAddress, ConfigValue.strDeviceIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerIPAddress, ConfigValue.strMainServerIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Subnetmask, ConfigValue.strSubnetmask)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.GatewayIPAddress, ConfigValue.strGatewayIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DNSIPAddress, ConfigValue.strDNSIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MonitoringPCIPAddress, ConfigValue.strMonitoringPCIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.KeyServerIPAddress, ConfigValue.strKeyServerIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FingerprintServer, ConfigValue.strFingerprintServer)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.GuardIPAddress, ConfigValue.strGuardIPAddress)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.PublicAccessPW, ConfigValue.strPublicAccessPW)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminAccessPW, ConfigValue.strAdminAccessPW)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminPW, ConfigValue.strAdminPW)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerPortNum, ConfigValue.nMainServerPortNum)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartAutodoorServerPortNum, ConfigValue.nSmartAutodoorServerPortNum)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.HearBeatTime, ConfigValue.nHearBeatTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.StatusBeatTime, ConfigValue.nStatusBeatTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.VolumeLevel_Talk, ConfigValue.nVolumeLevel_Talk)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.VolumeLevel_System, ConfigValue.nVolumeLevel_System)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ZigBeeSensitivity, ConfigValue.nZigBeeSensitivity)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.BLEStrength, ConfigValue.nBLEStrength)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassAvailableTime, ConfigValue.nOnePassAvailableTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassInOutBlockTime, ConfigValue.nOnePassInOutBlockTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartKeyInOutBlockTime, ConfigValue.nSmartKeyInOutBlockTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DoorOpenDuration, ConfigValue.nDoorOpenDuration)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ECOTime, ConfigValue.nECOTime)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FireSensorDoorOpenDelay, ConfigValue.nFireSensorDoorOpenDelay)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LineInfo, ConfigValue.strLineInfo)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainLPID, ConfigValue.strMainLPID)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SubIDs, ConfigValue.strSubIDs)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ElevDisableFloorsInfo, ConfigValue.strElevDisableFloorsInfo)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceReset, ConfigValue.strDeviceReset)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LogSave, ConfigValue.strLogSave)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassRSSI, ConfigValue.strOnePassRSSI)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceType, ConfigValue.eDeviceType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainSub, ConfigValue.eMainSub)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LPRole, ConfigValue.eLPRole)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CardReaderType, ConfigValue.eCardReaderType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AccessPWSelected, ConfigValue.eAccessPWSelected)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminAccessPWEnable, ConfigValue.eAdminAccessPWEnable)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.RFAccessLevel, ConfigValue.eRFAccessLevel)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallLevel, ConfigValue.eCallLevel)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallMelody_Resi, ConfigValue.eCallMelody_Resi)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallMelody_Guard, ConfigValue.eCallMelody_Guard)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LogSend, ConfigValue.eLogSend)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Language, ConfigValue.eLanguage)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ParcelLink, ConfigValue.eParcelLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ExternalOnePassLink, ConfigValue.eExternalOnePassLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerType, ConfigValue.eMainServerType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SubServerType, ConfigValue.eSubServerType)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MoviePlay, ConfigValue.eMoviePlay)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FireSensorDetected, ConfigValue.eFireSensorDetected)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ACULinkEnable, ConfigValue.eACULinkEnable)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CamPowerCtrl, ConfigValue.eCamPowerCtrl)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.IPExpansion, ConfigValue.eIPExpansion)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.HouseDivision, ConfigValue.eHouseDivision)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartAutodoorLink, ConfigValue.eSmartAutodoorLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.InsideSensorLink, ConfigValue.eInsideSensorLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FingerPrintLink, ConfigValue.eFingerPrintLink)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_APP, ConfigValue.strVer_APP)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_BSP, ConfigValue.strVer_BSP)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_EBOOT, ConfigValue.strVer_EBOOT)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOIP, ConfigValue.strVer_MOIP)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_SETTING, ConfigValue.strVer_SETTING)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_ADDITIONAL, ConfigValue.strVer_ADDITIONAL)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOVIE, ConfigValue.strVer_MOVIE)) return false;
            if (!MainActivity.ConfigDBManager.setData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOVIESETTING, ConfigValue.strVer_MOVIESETTING)) return false;

            LOG("setDBConfigValues() DONE!!");
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setDBConfigValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean getDBConfigValues() {
        try {
            ConfigValue.eFirstBoot = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FirstBoot, DefaultConfigValue.eFirstBoot.toString()));
            ConfigValue.strSitecode = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Sitecode, DefaultConfigValue.strSitecode);
            ConfigValue.strDevice_Dong = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Device_Dong, DefaultConfigValue.strDevice_Dong);
            ConfigValue.strDevice_ID = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Device_ID, DefaultConfigValue.strDevice_ID);
            ConfigValue.strGuard_Dong = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Guard_Dong, DefaultConfigValue.strGuard_Dong);
            ConfigValue.strGuard_ID = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Guard_ID, DefaultConfigValue.strGuard_ID);
            ConfigValue.strDeviceIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceIPAddress, DefaultConfigValue.strDeviceIPAddress);
            ConfigValue.strMainServerIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerIPAddress, DefaultConfigValue.strMainServerIPAddress);
            ConfigValue.strSubnetmask = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Subnetmask, DefaultConfigValue.strSubnetmask);
            ConfigValue.strGatewayIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.GatewayIPAddress, DefaultConfigValue.strGatewayIPAddress);
            ConfigValue.strDNSIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DNSIPAddress, DefaultConfigValue.strDNSIPAddress);
            ConfigValue.strMonitoringPCIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MonitoringPCIPAddress, DefaultConfigValue.strMonitoringPCIPAddress);
            ConfigValue.strKeyServerIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.KeyServerIPAddress, DefaultConfigValue.strKeyServerIPAddress);
            ConfigValue.strGuardIPAddress = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.GuardIPAddress, DefaultConfigValue.strGuardIPAddress);
            ConfigValue.strPublicAccessPW = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.PublicAccessPW, DefaultConfigValue.strPublicAccessPW);
            ConfigValue.strAdminAccessPW = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminAccessPW, DefaultConfigValue.strAdminAccessPW);
            ConfigValue.strAdminPW = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminPW, DefaultConfigValue.strAdminPW);
            ConfigValue.nMainServerPortNum = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerPortNum, Integer.toString(DefaultConfigValue.nMainServerPortNum)));
            ConfigValue.nSmartAutodoorServerPortNum = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartAutodoorServerPortNum, Integer.toString(DefaultConfigValue.nSmartAutodoorServerPortNum)));
            ConfigValue.nHearBeatTime = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.HearBeatTime, Integer.toString(DefaultConfigValue.nHearBeatTime)));
            ConfigValue.nStatusBeatTime = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.StatusBeatTime, Integer.toString(DefaultConfigValue.nStatusBeatTime)));
            ConfigValue.nVolumeLevel_Talk = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.VolumeLevel_Talk, Integer.toString(DefaultConfigValue.nVolumeLevel_Talk)));
            ConfigValue.nVolumeLevel_System = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.VolumeLevel_System, Integer.toString(DefaultConfigValue.nVolumeLevel_System)));
            ConfigValue.nDoorOpenDuration = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DoorOpenDuration, Integer.toString(DefaultConfigValue.nDoorOpenDuration)));
            ConfigValue.nECOTime = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ECOTime, Integer.toString(DefaultConfigValue.nECOTime)));
            ConfigValue.nFireSensorDoorOpenDelay = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FireSensorDoorOpenDelay, Integer.toString(DefaultConfigValue.nFireSensorDoorOpenDelay)));
            ConfigValue.nZigBeeSensitivity = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ZigBeeSensitivity, Integer.toString(DefaultConfigValue.nZigBeeSensitivity)));
            ConfigValue.nBLEStrength = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.BLEStrength, Integer.toString(DefaultConfigValue.nBLEStrength)));
            ConfigValue.nOnePassAvailableTime = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassAvailableTime, Integer.toString(DefaultConfigValue.nOnePassAvailableTime)));
            ConfigValue.nOnePassInOutBlockTime = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassInOutBlockTime, Integer.toString(DefaultConfigValue.nOnePassInOutBlockTime)));
            ConfigValue.nSmartKeyInOutBlockTime = Integer.parseInt(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartKeyInOutBlockTime, Integer.toString(DefaultConfigValue.nSmartKeyInOutBlockTime)));
            ConfigValue.strLineInfo = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LineInfo, DefaultConfigValue.strLineInfo);
            ConfigValue.strMainLPID = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainLPID, DefaultConfigValue.strMainLPID);
            ConfigValue.strSubIDs = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SubIDs, DefaultConfigValue.strSubIDs);
            ConfigValue.strElevDisableFloorsInfo = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ElevDisableFloorsInfo, DefaultConfigValue.strElevDisableFloorsInfo);
            ConfigValue.strDeviceReset = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceReset, DefaultConfigValue.strDeviceReset);
            ConfigValue.strLogSave = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LogSave, DefaultConfigValue.strLogSave);
            ConfigValue.strOnePassRSSI = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.OnePassRSSI, DefaultConfigValue.strOnePassRSSI);
            ConfigValue.eDeviceType = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.DeviceType, DefaultConfigValue.eDeviceType.toString()));
            ConfigValue.eMainSub = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainSub, DefaultConfigValue.eMainSub.toString()));
            ConfigValue.eLPRole = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LPRole, DefaultConfigValue.eLPRole.toString()));
            ConfigValue.eCardReaderType = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CardReaderType, DefaultConfigValue.eCardReaderType.toString()));
            ConfigValue.eAccessPWSelected = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AccessPWSelected, DefaultConfigValue.eAccessPWSelected.toString()));
            ConfigValue.eAdminAccessPWEnable = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.AdminAccessPWEnable, DefaultConfigValue.eAdminAccessPWEnable.toString()));
            ConfigValue.eRFAccessLevel = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.RFAccessLevel, DefaultConfigValue.eRFAccessLevel.toString()));
            ConfigValue.eCallLevel = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallLevel, DefaultConfigValue.eCallLevel.toString()));
            ConfigValue.eCallMelody_Resi = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallMelody_Resi, DefaultConfigValue.eCallMelody_Resi.toString()));
            ConfigValue.eCallMelody_Guard = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CallMelody_Guard, DefaultConfigValue.eCallMelody_Guard.toString()));
            ConfigValue.eLogSend = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.LogSend, DefaultConfigValue.eLogSend.toString()));
            ConfigValue.eLanguage = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Language, DefaultConfigValue.eLanguage.toString()));
            ConfigValue.eParcelLink = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ParcelLink, DefaultConfigValue.eParcelLink.toString()));
            ConfigValue.eExternalOnePassLink = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ExternalOnePassLink, DefaultConfigValue.eExternalOnePassLink.toString()));
            ConfigValue.eMainServerType = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MainServerType, DefaultConfigValue.eMainServerType.toString()));
            ConfigValue.eSubServerType = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SubServerType, DefaultConfigValue.eSubServerType.toString()));
            ConfigValue.eMoviePlay = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.MoviePlay, DefaultConfigValue.eMoviePlay.toString()));
            ConfigValue.eFireSensorDetected = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FireSensorDetected, DefaultConfigValue.eFireSensorDetected.toString()));
            ConfigValue.eACULinkEnable = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.ACULinkEnable, DefaultConfigValue.eACULinkEnable.toString()));
            ConfigValue.eCamPowerCtrl = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.CamPowerCtrl, DefaultConfigValue.eCamPowerCtrl.toString()));
            ConfigValue.eIPExpansion = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.IPExpansion, DefaultConfigValue.eIPExpansion.toString()));
            ConfigValue.eHouseDivision = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.HouseDivision, DefaultConfigValue.eHouseDivision.toString()));
            ConfigValue.eSmartAutodoorLink = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.SmartAutodoorLink, DefaultConfigValue.eSmartAutodoorLink.toString()));
            ConfigValue.eInsideSensorLink = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.InsideSensorLink, DefaultConfigValue.eInsideSensorLink.toString()));
            ConfigValue.eFingerPrintLink = SetValue.getSetValue(MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.FingerPrintLink, DefaultConfigValue.eFingerPrintLink.toString()));
            ConfigValue.strVer_APP = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_APP, DefaultConfigValue.strVer_APP);
            ConfigValue.strVer_BSP = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_BSP, DefaultConfigValue.strVer_BSP);
            ConfigValue.strVer_EBOOT = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_EBOOT, DefaultConfigValue.strVer_EBOOT);
            ConfigValue.strVer_MOIP = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOIP, DefaultConfigValue.strVer_MOIP);
            ConfigValue.strVer_SETTING = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_SETTING, DefaultConfigValue.strVer_SETTING);
            ConfigValue.strVer_ADDITIONAL = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_ADDITIONAL, DefaultConfigValue.strVer_ADDITIONAL);
            ConfigValue.strVer_MOVIE = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOVIE, DefaultConfigValue.strVer_MOVIE);
            ConfigValue.strVer_MOVIESETTING = MainActivity.ConfigDBManager.getData(Declare.DBInfo.TABLE_NAME_CONFIG, ConfigValKey.Ver_MOVIESETTING, DefaultConfigValue.strVer_MOVIESETTING);
            if (!getLineInfoDBValues()) return false;
            if (!getSubIDsDBValues()) return false;
            if (!getElevDisableDBValues()) return false;
            Global.changeVolumeMoIPMode(CALLTYPE.NONE);
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] getDBConfigValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static void printConfigValues() {
        try {
            Log.i(TAG, "[printConfigValues] ConfigValue.eFirstBoot [" + ConfigValue.eFirstBoot + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strSitecode [" + ConfigValue.strSitecode + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strDevice_Dong [" + ConfigValue.strDevice_Dong + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strDevice_ID [" + ConfigValue.strDevice_ID + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strGuard_Dong [" + ConfigValue.strGuard_Dong + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strGuard_ID [" + ConfigValue.strGuard_ID + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strDeviceIPAddress [" + ConfigValue.strDeviceIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strMainServerIPAddress [" + ConfigValue.strMainServerIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strSubnetmask [" + ConfigValue.strSubnetmask + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strGatewayIPAddress [" + ConfigValue.strGatewayIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strDNSIPAddress [" + ConfigValue.strDNSIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strMonitoringPCIPAddress [" + ConfigValue.strMonitoringPCIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strKeyServerIPAddress [" + ConfigValue.strKeyServerIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strGuardIPAddress [" + ConfigValue.strGuardIPAddress + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strPublicAccessPW [" + ConfigValue.strPublicAccessPW + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strAdminAccessPW [" + ConfigValue.strAdminAccessPW + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strAdminPW [" + ConfigValue.strAdminPW + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nMainServerPortNum [" + ConfigValue.nMainServerPortNum + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nSmartAutodoorServerPortNum [" + ConfigValue.nSmartAutodoorServerPortNum + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nHearBeatTime [" + ConfigValue.nHearBeatTime + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nStatusBeatTime [" + ConfigValue.nStatusBeatTime + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nVolumeLevel_Talk [" + ConfigValue.nVolumeLevel_Talk + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nVolumeLevel_System [" + ConfigValue.nVolumeLevel_System + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nDoorOpenDuration [" + ConfigValue.nDoorOpenDuration + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nECOTime [" + ConfigValue.nECOTime + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nFireSensorDoorOpenDelay [" + ConfigValue.nFireSensorDoorOpenDelay + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nZigBeeSensitivity [" + ConfigValue.nZigBeeSensitivity + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nBLEStrength [" + ConfigValue.nBLEStrength + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nOnePassAvailableTime [" + ConfigValue.nOnePassAvailableTime + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nOnePassInOutBlockTime [" + ConfigValue.nOnePassInOutBlockTime + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.nSmartKeyInOutBlockTime [" + ConfigValue.nSmartKeyInOutBlockTime + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strLineInfo [" + ConfigValue.strLineInfo + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strMainLPID [" + ConfigValue.strMainLPID + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strSubIDs [" + ConfigValue.strSubIDs + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strSubIDs [" + ConfigValue.strSubIDs + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strElevDisableFloorsInfo [" + ConfigValue.strElevDisableFloorsInfo + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strDeviceReset [" + ConfigValue.strDeviceReset + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strLogSave [" + ConfigValue.strLogSave + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.strOnePassRSSI [" + ConfigValue.strOnePassRSSI + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eDeviceType [" + ConfigValue.eDeviceType + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eMainSub [" + ConfigValue.eMainSub + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eLPRole [" + ConfigValue.eLPRole + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eCardReaderType [" + ConfigValue.eCardReaderType + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eAccessPWSelected [" + ConfigValue.eAccessPWSelected  + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eAdminAccessPWEnable [" + ConfigValue.eAdminAccessPWEnable + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eRFAccessLevel [" + ConfigValue.eRFAccessLevel + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eCallLevel [" + ConfigValue.eCallLevel + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eCallMelody_Resi [" + ConfigValue.eCallMelody_Resi + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eCallMelody_Guard [" + ConfigValue.eCallMelody_Guard + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eLogSend [" + ConfigValue.eLogSend + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eLanguage [" + ConfigValue.eLanguage + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.ePaecelLink [" + ConfigValue.eParcelLink + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eExternalOnePassLink [" + ConfigValue.eExternalOnePassLink + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eMainServerType [" + ConfigValue.eMainServerType + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eMoviePlay [" + ConfigValue.eMoviePlay + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eFireSensorDetected [" + ConfigValue.eFireSensorDetected + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eACULinkEnable [" + ConfigValue.eACULinkEnable + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eCamPowerCtrl [" + ConfigValue.eCamPowerCtrl + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eIPExpansion [" + ConfigValue.eIPExpansion + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eHouseDivision [" + ConfigValue.eHouseDivision + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eSmartAutodoorLink [" + ConfigValue.eSmartAutodoorLink + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eInsideSensorLink [" + ConfigValue.eInsideSensorLink + "]");
            Log.i(TAG, "[printConfigValues] ConfigValue.eFingerPrintLink [" + ConfigValue.eFingerPrintLink + "]");
        } catch (Exception e) {
            Log.e(TAG, "[Exception] printConfigValues()");
            e.printStackTrace();
        }
    }

    public static boolean initConfigValues(Context context) {
        try {
            MainActivity.ConfigDBManager = new DBManager(context, Declare.DBInfo.DATABASE_FILENAME_CONFIG);

            if (checkDB_Config()) {
                // DB 파일이 존재하는 경우 (일반 부팅으로 간주)
                LOG_INFO("[initConfigValues] Config DB OK!!");
                return getDBConfigValues();
            } else {
                // DB 파일이 존재하지 않는 경우 (최초부팅으로 간주)
                LOG_INFO("[initConfigValues] Config DB NOT OK!!");
                cleanDB_Config();
                MainActivity.ConfigDBManager.createTable(Declare.DBInfo.TABLE_NAME_CONFIG, Declare.DBInfo.VALUE_NAME_DEFAULT);
                return setDBDefaultConfigValues();
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] initConfigValues()");
            e.printStackTrace();
            return false;
        }
    }

    private static boolean checkDB_Config() {
        try {
            if (!MainActivity.ConfigDBManager.isDBFileExist()) return false;
            if (!MainActivity.ConfigDBManager.initDatabase()) return false;
            if (!MainActivity.ConfigDBManager.isTableExist(Declare.DBInfo.TABLE_NAME_CONFIG))
                return false;
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] checkDB_Config()");
            e.printStackTrace();
            return false;
        }
    }

    private static void cleanDB_Config() {
        try {
            LOG_INFO("[cleanDB_Config] ===== START =====");
            if (MainActivity.ConfigDBManager.isDBFileExist()) {
                LOG_INFO("[cleanDB_Config] DBFile exist!!!");
                MainActivity.ConfigDBManager.deleteDBFile();
            }
            MainActivity.ConfigDBManager.initDatabase();
        } catch (Exception e) {
            Log.e(TAG, "[Exception] cleanDB_Config()");
            e.printStackTrace();
        }
    }

    public static boolean setLineInfoDBValues() {
        try {
            String strDBLineInfo = "ERROR";
            strDBLineInfo = makeLineInfoString(ConfigValue.LineInfo);
            if (strDBLineInfo.matches(".*ERROR.*")) {
                LOG("[setLineInfoDBValues] strDBLineInfo = " + strDBLineInfo);
                return false;
            }
            ConfigValue.strLineInfo = strDBLineInfo;
            LOG("[setLineInfoDBValues] ConfigValue.strLineInfo = " + ConfigValue.strLineInfo);
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setLineInfoDBValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean getLineInfoDBValues() {
        try {
            return extractLineInfo(ConfigValue.strLineInfo);
        } catch (Exception e) {
            Log.e(TAG, "[Exception] getLineInfoDBValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean setSubIDsDBValues() {
        try {
            String strDBSubIDsInfo = "ERROR";
            strDBSubIDsInfo = makeSubIDsString(ConfigValue.SubInfo);
            if (strDBSubIDsInfo.matches(".*ERROR.*")) {
                LOG("[setLineInfoDBValues] strDBSubIDsInfo = " + strDBSubIDsInfo);
                return false;
            }
            ConfigValue.strSubIDs = strDBSubIDsInfo;
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setSubIDsDBValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean getSubIDsDBValues() {
        try {
            return extractSubIDs(ConfigValue.strSubIDs);
        } catch (Exception e) {
            Log.e(TAG, "[Exception] getSubIDsDBValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean setElevDisableDBValues() {
        try {
            String strElevDisableValue = "ERROR";
            strElevDisableValue = makeElevDisableFloorString(ConfigValue.ElevDisable);
            if (strElevDisableValue.matches(".*ERROR.*")) {
                LOG("[setLineInfoDBValues] strElevDisableValue = " + strElevDisableValue);
                return false;
            }
            ConfigValue.strElevDisableFloorsInfo = strElevDisableValue;
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setElevDisableDBValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static boolean getElevDisableDBValues() {
        try {
            return extractElevDisableFloor(ConfigValue.strElevDisableFloorsInfo);
        } catch (Exception e) {
            Log.e(TAG, "[Exception] getElevDisableDBValues()");
            e.printStackTrace();
            return false;
        }
    }

    public static String setSetSetupInfo(ConfigValueTable SetupInfo) {
        try {
            if (SetupInfo == null) return "ERROR";
            LOG("[setSetSetupInfo] SettingInfo.getCnt() [" + SetupInfo.getCnt() + "]");
            String strName = "";
            String strValue = "";
            int nValue = 0;
            int nItemCnt = SetupInfo.getCnt();

            for (int i = 0; i < nItemCnt; i++) {

                strName = SetupInfo.getConfigValue(i).NAME();
                strValue = SetupInfo.getConfigValue(i).VALUE();

                if (strName.equalsIgnoreCase("guard_id")) {
                    try {
                        if (ConfigValue.eIPExpansion == SetValue.TRUE) {
                            String[] strParsed = strValue.split("\\.");
                            if (strParsed[1].equals("0")) ConfigValue.strGuard_Dong = "100";
                            else
                                ConfigValue.strGuard_Dong = Integer.toString((Integer.parseInt(strParsed[0]) * 100) + Integer.parseInt(strParsed[1]));
                            ConfigValue.strGuard_ID = strParsed[3];
                            ConfigValue.strGuardIPAddress = strValue;
                        } else {
                            if (strValue.length() < 3 || 4 < strValue.length()) {
                                return strName;
                            }
                            nValue = Integer.parseInt(strValue);
                            int ndongIP = nValue / 100;
                            int ndongbase = (Integer.parseInt(ConfigValue.strDevice_Dong) / 100) * 100;

                            ConfigValue.strGuard_Dong = Integer.toString(ndongbase + ndongIP);
                            ConfigValue.strGuard_ID = Integer.toString(nValue % 100);
                            ConfigValue.strGuardIPAddress = "10." + ndongIP + ".128." + ConfigValue.strGuard_ID;
                        }

                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("use_passwd")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable") || strValue.equalsIgnoreCase("none"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 공용 비밀번호 사용
                            ConfigValue.eAccessPWSelected = SetValue.PublicAccessPW_Selected;
                        }
                        else if (strValue.equalsIgnoreCase("disable")) {
                            // 세대 비밀번호 사용
                            ConfigValue.eAccessPWSelected = SetValue.ResiAccessPW_Selected;
                        }
                        else if (strValue.equalsIgnoreCase("none")) {
                            // 비밀번호 출입 기능 사용안함
                            ConfigValue.eAccessPWSelected = SetValue.PW_Unselected;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("use_adminpw")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 관리자 비밀번호 사용
                            ConfigValue.eAdminAccessPWEnable = SetValue.TRUE;
                        }
                        else if (strValue.equalsIgnoreCase("disable")) {
                            // 관리자 비밀번호 미사용
                            ConfigValue.eAdminAccessPWEnable = SetValue.FALSE;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("rf_level")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("line") || strValue.equalsIgnoreCase("dong") || strValue.equalsIgnoreCase("all"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("line")) {
                            // RF Key 출입범위 : 라인
                            ConfigValue.eRFAccessLevel = SetValue.Level_Line;
                        }
                        else if (strValue.equalsIgnoreCase("dong")) {
                            // RF Key 출입범위 : 동
                            ConfigValue.eRFAccessLevel = SetValue.Level_Dong;
                        }
                        else if (strValue.equalsIgnoreCase("all")) {
                            // RF Key 출입범위 : 전체
                            ConfigValue.eRFAccessLevel = SetValue.Level_Entire;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("open_duration")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 99 < nValue) {
                            return strName;
                        }

                        ConfigValue.nDoorOpenDuration = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("guard_bell")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 6 < nValue) {
                            return strName;
                        }

                        if (nValue == 1) ConfigValue.eCallMelody_Guard = SetValue.Bell_1;
                        else if (nValue == 2) ConfigValue.eCallMelody_Guard = SetValue.Bell_2;
                        else if (nValue == 3) ConfigValue.eCallMelody_Guard = SetValue.Bell_3;
                        else if (nValue == 4) ConfigValue.eCallMelody_Guard = SetValue.Bell_4;
                        else if (nValue == 5) ConfigValue.eCallMelody_Guard = SetValue.Bell_5;
                        else if (nValue == 6) ConfigValue.eCallMelody_Guard = SetValue.Bell_6;
                        else return strName;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("home_bell")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 6 < nValue) {
                            return strName;
                        }

                        if (nValue == 1) ConfigValue.eCallMelody_Resi = SetValue.Bell_1;
                        else if (nValue == 2) ConfigValue.eCallMelody_Resi = SetValue.Bell_2;
                        else if (nValue == 3) ConfigValue.eCallMelody_Resi = SetValue.Bell_3;
                        else if (nValue == 4) ConfigValue.eCallMelody_Resi = SetValue.Bell_4;
                        else if (nValue == 5) ConfigValue.eCallMelody_Resi = SetValue.Bell_5;
                        else if (nValue == 6) ConfigValue.eCallMelody_Resi = SetValue.Bell_6;
                        else return strName;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("datetime")) {
                    try {
                        if (strValue.length() != 14) {
                            return strName;
                        }
                        LOG_DEBUG("[setSetSetupInfo] strValue = " + strValue);
                        int nYear = Integer.parseInt(strValue.substring(0, 4));
                        int nMonth = Integer.parseInt(strValue.substring(4, 6));
                        int nDate = Integer.parseInt(strValue.substring(6, 8));
                        int nHour = Integer.parseInt(strValue.substring(8, 10));
                        int nMin = Integer.parseInt(strValue.substring(10, 12));

                        LOG_DEBUG("[setSetSetupInfo] Cal Values [" + nYear + "/" + nMonth + "/" + nDate + " " + nHour + ":" + nMin + "]");
                        boolean bDateTime = Global.setSystemTime(nYear, nMonth, nDate, nHour, nMin);
                        LOG_DEBUG("[setSetSetupInfo] bDateTime [" + bDateTime + "]");

                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("call_level")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("line") || strValue.equalsIgnoreCase("dong") || strValue.equalsIgnoreCase("all"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("line")) {
                            // 호출범위 : 라인
                            ConfigValue.eCallLevel = SetValue.Level_Line;
                        }
                        else if (strValue.equalsIgnoreCase("dong")) {
                            // 호출범위 : 동
                            ConfigValue.eCallLevel = SetValue.Level_Dong;
                        }
                        else if (strValue.equalsIgnoreCase("all")) {
                            // 호출범위 : 전체
                            ConfigValue.eCallLevel = SetValue.Level_Entire;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("log_enable")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 로그전송
                            ConfigValue.eLogSend = SetValue.TRUE;
                        }
                        else if (strValue.equalsIgnoreCase("disable")) {
                            // 로그 미전송
                            ConfigValue.eLogSend = SetValue.FALSE;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("cam_pwrdur")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("calling") || strValue.equalsIgnoreCase("always"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("calling")) {
                            // 호출시에만 전원 인가
                            ConfigValue.eCamPowerCtrl = SetValue.CamPower_Calling;
                            Log.w(TAG, "ConfigValue.eCamPowerCtrl = " + ConfigValue.eCamPowerCtrl);
                        }
                        else if (strValue.equalsIgnoreCase("always")) {
                            // 항상 전원 인가
                            ConfigValue.eCamPowerCtrl = SetValue.CamPower_Always;
                            Log.w(TAG, "ConfigValue.eCamPowerCtrl = " + ConfigValue.eCamPowerCtrl);
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("role")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("lobby") || strValue.equalsIgnoreCase("cargate"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("lobby")) {
                            // 일반 공동현관 로비폰
                            ConfigValue.eLPRole = SetValue.LPRole_Lobby;
                        }
                        else if (strValue.equalsIgnoreCase("cargate")) {
                            // 차량게이트용 로비폰
                            ConfigValue.eLPRole = SetValue.LPRole_CarGate;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("site_code")) {
                    try {
//                        nValue = Integer.parseInt(strValue);
//                        strValue = Integer.toString(nValue);
                        if (strValue.length() != 8) {
                            return strName;
                        }
                        ConfigValue.strSitecode = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("line_info")) {
                    try {
                        int nLineCnt = Integer.parseInt(SetupInfo.getConfigValue(i).CNT());
                        if (!strValue.equalsIgnoreCase("list")) return strName;
                        if (nLineCnt < 1 || 99 < nLineCnt) return strName;
                        LineInfoTable mLineInfoTable = new LineInfoTable();
                        mLineInfoTable = (LineInfoTable) SetupInfo.getConfigValue(i).LIST();

                        if (nLineCnt != mLineInfoTable.getCnt()) return strName;

                        int nLineName;
                        int nLowFloor;
                        int nHighFloor;
                        for (int j = 0; j < nLineCnt; j++) {
                            nLineName = mLineInfoTable.getLineInfo(j).NAME();   // 라인번호 검증
                            nLowFloor = mLineInfoTable.getLineInfo(j).LOW();   // 저층 검증
                            nHighFloor = mLineInfoTable.getLineInfo(j).HIGH();   // 고층 검증
                            if (nLineName < 1 || 99 < nLineName) return strName;
                            if (nLowFloor < 1 || 99 < nLowFloor) return strName;
                            if (nHighFloor < 1 || 99 < nHighFloor) return strName;
                            if (nHighFloor < nLowFloor) return strName;
                        }

                        ConfigValue.strLineInfo = makeLineInfoString(mLineInfoTable);
                        ConfigValue.LineInfo = mLineInfoTable;

                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("ip_table")) {
                    try {
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("ver_setting")) {
                    try {
                        if (strValue.length() != 13) {
                            return strName;
                        }

                        ConfigValue.strVer_SETTING = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("beat_time")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 99 < nValue) {
                            return strName;
                        }

                        ConfigValue.nHearBeatTime = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("statusbeat_time")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 99999999 < nValue) {
                            return strName;
                        }

                        ConfigValue.nStatusBeatTime = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("lcd_eco_time")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 0 || 99 < nValue) {
                            return strName;
                        }

                        ConfigValue.nECOTime = nValue;
                        boolean bECOMode = Global.setLCDECOMode(ConfigValue.nECOTime);
                        LOG_DEBUG("[setSetSetupInfo] bECOMode = " + bECOMode);
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("security_link")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // ACU 연동
                            ConfigValue.eACULinkEnable = SetValue.TRUE;
                        }
                        else if (strValue.equalsIgnoreCase("disable")) {
                            // ACU 미연동
                            ConfigValue.eACULinkEnable = SetValue.FALSE;
                        }
                        else {
                            return strName;
                        }

                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("package_link")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 택배연동
                            ConfigValue.eParcelLink = SetValue.TRUE;
                        }
                        else if (strValue.equalsIgnoreCase("disable")) {
                            // 택배 미연동
                            ConfigValue.eParcelLink = SetValue.FALSE;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("external_onepass_link")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 타사 원패스키 연동
                            ConfigValue.eExternalOnePassLink= SetValue.TRUE;
                        }
                        else if (strValue.equalsIgnoreCase("disable")) {
                            // 타사 원패스키 미연동
                            ConfigValue.eExternalOnePassLink = SetValue.FALSE;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("mainserver_type")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("integrated") || strValue.equalsIgnoreCase("separated") || strValue.equalsIgnoreCase("integrated2"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("integrated2")) {
                            // 통합형 2.0
                            if (ConfigValue.eMainServerType != SetValue.Server2dot0_Integrated) bRebootRequied = true;
                            ConfigValue.eMainServerType = SetValue.Server2dot0_Integrated;
                            ConfigValue.strMonitoringPCIPAddress = DefaultConfigValue.strMainServerIPAddress;
                        }
                        else if (strValue.equalsIgnoreCase("integrated")) {
                            // 통합형
                            if (ConfigValue.eMainServerType != SetValue.Server_Integrated) bRebootRequied = true;
                            ConfigValue.eMainServerType = SetValue.Server_Integrated;
                            ConfigValue.strMonitoringPCIPAddress = DefaultConfigValue.strMainServerIPAddress;
                        }
                        else if (strValue.equalsIgnoreCase("separated")) {
                            // 분리형
                            if (ConfigValue.eMainServerType != SetValue.Server_Separated) bRebootRequied = true;
                            ConfigValue.eMainServerType = SetValue.Server_Separated;
                            ConfigValue.strMonitoringPCIPAddress = DefaultConfigValue.strMonitoringPCIPAddress;
                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("cardreader_type")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("standard") || strValue.equalsIgnoreCase("multireader") || strValue.equalsIgnoreCase("hdec"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("standard")) {
                            // 표준형
                            if (ConfigValue.eCardReaderType != SetValue.CardReaderType_Standard) bRebootRequied = true;
                            ConfigValue.eCardReaderType = SetValue.CardReaderType_Standard;
                        }
//                        else if (strValue.equalsIgnoreCase("multireader")) {
//                            // 멀티리더적용
//                            if (ConfigValue.eCardReaderType != SetValue.DerivedType_MultiReader)
//                                bRebootRequied = true;
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_MultiReader;
//                        }
//                        else if (strValue.equalsIgnoreCase("hdec")) {
//                            // 현대건설향
//                            if (ConfigValue.eCardReaderType != SetValue.DerivedType_HDEC)
//                                bRebootRequied = true;
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_HDEC;
//                        }
//                        else if (strValue.equalsIgnoreCase("apex")) {
//                            // APEX 연동
//                            if (ConfigValue.eCardReaderType != SetValue.DerivedType_APEX)
//                                bRebootRequied = true;
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_APEX;
//                        }
//                        else if (strValue.equalsIgnoreCase("smartphone_onepass")) {
//                            // 스마트폰원패스 연동
//                            if (ConfigValue.eCardReaderType != SetValue.DerivedType_SmartPhoneOnePass)
//                                bRebootRequied = true;
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_SmartPhoneOnePass;
//                        }
                        else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("dooropendelay")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 0 || 99 < nValue) {
                            return strName;
                        }

                        ConfigValue.nFireSensorDoorOpenDelay = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("keyserver")) {
                    try {
                        String[] strSplited = strValue.split("\\.");
                        if (strSplited.length != 4) {
                            return strName;
                        }
                        int[] nSplited = new int[4];
                        for (int j = 0; j < nSplited.length; j++) {
                            nSplited[j] = Integer.parseInt(strSplited[j]);
                        }
                        if (nSplited[0] < 0 || 255 < nSplited[0]) return strName;
                        if (nSplited[1] < 0 || 255 < nSplited[1]) return strName;
                        if (nSplited[2] < 0 || 255 < nSplited[2]) return strName;
                        if (nSplited[3] < 0 || 255 < nSplited[3]) return strName;

                        ConfigValue.strKeyServerIPAddress = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("elevdisabledfloors")) {
                    try {
                        if (extractElevDisableFloor(strValue))
                            ConfigValue.strElevDisableFloorsInfo = strValue;
                        else return strName;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("ip_expansion")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 단지 통합
                            ConfigValue.eIPExpansion = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 일반 단지
                            ConfigValue.eIPExpansion = SetValue.FALSE;
                        } else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("house_division")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 세대 분리 (임대세대 활성화)
                            if (ConfigValue.eHouseDivision != SetValue.TRUE) bRebootRequied = true;
                            ConfigValue.eHouseDivision = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 일반 단지
                            if (ConfigValue.eHouseDivision != SetValue.FALSE) bRebootRequied = true;
                            ConfigValue.eHouseDivision = SetValue.FALSE;
                        } else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("smartautodoor_link")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 세대 분리 (임대세대 활성화)
                            if (ConfigValue.eSmartAutodoorLink != SetValue.TRUE) bRebootRequied = true;
                            ConfigValue.eSmartAutodoorLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 일반 단지
                            if (ConfigValue.eSmartAutodoorLink != SetValue.FALSE) bRebootRequied = true;
                            ConfigValue.eSmartAutodoorLink = SetValue.FALSE;
                        } else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("insidesensor_link")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 내부센서 입력을 문열림 스위치로 사용
                            if (ConfigValue.eInsideSensorLink != SetValue.TRUE) bRebootRequied = true;
                            ConfigValue.eInsideSensorLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 내부센서 입력을 RF리더기용으로 사용
                            if (ConfigValue.eInsideSensorLink != SetValue.FALSE) bRebootRequied = true;
                            ConfigValue.eInsideSensorLink = SetValue.FALSE;
                        } else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("fingerprint_link")) {
                    try {
                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strName;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 지문인식 활성화
                            if (ConfigValue.eFingerPrintLink != SetValue.TRUE) bRebootRequied = true;
                            ConfigValue.eFingerPrintLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 지문인식 비활성화
                            if (ConfigValue.eFingerPrintLink != SetValue.FALSE) bRebootRequied = true;
                            ConfigValue.eFingerPrintLink = SetValue.FALSE;
                        } else {
                            return strName;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("ble_strength")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 0 || 20 < nValue) {
                            return strName;
                        }
                        ConfigValue.nBLEStrength = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("onepass_available_time")) {
                    try {
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 0 || 100 < nValue) {
                            return strName;
                        }
                        ConfigValue.nOnePassAvailableTime = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
                else if (strName.equalsIgnoreCase("onepass_rssi_index")) {
                    try {
                        String[] strParsed = strValue.split("/");
                        if (strParsed.length != 3) return strName;

                        for (int j = 0; j < strParsed.length; j++) {
                            int temp = Integer.parseInt(strParsed[i]);
                            if (temp < 0 || 20 < temp) return strName;
                        }
                        ConfigValue.strOnePassRSSI = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strName);
                        e.printStackTrace();
                        return strName;
                    }
                }
            }
            return "OK";
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo)");
            e.printStackTrace();
            return "ERROR";
        }
    }

    public static String setSetSetupInfo(DeviceSettingInfo SettingInfo, DeviceSetting_LineInfo LineInfo) {
        try {
            LOG("[setSetSetupInfo] SettingInfo.bValidity = " + SettingInfo.bValidity);
            LOG("[setSetSetupInfo] SettingInfo.nModuleCnt = " + SettingInfo.nModuleCnt);
            if (!SettingInfo.bValidity) return null;

            String strResult = "ERROR";
            String strValue = null;
            int nValue = 0;

            for (int i = 0; i < SettingInfo.nModuleCnt; i++) {
                LOG_DEBUG("[setSetSetupInfo] SettingInfo.aName[" + i + "] = " + SettingInfo.aName[i]);
                LOG_DEBUG("[setSetSetupInfo] SettingInfo.aCount[" + i + "] = " + SettingInfo.aCount[i]);
                LOG_DEBUG("[setSetSetupInfo] SettingInfo.aValue[" + i + "] = " + SettingInfo.aValue[i]);
                if (SettingInfo.aName[i].equalsIgnoreCase("guard_id")) {
                    strResult = "guard_id";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (strValue.length() < 3 || 4 < strValue.length()) {
                            return strResult;
                        }
                        nValue = Integer.parseInt(strValue);

                        int ndongIP = nValue / 100;
                        int ndongbase = (Integer.parseInt(ConfigValue.strDevice_Dong) / 100) * 100;
                        ConfigValue.strGuard_Dong = Integer.toString(ndongbase + ndongIP);
                        ConfigValue.strGuard_ID = Integer.toString(nValue % 100);
                        ConfigValue.strGuardIPAddress = "10." + ndongIP + ".128." + ConfigValue.strGuard_ID;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("use_passwd")) {
                    strResult = "use_passwd";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable") || strValue.equalsIgnoreCase("none"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 공용 비밀번호 사용
                            ConfigValue.eAccessPWSelected = SetValue.PublicAccessPW_Selected;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 세대 비밀번호 사용
                            ConfigValue.eAccessPWSelected = SetValue.ResiAccessPW_Selected;
                        } else if (strValue.equalsIgnoreCase("none")) {
                            // 비밀번호 출입 기능 사용안함
                            ConfigValue.eAccessPWSelected = SetValue.PW_Unselected;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("use_adminpw")) {
                    strResult = "use_adminpw";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 관리자 비밀번호 사용
                            ConfigValue.eAdminAccessPWEnable = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 관리자 비밀번호 미사용
                            ConfigValue.eAdminAccessPWEnable = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("rf_level")) {
                    strResult = "rf_level";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("line") || strValue.equalsIgnoreCase("dong") || strValue.equalsIgnoreCase("all"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("line")) {
                            // RF Key 출입범위 : 라인
                            ConfigValue.eRFAccessLevel = SetValue.Level_Line;
                        } else if (strValue.equalsIgnoreCase("dong")) {
                            // RF Key 출입범위 : 동
                            ConfigValue.eRFAccessLevel = SetValue.Level_Dong;
                        } else if (strValue.equalsIgnoreCase("all")) {
                            // RF Key 출입범위 : 전체
                            ConfigValue.eRFAccessLevel = SetValue.Level_Entire;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("open_duration")) {
                    strResult = "open_duration";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 99 < nValue) {
                            return strResult;
                        }

                        ConfigValue.nDoorOpenDuration = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("guard_bell")) {
                    strResult = "guard_bell";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 6 < nValue) {
                            return strResult;
                        }

                        if (nValue == 1) ConfigValue.eCallMelody_Guard = SetValue.Bell_1;
                        else if (nValue == 2) ConfigValue.eCallMelody_Guard = SetValue.Bell_2;
                        else if (nValue == 3) ConfigValue.eCallMelody_Guard = SetValue.Bell_3;
                        else if (nValue == 4) ConfigValue.eCallMelody_Guard = SetValue.Bell_4;
                        else if (nValue == 5) ConfigValue.eCallMelody_Guard = SetValue.Bell_5;
                        else if (nValue == 6) ConfigValue.eCallMelody_Guard = SetValue.Bell_6;
                        else return strResult;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("home_bell")) {
                    strResult = "home_bell";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 6 < nValue) {
                            return strResult;
                        }

                        if (nValue == 1) ConfigValue.eCallMelody_Resi = SetValue.Bell_1;
                        else if (nValue == 2) ConfigValue.eCallMelody_Resi = SetValue.Bell_2;
                        else if (nValue == 3) ConfigValue.eCallMelody_Resi = SetValue.Bell_3;
                        else if (nValue == 4) ConfigValue.eCallMelody_Resi = SetValue.Bell_4;
                        else if (nValue == 5) ConfigValue.eCallMelody_Resi = SetValue.Bell_5;
                        else if (nValue == 6) ConfigValue.eCallMelody_Resi = SetValue.Bell_6;
                        else return strResult;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("datetime")) {
                    strResult = "datetime";
                    try {
                        strValue = SettingInfo.aValue[i];
                        if (strValue.length() != 14) {
                            return strResult;
                        }
                        LOG_DEBUG("[setSetSetupInfo] strValue = " + strValue);
//                        nValue = Integer.parseInt(strValue);
//                        DEBUG("[setSetSetupInfo] nValue = " + nValue);
                        int nYear = Integer.parseInt(strValue.substring(0, 4));
                        int nMonth = Integer.parseInt(strValue.substring(4, 6));
                        int nDate = Integer.parseInt(strValue.substring(6, 8));
                        int nHour = Integer.parseInt(strValue.substring(8, 10));
                        int nMin = Integer.parseInt(strValue.substring(10, 12));

                        LOG_DEBUG("[setSetSetupInfo] Cal Values [" + nYear + "/" + nMonth + "/" + nDate + " " + nHour + ":" + nMin + "]");
                        boolean bDateTime = Global.setSystemTime(nYear, nMonth, nDate, nHour, nMin);
                        LOG_DEBUG("[setSetSetupInfo] bDateTime [" + bDateTime + "]");

                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("call_level")) {
                    strResult = "call_level";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("line") || strValue.equalsIgnoreCase("dong") || strValue.equalsIgnoreCase("all"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("line")) {
                            // 호출범위 : 라인
                            ConfigValue.eCallLevel = SetValue.Level_Line;
                        } else if (strValue.equalsIgnoreCase("dong")) {
                            // 호출범위 : 동
                            ConfigValue.eCallLevel = SetValue.Level_Dong;
                        } else if (strValue.equalsIgnoreCase("all")) {
                            // 호출범위 : 전체
                            ConfigValue.eCallLevel = SetValue.Level_Entire;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("log_enable")) {
                    strResult = "log_enable";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 로그전송
                            ConfigValue.eLogSend = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 로그 미전송
                            ConfigValue.eLogSend = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("cam_pwrdur")) {
                    strResult = "cam_pwrdur";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("calling") || strValue.equalsIgnoreCase("always"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("calling")) {
                            // 호출시에만 전원 인가
                            ConfigValue.eCamPowerCtrl = SetValue.CamPower_Calling;
                        } else if (strValue.equalsIgnoreCase("always")) {
                            // 항상 전원 인가
                            ConfigValue.eCamPowerCtrl = SetValue.CamPower_Always;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("role")) {
                    strResult = "role";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("lobby") || strValue.equalsIgnoreCase("cargate"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("lobby")) {
                            // 일반 공동현관 로비폰
                            ConfigValue.eLPRole = SetValue.LPRole_Lobby;
                        } else if (strValue.equalsIgnoreCase("cargate")) {
                            // 차량게이트용 로비폰
                            ConfigValue.eLPRole = SetValue.LPRole_CarGate;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("site_code")) {
                    strResult = "site_code";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        strValue = Integer.toString(nValue);
                        if (strValue.length() != 8) {
                            return strResult;
                        }
                        ConfigValue.strSitecode = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("line_info")) {
                    strResult = "line_info";
                    try {
                        strValue = SettingInfo.aValue[i];
                        nValue = Integer.parseInt(SettingInfo.aCount[i]);
                        if (!strValue.equalsIgnoreCase("list")) {
                            return strResult;
                        }
                        if (nValue < 1 || 99 < nValue) return strResult;
                        String[] strSplited_01 = SettingInfo.aListItem[i].split("/");
                        if (nValue != strSplited_01.length) {
                            return strResult;
                        }
                        String strLineInfoString = nValue + ":" + SettingInfo.aListItem[i];
                        if (!extractLineInfo(strLineInfoString)) {
                            return strResult;
                        }
                        ConfigValue.strLineInfo = makeLineInfoString(ConfigValue.LineInfo);
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("ip_table")) {
                    strResult = "ip_table";
                    try {
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("ver_setting")) {
                    strResult = "ver_setting";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (strValue.length() != 13) {
                            return strResult;
                        }

                        ConfigValue.strVer_SETTING = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("beat_time")) {
                    strResult = "beat_time";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 99 < nValue) {
                            return strResult;
                        }

                        ConfigValue.nHearBeatTime = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("statusbeat_time")) {
                    strResult = "statusbeat_time";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        if (nValue < 1 || 99999999 < nValue) {
                            return strResult;
                        }

                        ConfigValue.nStatusBeatTime = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("lcd_eco_time")) {
                    strResult = "lcd_eco_time";
                    try {
                        strValue = SettingInfo.aValue[i];

                        nValue = Integer.parseInt(strValue);
                        if (nValue < 0 || 99 < nValue) {
                            return strResult;
                        }

                        ConfigValue.nECOTime = nValue;
                        boolean bECOMode = Global.setLCDECOMode(ConfigValue.nECOTime);
                        LOG_DEBUG("[setSetSetupInfo] bECOMode = " + bECOMode);
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("security_link")) {
                    strResult = "security_link";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                }
                else if (SettingInfo.aName[i].equalsIgnoreCase("package_link")) {
                    strResult = "package_link";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 택배연동
                            ConfigValue.eParcelLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 택배 미연동
                            ConfigValue.eParcelLink = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                }
                else if (SettingInfo.aName[i].equalsIgnoreCase("external_onepass_link")) {
                    strResult = "external_onepass_link";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 타사 원패스 키 연동
                            ConfigValue.eExternalOnePassLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 타사 원패스 키 미연동
                            ConfigValue.eExternalOnePassLink = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                }
                else if (SettingInfo.aName[i].equalsIgnoreCase("mainserver_type")) {
                    strResult = "mainserver_type";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("integrated") || strValue.equalsIgnoreCase("separated") || strValue.equalsIgnoreCase("integrated2"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("integrated2")) {
                            // 통합형 2.0
                            ConfigValue.eMainServerType = SetValue.Server2dot0_Integrated;
                        }
                        else if (strValue.equalsIgnoreCase("integrated")) {
                            // 통합형
                            ConfigValue.eMainServerType = SetValue.Server_Integrated;
                        }
                        else if (strValue.equalsIgnoreCase("separated")) {
                            // 분리형
                            ConfigValue.eMainServerType = SetValue.Server_Separated;
                        }
                        else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("cardreader_type")) {
                    strResult = "cardreader_type";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("standard") || strValue.equalsIgnoreCase("multireader") || strValue.equalsIgnoreCase("hdec"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("standard")) {
                            // 호출범위 : 라인
                            ConfigValue.eCardReaderType = SetValue.CardReaderType_Standard;
                        }
//                        else if (strValue.equalsIgnoreCase("multireader")) {
//                            // 호출범위 : 동
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_MultiReader;
//                        }
//                        else if (strValue.equalsIgnoreCase("hdec")) {
//                            // 호출범위 : 전체
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_HDEC;
//                        }
//                        else if (strValue.equalsIgnoreCase("apex")) {
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_APEX;
//                        }
//                        else if (strValue.equalsIgnoreCase("smartphone_onepass")) {
//                            ConfigValue.eCardReaderType = SetValue.DerivedType_SmartPhoneOnePass;
//                        }
                        else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("dooropendelay")) {
                    strResult = "dooropendelay";
                    try {
                        strValue = SettingInfo.aValue[i];
                        nValue = Integer.parseInt(strValue);
                        if (nValue < 0 || 99 < nValue) {
                            return strResult;
                        }

                        ConfigValue.nFireSensorDoorOpenDelay = nValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("keyserver")) {
                    strResult = "keyserver";
                    try {
                        strValue = SettingInfo.aValue[i];

                        String[] strSplited = strValue.split("\\.");
                        if (strSplited.length != 4) {
                            return strResult;
                        }
                        int[] nSplited = new int[4];
                        for (int j = 0; j < nSplited.length; j++) {
                            nSplited[j] = Integer.parseInt(strSplited[j]);
                        }
                        if (nSplited[0] != 10) return strResult;
                        if (nSplited[1] < 0 || 255 < nSplited[1]) return strResult;
                        if (nSplited[2] < 0 || 255 < nSplited[2]) return strResult;
                        if (nSplited[3] < 0 || 255 < nSplited[3]) return strResult;

                        ConfigValue.strKeyServerIPAddress = strValue;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("elevdisabledfloors")) {
                    strResult = "elevdisabledfloors";
                    try {
                        strValue = SettingInfo.aValue[i];
                        if (extractElevDisableFloor(strValue))
                            ConfigValue.strElevDisableFloorsInfo = strValue;
                        else return strResult;
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("house_division")) {
                    strResult = "house_division";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 세대 분리 (임대세대 활성화)
                            ConfigValue.eHouseDivision = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 일반세대 (임대세대 없음)
                            ConfigValue.eHouseDivision = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("smartautodoor_link")) {
                    strResult = "smartautodoor_link";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 스마트 자동문 연동
                            ConfigValue.eSmartAutodoorLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 스마트 자동문 미연동
                            ConfigValue.eSmartAutodoorLink = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("insidesensor_link")) {
                    strResult = "insidesensor_link";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 내부센서 - 문열림 스위치 연동
                            ConfigValue.eInsideSensorLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 내부센서 - RF리더기 연동
                            ConfigValue.eInsideSensorLink = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                } else if (SettingInfo.aName[i].equalsIgnoreCase("fingerprint_link")) {
                    strResult = "fingerprint_link";
                    try {
                        strValue = SettingInfo.aValue[i];

                        if (!(strValue.equalsIgnoreCase("enable") || strValue.equalsIgnoreCase("disable"))) {
                            return strResult;
                        }

                        if (strValue.equalsIgnoreCase("enable")) {
                            // 지문인식 모듈 연동
                            ConfigValue.eFingerPrintLink = SetValue.TRUE;
                        } else if (strValue.equalsIgnoreCase("disable")) {
                            // 지문인식 모듈 미연동
                            ConfigValue.eFingerPrintLink = SetValue.FALSE;
                        } else {
                            return strResult;
                        }
                    } catch (Exception e) {
                        Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo) : " + strResult);
                        e.printStackTrace();
                        return strResult;
                    }
                }
            }
            return "OK";
        } catch (Exception e) {
            Log.e(TAG, "[Exception] setSetSetupInfo(SettingInfo)");
            e.printStackTrace();
            return "ERROR";
        }
    }

    // 설정정보와 DB간의 데이터 형식 변환 함수
    public static String makeLineInfoString(LineInfoTable LineInfo) {
        try {
            LOG("[makeLineInfoString] ===== START =====");
            // 라인정보 저장형식
            // 라인개수:라인번호=저층-고층/라인번호=저층-고층
            int nCnt = LineInfo.getCnt();
            if (nCnt == 0) return "NONE";
            String strResult = nCnt + ":";
            for (int i = 0; i < nCnt; i++) {
                if (i == 0)
                    strResult += LineInfo.getLineInfo(i).NAME() + "=" + LineInfo.getLineInfo(i).LOW() + "-" + LineInfo.getLineInfo(i).HIGH();
                else
                    strResult += "/" + LineInfo.getLineInfo(i).NAME() + "=" + LineInfo.getLineInfo(i).LOW() + "-" + LineInfo.getLineInfo(i).HIGH();
            }
            LOG("[makeLineInfoString] strResult = " + strResult);
            return strResult;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] makeLineInfoString(LineInfo)");
            e.printStackTrace();
            return "ERROR";
        }
    }

    public static boolean extractLineInfo(String strLineInfoString) {
        try {
            // 라인개수:라인번호=저층-고층/라인번호=저층-고층...
            LOG("[extractLineInfo] strLineInfoString = " + strLineInfoString);
            if (strLineInfoString.matches(".*NONE.*")) {
                ConfigValue.LineInfo.clearTable();
                return true;
            } else if (strLineInfoString.matches(".*ERROR.*")) {
                return false;
            } else {
                String[] strSplited_01 = strLineInfoString.split(":");
                int nCnt = Integer.parseInt(strSplited_01[0]);   // 라인개수
                String[] strSplited_02 = strSplited_01[1].split("/");   // 라인정보 분리
                if (nCnt != strSplited_02.length) {
                    return false;
                }

                LineInfoTable TempLineInfo = new LineInfoTable();
                TempLineInfo.clearTable();
                int nLineName;
                int nLowFloor;
                int nHighFloor;
                for (int i = 0; i < nCnt; i++) {
                    String[] strSplited_03 = strSplited_02[i].split("=");   // 라인번호 = 저층-고층
                    String[] strSplited_04 = strSplited_03[1].split("-");   // 저층 - 고층
                    nLineName = Integer.parseInt(strSplited_03[0]);   // 라인번호 검증
                    nLowFloor = Integer.parseInt(strSplited_04[0]);   // 저층 검증
                    nHighFloor = Integer.parseInt(strSplited_04[1]);   // 고층 검증
                    if (nLineName < 1 || 99 < nLineName) return false;
                    ;
                    if (nLowFloor < 1 || 99 < nLowFloor) return false;
                    if (nHighFloor < 1 || 99 < nHighFloor) return false;
                    if (nHighFloor < nLowFloor) return false;
                    TempLineInfo.addLineTable(nLineName, nLowFloor, nHighFloor, null);
                }
                ConfigValue.LineInfo.clearTable();
                ConfigValue.LineInfo = TempLineInfo;
                return true;
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] extractLineInfo(strLineInfoString)");
            e.printStackTrace();
            return false;
        }
    }

    public static String makeSubIDsString(SubInfoTable SubInfo) {
        try {
            // 개수:ID/ID/ID/ID...
            // 서브로비폰정보 저장형식
            // ID:IP/ID:IP
            LOG("[makeSubIDsString] ===== START =====");
            int nCnt = SubInfo.getCnt();
            LOG("[makeSubIDsString] nCnt = " + nCnt);
            if (nCnt < 1) return "NONE";
            if (nCnt < 1 || 99 < nCnt) return "ERROR_01";
            for (int i = 0; i < nCnt; i++) {
                LOG("[makeSubIDsString] nSubIDs[" + i + "] = " + SubInfo.getSubInfo(i).ID());
            }
            String strResult = nCnt + ":";
            int nSubID = 0;
            for (int i = 0; i < nCnt; i++) {
                nSubID = SubInfo.getSubInfo(i).ID();
                if (nSubID < 1 || 99 < nSubID) return "ERROR_03";
                if (i == 0) strResult += nSubID;
                else strResult += "/" + nSubID;
            }
            LOG("[makeSubIDsString] strResult = " + strResult);
            return strResult;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] makeSubIDsString(SubInfo)");
            e.printStackTrace();
            return "ERROR";
        }
    }

    public static boolean extractSubIDs(String strSubIDsString) {
        try {
            // 서브개수:ID/ID/ID/ID/ID/ID
            // 서브개수:IP/IP/IP/IP/IP/IP
            LOG("[extractSubIDs] strSubIDsString = " + strSubIDsString);
            if (strSubIDsString.matches(".*NONE.*")) {
                ConfigValue.strSubIDs = "NONE";
                ConfigValue.SubInfo.clearTable();
                return true;
            } else if (strSubIDsString.matches(".*ERROR.*")) {
                return false;
            } else {
                String[] strSplited_01 = strSubIDsString.split(":");
                int nSubCnt = Integer.parseInt(strSplited_01[0]);   // 서브개수
                String[] strSplited_02 = strSplited_01[1].split("/");   // 서브로비폰정보 분리
                if (nSubCnt != strSplited_02.length) {
                    return false;
                }

                int nDongIP = Integer.parseInt(ConfigValue.strDevice_Dong) % 100;
                int nSubID;
                String strSubIP;
                SubInfoTable TempSubInfo = new SubInfoTable();
                TempSubInfo.clearTable();
                for (int i = 0; i < nSubCnt; i++) {
                    nSubID = Integer.parseInt(strSplited_02[i]);   // ID 검증
                    if (nSubID < 1 || 99 < nSubID) return false;
                    strSubIP = "10." + nDongIP + ".0." + nSubID;
                    TempSubInfo.addSubTable(nSubID, strSubIP, null);
                }
                ConfigValue.SubInfo.clearTable();
                ConfigValue.SubInfo = TempSubInfo;
                return true;
            }
        } catch (Exception e) {
            Log.e(TAG, "[Exception] extractSubIDs(strSubIDsString)");
            e.printStackTrace();
            return false;
        }
    }

    public static String makeElevDisableFloorString(ElevDisableFloorTable ElevDisable) {
        try {
            if (ElevDisable == null) return "ERROR";
            int nCnt = ElevDisable.getCnt();
            LOG("[makeElevDisableFloorString] nCnt [" + nCnt + "]");
            // 라인정보 저장형식
            // 순서:라인번호=저층-고층/순서:라인번호=저층-고층
            if (nCnt == 0) return "NONE";
            String strResult = nCnt + ":";
            for (int i = 0; i < nCnt; i++) {
                if (i == 0) strResult += ElevDisable.getElevDisableInfo(i).FLOOR();
                else strResult += "/" + ElevDisable.getElevDisableInfo(i).FLOOR();
            }
            LOG("[makeElevDisableFloorString] strResult = " + strResult);
            return strResult;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] makeElevDisableFloorString(ElevDisable)");
            e.printStackTrace();
            return "ERROR";
        }
    }

    public static boolean extractElevDisableFloor(String strFloorString) {
        try {
            LOG("[extractElevDisableFloor] strFloorString = " + strFloorString);
            if (strFloorString.matches(".*NONE.*")) {
                LOG("[extractElevDisableFloor] strFloorString has NONE!!");
                ConfigValue.strElevDisableFloorsInfo = "NONE";
                ConfigValue.ElevDisable.clearTable();
                return true;
            }
            if (strFloorString.matches(".*ERROR.*")) {
                LOG("[extractElevDisableFloor] strFloorString has ERROR!!");
                return false;
            }
            String[] strSplited_01 = strFloorString.split(":");   // 층정보 개수:층/층/층/층/층/층/층/층/
            int nCnt = Integer.parseInt(strSplited_01[0]);   // 층정보 개수 추출
            String[] strSplited_02 = strSplited_01[1].split("/");   // 층정보 추출
            if (nCnt != strSplited_02.length) {
                LOG("[extractElevDisableFloor] strFloorString has Fault!!");
                return false;
            }
            for (int i = 0; i < nCnt; i++) {
                if (Integer.parseInt(strSplited_02[i]) == 0) return false;
            }
            ElevDisableFloorTable TempElevDisable = new ElevDisableFloorTable();
            TempElevDisable.clearTable();
            for (int i = 0; i < nCnt; i++) {
                TempElevDisable.addElevDisableFloorTable(Integer.parseInt(strSplited_02[i]), null);
            }
            ConfigValue.ElevDisable.clearTable();
            ConfigValue.ElevDisable = TempElevDisable;
            return true;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] extractElevDisableFloor(strFloorString)");
            e.printStackTrace();
            return false;
        }
    }

    public static String makeDeviceReset(SetValue Enable, String strType, int nCycle, int nTime, int nRandomMin) {
        try {
            LOG("[makeRMDeviceReset] Enable [" + Enable + "], strType [" + strType + "], nCycle [" + nCycle + "], nTime [" + nTime + "], , nRandomMin [" + nRandomMin + "]");
            String strResult = "NONE";
            strResult = Enable.toString() + "/" + strType + "/" + Integer.toString(nCycle) + "/" + Integer.toString(nTime) + "/" + Integer.toString(nRandomMin);
            LOG("[makeRMDeviceReset] strResult [" + strResult + "]");
            return strResult;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] makeRMDeviceReset(bEnable, strType, nCycle, nTime, nRandomMin)");
            e.printStackTrace();
            return "ERROR";
        }
    }

    public static boolean extractDeviceReset(String strDeviceResetInfo) {
        try {
            // 데이터 형식 : type/cycle/time
            LOG("[extractDeviceReset] strDeviceResetInfo = " + strDeviceResetInfo);
            String[] strParse = strDeviceResetInfo.split("/");
            SetValue eEnable = SetValue.FALSE;
            String strType = "null";
            int nCycle = 0;
            int nTime = 0;
            int nRandomMin = 0;

            if (strParse[0].equalsIgnoreCase("week")) {
                eEnable = SetValue.TRUE;
                strType = strParse[0];
                nCycle = Integer.parseInt(strParse[1]);
                if (nCycle < 0 || 6 < nCycle) {
                    ConfigValue.DeviceReset.reset();
                    return false;
                }
                if (nTime < 0 || 23 < nTime) {
                    ConfigValue.DeviceReset.reset();
                    return false;
                }
            } else if (strParse[0].equalsIgnoreCase("month")) {

            } else {
                eEnable = SetValue.FALSE;
                strType = "disable";
            }
            return false;
        } catch (Exception e) {
            Log.e(TAG, "[Exception] extractDeviceReset(strDeviceResetInfo)");
            e.printStackTrace();
            return false;
        }
    }

    public static enum SetValue {
        Wallpad,
        Lobby,
        Guard,
        Main,
        Sub,
        PublicAccessPW_Selected,
        ResiAccessPW_Selected,
        PW_Unselected,
        Level_Line,
        Level_Dong,
        Level_Entire,
        LPRole_Lobby,
        LPRole_CarGate,
        Server_Separated,
        Server_Integrated,
        Server2dot0_Integrated,
        ServerMixed_Integrated,
        CardReaderType_Standard,
        CamPower_Always,
        CamPower_Calling,
        Bell_1,
        Bell_2,
        Bell_3,
        Bell_4,
        Bell_5,
        Bell_6,
        Korean,
        English,
        Chinese,
        Taiwanese,
        Vietnamese,
        TRUE,
        FALSE,
        Reserved_1,
        Reserved_2,
        Reserved_3,
        Reserved_4,
        Reserved_5,
        Reserved_6,
        NONE;

        public static SetValue getSetValue(String value) {
            try {
//            	Log.e(TAG, "[getSetValue] value [" + value + "]");
                if (value == null) return NONE;

                if (value.equals(Wallpad.toString())) {
                    return Wallpad;
                } else if (value.equals(Lobby.toString())) {
                    return Lobby;
                } else if (value.equals(Guard.toString())) {
                    return Guard;
                } else if (value.equals(Main.toString())) {
                    return Main;
                } else if (value.equals(Sub.toString())) {
                    return Sub;
                } else if (value.equals(PublicAccessPW_Selected.toString())) {
                    return PublicAccessPW_Selected;
                } else if (value.equals(ResiAccessPW_Selected.toString())) {
                    return ResiAccessPW_Selected;
                } else if (value.equals(PW_Unselected.toString())) {
                    return PW_Unselected;
                } else if (value.equals(Level_Line.toString())) {
                    return Level_Line;
                } else if (value.equals(Level_Dong.toString())) {
                    return Level_Dong;
                } else if (value.equals(Level_Entire.toString())) {
                    return Level_Entire;
                } else if (value.equals(LPRole_Lobby.toString())) {
                    return LPRole_Lobby;
                } else if (value.equals(LPRole_CarGate.toString())) {
                    return LPRole_CarGate;
                } else if (value.equals(Server_Separated.toString())) {
                    return Server_Separated;
                } else if (value.equals(Server_Integrated.toString())) {
                    return Server_Integrated;
                } else if (value.equals(Server2dot0_Integrated.toString())) {
                    return Server2dot0_Integrated;
                } else if (value.equals(ServerMixed_Integrated.toString())) {
                    return ServerMixed_Integrated;
                } else if (value.equals(CardReaderType_Standard.toString())) {
                    return CardReaderType_Standard;
                } else if (value.equals(CamPower_Always.toString())) {
                    return CamPower_Always;
                } else if (value.equals(CamPower_Calling.toString())) {
                    return CamPower_Calling;
                } else if (value.equals(Bell_1.toString())) {
                    return Bell_1;
                } else if (value.equals(Bell_2.toString())) {
                    return Bell_2;
                } else if (value.equals(Bell_3.toString())) {
                    return Bell_3;
                } else if (value.equals(Bell_4.toString())) {
                    return Bell_4;
                } else if (value.equals(Bell_5.toString())) {
                    return Bell_5;
                } else if (value.equals(Bell_6.toString())) {
                    return Bell_6;
                } else if (value.equals(Korean.toString())) {
                    return Korean;
                } else if (value.equals(English.toString())) {
                    return English;
                } else if (value.equals(Chinese.toString())) {
                    return Chinese;
                } else if (value.equals(Taiwanese.toString())) {
                    return Taiwanese;
                } else if (value.equals(Vietnamese.toString())) {
                    return Vietnamese;
                } else if (value.equals(TRUE.toString())) {
                    return TRUE;
                } else if (value.equals(FALSE.toString())) {
                    return FALSE;
                } else if (value.equals(Reserved_1.toString())) {
                    return Reserved_1;
                } else if (value.equals(Reserved_2.toString())) {
                    return Reserved_2;
                } else if (value.equals(Reserved_3.toString())) {
                    return Reserved_3;
                } else if (value.equals(Reserved_4.toString())) {
                    return Reserved_4;
                } else if (value.equals(Reserved_5.toString())) {
                    return Reserved_5;
                } else if (value.equals(Reserved_6.toString())) {
                    return Reserved_6;
                } else {
                    return NONE;
                }
            } catch (Exception e) {
                Log.e(TAG, "[Exception] getSetValue(String value)");
                e.printStackTrace();
                return NONE;
            }
        }

    }

    public static class ConfigValKey {
        public static String FirstBoot = "FirstBoot";
        public static String Sitecode = "Sitecode";
        public static String Device_Dong = "Device_Dong";
        public static String Device_ID = "Device_ID";
        public static String Guard_Dong = "Guard_Dong";
        public static String Guard_ID = "Guard_ID";
        public static String DeviceIPAddress = "DeviceIPAddress";
        public static String MainServerIPAddress = "MainServerIPAddress";
        public static String Subnetmask = "Subnetmask";
        public static String GatewayIPAddress = "GatewayIPAddress";
        public static String DNSIPAddress = "DNSIPAddress";
        public static String MonitoringPCIPAddress = "MonitoringPCIPAddress";
        public static String KeyServerIPAddress = "KeyServerIPAddress";
        public static String FingerprintServer = "FingerprintServer";
        public static String GuardIPAddress = "GuardIPAddress";
        public static String PublicAccessPW = "PublicAccessPW";
        public static String AdminAccessPW = "AdminAccessPW";
        public static String AdminPW = "AdminPW";
        public static String MainServerPortNum = "MainServerPortNum";
        public static String SmartAutodoorServerPortNum = "SmartAutodoorServerPortNum";
        public static String HearBeatTime = "HearBeatTime";
        public static String StatusBeatTime = "StatusBeatTime";
        public static String VolumeLevel_Talk = "VolumeLevel_Talk";
        public static String VolumeLevel_System = "VolumeLevel_System";
        public static String ZigBeeSensitivity = "ZigBeeSensitivity";
        public static String DoorOpenDuration = "DoorOpenDuration";
        public static String ECOTime = "ECOTime";
        public static String FireSensorDoorOpenDelay = "FireSensorDoorOpenDelay";
        public static String MainLPID = "MainLPID";
        public static String LineInfo = "LineInfo";
        public static String SubIDs = "SubIDs";
        public static String ElevDisableFloorsInfo = "ElevDisableFloorsInfo";
        public static String DeviceReset = "DeviceReset";
        public static String LogSave = "LogSave";
        public static String OnePassRSSI = "OnePassRSSI";
        public static String DeviceType = "DeviceType";
        public static String MainSub = "MainSub";
        public static String LPRole = "LPRole";
        public static String CardReaderType = "CardReaderType";
        public static String AccessPWSelected = "AccessPWSelected";
        public static String AdminAccessPWEnable = "AdminAccessPWEnable";
        public static String RFAccessLevel = "RFAccessLevel";
        public static String CallLevel = "CallLevel";
        public static String CallMelody_Resi = "CallMelody_Resi";
        public static String CallMelody_Guard = "CallMelody_Guard";
        public static String LogSend = "LogSend";
        public static String Language = "Language";
        public static String ParcelLink = "ParcelLink";
        public static String ExternalOnePassLink = "ExternalOnePassLink";
        public static String MainServerType = "MainServerType";
        public static String SubServerType = "SubServerType";
        public static String MoviePlay = "MoviePlay";
        public static String FireSensorDetected = "FireSensorDetected";
        public static String ACULinkEnable = "ACULinkEnable";
        public static String CamPowerCtrl = "CamPowerCtrl";
        public static String IPExpansion = "IPExpansion";
        public static String HouseDivision = "HouseDivision";
        public static String SmartAutodoorLink = "SmartAutodoor";
        public static String InsideSensorLink = "InsideSensorLink";
        public static String FingerPrintLink = "FingerPrintLink";
        public static String BLEStrength = "BLEStrength";
        public static String OnePassAvailableTime = "OnePassAvailableTime";
        public static String OnePassInOutBlockTime = "OnePassInOutBlockTime";
        public static String SmartKeyInOutBlockTime = "SmartKeyInOutBlockTime";
        public static String Ver_APP = "Ver_APP";
        public static String Ver_BSP = "Ver_BSP";
        public static String Ver_EBOOT = "Ver_EBOOT";
        public static String Ver_MOIP = "Ver_MOIP";
        public static String Ver_SETTING = "Ver_SETTING";
        public static String Ver_ADDITIONAL = "Ver_ADDITIONAL";
        public static String Ver_MOVIE = "Ver_MOVIE";
        public static String Ver_MOVIESETTING = "Ver_MOVIESETTING";
    }

    public static class ConfigValue {
        public static int DEVICE_BOARDTYPE = 0;   // 디바이스 보드 종류
        public static int DEVICE_MODELTYPE = 0;   // 디바이스 모델 종류 (0: 4.3'(현산향) / 1: 7'(대외향))
        public static SetValue eFirstBoot = SetValue.TRUE;
        public static String strSitecode = "12345678";
        public static String strDevice_Dong = "100";
        public static String strDevice_ID = "10";
        public static String strGuard_Dong = "100";
        public static String strGuard_ID = "10";
        public static String strDeviceIPAddress = "10.0.0.10";
        public static String strMainServerIPAddress = "10.0.1.1";
        public static String strSubnetmask = "255.255.0.0";
        public static String strGatewayIPAddress = "10.0.0.254";
        public static String strDNSIPAddress = "10.0.1.1";
        public static String strMonitoringPCIPAddress = "10.0.1.10";
        public static String strKeyServerIPAddress = "10.0.1.10";
        public static String strFingerprintServer = "10.0.1.10:10000";
        public static String strGuardIPAddress = "10.0.128.10";
        public static String strPublicAccessPW = "1234";
        public static String strAdminAccessPW = "2486";
        public static String strAdminPW = "2580";
        public static int nMainServerPortNum = 10000;
        public static int nSubServerPortNum = 10000;
        public static int nSmartAutodoorServerPortNum = 12000;
        public static int nHearBeatTime = 5;   // Min 단위
        public static int nStatusBeatTime = 720;   // Min 단위
        public static int nVolumeLevel_Talk = 5;
        public static int nVolumeLevel_System = 5;
        public static int nDoorOpenDuration = 5;   // Sec 단위
        public static int nECOTime = 0;   // Min 단위
        public static int nFireSensorDoorOpenDelay = 0;   // Min 단위
        public static int nZigBeeSensitivity = 0;
        public static int nBLEStrength = 10;
        public static int nOnePassAvailableTime = 5;   // Sec 단위
        public static int nOnePassInOutBlockTime = 5;   // Sec 단위
        public static int nSmartKeyInOutBlockTime = 5;   // Sec 단위
        public static String strMainLPID = "10";
        public static String strLineInfo = "NONE";
        public static String strSubIDs = "NONE";
        public static String strElevDisableFloorsInfo = "NONE";   // 엘리베이터 비연동층 정보
        public static String strDeviceReset = "NONE";   // "/"로 구분한다.
        public static String strLogSave = "NONE";   // 경로에 "/"가 포함되므로, "#"으로 구분한다.
        public static String strOnePassRSSI = "10/10/10";   // "/"로 구분한다.

        public static SetValue eDeviceType = SetValue.Lobby;
        public static SetValue eMainSub = SetValue.Main;
        public static SetValue eLPRole = SetValue.LPRole_Lobby;
        public static SetValue eCardReaderType = SetValue.CardReaderType_Standard;
        public static SetValue eAccessPWSelected = SetValue.PublicAccessPW_Selected;
        public static SetValue eAdminAccessPWEnable = SetValue.FALSE;
        public static SetValue eRFAccessLevel = SetValue.Level_Line;
        public static SetValue eCallLevel = SetValue.Level_Line;
        public static SetValue eCallMelody_Resi = SetValue.Bell_1;
        public static SetValue eCallMelody_Guard = SetValue.Bell_2;
        public static SetValue eLogSend = SetValue.FALSE;
        public static SetValue eLanguage = SetValue.Korean;
        public static SetValue eParcelLink = SetValue.FALSE;
        public static SetValue eExternalOnePassLink = SetValue.FALSE;
        public static SetValue eMainServerType = SetValue.Server_Separated;
        public static SetValue eSubServerType = SetValue.Server_Separated;
        public static SetValue eMoviePlay = SetValue.FALSE;
        public static SetValue eFireSensorDetected = SetValue.FALSE;
        public static SetValue eACULinkEnable = SetValue.FALSE;
        public static SetValue eCamPowerCtrl = SetValue.CamPower_Calling;
        public static SetValue eIPExpansion = SetValue.FALSE;
        public static SetValue eHouseDivision = SetValue.FALSE;
        public static SetValue eSmartAutodoorLink = SetValue.FALSE;
        public static SetValue eInsideSensorLink = SetValue.FALSE;
        public static SetValue eFingerPrintLink = SetValue.FALSE;
        public static String strVer_APP = "0000.00.00.00";
        public static String strVer_BSP = "0000.00.00.00";
        public static String strVer_EBOOT = "0000.00.00.00";
        public static String strVer_MOIP = "0000.00.00.00";
        public static String strVer_SETTING = "0000.00.00.00";
        public static String strVer_ADDITIONAL = "0000.00.00.00";
        public static String strVer_MOVIE = "0000.00.00.00";
        public static String strVer_MOVIESETTING = "0000.00.00.00";


        // 데이터베이스에 저장되지 않고 로딩하여 사용하는 설정정보
        public static LineInfoTable LineInfo = new LineInfoTable();
        public static SubInfoTable SubInfo = new SubInfoTable();
        public static ElevDisableFloorTable ElevDisable = new ElevDisableFloorTable();

        public static class DeviceReset {
            public static SetValue eEnable = SetValue.FALSE;
            public static String strType = "null";
            public static int nCycle = 0;
            public static int nTime = 0;
            public static int nRandomMin = 0;

            public static void reset() {
                eEnable = SetValue.FALSE;
                strType = "nul";
                nCycle = 0;
                nTime = 0;
                nRandomMin = 0;
                Log.e(TAG, "[DeviceReset.reset()] ConfigValue.DeviceReset variables are reset!!");
            }
        }

        public static class LogSave {
            public static SetValue eEnable = SetValue.FALSE;
            public static String strType = "null";
            public static String strFTPInfo = "null";
            public static String strFTPUser = "null";
            public static String strFTPPW = "null";
            public static String strPeriod = "null";
            public static String strFileSize = "null";

            public static void reset() {
                eEnable = SetValue.FALSE;
                strType = "nul";
                strType = "nul";
                strType = "nul";
                strType = "nul";
                strType = "nul";
                Log.e(TAG, "[DeviceReset.reset()] ConfigValue.DeviceReset variables are reset!!");
            }
        }

    }

    public static class DefaultConfigValue {
        public static SetValue eFirstBoot = SetValue.TRUE;
        public static String strSitecode = "12345678";
        public static String strDevice_Dong = "100";
        public static String strDevice_ID = "10";
        public static String strGuard_Dong = "100";
        public static String strGuard_ID = "10";
        public static String strDeviceIPAddress = "10.0.0.10";
        public static String strMainServerIPAddress = "10.0.1.1";
        public static String strMainServer2IPAddress = "10.0.2.1";
        public static String strSubnetmask = "255.255.0.0";
        public static String strGatewayIPAddress = "10.0.0.254";
        public static String strDNSIPAddress = "10.0.1.1";
        public static String strDNS2IPAddress = "10.0.2.1";
        public static String strMonitoringPCIPAddress = "10.0.1.10";
        public static String strKeyServerIPAddress = "10.0.1.10";
        public static String strFingerprintServer = "10.0.1.10:10000";
        public static String strGuardIPAddress = "10.0.128.10";
        public static String strPublicAccessPW = "1234";
        public static String strAdminAccessPW = "2486";
        public static String strAdminPW = "2580";
        public static int nMainServerPortNum = 10000;
        public static int nSmartAutodoorServerPortNum = 12000;
        public static int nHearBeatTime = 5;
        public static int nStatusBeatTime = 720;
        public static int nVolumeLevel_Talk = 5;
        public static int nVolumeLevel_System = 5;
        public static int nDoorOpenDuration = 5;   // Sec 단위
        public static int nECOTime = 0;
        public static int nFireSensorDoorOpenDelay = 0;
        public static int nZigBeeSensitivity = 0;
        public static int nBLEStrength = 10;
        public static int nOnePassAvailableTime = 5;   // Sec 단위
        public static int nOnePassInOutBlockTime = 5;   // Sec 단위
        public static int nSmartKeyInOutBlockTime = 5;   // Sec 단위
        public static String strMainLPID = "10";
        public static int nLineCnt = 0;
        public static String strLineInfo = "NONE";
        public static int nSubCnt = 0;
        public static String strSubIDs = "NONE";
        public static String strElevDisableFloorsInfo = "NONE";   // 엘리베이터 비연동층 정보
        public static String strDeviceReset = "NONE";   // "/"로 구분한다.
        public static String strLogSave = "NONE";   // 경로에 "/"가 포함되므로, "#"으로 구분한다.
        public static String strOnePassRSSI = "10/10/10";   // "/"로 구분한다.

        public static SetValue eDeviceType = SetValue.Lobby;
        public static SetValue eMainSub = SetValue.Main;
        public static SetValue eLPRole = SetValue.LPRole_Lobby;
        public static SetValue eCardReaderType = SetValue.CardReaderType_Standard;
        public static SetValue eAccessPWSelected = SetValue.PublicAccessPW_Selected;
        public static SetValue eAdminAccessPWEnable = SetValue.FALSE;
        public static SetValue eRFAccessLevel = SetValue.Level_Line;
        public static SetValue eCallLevel = SetValue.Level_Line;
        public static SetValue eCallMelody_Resi = SetValue.Bell_1;
        public static SetValue eCallMelody_Guard = SetValue.Bell_2;
        public static SetValue eLogSend = SetValue.FALSE;
        public static SetValue eLanguage = SetValue.Korean;
        public static SetValue eParcelLink = SetValue.FALSE;
        public static SetValue eExternalOnePassLink = SetValue.FALSE;
        public static SetValue eMainServerType = SetValue.Server_Separated;
        public static SetValue eSubServerType = SetValue.Server_Separated;
        public static SetValue eMoviePlay = SetValue.FALSE;
        public static SetValue eFireSensorDetected = SetValue.FALSE;
        public static SetValue eACULinkEnable = SetValue.FALSE;
        public static SetValue eCamPowerCtrl = SetValue.CamPower_Calling;
        public static SetValue eIPExpansion = SetValue.FALSE;
        public static SetValue eHouseDivision = SetValue.FALSE;
        public static SetValue eSmartAutodoorLink = SetValue.FALSE;
        public static SetValue eInsideSensorLink = SetValue.FALSE;
        public static SetValue eFingerPrintLink = SetValue.FALSE;
        public static String strVer_APP = "0000.00.00.00";
        public static String strVer_BSP = "0000.00.00.00";
        public static String strVer_EBOOT = "0000.00.00.00";
        public static String strVer_MOIP = "0000.00.00.00";
        public static String strVer_SETTING = "0000.00.00.00";
        public static String strVer_ADDITIONAL = "0000.00.00.00";
        public static String strVer_MOVIE = "0000.00.00.00";
        public static String strVer_MOVIESETTING = "0000.00.00.00";
    }


}

