Просмотр исходного кода

부재중, 방문자 사진 알림 막음. 일부 오류 수정.

jslee(madeinlab) 3 лет назад
Родитель
Сommit
40d5a03c7f

+ 14 - 0
WallPadAPI/src/main/java/com/artncore/WallPadDataMgr/wallpaddbmgr.java

@@ -2615,6 +2615,20 @@ public class wallpaddbmgr {
             InsertinitWidgetData(10, define.ICONS.MENUS.ADD_CCTV.getID());
             InsertinitWidgetData(11, define.ICONS.MENUS.SETTING_CONFIG.getID());
         }
+        else if(mModelType == Version.MODEL_TYPE.IHN_D101_I_LX2){
+            InsertinitWidgetData(0, define.ICONS.MENUS.MAIN_ELEVATOR.getID());
+            InsertinitWidgetData(1, define.ICONS.MENUS.TALK_FRONT.getID());
+            InsertinitWidgetData(2, define.ICONS.MENUS.TALK_GUARD.getID());
+            InsertinitWidgetData(3, define.ICONS.MENUS.CTRL_LIVINGLIGHT.getID());
+            InsertinitWidgetData(4, define.ICONS.MENUS.CTRL_HEATING.getID());
+            InsertinitWidgetData(5, define.ICONS.MENUS.CTRL_VENT.getID());
+            InsertinitWidgetData(6, define.ICONS.MENUS.ENERGY_SMARTPANEL.getID());
+            InsertinitWidgetData(7, define.ICONS.MENUS.ADD_NOTICE.getID());
+            InsertinitWidgetData(8, define.ICONS.MENUS.ADD_MEMO.getID());
+            InsertinitWidgetData(9, define.ICONS.MENUS.SECURITY_SETARMED.getID());
+            InsertinitWidgetData(10, define.ICONS.MENUS.ADD_CCTV.getID());
+            InsertinitWidgetData(11, define.ICONS.MENUS.SETTING_CONFIG.getID());
+        }
         else if (mModelType == Version.MODEL_TYPE.IHN_HS101 || mModelType == Version.MODEL_TYPE.IHN_HS101_I) {
             InsertinitWidgetData(0, define.ICONS.MENUS.MAIN_CALRENDAR.getID());   // 달력/시계
             InsertinitWidgetData(1, define.ICONS.MENUS.MAIN_ELEVATOR.getID());   // 엘리베이터

+ 88 - 28
WallPadDevService/src/main/java/com/artncore/wallpaddevservice/driver/KNX_Controller.java

@@ -566,7 +566,7 @@ public class KNX_Controller extends DeviceManager {
              */
             public byte GetLightSwitchCount(byte EmIndex) {
                 // 1. Param Check
-                if (!CheckEmIndex(EmIndex)) {
+                if (!CheckLightSwitchIndex(EmIndex)) {
                     Log.w(TAG, "[GetLightSwitchCount] Param : EmIndex - Out Of Range !!! (EmIndex:" + EmIndex + ")");
                     return 0;
                 }
@@ -746,6 +746,21 @@ public class KNX_Controller extends DeviceManager {
                 }
                 return true;
             }
+
+            /**
+             * 조명스위치 인덱스의 범위를 체크한다.
+             *
+             * @param lightSwitchIndex - (byte) 범위체크할 조명스위치 인덱스
+             * @return - (boolean) true:정상, false:범위이탈
+             */
+            public boolean CheckLightSwitchIndex(byte lightSwitchIndex) {
+                if (lightSwitchIndex != EM_FIX_INDEX_LIVING) {
+                    if ((lightSwitchIndex < 0) || (lightSwitchIndex >= Light_Switch_Count)) {
+                        return false;
+                    }
+                }
+                return true;
+            }
         }
     }
 
@@ -2344,9 +2359,9 @@ public class KNX_Controller extends DeviceManager {
                 if (ByteOnOff == 1) LightControl.OnOff = 0x01;
                 else LightControl.OnOff = 0x02;
 
-                // 3. Send
-                EnergyMeterClass.DataClass Data = Send_Set_EnergyMeterBadLight(EmIndex, LightIndex, LightControl);
-                if (Data == null) return SHMem.retVal = "FAIL;" + APIErrorCode.DEVICEISNORESPONSE;
+            // 3. Send
+            EnergyMeterClass.DataClass Data = Send_Set_EnergyMeterBadLight(EmIndex, LightIndex, LightControl, TYPE_ONOFF);
+            if (Data == null) return SHMem.retVal = "FAIL;" + APIErrorCode.DEVICEISNORESPONSE;
 
                 // 4. Update
                 UpdateVariables_BadData(EmIndex, Data);
@@ -2402,14 +2417,40 @@ public class KNX_Controller extends DeviceManager {
                 // 4. Update
                 UpdateVariables_LivingData(EM_FIX_INDEX_LIVING, Data);
 
-                return SHMem.retVal = "SUCCESS";
-            }
-            //////////////////////////////////////////////////////////
-            // SetLightColor : 조명을 색상을 제어한다.
-            // [0] 제어할 에너지미터 인덱스
-            // [1] 제어할 조명 인덱스
-            // [2] 제어할 조명 색상 단계 (1, 2, 3 ... 10 : 10단계)
-            //////////////////////////////////////////////////////////
+            return SHMem.retVal = "SUCCESS";
+        }
+        //////////////////////////////////////////////////////////
+        // SetEMLightDimming : 에너지미터 조명을 밝기를 제어한다.
+        // [0] 제어할 에너지미터 인덱스
+        // [1] 제어할 조명 인덱스
+        // [2] 제어할 조명 밝기 단계 (1, 2, 3 ... 10 : 10단계)
+        //////////////////////////////////////////////////////////
+        else if (ctrDevFormat.CmdStr.equals("SetEMLightDimming")) {
+            // 1. Param Get
+            byte EmIndex = ctrDevFormat.param[0];
+            byte LightIndex = ctrDevFormat.param[1];
+            byte Dimming = ctrDevFormat.param[2];
+            DeviceLog("[do_ctrEmm] : SetEMLightDimming(LightIndex:" + LightIndex + ", Dimming:" + Dimming + ")");
+
+            // 2. Make Control Data
+            LightControlClass LightControl = new LightControlClass();
+            LightControl.Dimming = Dimming;
+
+            // 3. Send
+            EnergyMeterClass.DataClass Data = Send_Set_EnergyMeterBadLight(EmIndex, LightIndex, LightControl, TYPE_DIMMING);
+            if (Data == null) return SHMem.retVal = "FAIL;" + APIErrorCode.DEVICEISNORESPONSE;
+
+            // 4. Update
+            UpdateVariables_BadData(EmIndex, Data);
+
+            return SHMem.retVal = "SUCCESS";
+        }
+        //////////////////////////////////////////////////////////
+        // SetLightColor : 조명을 색상을 제어한다.
+        // [0] 제어할 에너지미터 인덱스
+        // [1] 제어할 조명 인덱스
+        // [2] 제어할 조명 색상 단계 (1, 2, 3 ... 10 : 10단계)
+        //////////////////////////////////////////////////////////
         /*else if(ctrDevFormat.CmdStr.equals("SetLightColor"))
         {
             // 1. Param Get
@@ -3683,7 +3724,7 @@ public class KNX_Controller extends DeviceManager {
         int ReplyLength = 16;
 
         // 1. In 파라미터 확인
-        if (!mDriver.Device.CheckEmIndex(EmIndex)) {
+        if (!mDriver.Device.CheckLightSwitchIndex(EmIndex)) {
             Log.w(TAG, FUNC_NAME + " Param : EmIndex - Out Of Range !!! (EmIndex:" + EmIndex + ")");
             return null;
         }
@@ -4112,7 +4153,7 @@ public class KNX_Controller extends DeviceManager {
         DeviceLog(FUNC_NAME + " Start");
 
         // 1. In 파라미터 확인
-        if (!mDriver.Device.CheckEmIndex(EmIndex)) {
+        if (!mDriver.Device.CheckLightSwitchIndex(EmIndex)) {
             Log.w(TAG, FUNC_NAME + " Param : EmIndex - Out Of Range !!! (EmIndex:" + EmIndex + ")");
             return null;
         }
@@ -4491,7 +4532,7 @@ public class KNX_Controller extends DeviceManager {
      * @param LightControl - (LedLightControlClass) 변경할 조명 제어 데이터 클래스
      * @return (EnergyMeterClass.DataClass) 데이터 null - Error , Not null - OK
      */
-    private EnergyMeterClass.DataClass Send_Set_EnergyMeterBadLight(byte EmIndex, byte LightIndex, LightControlClass LightControl) {
+    private EnergyMeterClass.DataClass Send_Set_EnergyMeterBadLight(byte EmIndex, byte LightIndex, LightControlClass LightControl, int controlType) {
         if (mDriver.GetReset()) return null;
 
         String FUNC_NAME = "[Send_Set_EnergyMeterLight]";
@@ -4547,22 +4588,41 @@ public class KNX_Controller extends DeviceManager {
 
         //     D3 ~ D8
         for (byte i = 0; i < ControlLightCount; i++) {
-            //     D4 : n번 조명 ON/OFF 상태
-            if (LightIndex == define.DEVICE_ALL_OR_NOTHING) {
-                ReqData[index++] = LightControl.OnOff;
-            } else {
-                //제어하려는 해당 조명인 경우
-                if (i == LightIndex) {
+            if (controlType == TYPE_ONOFF) {
+                //     D4 : n번 조명 ON/OFF 상태
+                if (LightIndex == define.DEVICE_ALL_OR_NOTHING) {
                     ReqData[index++] = LightControl.OnOff;
                 } else {
-                    //나머지는 미설정.
+                    //제어하려는 해당 조명인 경우
+                    if (i == LightIndex) {
+                        ReqData[index++] = LightControl.OnOff;
+                    } else {
+                        //나머지는 미설정.
+                        ReqData[index++] = (byte) 0;
+                    }
+                }
+                //     D5 : n번 조명 디밍 상태(미설정)
+                ReqData[index++] = (byte) 0;
+            }else if (controlType == TYPE_DIMMING) {
+                if (LightIndex == define.DEVICE_ALL_OR_NOTHING) {
+                    //     D5 : n번 조명 on/off 상태(미설정)
                     ReqData[index++] = (byte) 0;
+                    //     D5 : n번 조명 디밍 상태
+                    ReqData[index++] = LightControl.Dimming;
+                } else {
+                    //제어하려는 해당 조명인 경우
+                    if (i == LightIndex) {
+                        ReqData[index++] = (byte) 0;
+                        ReqData[index++] = LightControl.Dimming;
+                    } else {
+                        //나머지는 미설정.
+                        ReqData[index++] = (byte) 0;
+                        //     D5 : n번 조명 디밍 상태(미설정)
+                        ReqData[index++] = (byte) 0;
+                    }
                 }
             }
 
-            //     D5 : n번 조명 디밍 상태(미설정)
-            ReqData[index++] = (byte) 0;
-
             //     D6 : n번 조명 색온도 상태(미설정)
             ReqData[index++] = (byte) 0;
         }
@@ -4607,7 +4667,7 @@ public class KNX_Controller extends DeviceManager {
         // 1. In 파라미터 확인
 
         //     1.1. EmIndex
-        if (!mDriver.Device.CheckEmIndex(EmIndex)) {
+        if (!mDriver.Device.CheckLightSwitchIndex(EmIndex)) {
             Log.w(TAG, FUNC_NAME + " Param : EmIndex - Out Of Range !!! (EmIndex:" + EmIndex + ")");
             return null;
         }
@@ -6330,7 +6390,7 @@ public class KNX_Controller extends DeviceManager {
 
         // 1. Param Check
         if (NewInfo == null) return false;
-        if (mDriver.Device.CheckEmIndex(EmIndex) == false) {
+        if (mDriver.Device.CheckLightSwitchIndex(EmIndex) == false) {
             Log.w(TAG, FUNC_NAME + " Param : EmIndex - Out Of Range !!! (EmIndex:" + EmIndex + ")");
             return false;
         }
@@ -7005,7 +7065,7 @@ public class KNX_Controller extends DeviceManager {
 
         // 1. Param Check
         if (NewData == null) return false;
-        if (mDriver.Device.CheckEmIndex(EmIndex) == false) {
+        if (mDriver.Device.CheckLightSwitchIndex(EmIndex) == false) {
             Log.w(TAG, FUNC_NAME + " Param : EmIndex - Out Of Range !!! (EmIndex:" + EmIndex + ")");
             return false;
         }

+ 9 - 4
WallPadMain/src/main/java/kr/co/icontrols/wallpadmain/MainActivity.java

@@ -751,6 +751,7 @@ public class MainActivity extends WpadActivity {
                 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
             runMultiControlService();
         }
+
         WallpadStatusData dbMGR = new WallpadStatusData(this.getContext());
         wallpaddbmgr.AddressSet addrSet = dbMGR.getAddressMGR();
         dbMGR.closeDB();
@@ -3973,7 +3974,7 @@ public class MainActivity extends WpadActivity {
             if (nRetElecVehicle == WallpadDeviceSet.DEV_DATA_ENABLE) bElecVehicleUsage = true;
             else bElecVehicleUsage = false;
             Log.d(TAG, "[checkEventNotifications] bSmartPostUsage [" + bSmartPostUsage + "], nRetElecVehicle [" + nRetElecVehicle + "], bElecVehicleUsage [" + bElecVehicleUsage + "]");
-
+/* 부재중, 방문자 사진 막음
             // 부재중 통화
             WallpadCallHistoryData mWallpadCallHistoryData = new WallpadCallHistoryData(getContext());
             try {
@@ -3992,14 +3993,16 @@ public class MainActivity extends WpadActivity {
             try {
                 nVisitorPicCnt = mWallpadVisitorPicData_A20.RowVisitorPictureCountData();
             } catch (RuntimeException re) {
-            LogUtil.errorLogInfo("", TAG, re);
-        }
-		catch (Exception e) {
+                LogUtil.errorLogInfo("", TAG, re);
+            } catch (Exception e) {
                 Log.e(TAG, "[Exception] checkEventNotifications() -> mWallpadVisitorPicData_A20");
                 LogUtil.errorLogInfo("", TAG, e);
             }
             mWallpadVisitorPicData_A20.closeDB();
 
+
+ */
+
             // 공지사항, 택배, 스마트 우편
             WallpadStatusData mWallpadStatusData = new WallpadStatusData(this.getContext());
             try {
@@ -4058,6 +4061,8 @@ public class MainActivity extends WpadActivity {
 
             Log.d(TAG,"[checkEventNotifications] nMissedCallCnt [" + nMissedCallCnt + "], nVisitorPicCnt [" + nVisitorPicCnt + "], nNoticeCnt [" + nNoticeCnt + "], nParcelCnt [" + nParcelCnt + "], nPostCnt [" + nPostCnt + "], nElecVehicleChangingCnt [" + nElecVehicleChangingCnt + "]");
 
+
+
             sendEventNotiBR(nMissedCallCnt, nVisitorPicCnt, nNoticeCnt, nParcelCnt, nPostCnt, nElecVehicleChangingCnt);
             Send_NotiSmartSwitch(MainActivity.nNoticeCnt, MainActivity.nParcelCnt, MainActivity.nVisitorPicCnt);
         } catch (RuntimeException re) {

+ 8 - 7
WallPadMain/src/main/java/kr/co/icontrols/wallpadmain/popup/EventNotification.java

@@ -478,7 +478,7 @@ public class EventNotification extends WpadScreen {
     public void getEventNotificationInfo() {
         try {
             Log.d(TAG,"[getEventNotificationInfo] ========== START ==========)");
-
+/*
             // 부재중 통화
             WallpadCallHistoryData mWallpadCallHistoryData = new WallpadCallHistoryData(getContext());
             try {
@@ -506,7 +506,7 @@ public class EventNotification extends WpadScreen {
                 LogUtil.errorLogInfo("", TAG, e);
             }
             mWallpadVisitorPicData_A20.closeDB();
-
+*/
             // 공지사항, 택배
             WallpadStatusData mWallpadStatusData = new WallpadStatusData(this.getContext());
             try {
@@ -569,7 +569,8 @@ public class EventNotification extends WpadScreen {
 
     private void registerEventNotification(RelativeLayout layout) {
         try {
-            nEnabledEventCnt = 4;   // 기본 적용 이벤트 (부재중 전화, 방문객 사진, 공지사항, 택배)
+            //nEnabledEventCnt = 4;   // 기본 적용 이벤트 (부재중 전화, 방문객 사진, 공지사항, 택배)
+            nEnabledEventCnt = 2;   // 기본 적용 이벤트 (공지사항, 택배)
 
             // 스마트우편함, 전기차충전 연동 여부 확인
             int nRetElecVehicle = -1;
@@ -593,7 +594,7 @@ public class EventNotification extends WpadScreen {
             for (int  i = 0; i < nEnabledEventCnt; i++) {
                 mEVENTS[i] = new EVENTS();
             }
-
+/*
             // 부재중 전화
             if (nEnabledEventCnt > nNotiIndex) {
                 if (Common.SCREEN_TYPE == Common.SCREEN_TYPE_1280x800) {
@@ -645,7 +646,7 @@ public class EventNotification extends WpadScreen {
                 nID_TXT++;
             }
             else Log.w(TAG, "[registerEventNotification] nEnabledEventCnt(" + nEnabledEventCnt + ") > nNotiIndex(" + nNotiIndex + ") : Visitor picture!!");
-
+*/
             // 공지사항
             if (nEnabledEventCnt > nNotiIndex) {
                 if (Common.SCREEN_TYPE == Common.SCREEN_TYPE_1280x800) {
@@ -765,7 +766,7 @@ public class EventNotification extends WpadScreen {
     private void displayEventNotification() {
         try {
             int nNotiIndex = 0;
-
+/*
             // 부재중 전화
             if (nMissedCallCnt > 0) {
                 mEVENTS[nNotiIndex].TXT_EVENT.setVisibility(View.VISIBLE);
@@ -790,7 +791,7 @@ public class EventNotification extends WpadScreen {
                 mEVENTS[nNotiIndex].BTN_EVENT.setButtonEventOffEnable();
             }
             nNotiIndex++;
-
+*/
 
             // 공지사항
             if (nNoticeCnt > 0) {

+ 10 - 10
WallPadMain/src/main/java/kr/co/icontrols/wallpadmain/util/IconManager.java

@@ -514,20 +514,20 @@ public class IconManager {
              */
 
             // 방범설정
-            mIconInfoTable.addIconInfo(ID.ICONS.MENUS.SECURITY_SETARMED.getID(), ID.ICONS.MENUS.SECURITY_SETARMED.getNameKR(), ID.LINKEDSCREEN.SubMenuSecurity.SecurityMain,
-                    R.drawable.icon_security_setarmed_normal, R.drawable.icon_security_setarmed_pressed, R.drawable.icon_security_setarmed_pressed, R.drawable.icon_security_setarmed_pressed);
+            //mIconInfoTable.addIconInfo(ID.ICONS.MENUS.SECURITY_SETARMED.getID(), ID.ICONS.MENUS.SECURITY_SETARMED.getNameKR(), ID.LINKEDSCREEN.SubMenuSecurity.SecurityMain,
+            //        R.drawable.icon_security_setarmed_normal, R.drawable.icon_security_setarmed_pressed, R.drawable.icon_security_setarmed_pressed, R.drawable.icon_security_setarmed_pressed);
 
             // 연동설정
-            mIconInfoTable.addIconInfo(ID.ICONS.MENUS.SECURITY_DEVICELINK.getID(), ID.ICONS.MENUS.SECURITY_DEVICELINK.getNameKR(), ID.LINKEDSCREEN.SubMenuSecurity.LinkDeviceSet,
-                    R.drawable.icon_ctrl_devicelink_normal, R.drawable.icon_ctrl_devicelink_pressed, R.drawable.icon_ctrl_devicelink_pressed, R.drawable.icon_ctrl_devicelink_pressed);
+            //mIconInfoTable.addIconInfo(ID.ICONS.MENUS.SECURITY_DEVICELINK.getID(), ID.ICONS.MENUS.SECURITY_DEVICELINK.getNameKR(), ID.LINKEDSCREEN.SubMenuSecurity.LinkDeviceSet,
+            //        R.drawable.icon_ctrl_devicelink_normal, R.drawable.icon_ctrl_devicelink_pressed, R.drawable.icon_ctrl_devicelink_pressed, R.drawable.icon_ctrl_devicelink_pressed);
 
             // 출입내역
-            if (naFrontCamInfoEnable[0] == WallpadDeviceSet.DO_USE) {
-                if (naFrontCamInfoEnable[1] == WallpadDeviceSet.DOORTYPE_SMARTKEY || naFrontCamInfoEnable[1] == WallpadDeviceSet.DOORTYPE_SMARTKEY_EXTERNAL || naFrontCamInfoEnable[1] == WallpadDeviceSet.DOORTYPE_IOT_SMART) {
-                    mIconInfoTable.addIconInfo(ID.ICONS.MENUS.SECURITY_ACCESSHISTORY.getID(), ID.ICONS.MENUS.SECURITY_ACCESSHISTORY.getNameKR(), ID.LINKEDSCREEN.SubMenuSecurity.AccessHistoryDoor,
-                            R.drawable.icon_security_accesshistory_normal, R.drawable.icon_security_accesshistory_pressed, R.drawable.icon_security_accesshistory_pressed, R.drawable.icon_security_accesshistory_pressed);
-                }
-            }
+            //if (naFrontCamInfoEnable[0] == WallpadDeviceSet.DO_USE) {
+            //    if (naFrontCamInfoEnable[1] == WallpadDeviceSet.DOORTYPE_SMARTKEY || naFrontCamInfoEnable[1] == WallpadDeviceSet.DOORTYPE_SMARTKEY_EXTERNAL || naFrontCamInfoEnable[1] == WallpadDeviceSet.DOORTYPE_IOT_SMART) {
+            //        mIconInfoTable.addIconInfo(ID.ICONS.MENUS.SECURITY_ACCESSHISTORY.getID(), ID.ICONS.MENUS.SECURITY_ACCESSHISTORY.getNameKR(), ID.LINKEDSCREEN.SubMenuSecurity.AccessHistoryDoor,
+            //                R.drawable.icon_security_accesshistory_normal, R.drawable.icon_security_accesshistory_pressed, R.drawable.icon_security_accesshistory_pressed, R.drawable.icon_security_accesshistory_pressed);
+            //    }
+            //}
 
             // 방문자 영상
             if (naFrontCamInfoEnable[0] == WallpadDeviceSet.DO_USE) {

+ 378 - 11
WallPadMain/src/main/java/kr/co/icontrols/wallpadmain/util/iMapServer.java

@@ -2844,6 +2844,7 @@ public class iMapServer extends Service {
 
             SvrSock = new iMapSverSocket();
             SvrSock.start();
+
         } catch (IOException e) {
             Log.e(TAG, "[IOException] [onStartCommand] SvrSock init...");
             //e.printStackTrace();
@@ -2981,8 +2982,10 @@ public class iMapServer extends Service {
             bundle.putInt("fromService", sendValue);
             Message msg = Message.obtain(null, MSG_SEND_TO_ACTIVITY);
             msg.setData(bundle);
-            mClient.send(msg);      // msg 보내기
-        } catch (RemoteException e) {
+            if(mClient!=null) {
+                mClient.send(msg);      // msg 보내기
+            }
+        } catch (Exception e) {
         }
     }
 
@@ -3042,13 +3045,7 @@ public class iMapServer extends Service {
                     } else {
                         sock = sslsvr.accept();
                     }
-                    if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
-                            || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
-                            || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
-                        //madeinlab accept 대기중에 모바일에서 요청오면 아래 쓰레드 돌려서 처리.
-                        //아래 쓰레드가 돌기전에 다른층의 디바이스 정보를 받아와서 미리 가지고 있어야 한다.
-                        sendMsgToActivity(1234);
-                    }
+
                     iMapSverSocketThread ProciMap = new iMapSverSocketThread(sock);
                     ProciMap.start();
                 } catch (IOException e) {
@@ -3462,6 +3459,9 @@ public class iMapServer extends Service {
                             }
                         } else if (cmd.equalsIgnoreCase("remote_access_light_batch_control")) {
                             retXML = iCMDProcLightBatchControl(elelist);
+                        }
+						else if (cmd.equalsIgnoreCase("remote_access_sysaircon")) {
+                            retXML = iCMDProcSysairconControl(elelist);
                         }
                         //모바일 사용자 인증 관련 메시지
                         else if (cmd.equalsIgnoreCase("remote_register_new_device_auth_number")) {
@@ -5023,7 +5023,8 @@ public class iMapServer extends Service {
                         }
 
                     }
-                } else if (HeatingKind == 2) {
+                }
+                else if (HeatingKind == 2) {
                     byte Mode = HeatingV2.MODE.HeatingOFF;
                     if (ctrl == 1) Mode = HeatingV2.MODE.HeatingON;
 
@@ -5130,7 +5131,7 @@ public class iMapServer extends Service {
                     }
                     byte RoomCount = heatingV2API.data.Device.info.RoomCount;
                     resultStr += "      <action> \"" + tempercmd.actionTXT + "\"</action>\r\n";
-                    resultStr += "      <status_map dev_num=\"1\" unit_cnt = \"" + RoomCount + "\" />\r\n";
+                    //resultStr += "      <status_map dev_num=\"1\" unit_cnt = \"" + RoomCount + "\" />\r\n";
                     if ((tempercmd.unitnum.equals("all")) || (tempercmd.unitnum.equals("null"))) {
                         Log.d(TAG, "&&&&&&&&&&&&&&&&&&&&& all :" + RoomCount);
                         String drvmode = "off";
@@ -5140,6 +5141,7 @@ public class iMapServer extends Service {
                             else drvmode = "off";
 
                             drvmode += "/" + roomData.SetTemp + "/" + roomData.NowTemp;
+                            resultStr += "      <status_map dev_num=\"" + (i+1) + "\" unit_cnt = \"1\"/>\r\n";
 
                             if (target.equalsIgnoreCase(REMOTETYPE_SVR2MOBILEAUTH) || target.equalsIgnoreCase(REMOTETYPE_SVR2WEB)) {
                                 resultStr += "         <status_info unit_num=\"" + RoomList[i] + "\" unit_status=\"" + drvmode + "\" room_name=\"" + mDefaultRoomNameList_Heating[i] + "\"/>\r\n";
@@ -9448,6 +9450,365 @@ public class iMapServer extends Service {
         }
     }
 
+    private boolean airconTestMode = false;
+    private boolean [] airconTestModeOnOff = {false, true, false, true, false, true, false, true, false, true, false};
+    private String getTextSysAirconMode(byte in)
+    {
+        if( in == DataClasses.KnxSystemAircon.MODE.Auto)
+            return "auto";
+        else if( in == DataClasses.KnxSystemAircon.MODE.Cold)
+            return "cool";
+        else if( in == DataClasses.KnxSystemAircon.MODE.Dry)
+            return "dehum";
+        else if( in == DataClasses.KnxSystemAircon.MODE.Venti)
+            return "blow";
+        else if( in == DataClasses.KnxSystemAircon.MODE.Heat)
+            return "heat";
+        else
+            return "null";
+    }
+
+    private String iCMDProcSysairconControl(Element ele) {
+        try {
+
+            String target= "null", tid= "null", msgno= "null", devnum = "null",ctraction = "null", ilgalstatus = "null";
+            String retStr = CheckiCMDProc("remote_access_sysaircon");
+            if (retStr != null) return retStr;
+
+            NodeList items = ele.getElementsByTagName("target");
+            Node item = items.item(0);
+            if (item != null) {
+                NamedNodeMap attrs = item.getAttributes();
+                for (int j = 0; j < attrs.getLength(); j++) {
+                    Node attr = attrs.item(j);
+                    if (attr.getNodeName().equalsIgnoreCase("name")) target = attr.getNodeValue();
+                    else if (attr.getNodeName().equalsIgnoreCase("id")) tid = attr.getNodeValue();
+                    else if (attr.getNodeName().equalsIgnoreCase("msg_no")) msgno = attr.getNodeValue();
+                }
+            }
+            Log.e(TAG, "[yskim] iCMDProcSysairconControl() iCMDProcSysairconControl : ");
+
+            // 단지서버 2.0 사용하는 경우, 모바일 인증 또는 단지 웹 제어 비밀번호 인증 필요 (JEFF, 2019.07.26)
+            if (NewServerUse()) {
+                String ServerCheckResult = checkRemoteCtrlAuthentication(retStr, target, ele);
+                if (!ServerCheckResult.equals(MOBILE_USER_AUTH_PASSED) && !ServerCheckResult.equals(WEB_USER_AUTH_PASSED)) return ServerCheckResult;
+            }
+
+            NodeList itemsParam = ele.getElementsByTagName("params");
+            Node itemParam = itemsParam.item(0);
+            if (itemParam != null) {
+                NamedNodeMap attrsParam = itemParam.getAttributes();
+
+                for (int j = 0; j < attrsParam.getLength(); j++) {
+                    Node attr = attrsParam.item(j);
+                    if (attr.getNodeName().equalsIgnoreCase("dev_num")) devnum = attr.getNodeValue();
+                    if (attr.getNodeName().equalsIgnoreCase("ctrl_action")) {
+                        ctraction = attr.getNodeValue();
+                    }
+                }
+            }
+
+            NodeList itemsaction = ele.getElementsByTagName("action");
+            Node itemaction = itemsaction.item(0);
+            Node text = itemaction.getFirstChild();
+            String actionTXT = text.getNodeValue();
+
+            retStr = XMLHeader + "   <service type=\"reply\" name=\"remote_access_sysaircon\" result=";
+            actionTXT = trimquotation(actionTXT);
+
+            Log.d(TAG, "&&&&&&&&&&&&&&& : " + actionTXT);
+
+            int ndeviceCount = 0;
+            String sMode = "auto/cool/dehum/blow/heat"; // 자동, 냉방, 제습, 송풍, 난방
+            String [] aMode = {"auto","cool","dehum","blow","heat"};
+            String strResultStatus = "";
+
+            WallpadStatusData DBMGR = null;
+            DBMGR = new WallpadStatusData(getApplicationContext());
+            AddressSet addc = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
+            DBMGR.closeDB();
+
+            //기준층 명칭
+            String[] mDefaultRoomNameList = new String[]{"거실", "침실4", "침실1", "파우더룸", "침실2", "주방1", "침실3",
+                    "복도1", "욕실1", "욕실2","보조주방","욕실3","욕실4","욕실5","복도2", "현관", "신발장", "창고", "주방2", "간이주방"};
+
+            String[] mEtypeRoomNameList = new String[]{"거실", "침실1", "침실2", "침실3", "식당", "주방", "드레스룸1",
+                    "서재", "다용도실", "메이드룸","욕실1","파우더룸","간이주방","테라스계단","오픈라운지" ,"스위치1","스위치2","스위치3","스위치4","스위치5","스위치6","스위치7","스위치8"};
+
+            String [] knxRoomNameList = null;
+
+            String [] mTextWindType = {"자동", "약", "중", "강"};
+            String m_TextWindRange = "자동/약/중/강";
+
+            // 기준층 A, B, C 타입과 D타입 2003호 , E타입 2001호 구분하여 처리
+            if(Integer.parseInt(addc.Ho) == 2001 || Integer.parseInt(addc.Ho) == 2003)
+            {
+                knxRoomNameList = mEtypeRoomNameList;
+                Log.e(TAG, "yskim[iCMDProcKNXConcentControl] mEtypeRoomNameList");
+            }
+            else
+            {
+                knxRoomNameList = mDefaultRoomNameList;
+                Log.e(TAG, "yskim[iCMDProcKNXConcentControl] mDefaultRoomNameList");
+            }
+
+            WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
+            String[] strValue = devSet.GetSettingData("KNX명칭");
+            devSet.closeDB();
+
+            // 현대건설 더 펜트하우스 서버에서 설정된 명칭이 있다면 그 명칭을 사용하도록 한다.
+            if( strValue != null ) {
+                String strLight = strValue[1].substring( (strValue[1].indexOf("조명(") + 3) , (strValue[1].indexOf(")난방(")));
+                String strHeating = strValue[1].substring( (strValue[1].indexOf("난방(") + 3) , (strValue[1].indexOf(")에어컨(")));
+                String strAircon = strValue[1].substring( (strValue[1].indexOf("에어컨(") + 4) , (strValue[1].indexOf("))")));
+//            DebugLogOutput("[Create] - room name strlight "  + strLight);
+//            DebugLogOutput("[Create] - room name strHeating "  + strHeating);
+//            DebugLogOutput("[Create] - room name strAircon "  + strAircon);
+                if( strAircon != null)knxRoomNameList = strAircon.split("_");
+            }
+
+
+            WallpadDeviceSet mWallpadDeviceSet = new WallpadDeviceSet(getApplicationContext());
+            int nResult = mWallpadDeviceSet.Get_DistributionPannelType_Info();
+            mWallpadDeviceSet.closeDB();
+
+            if (nResult != Version.DISTRIBUTION_MODEL.KNX_DIST) {
+                String[] mAirconNmae = new String[]{"에어컨1", "에어컨2", "에어컨3", "에어컨4", "에어컨5", "에어컨6", "에어컨7", "에어컨8"};
+                knxRoomNameList = mAirconNmae;
+            }
+
+            KnxSystemAirconAPI airconAPI = mWallPadAPI.Get_KnxAirconController();
+
+            int nCount = 7;
+            if( airconAPI != null )
+                nCount = airconAPI.data.Device.info.InsideAirconCount;
+            if( airconTestMode == true )nCount = 7;
+
+            if( actionTXT.equalsIgnoreCase("status") ) {
+                // 에어컨 상태조회
+                int ret = (byte) airconAPI.Refresh((byte) 0xFF, false);
+                if (devnum.equalsIgnoreCase("all")) {
+
+                    Log.e(TAG, "[yskim] iCMDProcSysairconControl() iCMDProcSysairconControl : airconTestMode : " + airconTestMode + " nCount : " + nCount );
+                    if (airconTestMode == false && ret < 0) {
+                        retStr += " \"fail\" >\r\n   </service>\r\n</imap>";
+                        return retStr;
+                    } else {
+                        for (int i = 0; i < nCount; i++) {
+                            String sOnOff = "off";
+                            if( airconTestMode == true )
+                            {
+                                if( airconTestModeOnOff[i] == true )sOnOff = "on";
+
+                                strResultStatus += "      <status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"1\"/>\r\n";
+                                //strResultStatus += "      <status_info unit_num=\"" + "aircon" + (i+1) + "\" mode = \"" + sMode + "\" wind = \"" + sWind + "\" unit_status=\"" + sOnOff + "/" + "cool" + "/" + "1" + "/" + "22" + "/" + "33" + "\"/>\r\n";
+                                strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[i] + "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + "cool" + "/" + "약" + "/" + "22" + "/" + "33" + "\"/>\r\n";
+                            }
+                            else {
+                                if (airconAPI.data.Device.Aircon[i].OnOff == DataClasses.KnxSystemAircon.ONOFF.AirconON)
+                                    sOnOff = "on";
+
+                                strResultStatus += "      <status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"1\"/>\r\n";
+                                strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[i]+ "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + getTextSysAirconMode(airconAPI.data.Device.Aircon[i].Mode) + "/" + mTextWindType[airconAPI.data.Device.Aircon[i].Volume] + "/" + airconAPI.data.Device.Aircon[i].SetTemp + "/" + airconAPI.data.Device.Aircon[i].NowTemp + "\"/>\r\n";
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    // 개별 상태 조회
+                    if (airconTestMode == false && ret < 0) {
+                        retStr += " \"fail\" >\r\n   </service>\r\n</imap>";
+                        return retStr;
+                    } else {
+                        int reqDevNum = Integer.parseInt(devnum);
+                        String sOnOff = "off";
+                        if( airconTestMode == true )
+                        {
+                            if( airconTestModeOnOff[reqDevNum-1] == true )sOnOff = "on";
+
+                            strResultStatus += "      <status_map dev_num=\"" + (reqDevNum) + "\" unit_cnt=\"1\"/>\r\n";
+                            //strResultStatus += "      <status_info unit_num=\"" + "aircon" + (i+1) + "\" mode = \"" + sMode + "\" wind = \"" + sWind + "\" unit_status=\"" + sOnOff + "/" + "cool" + "/" + "1" + "/" + "22" + "/" + "33" + "\"/>\r\n";
+                            strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[reqDevNum-1] + "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + "cool" + "/" + "약" + "/" + "22" + "/" + "33" + "\"/>\r\n";
+                        }
+                        else {
+                            if (airconAPI.data.Device.Aircon[reqDevNum-1].OnOff == DataClasses.KnxSystemAircon.ONOFF.AirconON)
+                                sOnOff = "on";
+
+                            strResultStatus += "      <status_map dev_num=\"" + (reqDevNum) + "\" unit_cnt=\"1\"/>\r\n";
+                            strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[reqDevNum-1]+ "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + getTextSysAirconMode(airconAPI.data.Device.Aircon[reqDevNum-1].Mode) + "/" + mTextWindType[airconAPI.data.Device.Aircon[reqDevNum-1].Volume] + "/" + airconAPI.data.Device.Aircon[reqDevNum-1].SetTemp + "/" + airconAPI.data.Device.Aircon[reqDevNum-1].NowTemp + "\"/>\r\n";
+                        }
+
+                    }
+                }
+            }
+            else if (actionTXT.equalsIgnoreCase("control")) {
+                // 에어컨 제어
+                String[] CtrList;
+                CtrList = ctraction.split("/");
+                for( int k = 0 ; k < CtrList.length; k++)
+                {
+                    Log.e(TAG, "[yskim] iCMDProcSysairconControl() iCMDProcSysairconControl : CtrList[k] : " + k + " CtrList[k] : " + CtrList[k]);
+                }
+                strResultStatus = "";
+                int ret = (byte) airconAPI.Refresh((byte) 0xFF, false);
+                if (devnum.equalsIgnoreCase("all")) {
+
+                    // 일괄제어는 Off 밖에 없음
+                    if( airconTestMode == true )
+                    {
+                        for (int i = 0; i < nCount; i++) {
+                            String sOnOff = "off";
+                            //CtrList[1] = cool , CtrList[2] = 1 (바람세기) ,CtrList[3] = 설정온도 ,CtrList[4] = 현재온도 ,
+                            if(CtrList[0].equalsIgnoreCase("off"))
+                            {
+                                airconTestModeOnOff[i] = false;
+                            }
+                            else
+                            {
+                                airconTestModeOnOff[i] = true;
+                                sOnOff = "on";
+                            }
+
+                            strResultStatus += "      <status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"1\"/>\r\n";
+                            strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[i] + "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + "cool" + "/" + "약" + "/" + "22" + "/" + "33" + "\"/>\r\n";
+                        }
+                    }
+                    else
+                    {
+                        for (int i = 0; i < nCount; i++) {
+                            String sOnOff = "off";
+                            //CtrList[1] = cool , CtrList[2] = 1 (바람세기) ,CtrList[3] = 설정온도 ,CtrList[4] = 현재온도 ,
+                            byte hOnOff = 0x00;
+                            if(CtrList[0].equalsIgnoreCase("off"))
+                            {
+                                hOnOff = DataClasses.KnxSystemAircon.ONOFF.AirconOFF;
+                                sOnOff = "off";
+                            }
+                            else
+                            {
+                                hOnOff = DataClasses.KnxSystemAircon.ONOFF.AirconON;
+                                sOnOff = "on";
+                            }
+                            double setTemp = airconAPI.data.Device.Aircon[i].SetTemp;
+                            byte volume = airconAPI.data.Device.Aircon[i].Volume;
+                            byte mode = airconAPI.data.Device.Aircon[i].Mode;
+                            int hMode = (int) (hOnOff+(volume<<2)+(mode<<4));
+
+                            ret = airconAPI.SetEachRoomStatus((byte)i, hMode, setTemp);
+
+                            strResultStatus += "      <status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"1\"/>\r\n";
+                            strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[i]+ "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + getTextSysAirconMode(mode) + "/" + mTextWindType[volume]+ "/" + setTemp + "/" + airconAPI.data.Device.Aircon[i].NowTemp + "\"/>\r\n";
+                        }
+                    }
+                }
+                else
+                {
+                    // 개별 제어
+                    int nDevNum = Integer.parseInt(devnum);
+                    if( airconTestMode == true )
+                    {
+                        String sOnOff = "off";
+                        //CtrList[1] = cool , CtrList[2] = 1 (바람세기) ,CtrList[3] = 설정온도 ,CtrList[4] = 현재온도 ,
+                        if(CtrList[0].equalsIgnoreCase("off"))
+                        {
+                            airconTestModeOnOff[nDevNum-1] = false;
+                        }
+                        else
+                        {
+                            airconTestModeOnOff[nDevNum-1] = true;
+                            sOnOff = "on";
+                        }
+
+                        strResultStatus += "      <status_map dev_num=\"" + nDevNum + "\" unit_cnt=\"1\"/>\r\n";
+                        strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[nDevNum-1] + "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + "cool" + "/" + "약" + "/" + "22" + "/" + "33" + "\"/>\r\n";
+
+                    }
+                    else
+                    {
+
+                        String sOnOff = "off";
+                        //CtrList[1] = cool , CtrList[2] = 1 (바람세기) ,CtrList[3] = 설정온도 ,CtrList[4] = 현재온도 ,
+                        byte hOnOff = 0x00;
+                        if(CtrList[0].equalsIgnoreCase("off"))
+                        {
+                            hOnOff = DataClasses.KnxSystemAircon.ONOFF.AirconOFF;
+                            sOnOff = "off";
+                        }
+                        else
+                        {
+                            hOnOff = DataClasses.KnxSystemAircon.ONOFF.AirconON;
+                            sOnOff = "on";
+                        }
+                        //String [] aMode = {"auto","cool","dehum","blow","heat"};
+                        byte mode = 0x00;
+                        if(CtrList[1].equalsIgnoreCase("auto"))
+                            mode = DataClasses.KnxSystemAircon.MODE.Auto;
+                        else if(CtrList[1].equalsIgnoreCase("cool"))
+                            mode = DataClasses.KnxSystemAircon.MODE.Cold;
+                        else if(CtrList[1].equalsIgnoreCase("dehum"))
+                            mode = DataClasses.KnxSystemAircon.MODE.Dry;
+                        else if(CtrList[1].equalsIgnoreCase("blow"))
+                            mode = DataClasses.KnxSystemAircon.MODE.Venti;
+                        else if(CtrList[1].equalsIgnoreCase("heat"))
+                            mode = DataClasses.KnxSystemAircon.MODE.Heat;
+                        else
+                            mode = airconAPI.data.Device.Aircon[nDevNum-1].Mode;
+
+                        byte volume = 0x00;
+                        if(CtrList[2].equalsIgnoreCase(mTextWindType[0]))
+                            volume = DataClasses.KnxSystemAircon.VOLUME.Auto;
+                        else if(CtrList[2].equalsIgnoreCase(mTextWindType[1]))
+                            volume = DataClasses.KnxSystemAircon.VOLUME.Weak;
+                        else if(CtrList[2].equalsIgnoreCase(mTextWindType[2]))
+                            volume = DataClasses.KnxSystemAircon.VOLUME.Medium;
+                        else if(CtrList[2].equalsIgnoreCase(mTextWindType[3]))
+                            volume = DataClasses.KnxSystemAircon.VOLUME.Strong;
+                        else
+                            volume = airconAPI.data.Device.Aircon[nDevNum-1].Volume;
+
+                        double setTemp = 0;
+                        if( CtrList[3].equalsIgnoreCase("null"))
+                            setTemp = airconAPI.data.Device.Aircon[nDevNum-1].SetTemp;
+                        else
+                            setTemp = Double.parseDouble(CtrList[3]);
+
+                        int hMode = (int) (hOnOff+(volume<<2)+(mode<<4));
+                        ret = airconAPI.SetEachRoomStatus((byte)(nDevNum-1), hMode, setTemp);
+
+                        if( ret >= 0 ) {
+                            ret = (byte) airconAPI.Refresh((byte) 0xFF, false);
+                        }
+
+                        double curTemp = airconAPI.data.Device.Aircon[nDevNum-1].NowTemp;
+
+
+                        strResultStatus += "      <status_map dev_num=\"" + nDevNum + "\" unit_cnt=\"1\"/>\r\n";
+                        strResultStatus += "      <status_info unit_num=\"" + knxRoomNameList[nDevNum-1] + "\" mode = \"" + sMode + "\" wind = \"" + m_TextWindRange + "\" unit_status=\"" + sOnOff + "/" + getTextSysAirconMode(mode)  + "/" + mTextWindType[volume] + "/" + setTemp + "/" + curTemp + "\"/>\r\n";
+
+                    }
+                }
+            }
+            else {
+                retStr += "\"fail\" />\r\n   </service>\r\n</imap>";
+                return retStr;
+            }
+
+            retStr +=  "\"ok\" >\r\n";
+            retStr +=  "      <target name=\"" + target +"\" id=\"" + tid + "\" msg_no=\"" + msgno +"\"/>\r\n";
+            retStr +=  "      <action>\""+actionTXT+"\"</action>\r\n";
+            retStr +=      strResultStatus;
+            retStr += "   </service>\r\n";
+            retStr += "</imap> ";
+
+            return retStr;
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] iCMDProcSysairconControl(Document ele)");
+            e.printStackTrace();
+            return null;
+        }
+    }
+
     private String iCMDProcEntireLightControl(Document ele) {
         try {
             String retStr = CheckiCMDProc("remote_entire_access_light_control");
@@ -12667,6 +13028,12 @@ public class iMapServer extends Service {
                 CheckStatusBeat();
                 CheckWallPadLiveSignal();
                 LiveCheckRebooting();
+                if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
+                        || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
+                        || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
+                    //다른층의 디바이스 정보를 받아와서 미리 가지고 있어야 한다.
+                    sendMsgToActivity(1234);
+                }
                 try {
                     Thread.sleep(10000);
                 } catch (RuntimeException re) {

+ 6 - 12
WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/DataSenderService.java

@@ -2227,6 +2227,8 @@ public class DataSenderService extends Service {
         return strResult;
     }
 
+    int nDPType;
+
     @Override
     public void onCreate() {
         //handler.sendEmptyMessage(MSG_WORK);
@@ -2248,6 +2250,10 @@ public class DataSenderService extends Service {
             myHo = "102";
         }
 
+        WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
+        nDPType = wds.Get_DistributionPannelType_Info();
+        wds.closeDB();
+
         registerEventAlarmBr();
         mKnxData = new Data_KnxLiv();
         mSDBEMInfo = new SDBEMInfo();
@@ -2283,9 +2289,6 @@ public class DataSenderService extends Service {
 
     public void deviceApiLoadLight() {
         try {
-            WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
-            int nDPType = wds.Get_DistributionPannelType_Info();
-            wds.closeDB();
             if (mWallPadAPI.Check_Connect()) {
                 if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
                         || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
@@ -2328,9 +2331,6 @@ public class DataSenderService extends Service {
 
     public void deviceApiLoad() {
         try {
-            WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
-            int nDPType = wds.Get_DistributionPannelType_Info();
-            wds.closeDB();
             if (mWallPadAPI.Check_Connect()) {
                 if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
                         || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
@@ -3211,9 +3211,6 @@ public class DataSenderService extends Service {
     private void registerEventAlarmBr() {
         try {
             Log.d(TAG, "[registerEventAlarmBr] ========== START ==========");
-            WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
-            int nDPType = wds.Get_DistributionPannelType_Info();
-            wds.closeDB();
             IntentFilter mIntentFilter = new IntentFilter();
             mIntentFilter.addAction(define.NOTIFY_ACNAME);
             mIntentFilter.addAction(Common.BR_MAIN_NOTI.ACNAME_MAIN_NOTI);
@@ -3254,9 +3251,6 @@ public class DataSenderService extends Service {
     private void registerDeviceBR() {
         try {
             Log.d(TAG, "[registerSubcriptionDeviceBR] ========== START ==========");
-            WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
-            int nDPType = wds.Get_DistributionPannelType_Info();
-            wds.closeDB();
             if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL
                     || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL
                     || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I) {