Преглед изворни кода

환기, 에어컨 멀티 제어 작업

jslee(madeinlab) пре 3 година
родитељ
комит
85ea5b8e74
21 измењених фајлова са 1048 додато и 150 уклоњено
  1. 1 1
      WallPadAPI/build.gradle
  2. BIN
      WallPadAPI/jar/WallPadAPI.jar
  3. BIN
      WallPadAPI/jar/WallPadAPIforSVC.jar
  4. 463 0
      WallPadAPI/src/main/java/com/artncore/commons/DataClasses.java
  5. 2 1
      WallPadAPI/src/main/java/com/artncore/commons/define.java
  6. 1 1
      WallPadAPI/src/main/java/com/artncore/wallpadapi/KnxVentiAPI.java
  7. 11 0
      WallPadAPI/src/main/java/com/artncore/wallpadapi/WallPadAPI.java
  8. BIN
      WallPadDevService/libs/WallPadAPIforSVC.jar
  9. 29 1
      WallPadDevService/src/main/java/com/artncore/wallpaddevservice/ServiceMain.java
  10. BIN
      WallPadHomeCtrl/libs/WallPadAPI.jar
  11. 66 6
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/MainActivity.java
  12. 59 5
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/PopupActivity.java
  13. 6 1
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/data/AirconData.java
  14. 9 1
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/declare/Common.java
  15. 163 0
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/declare/ID.java
  16. 9 0
      WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_aircon/SystemAirconMainScreen.java
  17. BIN
      WallPadMultiControlService/libs/WallPadAPI.jar
  18. 7 6
      WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/Common.java
  19. 218 121
      WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/DataSenderService.java
  20. 0 6
      WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/control/HeatingControl.java
  21. 4 0
      WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/data/RequestData.java

+ 1 - 1
WallPadAPI/build.gradle

@@ -40,7 +40,7 @@ android {
             java {
                 //WallPadAPI jar생성시에는 아래 코드 주석처리하고 exportJar 수행
                 //WallPadDevice용 jar생성시에는 아래 코드 주석 해제하고 exportServiceJar 실행
-//                exclude "**/wallpadapi/**"
+                exclude "**/wallpadapi/**"
             }
         }
     }

BIN
WallPadAPI/jar/WallPadAPI.jar


BIN
WallPadAPI/jar/WallPadAPIforSVC.jar


+ 463 - 0
WallPadAPI/src/main/java/com/artncore/commons/DataClasses.java

@@ -5576,6 +5576,469 @@ public class DataClasses {
         }
     }
 
+    /////////////////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////////////////////
+    /** [Knx System Aircon]  데이터 클래스   */
+    /////////////////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////////////////////
+    public static class KnxSystemAircon
+    {
+        /** 기기정보 */
+        public Info info;
+        public Setting setting;
+        /** 각 에어컨 데이터 */
+        public AirData [] Aircon;
+
+        public KnxSystemAircon()
+        {
+            info = new Info();
+            setting = new Setting();
+            Aircon = null;
+        }
+
+        /**
+         * 실내기 개수를 설정한다.<br>
+         *
+         * @param cnt - (byte) 설정할 실내기개수 (범위: 1 ~ 9)
+         * @return (boolean) true : 성공 , false : 실패
+         */
+        public boolean SetAirconCount(byte cnt)
+        {
+            if(info == null) return false;
+
+            if((cnt <= 0) || (cnt > 15)) return false;
+
+            info.InsideAirconCount = cnt;
+            Aircon = new AirData [cnt];
+            for(byte i=0 ; i<cnt ; i++) Aircon[i] = new AirData();
+
+            return true;
+        }
+
+        /** 기기정보 */
+        public static class Info
+        {
+            /** 실내기개수(범위 : 1~9) */
+            public byte InsideAirconCount;
+            /** 에어컨 연동 상태 */
+            public byte AirconStatus;
+            /** 제조사 코드 ( 프로토콜 문서에 따름 ) */
+            public byte Vendor;
+            /** 펌웨어 Build Date (년) */
+            public byte FwVer_Year;
+            /** 펌웨어 Build Date (월) */
+            public byte FwVer_Month;
+            /** 펌웨어 Build Date (일) */
+            public byte FwVer_Day;
+            /** 펌웨어 Build Date (일련번호) */
+            public byte FwVer_Number;
+
+            /** 지원 프로토콜 버전 Main */
+            public byte ProtocolVer_Main;
+            /** 지원 프로토콜 버전 Sub */
+            public byte ProtocolVer_Sub;
+
+            /** 실외기개수(범위 : 1~4) */
+            public byte OutsideAirconCount;
+
+            /** 첫 실외기에 포함된 실내기개수(범위 : 1~15) */
+            public byte FirtstOutAirconCount;
+
+            public SupportInfo Support;
+
+            /** 기능 지원 여부 */
+            public class SupportInfo
+            {
+                /** 지원하는 최저설정온도 (범위 : 5도 ~ 20도) */
+                public byte MinSetTemp;
+                /** 지원하는 최저설정온도 (범위 : (난방)6도 ~ 30도) */
+                public byte HeatMinSetTemp;
+                /** 지원하는 최대설정온도 (범위 : 21도 ~ 40도) */
+                public byte MaxSetTemp;
+                /** 모드제어 */
+                public boolean ModeControl;
+                /** 풍량제어 */
+                public boolean VolumeControl;
+
+                public SupportInfo()
+                {
+                    MinSetTemp = 18;
+                    HeatMinSetTemp = 16;
+                    MaxSetTemp = 30;
+                }
+            }
+
+            public Info()
+            {
+                Support = new SupportInfo();
+                InsideAirconCount = 0;
+                OutsideAirconCount = 0;
+                AirconStatus = Status.WAIT_OUTDOOR;
+            }
+            /** 디버깅 메시지 출력 */
+            public String ToDebugString()
+            {
+                String retStr =
+                        "==========================\r\n" +
+                                "Info\r\n" +
+                                "==========================\r\n" +
+                                "InsideAirconCount    : " + InsideAirconCount + "\r\n" +
+                                "OutsideAirconCount    : " + OutsideAirconCount + "\r\n" +
+                                "Vendor       : " + String.format("0x%02X", Vendor) + "\r\n" +
+                                "AirconStatus       : " + AirconStatus + "\r\n" +
+                                "FwVer        : " + (int)(FwVer_Year+2000) + "." + FwVer_Month + "." + FwVer_Day + "." + FwVer_Number + "\r\n" +
+                                "ProtocolVer  : " +  "V" + ProtocolVer_Main + "." + ProtocolVer_Sub + "\r\n" +
+
+                                "[Support]" + "\r\n" +
+                                "MinSetTemp     : " + Support.MinSetTemp +"\r\n" +
+                                "MaxSetTemp     : " + Support.MaxSetTemp +"\r\n" +
+                                "==========================";
+                return retStr;
+            }
+        }
+
+        /** 기기정보 설정*/
+        public static class Setting
+        {
+            /** 설정 여부 ( 프로토콜 문서에 따름 ) */
+            public byte UseSetting;
+
+            /** 에어컨 연동 설정 */
+            public byte AirconSetting;
+
+            public Setting()
+            {
+                UseSetting = 0;
+                //기본은 냉방전용 에어컨, 원래 값과 다른 경우 재설정을 해줘야 한다.
+                AirconSetting = 1;
+            }
+
+            /** 디버깅 메시지 출력 */
+            public String ToDebugString()
+            {
+                String retStr =
+                        "==========================\r\n" +
+                                "Setting\r\n" +
+                                "==========================\r\n" +
+                                "UseSetting    : " + String.format("0x%02X", UseSetting) + "\r\n" +
+                                "AirconSetting       : " + String.format("0x%02X", AirconSetting) + "\r\n" +
+                                "==========================";
+                return retStr;
+            }
+        }
+
+        /** 에어컨 연동 상태 */
+        public static class Status
+        {
+            /** 실외기 수 정보 수신 대기 */
+            public static byte WAIT_OUTDOOR      = (byte) 0x00;
+            /** 실내기 수 정보 수신 대기 */
+            public static byte WAIT_INSIDE   	 = (byte) 0x01;
+            /** 실내기 상태 정보 수신 대기 */
+            public static byte WAIT_ALL 		 = (byte) 0x02;
+            /** 에어컨 연동 완료 */
+            public static byte COMPLETE    		 = (byte) 0x03;
+
+            /**
+             * 범위를 체크한다.
+             *
+             * @param nStatus - (byte) 체크할 상태
+             *
+             * @return (boolean) ture:정상 , false:범위이탈
+             */
+            public static boolean CheckRange(byte nStatus)
+            {
+                if(nStatus == WAIT_OUTDOOR)     return true;
+                else if(nStatus == WAIT_INSIDE) return true;
+                else if(nStatus == WAIT_ALL)    return true;
+                else if(nStatus == COMPLETE)    return true;
+                return false;
+            }
+
+            public static String ToDebugString(byte nStatus)
+            {
+                String retStr;
+                if(nStatus == WAIT_OUTDOOR)         retStr = "OFF";
+                else if(nStatus == WAIT_INSIDE)   	retStr = "STAND_BY";
+                else if(nStatus == WAIT_ALL) 		retStr = "NOT_SUPPORT";
+                else if(nStatus == COMPLETE)        retStr = "ON";
+                else retStr = "UnDefined";
+                return retStr;
+            }
+        }
+
+        /** ON/OFF상태 정의 */
+        public static class ONOFF
+        {
+            /** 정보없음 */
+            public static byte NoInfo          = 0x00;
+            /** 에어컨 ON */
+            public static byte AirconON      = 0x01;
+            /** 에어컨 OFF */
+            public static byte AirconOFF     = 0x02;
+
+            public static String ToDebugString(byte Mode)
+            {
+                String retStr;
+                if(Mode == ONOFF.NoInfo)             retStr = "NoInfo";
+                else if(Mode == ONOFF.AirconON)      retStr = "AirconON";
+                else if(Mode == ONOFF.AirconOFF)     retStr = "AirconOFF";
+                else retStr = "UnDefined";
+                return retStr;
+            }
+
+            /**
+             * 읽기 on/off 상태 범위를 체크한다.
+             *
+             * @param Mode - (byte) 체크할 on/off모드
+             *
+             * @return (boolean) ture:정상 , false:범위이탈
+             */
+            public static boolean CheckGetMode(byte Mode)
+            {
+                if(Mode == ONOFF.NoInfo)             return true;
+                else if(Mode == ONOFF.AirconON)      return true;
+                else if(Mode == ONOFF.AirconOFF)     return true;
+                return false;
+            }
+
+
+            /**
+             * 운전모드에 따른  ON/OFF 상태를 반환한다.
+             *
+             * @param Mode - (byte) 입력 운전모드
+             *
+             * @return (boolean) ture:ON , false:OFF
+             */
+            public static boolean GetOnOff(byte Mode)
+            {
+                if(Mode == KnxSystemAircon.ONOFF.AirconON)        return true;
+                else if(Mode == KnxSystemAircon.ONOFF.AirconOFF)  return false;
+                return false;
+            }
+        }
+
+        /** 운전상태 정의 */
+        public static class MODE
+        {
+            /** 자동 */
+            public static byte Auto          = 0x00;
+            /** 냉방 */
+            public static byte Cold			 = 0x01;
+            /** 제습 */
+            public static byte Dry			 = 0x02;
+            /** 송풍 */
+            public static byte Venti		 = 0x03;
+            /** 난방 */
+            public static byte Heat			 = (byte) 0x04;
+
+            public static String ToDebugString(byte Mode)
+            {
+                String retStr;
+                if(Mode == MODE.Auto)         retStr = "Auto";
+                else if(Mode == MODE.Cold)    retStr = "Cold";
+                else if(Mode == MODE.Dry)     retStr = "Dry";
+                else if(Mode == MODE.Venti)   retStr = "Venti";
+                else if(Mode == MODE.Heat)    retStr = "Heat";
+                else retStr = "UnDefined";
+                return retStr;
+            }
+
+            /**
+             * 설정운전모드 범위를 체크한다.
+             *
+             * @param Mode - (byte) 체크할 운전모드
+             *
+             * @return (boolean) ture:정상 , false:범위이탈
+             */
+            public static boolean CheckGetMode(byte Mode)
+            {
+                if(Mode == MODE.Auto)         return true;
+                else if(Mode == MODE.Cold)    return true;
+                else if(Mode == MODE.Dry)     return true;
+                else if(Mode == MODE.Venti)   return true;
+                else if(Mode == MODE.Heat)    return true;
+                return false;
+            }
+        }
+
+        /**
+         * 풍량 정의
+         */
+        public static class VOLUME {
+            /** 미설정  ( * 설정전용 : 읽기시 해당없음) */
+            public static byte Auto          = 0x00;
+            /** 약 */
+            public static byte Weak          = 0x01;
+            /** 중 */
+            public static byte Medium        = 0x02;
+            /** 강 */
+            public static byte Strong        = 0x03;
+
+            /**
+             * 설정운전모드 범위를 체크한다.
+             *
+             * @param Mode - (byte) 체크할 운전모드
+             *
+             * @return (boolean) ture:정상 , false:범위이탈
+             */
+            public static boolean CheckGetVolume(byte Mode)
+            {
+                if(Mode == VOLUME.Auto)            return true;
+                else if(Mode == VOLUME.Weak)       return true;
+                else if(Mode == VOLUME.Medium)     return true;
+                else if(Mode == VOLUME.Strong)     return true;
+                return false;
+            }
+        }
+
+        /** 각 에어컨 데이터 */
+        public static class AirData
+        {
+            ////////////////////////////////////////////
+            // 기본기능
+            ////////////////////////////////////////////
+            /** onoff {@link MODE} 값에 따름 */
+            public byte OnOff;
+            /** 운전모드 {@link MODE} 값에 따름 */
+            public byte Mode;
+            /** 밸브상태 ( ture : 열림, false : 닫힘 ) */
+            public boolean bValveStatus;
+            /** 풍량 {@link VOLUME} 값에 따름 */
+            public byte Volume;
+            /** 설정온도 ( 0.5도 혹은 1도 단위) */
+            public double SetTemp;
+            /** 현재온도 */
+            public double NowTemp;
+
+            /** 디버깅 메시지 출력 */
+            public String ToDebugString(byte RoomIndex)
+            {
+                String retStr =
+                        "==========================\r\n" +
+                                "RoomData (" + (int) (RoomIndex+1) + ") \r\n" +
+                                "==========================\r\n" +
+                                "Mode         : " + MODE.ToDebugString(Mode) + "\r\n" +
+                                "SetTemp      : " + SetTemp + "\r\n" +
+                                "NowTemp      : " + NowTemp + "\r\n" +
+                                "==========================";
+                return retStr;
+            }
+        }
+
+        /** 각 방 제어용 데이터 */
+        public static class CtrlRoomData
+        {
+            /** 운전모드 {@link MODE} 값에 따름 */
+            public byte Mode;
+            /** 풍량 {@link VOLUME} 값에 따름 */
+            public byte Volume;
+            /** onoff {@link MODE} 값에 따름 */
+            public byte OnOff;
+            /** 풍량 {@link VOLUME} 값에 따름 */
+            public double SetTemp;
+
+            public CtrlRoomData()
+            {
+                Mode = MODE.Auto;
+                Volume = VOLUME.Auto;
+                OnOff = ONOFF.NoInfo;
+                SetTemp = 0;
+            }
+        }
+
+        /** 전체방 데이터 정의 (통신용) */
+        public static class AllRoomData
+        {
+            public byte RoomCount;
+            public EachRoomData [] Room;
+
+            public AllRoomData(byte nRoomCount)
+            {
+                RoomCount = nRoomCount;
+                Room = new EachRoomData[RoomCount];
+                for(byte i=0 ; i<RoomCount ; i++) Room[i] = new EachRoomData();
+            }
+
+            public class EachRoomData
+            {
+                /** 운전모드 {@link MODE} 값에 따름 */
+                public byte Mode;
+                /** 풍량 {@link VOLUME} 값에 따름 */
+                public byte Volume;
+                /** onoff {@link MODE} 값에 따름 */
+                public byte OnOff;
+                /** 설정온도 ( 0.5도 혹은 1도 단위) */
+                public double SetTemp;
+
+                public EachRoomData()
+                {
+                    Mode = MODE.Auto;
+                    Volume = VOLUME.Auto;
+                    OnOff = ONOFF.NoInfo;
+                    SetTemp = 0;
+                }
+            }
+
+            /** 디버깅 메시지 출력 */
+            public String ToDebugString()
+            {
+                String retStr =
+                        "==========================\r\n" +
+                                "AllRoomData\r\n" +
+                                "==========================\r\n";
+
+                for(byte i=0 ; i<RoomCount ; i++)
+                {
+                    //retStr += Room[i].ToDebugString(i);
+                }
+
+                retStr += "==========================";
+                return retStr;
+            }
+        }
+
+        /** 설정시간 */
+        public static class SET_TIME
+        {
+            /** 30분 (ture : 30분, false : 정각) */
+            public boolean bMinute30;
+            /** 시간 (범위 : 0x03 - 3시 ~ 0x0C - 12시 ) */
+            public byte    Hour;
+
+            public SET_TIME()
+            {
+                bMinute30 = false;
+                Hour = 0;
+            }
+            /** 디버깅 메시지 출력 */
+            public String ToDebugString()
+            {
+                if(bMinute30) return String.format("%d:30", Hour);
+                else          return String.format("%d:00", Hour);
+            }
+        }
+
+        /** 에러코드 */
+        public static class ERROR
+        {
+            /** 실내기 에러여부             ( true : 이상, false : 정상) */
+            public boolean bError;
+            /** 기타이상                              ( true : 이상, false : 정상) */
+            public boolean bEtc;
+
+            public ERROR()
+            {
+                bError = false;
+                bEtc = false;
+            }
+
+            private String ToStrBoolean(boolean in) { if(in) return "O"; else return "X"; }
+        }
+    }
+
+
+
     /////////////////////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////////////////////////
     /** [Purity]  데이터 클래스   */

+ 2 - 1
WallPadAPI/src/main/java/com/artncore/commons/define.java

@@ -61,8 +61,9 @@ public class define {
 	public static final String DRIVER_TITLE_COOKTOPFINDER = "COOKTOPFINDER";
 	public static final String DRIVER_TITLE_COOKTOP 	  = "COOKTOP";
 
-	//madeinLab++ 에어컨, 전동루버, 청정환기 title 추가
+	//에어컨, 전동루버, 청정환기 title 추가
 	public static final String DRIVER_TITLE_AIRCON 	  = "AIRCON";
+	public static final String DRIVER_TITLE_KNXAIRCON 	  = "KNXAIRCON";
 	public static final String DRIVER_TITLE_LOUVER 	  = "LOUVER";
 	public static final String DRIVER_TITLE_PURITY 	  = "PURITY";
 

+ 1 - 1
WallPadAPI/src/main/java/com/artncore/wallpadapi/KnxVentiAPI.java

@@ -12,7 +12,7 @@ import com.util.LogUtil;
 /** 환기제어기의 API */
 public class KnxVentiAPI extends WallPadDevAPI
 {
-    private final String TAG = "VentiAPI";
+    private final String TAG = "KnxVentiAPI";
 
     private final boolean DEBUG_LOG_ON = true;
     private void DebugLogOutput(String s) { if(DEBUG_LOG_ON) Log.d(TAG, s); }

+ 11 - 0
WallPadAPI/src/main/java/com/artncore/wallpadapi/WallPadAPI.java

@@ -786,6 +786,17 @@ public class WallPadAPI {
         return new SystemAirconAPI(SvcCon.devctrcmd);
     }
 
+    /**
+     * Knx 에어컨 API 를 가져온다
+     *
+     * @return - (KnxSystemAirconAPI) 에어컨제어기 API
+     */
+    public KnxSystemAirconAPI Get_KnxAirconController()
+    {
+        if (SvcCon.devctrcmd == null) return null;
+        return new KnxSystemAirconAPI(SvcCon.devctrcmd);
+    }
+
     /**
      * 전동루버 API 를 가져온다
      *

BIN
WallPadDevService/libs/WallPadAPIforSVC.jar


+ 29 - 1
WallPadDevService/src/main/java/com/artncore/wallpaddevservice/ServiceMain.java

@@ -39,6 +39,7 @@ import com.artncore.wallpaddevservice.driver.InRoomDetectSensor_Controller;
 import com.artncore.wallpaddevservice.driver.InterlayerNoise_Controller;
 import com.artncore.wallpaddevservice.driver.KNX_Controller;
 import com.artncore.wallpaddevservice.driver.KNX_LivingRoomLight_Controller;
+import com.artncore.wallpaddevservice.driver.Knx_SystemAircon_Controller;
 import com.artncore.wallpaddevservice.driver.LedDimming_Controller_KCC;
 import com.artncore.wallpaddevservice.driver.Louver_Controller;
 import com.artncore.wallpaddevservice.driver.MultiSwitch_Controller;
@@ -173,6 +174,8 @@ public class ServiceMain extends Service {
 	public static Purity_Controller purity_controller;
 	// 시스템 에어컨
 	public static SystemAircon_Controller systemAircon_controller;
+	// KNX 시스템 에어컨
+	public static Knx_SystemAircon_Controller knx_systemAircon_controller;
 	// 청담 환기 장비 (최대 3개 연동)
 	public static Knx_Ventilation_Controller knxVentilation_Controller;
 	// 전동루버
@@ -421,6 +424,10 @@ public class ServiceMain extends Service {
 				if (systemAircon_controller == null) return RET_MSG_DEV_NOT_READY;
 				return DeviceDriverCtrl(systemAircon_controller, Command, Data);
 			}
+			else if (DriverTitle.equals(define.DRIVER_TITLE_KNXAIRCON)) {
+				if (knx_systemAircon_controller == null) return RET_MSG_DEV_NOT_READY;
+				return DeviceDriverCtrl(knx_systemAircon_controller, Command, Data);
+			}
 			else if (DriverTitle.equals(define.DRIVER_TITLE_LIGHT)) {
 				if (light_Controller == null) return RET_MSG_DEV_NOT_READY;
 				return DeviceDriverCtrl(light_Controller, Command, Data);
@@ -889,6 +896,27 @@ public class ServiceMain extends Service {
 					// 3. 초기화체크 드라이버 등록
 					ServiceMain.deviceInitChecker.Add(attsName);
 				}
+				else if (attsName.equals("Knx_SystemAircon_Controller")) {
+					///////////////////////////////////////////
+					// Knx_SystemAircon_Controller
+					///////////////////////////////////////////
+
+					// 0. 로딩여부 판단
+					WallpadDeviceSet devset = new WallpadDeviceSet(getApplicationContext());
+					int setdata = devset.Get_AirCON_Info();
+					devset.closeDB();
+
+					if (setdata == WallpadDeviceSet.SYSTEMAIRCON_NONE) return;
+
+					// 1. Class 생성
+					knx_systemAircon_controller = new Knx_SystemAircon_Controller();
+
+					// 2. 등록
+					RegistrationDeviceManager = knx_systemAircon_controller;
+
+					// 3. 초기화체크 드라이버 등록
+					ServiceMain.deviceInitChecker.Add(attsName);
+				}
 				else if (attsName.equals("HeatingFinder_Driver")) {
 					///////////////////////////////////////////
 					// HeatingFinder_Driver
@@ -1883,7 +1911,7 @@ public class ServiceMain extends Service {
 
 						// COM4 - Energy_Module
 						"<driver name = \"KNX_Driver\"      module =\"Energy_Module\"             startaddr = \"0x01\"    endaddr = \"0x01\"    option = \"null\"  />"+
-						"<driver name = \"SystemAircon_Controller\"      module =\"Energy_Module\"             startaddr = \"0x78\"    endaddr = \"0x78\"    option = \"null\"  />"+
+						"<driver name = \"Knx_SystemAircon_Controller\"      module =\"Energy_Module\"             startaddr = \"0x78\"    endaddr = \"0x78\"    option = \"null\"  />"+
 
 						// COM5 - Dgw_Module
 						"<driver name = \"IGW300_Controller\"             module =\"Dgw_Module\"                startaddr = \"0x01\"    endaddr = \"0x01\"    option = \"null\"  />"+

BIN
WallPadHomeCtrl/libs/WallPadAPI.jar


+ 66 - 6
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/MainActivity.java

@@ -58,9 +58,11 @@ import java.util.List;
 import kr.co.icontrols.v40ioctl.V40IF;
 import kr.co.icontrols.wallpadhomectrl.declare.Common;
 import kr.co.icontrols.wallpadhomectrl.declare.ID;
+import kr.co.icontrols.wallpadhomectrl.screen.screen_aircon.KnxSystemAirconMainScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_aircon.SystemAirconMainScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.HeatingV2TestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.HybridCookTopTestScreen;
+import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.KnxSystemAirconMainTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.LightKnxMainTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.ParkingDoorMainScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.SystemAirconTestScreen;
@@ -219,6 +221,7 @@ public class MainActivity extends WpadActivity {
 	private ElectricRangeMainScreen electricRangeMainScreen = null;
 	private CookTopConcentMainScreen cookTopConcentMainScreen = null;
 	private SystemAirconMainScreen systemAirconMainScreen = null;
+	private KnxSystemAirconMainScreen knxSystemAirconMainScreen = null;
     private PurityMainScreen purityMainScreen = null;
     private ParkingDoorMainScreen parkingDoorMainScreen = null;
 
@@ -1228,7 +1231,8 @@ public class MainActivity extends WpadActivity {
 						} else if (mCurrentScreenId == API_Menu.SubMenuCtrl.Gas) {
 							StartMultiControl(ID.screen.GasTestScreen, index+1);
 						} else if (mCurrentScreenId == API_Menu.SubMenuCtrl.SystemAircon) {
-							StartMultiControl(ID.screen.SystemAirconTest1Screen, index+1);
+							StartMultiControl(ID.screen.KnxSystemAirconMainTestScreen, index+1);
+							//StartMultiControl(ID.screen.SystemAirconTest1Screen, index+1);
 						} else if (mCurrentScreenId == API_Menu.SubMenuCtrl.ChangAir_Normal) {
 							StartMultiControl(ID.screen.VentiMainTestScreen, index+1);
 						}
@@ -1448,6 +1452,7 @@ public class MainActivity extends WpadActivity {
 				case API_Menu.SubMenuCtrl.ChangAir_Normal:
 				case API_Menu.SubMenuCtrl.ChangAir_LH:
 				case API_Menu.SubMenuCtrl.ChangAir_Hood:
+				case ID.screen.VentiMainTestScreen:
 					SetTitleText(API_Menu.SubMenuCtrl.Name_Venti);
 					ret = true;
 					break;
@@ -1470,6 +1475,7 @@ public class MainActivity extends WpadActivity {
 
 				case API_Menu.SubMenuCtrl.SystemAircon:
 				case ID.screen.SystemAirconTest1Screen:
+				case ID.screen.KnxSystemAirconMainTestScreen:
 					SetTitleText(API_Menu.SubMenuCtrl.Name_SystemAircon);
 					ret = true;
 					break;
@@ -1908,8 +1914,15 @@ public class MainActivity extends WpadActivity {
 
 				case API_Menu.SubMenuCtrl.SystemAircon:
 					SetTitleText(API_Menu.SubMenuCtrl.Name_SystemAircon);
-					systemAirconMainScreen = new SystemAirconMainScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mDefaultRoomNameList);
-					super.setCurrentScreen(systemAirconMainScreen);
+					 if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+						// KNX 분전반
+						knxSystemAirconMainScreen = new KnxSystemAirconMainScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mDefaultRoomNameList);
+						super.setCurrentScreen(knxSystemAirconMainScreen);
+
+					 }else {
+						 systemAirconMainScreen = new SystemAirconMainScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mDefaultRoomNameList);
+						 super.setCurrentScreen(systemAirconMainScreen);
+					 }
 					setTopBoilerBtnVisible(false);
 					setAIRBackBtnVisible(false);
 					setKccDimmBtnVisible(false);
@@ -2004,11 +2017,16 @@ public class MainActivity extends WpadActivity {
 			setTitleName(nScreenId);
 			//super.setFinishTimerCreate(Common.FINISH_TIME_SEC);
 			switch (nScreenId) {
-				case ID.screen.SystemAirconTest1Screen: // sub - 공지사항 내용
+				case ID.screen.SystemAirconTest1Screen: // 시스템 에어컨
 					SystemAirconTestScreen systemAirconTest1Screen = new SystemAirconTestScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mDefaultRoomNameList);
 					super.setCurrentScreen(systemAirconTest1Screen);
 					result = true;
 					break;
+				case ID.screen.KnxSystemAirconMainTestScreen: // 시스템 에어컨
+					KnxSystemAirconMainTestScreen knxSystemAirconMainTestScreen = new KnxSystemAirconMainTestScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mDefaultRoomNameList);
+					super.setCurrentScreen(knxSystemAirconMainTestScreen);
+					result = true;
+					break;
 				case ID.screen.LightKnxMainTestScreen: // sub - 공지사항 내용
 					LightKnxMainTestScreen lightKnxMainTestScreen = new LightKnxMainTestScreen(this, ScreenLayout, wpapi, OPERATION_MODE, mRoomNameList_Light);
 					super.setCurrentScreen(lightKnxMainTestScreen);
@@ -3458,8 +3476,11 @@ public class MainActivity extends WpadActivity {
 	class ClientThread extends Thread {
 		private Handler handler;
 		private String  category;
-		private int menu, kind, reason, state, position;
+		private int menu, kind, reason, position;
 		private int roomNumber;
+		private double doubleState;
+		private byte[] arrayState;
+		private int state = -9999;
 
 		public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, int state) {
 			this.handler = handler;
@@ -3472,6 +3493,29 @@ public class MainActivity extends WpadActivity {
 			this.state = state;
 		}
 
+		public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, double state) {
+			this.handler = handler;
+			this.menu = menu;
+			this.kind = kind;
+			this.reason = reason;
+			this.position = position;
+			this.category = category;
+			this.roomNumber = roomNumber;
+			this.doubleState = state;
+		}
+
+		public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, byte[] state) {
+			this.handler = handler;
+			this.menu = menu;
+			this.kind = kind;
+			this.reason = reason;
+			this.position = position;
+			this.category = category;
+			this.roomNumber = roomNumber;
+			this.arrayState = state;
+			this.state = -1111;
+		}
+
 		public ClientThread(Handler handler, int menu, int kind, int reason, int position) {
 			this.handler = handler;
 			this.menu = menu;
@@ -3499,10 +3543,21 @@ public class MainActivity extends WpadActivity {
 				jsonObject.accumulate("reason", reason);
 				jsonObject.accumulate("position", position);
 				//제어
+				//제어
 				if (reason == Common.JSON.REASON.Control) {
+					dataJsonObject.accumulate("number", roomNumber);
 					dataJsonObject.accumulate("category", category);
+					if(state==-1111) {
+						dataJsonObject.accumulate("arrayState", arrayState);
+					}else if(state!=-9999) {
+						dataJsonObject.accumulate("state", state);
+					}else{
+						dataJsonObject.accumulate("doubleState", doubleState);
+					}
+				}
+				//상태 조회
+				else if (reason == Common.JSON.REASON.Status) {
 					dataJsonObject.accumulate("number", roomNumber);
-					dataJsonObject.accumulate("state", state);
 				}
 				jsonObject.accumulate("data", dataJsonObject);
 			} catch (JSONException e) {
@@ -3576,6 +3631,11 @@ public class MainActivity extends WpadActivity {
 		thread.start();
 	}
 
+	public void requestMultiControl(Handler handler, int menu, int kind, int reason, int position, String category, int number, double state) {
+		ClientThread thread = new ClientThread(handler, menu, kind, reason, position, category, number, state);
+		thread.start();
+	}
+
 	public void requestMultiStatus(Handler handler, int menu, int kind, int reason, int position) {
 		ClientThread thread = new ClientThread(handler, menu, kind, reason, position);
 		thread.start();

+ 59 - 5
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/PopupActivity.java

@@ -37,9 +37,11 @@ import java.text.SimpleDateFormat;
 
 import kr.co.icontrols.wallpadhomectrl.declare.Common;
 import kr.co.icontrols.wallpadhomectrl.declare.ID;
+import kr.co.icontrols.wallpadhomectrl.screen.screen_aircon.KnxSystemAirconPopupScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_aircon.SystemAirconPopupScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.HeatingV2PopupBoilerTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.HeatingV2PopupTestScreen;
+import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.KnxSystemAirconPopupTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.LightKnxPopupTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.SystemAirconPopupTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_concent.ConcentHdcLivPopupScreen;
@@ -50,6 +52,7 @@ import kr.co.icontrols.wallpadhomectrl.screen.screen_heating.HeatingV2PopupBoile
 import kr.co.icontrols.wallpadhomectrl.screen.screen_heating.HeatingV2PopupScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_light.LightEtcEachPopupRoomScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_light.LightHdcLivPopupScreen;
+import kr.co.icontrols.wallpadhomectrl.screen.screen_multi.VentiPopupReservationTestScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_venti.VentiPopupAlarmScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_venti.VentiPopupReservationScreen;
 import kr.co.icontrols.wallpadhomectrl.screen.screen_venti.VentiPopupServiceScreen;
@@ -103,6 +106,7 @@ public class PopupActivity extends WpadActivity
     private HeatingV2PopupBoilerTestScreen heatingV2PopupBoilerTestScreen;
     private KnxVentiPopupReservationScreen knxVentiPopupReservationScreen;
     private VentiPopupReservationScreen ventiPopupReservationScreen;
+    private VentiPopupReservationTestScreen ventiPopupReservationTestScreen;
     private KnxVentiPopupAlarmScreen knxVentiPopupAlarmScreen;
     private VentiPopupAlarmScreen ventiPopupAlarmScreen;
     private LightEtcEachPopupRoomScreen lightEtcEachPopupRoomScreen;
@@ -112,7 +116,9 @@ public class PopupActivity extends WpadActivity
     private ConcentPopupScreen concentPopupScreen;
     private ConcentKnxPopupScreen concentKnxPopupScreen;
     private SystemAirconPopupScreen systemAirconPopupScreen;
+    private KnxSystemAirconPopupScreen knxSystemAirconPopupScreen;
     private SystemAirconPopupTestScreen systemAirconPopupTestScreen;
+    private KnxSystemAirconPopupTestScreen knxSystemAirconPopupTestScreen;
     private PurityPopupScreen purityPopupScreen;
 	private VentiPopupServiceScreen ventiPopupServiceScreen;
     private ConcentHdcLivPopupScreen concentHdcLivPopupScreen = null;
@@ -572,6 +578,22 @@ public class PopupActivity extends WpadActivity
                     }
                     break;
 
+                case ID.screen.VentiPopupReservationTestScreen:
+                    try
+                    {
+                        ventiPopupReservationTestScreen = new VentiPopupReservationTestScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
+                        super.setCurrentScreen(ventiPopupReservationTestScreen);
+                    }
+                    catch (RuntimeException re) {
+                        LogUtil.errorLogInfo("", TAG, re);
+                    }
+                    catch (Exception e)
+                    {
+                        Log.i(TAG, "VentiPopupReservationTestScreen make error");
+                    }
+
+                    break;
+
                 case ID.screen.VentiPopupAlarmScreen:
                     if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
                         knxVentiPopupAlarmScreen = new KnxVentiPopupAlarmScreen(mContext, AllLayout);
@@ -619,13 +641,24 @@ public class PopupActivity extends WpadActivity
                     break;
 
                 case ID.screen.SystemAirconPopupScreen:
-                    systemAirconPopupScreen = new SystemAirconPopupScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
-                    super.setCurrentScreen(systemAirconPopupScreen);
+                    if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+                        knxSystemAirconPopupScreen = new KnxSystemAirconPopupScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
+                        super.setCurrentScreen(knxSystemAirconPopupScreen);
+                    }else{
+                        systemAirconPopupScreen = new SystemAirconPopupScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
+                        super.setCurrentScreen(systemAirconPopupScreen);
+                    }
                     break;
 
                 case ID.screen.SystemAirconPopupTestScreen:
-                    systemAirconPopupTestScreen = new SystemAirconPopupTestScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
-                    super.setCurrentScreen(systemAirconPopupTestScreen);
+                    if (nDistributionPanelType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+                        knxSystemAirconPopupTestScreen = new KnxSystemAirconPopupTestScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
+                        super.setCurrentScreen(knxSystemAirconPopupTestScreen);
+                    }else{
+                        systemAirconPopupTestScreen = new SystemAirconPopupTestScreen(mContext, AllLayout, wpapi, OPERATION_MODE);
+                        super.setCurrentScreen(systemAirconPopupTestScreen);
+                    }
+
                     break;
 
                 case ID.screen.PurityPopupScreen:
@@ -727,6 +760,7 @@ public class PopupActivity extends WpadActivity
         private int menu, kind, reason, position;
         private int roomNumber;
         private double doubleState;
+        private byte[] arrayState;
         private int state = -9999;
 
         public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, int state) {
@@ -751,6 +785,18 @@ public class PopupActivity extends WpadActivity
             this.doubleState = state;
         }
 
+        public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, byte[] state) {
+            this.handler = handler;
+            this.menu = menu;
+            this.kind = kind;
+            this.reason = reason;
+            this.position = position;
+            this.category = category;
+            this.roomNumber = roomNumber;
+            this.arrayState = state;
+            this.state = -1111;
+        }
+
         public ClientThread(Handler handler, int menu, int kind, int reason, int position) {
             this.handler = handler;
             this.menu = menu;
@@ -781,7 +827,9 @@ public class PopupActivity extends WpadActivity
                 //제어
                 if (reason == 1) {
                     dataJsonObject.accumulate("number", roomNumber);
-                    if(state!=-9999) {
+                    if(state==-1111) {
+                        dataJsonObject.accumulate("arrayState", arrayState);
+                    }else if(state!=-9999) {
                         dataJsonObject.accumulate("state", state);
                     }else{
                         dataJsonObject.accumulate("doubleState", doubleState);
@@ -859,6 +907,12 @@ public class PopupActivity extends WpadActivity
         ClientThread thread = new ClientThread(handler, menu, kind, reason, position, category, number, state);
         thread.start();
     }
+
+    public void requestMultiControl(Handler handler, int menu, int kind, int reason, int position, String category, int number, byte[] state) {
+        ClientThread thread = new ClientThread(handler, menu, kind, reason, position, category, number, state);
+        thread.start();
+    }
+
     public void requestMultiStatus(Handler handler, int menu, int kind, int reason, int position) {
         ClientThread thread = new ClientThread(handler, menu, kind, reason, position);
         thread.start();

+ 6 - 1
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/data/AirconData.java

@@ -4,6 +4,7 @@ import android.os.Parcel;
 import android.os.Parcelable;
 
 public class AirconData implements Parcelable {
+    private int aircon_status;
     private boolean support_auto;
     private boolean support_cooling;
     private boolean support_dehumidify;
@@ -11,6 +12,7 @@ public class AirconData implements Parcelable {
     private boolean support_heating;
 
     protected AirconData(Parcel in) {
+        aircon_status = in.readInt();
         support_auto = in.readByte() != 0;
         support_cooling = in.readByte() != 0;
         support_dehumidify = in.readByte() != 0;
@@ -30,6 +32,9 @@ public class AirconData implements Parcelable {
         }
     };
 
+    public int getAircon_status() {
+        return aircon_status;
+    }
     public boolean getSupportAuto() {
         return support_auto;
     }
@@ -61,11 +66,11 @@ public class AirconData implements Parcelable {
 
     @Override
     public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(aircon_status);
         dest.writeByte((byte) (support_auto ? 1 : 0));
         dest.writeByte((byte) (support_cooling ? 1 : 0));
         dest.writeByte((byte) (support_dehumidify ? 1 : 0));
         dest.writeByte((byte) (support_fan ? 1 : 0));
         dest.writeByte((byte) (support_heating ? 1 : 0));
     }
-
 }

+ 9 - 1
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/declare/Common.java

@@ -403,13 +403,15 @@ public final class Common
             public final static int AIRCON  	= MENU_BASE + 4;
             public final static int VENTI     	= MENU_BASE + 5;
             public final static int GAS      	= MENU_BASE + 6;
-            public final static int CURTAIN  	= MENU_BASE + 7;
+            public final static int COOKTOP  	= MENU_BASE + 7;
+            public final static int PASSWORD  	= MENU_BASE + 8;
         }
 
         public static final class REASON
         {
             public final static int Status              = 0;
             public final static int Control             = 1;
+            public final static int PassWordChange      = 2;
         }
 
         public static final class KIND
@@ -422,6 +424,12 @@ public final class Common
         {
             public final static int All              = 0;
         }
+
+        public static final class ONOFF
+        {
+            public final static int ON              = 0;
+            public final static int OFF              = 1;
+        }
     }
 
 

+ 163 - 0
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/declare/ID.java

@@ -33,6 +33,7 @@ public final class ID
 		public final static int VentiMainScreen			                      = 4000;
 		public final static int VentiMainTestScreen			                  = 4010;
 		public final static int VentiPopupReservationScreen					  = 4100;        // 환기 - 팝업 - 예약
+		public final static int VentiPopupReservationTestScreen				  = 4110;        // 멀티 환기 - 팝업 - 예약
 		public final static int VentiPopupAlarmScreen           			  = 4200;        // 환기 - 팝업 - 알림
 		public final static int VentiPopupServiceScreen           			  = 4300;        // 환기 케어 서비스 팝업
 		public final static int VentilationMainScreen			                      = 4400;   // 지능형 환기 화면
@@ -75,6 +76,9 @@ public final class ID
 		public final static int SystemAirconPopupScreen = 51000;          // 시스템에어컨 - 팝업
 		public final static int SystemAirconTest1Screen = 52000;          // 시스템에어컨 - 멀티제어1
 		public final static int SystemAirconPopupTestScreen = 53000;          // 시스템에어컨 - 멀티팝업제어1
+		public final static int KnxSystemAirconMainTestScreen = 56000;          // KNX시스템에어컨 - 멀티제어1
+		public final static int KnxSystemAirconPopupTestScreen = 57000;          // KNX시스템에어컨 - 멀티팝업제어1
+
 		public final static int PurityMainScreen = 60000;          // 청정환기 - 메인
 		public final static int PurityPopupScreen = 61000;          // 청정환기 - 팝업
 
@@ -3083,6 +3087,165 @@ public final class ID
 		}
 	}
 
+	/* ==========================================================================
+	 * ==========================================================================
+	 * SYSTEM AIRCON
+	 * ==========================================================================
+	 * ========================================================================== */
+	public static final class KnxSystemAirconMain {
+		final static int BASE = screen.SystemAirconMainScreen;
+
+		public final static String BR_AIRCON = BR_ACTION_BASE + "AIRCON_MAIN" + "(" + BASE + ")";
+		public final static String BR_LOUVER = BR_ACTION_BASE + "LOUVER_MAIN" + "(" + BASE + ")";
+
+		public static final class layout {
+		}
+
+		public static final class image {
+			public final static int BACKGROUND = BASE + 100;
+
+			public final static int ROOM_BACKGROUND_1 = BASE + 110;
+			public final static int ROOM_BACKGROUND_2 = BASE + 111;
+			public final static int ROOM_BACKGROUND_3 = BASE + 112;
+			public final static int ROOM_BACKGROUND_4 = BASE + 113;
+			public final static int ROOM_BACKGROUND_5 = BASE + 114;
+			public final static int ROOM_BACKGROUND_6 = BASE + 115;
+
+			public final static int ROOM_VOLUME_1 = BASE + 120;
+		}
+
+		public static final class button {
+			public final static int ALL_ONOFF = BASE + 200;
+
+			public final static int ROOM_TITLE_1 = BASE + 201;
+			public final static int ROOM_TITLE_2 = BASE + 202;
+			public final static int ROOM_TITLE_3 = BASE + 212;
+			public final static int ROOM_TITLE_4 = BASE + 213;
+			public final static int ROOM_TITLE_5 = BASE + 214;
+			public final static int ROOM_TITLE_6 = BASE + 215;
+			public final static int ROOM_TITLE_7 = BASE + 216;
+			public final static int ROOM_TITLE_8 = BASE + 217;
+			public final static int ROOM_TITLE_9 = BASE + 218;
+			public final static int ROOM_TITLE_MAX = BASE + 215;
+
+			public final static int ROOM_ONOFF_1 = BASE + 220;
+			public final static int ROOM_ONOFF_2 = BASE + 221;
+			public final static int ROOM_ONOFF_3 = BASE + 222;
+			public final static int ROOM_ONOFF_4 = BASE + 223;
+			public final static int ROOM_ONOFF_5 = BASE + 224;
+			public final static int ROOM_ONOFF_6 = BASE + 225;
+			public final static int ROOM_ONOFF_7 = BASE + 226;
+			public final static int ROOM_ONOFF_8 = BASE + 227;
+			public final static int ROOM_ONOFF_9 = BASE + 228;
+			public final static int ROOM_ONOFF_MAX = BASE + 235;
+
+			public final static int LEFT_MOVE_BTN = BASE + 236;
+			public final static int RIGHT_MOVE_BTN = BASE + 237;
+
+			public final static int ALL_MODE_PREV = BASE + 240;
+			public final static int ALL_MODE_NEXT = BASE + 241;
+
+			public final static int ALL_VOLUME_PREV = BASE + 250;
+			public final static int ALL_VOLUME_NEXT = BASE + 251;
+
+			public final static int AUTO_MODE = BASE + 260;
+			public final static int COLD_MODE = BASE + 261;
+			public final static int DRY_MODE = BASE + 262;
+			public final static int VENTI_MODE = BASE + 263;
+			public final static int HEAT_MODE = BASE + 264;
+
+			public final static int AUTO_VOLUME = BASE + 270;
+			public final static int WEAK_VOLUME = BASE + 271;
+			public final static int MEDIUM_VOLUME = BASE + 272;
+			public final static int STRONG_VOLUME = BASE + 273;
+
+
+			public final static int LOUVER_TITLE = BASE + 280;
+			public final static int LOUVER_MODE = BASE + 281;
+		}
+
+		public static final class text {
+			public final static int ROOM_TITLE_1 = BASE + 300;
+			public final static int ROOM_TITLE_2 = BASE + 301;
+			public final static int ROOM_TITLE_3 = BASE + 302;
+			public final static int ROOM_TITLE_4 = BASE + 303;
+			public final static int ROOM_TITLE_5 = BASE + 304;
+			public final static int ROOM_TITLE_6 = BASE + 305;
+			public final static int OUT_TITLE = BASE + 305;
+
+			public final static int ROOM_MODE_1 = BASE + 310;
+			public final static int ROOM_MODE_2 = BASE + 311;
+			public final static int ROOM_MODE_3 = BASE + 312;
+			public final static int ROOM_MODE_4 = BASE + 313;
+			public final static int ROOM_MODE_5 = BASE + 314;
+			public final static int ROOM_MODE_6 = BASE + 315;
+
+			public final static int ROOM_NOWTEMP_1 = BASE + 320;
+			public final static int ROOM_NOWTEMP_2 = BASE + 321;
+			public final static int ROOM_NOWTEMP_3 = BASE + 322;
+			public final static int ROOM_NOWTEMP_4 = BASE + 323;
+			public final static int ROOM_NOWTEMP_5 = BASE + 324;
+			public final static int ROOM_NOWTEMP_6 = BASE + 325;
+
+			public final static int ROOM_SETTEMP_1 = BASE + 330;
+			public final static int ROOM_SETTEMP_2 = BASE + 331;
+			public final static int ROOM_SETTEMP_3 = BASE + 332;
+			public final static int ROOM_SETTEMP_4 = BASE + 333;
+			public final static int ROOM_SETTEMP_5 = BASE + 334;
+			public final static int ROOM_SETTEMP_6 = BASE + 335;
+
+			public final static int PAGE_TEXT = BASE + 336;
+
+			public final static int TITLE = BASE + 340;
+			public final static int ALL_MODE = BASE + 341;
+			public final static int ALL_VOLUME = BASE + 342;
+			public final static int WAIT_TITLE = BASE + 343;
+		}
+	}
+
+	public static final class KNxSystemAirconPopup {
+		public final static int BASE = screen.SystemAirconPopupScreen;
+
+		public final static String BR_AIRCON = BR_ACTION_BASE + "AIRCON_POPUP" + "(" + BASE + ")";
+
+		public static final class layout {
+		}
+
+		public static final class image {
+			public final static int BACKGROUND = BASE + 10;
+			public final static int TITLE = BASE + 11;
+			public final static int BOX_BG = BASE + 12;
+			public final static int SETTING_BG = BASE + 13;
+			public final static int MODE = BASE + 14;
+		}
+
+		public static final class button {
+			public final static int EXIT = BASE + 20;
+
+			public final static int ROOM_PREV = BASE + 21;
+			public final static int ROOM_NEXT = BASE + 22;
+			public final static int ONOFF = BASE + 23;
+
+			public final static int MANUAL = BASE + 26;
+			public final static int MODE_1 = BASE + 30;
+			public final static int MODE_2 = BASE + 31;
+			public final static int MODE_3 = BASE + 32;
+			public final static int MODE_4 = BASE + 33;
+			public final static int MODE_5 = BASE + 34;
+			public final static int VOLUME_DEC = BASE + 40;
+			public final static int VOLUME_ENC = BASE + 41;
+			public final static int TEMP_DEC = BASE + 42;
+			public final static int TEMP_ENC = BASE + 43;
+		}
+
+		public static final class text {
+			public final static int TITLE = BASE + 50;
+			public final static int MODE = BASE + 51;
+			public final static int NOW_TEMP = BASE + 52;
+			public final static int SET_TEMP = BASE + 53;
+		}
+	}
+
 	// Tab Default
 	public static final class PurityMain {
 		final static int BASE = screen.PurityMainScreen;

+ 9 - 0
WallPadHomeCtrl/src/main/java/kr/co/icontrols/wallpadhomectrl/screen/screen_aircon/SystemAirconMainScreen.java

@@ -3,6 +3,9 @@ package kr.co.icontrols.wallpadhomectrl.screen.screen_aircon;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
 import android.os.SystemClock;
 import android.util.Log;
 import android.util.TypedValue;
@@ -23,12 +26,18 @@ import com.artncore.wallpadapi.LouverAPI;
 import com.artncore.wallpadapi.SystemAirconAPI;
 import com.artncore.wallpadapi.WallPadAPI;
 import com.artncore.wallpadapi.WallPadDevAPI;
+import com.google.gson.Gson;
 import com.util.LogUtil;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import kr.co.icontrols.wallpadhomectrl.MainActivity;
 import kr.co.icontrols.wallpadhomectrl.R;
 import kr.co.icontrols.wallpadhomectrl.declare.Common;
 import kr.co.icontrols.wallpadhomectrl.declare.ID;
+import kr.co.icontrols.wallpadhomectrl.declare.Common.JSON;
 import kr.co.icontrols.wallpadhomectrl.declare.TransactionDisplay;
 import kr.co.icontrols.wallpadsupport.Version;
 import kr.co.icontrols.wallpadsupport.WpadImageView;

BIN
WallPadMultiControlService/libs/WallPadAPI.jar


+ 7 - 6
WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/Common.java

@@ -54,7 +54,7 @@ public final class Common
             public final static int CONCENT  	= MENU_BASE + 2;
             public final static int HEATING  	= MENU_BASE + 3;
             public final static int AIRCON  	= MENU_BASE + 4;
-            public final static int PURITY  	= MENU_BASE + 5;
+            public final static int VENTI     	= MENU_BASE + 5;
             public final static int GAS      	= MENU_BASE + 6;
             public final static int COOKTOP  	= MENU_BASE + 7;
             public final static int PASSWORD  	= MENU_BASE + 8;
@@ -65,11 +65,12 @@ public final class Common
         {
             public final static int RuntimeException    = ERROR_BASE + 1;
             public final static int Exception           = ERROR_BASE + 2;
-            public final static int NotReady            = ERROR_BASE + 3;
-            public final static int NotSupported        = ERROR_BASE + 4;
-            public final static int ApiNull           	= ERROR_BASE + 5;
-            public final static int ResultFail         	= ERROR_BASE + 6;
-            public final static int OutOfRange        	= ERROR_BASE + 7;
+            public final static int JsonException       = ERROR_BASE + 3;
+            public final static int NotReady            = ERROR_BASE + 4;
+            public final static int NotSupported        = ERROR_BASE + 5;
+            public final static int ApiNull           	= ERROR_BASE + 6;
+            public final static int ResultFail         	= ERROR_BASE + 7;
+            public final static int OutOfRange        	= ERROR_BASE + 8;
         }
 
         public static final class REASON

+ 218 - 121
WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/DataSenderService.java

@@ -15,6 +15,7 @@ import android.util.Log;
 import com.artncore.WallPadDataMgr.WallpadDeviceSet;
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.WallPadDataMgr.wallpaddbmgr;
+import com.artncore.commons.API_Menu;
 import com.artncore.commons.DataClasses;
 import com.artncore.commons.KNX_DataClasses;
 import com.artncore.commons.define;
@@ -25,6 +26,7 @@ import com.artncore.wallpadapi.GasAPI;
 import com.artncore.wallpadapi.HeatingV2API;
 import com.artncore.wallpadapi.IGW300API;
 import com.artncore.wallpadapi.KnxAPI;
+import com.artncore.wallpadapi.KnxSystemAirconAPI;
 import com.artncore.wallpadapi.RealTimeMeterAPI;
 import com.artncore.wallpadapi.SdbAPI;
 import com.artncore.wallpadapi.Sdb_LivingRoomLightAPI;
@@ -48,7 +50,9 @@ import java.util.Random;
 
 import kr.co.icontrols.wallpadmulticontrolservice.control.AirconControl;
 import kr.co.icontrols.wallpadmulticontrolservice.control.HeatingControl;
+import kr.co.icontrols.wallpadmulticontrolservice.control.KnxAirconControl;
 import kr.co.icontrols.wallpadmulticontrolservice.control.LightControl;
+import kr.co.icontrols.wallpadmulticontrolservice.control.VentiControl;
 import kr.co.icontrols.wallpadmulticontrolservice.data.BasicData;
 import kr.co.icontrols.wallpadmulticontrolservice.data.RequestData;
 import kr.co.icontrols.wallpadmulticontrolservice.Common.JSON;
@@ -111,7 +115,22 @@ public class DataSenderService extends Service {
 
     // 환기
     private VentiAPI mVentiAPI = null;
+    private VentiControl mVentiControl;
     public Ventilation mVentilation = new Ventilation();
+    private VentilData mVentilData = null;
+
+    private class VentilData {
+        DataClasses.Venti VentilStatus;
+        int Type;   // 현산,LH,후드
+        int[] TimerTable;
+
+        public VentilData(int nType) {
+            VentilStatus = new DataClasses.Venti();
+            Type = nType;
+            if (Type == API_Menu.SubMenuCtrl.ChangAir_LH) TimerTable = new int[]{0, 30, 60, 90};
+            else TimerTable = new int[]{0, 10, 20, 30, 60, 120, 180, 240};
+        }
+    }
 
     public static class Ventilation {
         /**
@@ -152,6 +171,19 @@ public class DataSenderService extends Service {
         }
     }
 
+    //KNX 에어컨
+    private KnxSystemAirconAPI mKnxSystemAirconAPI;
+    private KnxAirconData mKnxAirconData = new KnxAirconData();
+    private KnxAirconControl mKnxAirconControl;
+
+    private class KnxAirconData {
+        private KnxSystemAirconAPI.Data systemAircon;
+
+        public KnxAirconData() {
+            systemAircon = new KnxSystemAirconAPI.Data();
+        }
+    }
+
     //조명(KNX 분전반)
     private KnxAPI mKnxAPI = null;
     private LightControl mLightControl;
@@ -343,7 +375,6 @@ public class DataSenderService extends Service {
                     } else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getReason() == JSON.REASON.Status) {
                         try {
                             JSONObject result = updateRequest(basicData.getMenu(), basicData.getKind(), basicData.getPosition());
-                            mSound.Play(WpadSound.SND.effect.TOUCH_LATCHED);
                             Random rand = new Random();
                             int iValue = rand.nextInt(4);  // 0 <= iValue < 10
                             int menu = basicData.getMenu();
@@ -351,6 +382,7 @@ public class DataSenderService extends Service {
                                     "\"timestamp\" : \"2020-09-08T03:03:04\", " +
                                     "\"ip\" : \"52.33.222.11\", " +
                                     "\"menu\" : 1004, " +
+                                    "\"aircon_status\" : 3, " +
                                     "\"support_auto\" : true, " +
                                     "\"support_cooling\" : true, " +
                                     "\"support_dehumidify\" : true, " +
@@ -1184,11 +1216,66 @@ public class DataSenderService extends Service {
         return result;
     }
 
+    private int controlKnxAircon(int kind, int pos, RequestData reqData) {
+        int result = JSON.ERROR.ResultFail;
+        String category = reqData.getCategory();
+        int state = reqData.getState();
+        int mode = reqData.getNumber();
+        if (kind == 0) { //전체 제어
+            if (category.equalsIgnoreCase("switch")) {
+                result = mKnxAirconControl.Device_AllControl((byte)state);
+            }
+        } else if (kind == 1) {//개별 제어
+            if (category.equalsIgnoreCase("switch")) {
+                Double doubleState = reqData.getDoubleState();
+                result = mKnxAirconControl.Device_SetEachRoomStatus((byte) pos, mode, doubleState);
+            }
+        }
+        return result;
+    }
+
     private int controlPurity(int kind, RequestData reqData) {
         int result = JSON.ERROR.ResultFail;
         String category = reqData.getCategory();
         if (kind == 0) {
             //전체 제어
+            int state = reqData.getState();
+            if (category.equalsIgnoreCase("switch")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDevicePower(onoff);
+            } else if (category.equalsIgnoreCase("auto_air_clean")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceAutoAirClean(onoff);
+            } else if (category.equalsIgnoreCase("reservation")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceReservation(onoff);
+            } else if (category.equalsIgnoreCase("wind")) {
+                result = mVentiControl.ctrlDeviceWindType((byte) state);
+            } else if (category.equalsIgnoreCase("natural_ventil")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceNaturalVentil(onoff);
+            } else if (category.equalsIgnoreCase("auto_ventil")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceAutoVentil(onoff);
+            } else if (category.equalsIgnoreCase("internal_ventil")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceInternalVentil(onoff);
+            } else if (category.equalsIgnoreCase("outair_clean")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceOutAirClean(onoff);
+            } else if (category.equalsIgnoreCase("heater")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceHeater(onoff);
+            } else if (category.equalsIgnoreCase("sleep_mode")) {
+                boolean onoff = state == 0 ? true : false;
+                result = mVentiControl.ctrlDeviceSleepMode(onoff);
+            } else if (category.equalsIgnoreCase("timer")) {
+                result = mVentiControl.ctrlDeviceTimer(state);
+            } else if (category.equalsIgnoreCase("reset_filter")) {
+                result = mVentiControl.ctrlDeviceResetFilter();
+            } else if (category.equalsIgnoreCase("save_shedule")) {
+                result = mVentiControl.Device_SaveSchedule(reqData.getArrayState());
+            }
         } else if (kind == 1) {
             //개별 제어
             if (category.equalsIgnoreCase("switch")) {
@@ -1252,8 +1339,9 @@ public class DataSenderService extends Service {
                 return controlHeating(kind, pos, reqData);
             } else if (menu == JSON.MENU.AIRCON) {
                 //에어컨 상태, 제어
-                return controlAircon(kind, pos, reqData);
-            } else if (menu == JSON.MENU.PURITY) {
+                //return controlAircon(kind, pos, reqData);
+                return controlKnxAircon(kind, pos, reqData);
+            } else if (menu == JSON.MENU.VENTI) {
                 //환기 상태, 제어
                 return controlPurity(kind, reqData);
             } else if (menu == JSON.MENU.GAS) {
@@ -1262,10 +1350,10 @@ public class DataSenderService extends Service {
             }
         } catch (JSONException e) {
             e.printStackTrace();
-            return -1000;
+            return JSON.ERROR.JsonException;
         } catch (Exception e) {
             e.printStackTrace();
-            return -1000;
+            return JSON.ERROR.Exception;
         }
         return -1;
     }
@@ -1490,9 +1578,96 @@ public class DataSenderService extends Service {
         return jsonObject;
     }
 
-    private JSONObject updatePurity(int kind, int position) {
-        int roomCount = mHeatingV2API.data.Device.info.RoomCount;
+    private JSONObject updateKnxAircon(int kind, int pos) {
+        int roomCount = mKnxSystemAirconAPI.data.Device.info.InsideAirconCount;
         JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.accumulate("type", "updateResponse");
+            jsonObject.accumulate("timestamp", millToDate(System.currentTimeMillis()));
+            jsonObject.accumulate("ip", myIP);
+            jsonObject.accumulate("menu", JSON.MENU.AIRCON);
+            JSONArray dataArray = new JSONArray();
+            if (kind == 0) {        //전체 응답
+                for (int i = 0; i < roomCount; i++) {
+                    // build jsonObject
+                    JSONObject dataObject = new JSONObject();
+                    dataObject.accumulate("roomNumber", i);
+                    dataObject.accumulate("power", mKnxSystemAirconAPI.data.Device.Aircon[i].OnOff);
+                    dataObject.accumulate("mode", mKnxSystemAirconAPI.data.Device.Aircon[i].Mode);
+                    dataObject.accumulate("airvol", mKnxSystemAirconAPI.data.Device.Aircon[i].Volume);
+                    dataObject.accumulate("setTemp", mKnxSystemAirconAPI.data.Device.Aircon[i].SetTemp);
+                    dataObject.accumulate("NowTemp", mKnxSystemAirconAPI.data.Device.Aircon[i].NowTemp);
+                    dataArray.put(dataObject);
+                }
+            } else if (kind == 1) {
+                // build jsonObject
+                JSONObject dataObject = new JSONObject();
+                dataObject.accumulate("roomNumber", pos);
+                dataObject.accumulate("power", mKnxSystemAirconAPI.data.Device.Aircon[pos].OnOff);
+                dataObject.accumulate("mode", mKnxSystemAirconAPI.data.Device.Aircon[pos].Mode);
+                dataObject.accumulate("airvol", mKnxSystemAirconAPI.data.Device.Aircon[pos].Volume);
+                dataObject.accumulate("setTemp", mKnxSystemAirconAPI.data.Device.Aircon[pos].SetTemp);
+                dataObject.accumulate("NowTemp", mKnxSystemAirconAPI.data.Device.Aircon[pos].NowTemp);
+                dataArray.put(dataObject);
+            }
+            jsonObject.accumulate("data_array", dataArray);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return jsonObject;
+    }
+
+    private JSONObject updateVenti(int kind, int position) {
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.accumulate("type", "updateResponse");
+            jsonObject.accumulate("timestamp", millToDate(System.currentTimeMillis()));
+            jsonObject.accumulate("ip", myIP);
+            jsonObject.accumulate("menu", JSON.MENU.VENTI);
+            jsonObject.accumulate("support_heater", mVentiAPI.data.Support.Heater);
+            jsonObject.accumulate("support_innercycle", mVentiAPI.data.Support.InnerCycle);
+            jsonObject.accumulate("support_outairclean", mVentiAPI.data.Support.OutAirClean);
+            jsonObject.accumulate("support_autodriving", mVentiAPI.data.Support.AutoDriving);
+            jsonObject.accumulate("support_bypass", mVentiAPI.data.Support.ByPass);
+            jsonObject.accumulate("support_filterreset", mVentiAPI.data.Support.FilterReset);
+            jsonObject.accumulate("support_bathroom", mVentiAPI.data.Support.BathRoom);
+            jsonObject.accumulate("support2_windowventi", mVentiAPI.data.Support2.WindowVenti);
+            jsonObject.accumulate("support2_sleepmode", mVentiAPI.data.Support2.SleepMode);
+            jsonObject.accumulate("fault_motorerror", mVentiAPI.data.Fault.MotorError);
+            jsonObject.accumulate("fault_tempsensorerror", mVentiAPI.data.Fault.TempSensorError);
+            jsonObject.accumulate("fault_supplyfanerror", mVentiAPI.data.Fault.SupplyFanError);
+            jsonObject.accumulate("fault_exhaustfanerror", mVentiAPI.data.Fault.ExhaustFanError);
+            jsonObject.accumulate("fault_filterchangefree", mVentiAPI.data.Fault.FilterChangeFree);
+            jsonObject.accumulate("fault_filterchangemedium", mVentiAPI.data.Fault.FilterChangeMedium);
+            jsonObject.accumulate("fault_safemode", mVentiAPI.data.Fault.SafeMode);
+            jsonObject.accumulate("OnOff", mVentiAPI.data.OnOff);
+            jsonObject.accumulate("Reservation", mVentiAPI.data.Reservation);
+            jsonObject.accumulate("Wind", mVentiAPI.data.Wind);
+            jsonObject.accumulate("Sleep", mVentiAPI.data.Sleep);
+            jsonObject.accumulate("Timer", mVentiAPI.data.Timer);
+            jsonObject.accumulate("ByPass", mVentiAPI.data.ByPass);
+            jsonObject.accumulate("HeaterTimeRemaining", mVentiAPI.data.HeaterTimeRemaining);
+            jsonObject.accumulate("HeaterStatus", mVentiAPI.data.HeaterStatus);
+            jsonObject.accumulate("AutoDriving", mVentiAPI.data.AutoDriving);
+            jsonObject.accumulate("BathRoom", mVentiAPI.data.BathRoom);
+            jsonObject.accumulate("InnerCycle", mVentiAPI.data.InnerCycle);
+            jsonObject.accumulate("OutAirClean", mVentiAPI.data.OutAirClean);
+            jsonObject.accumulate("AirCleanAuto", mVentiAPI.data.AirCleanAuto);
+            jsonObject.accumulate("HDCAutoAirClean", mVentiAPI.data.HDCAutoAirClean);
+            JSONArray reserveArray = new JSONArray();
+            byte[] ReserveList = mVentiAPI.GetReservationSchedule();
+            for (int j = 0; j < ReserveList.length; j++) {
+                reserveArray.put(ReserveList[j]);
+            }
+            jsonObject.accumulate("reservationArray", reserveArray);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         return jsonObject;
     }
 
@@ -1585,9 +1760,10 @@ public class DataSenderService extends Service {
             } else if (menu == JSON.MENU.HEATING) {
                 return updateHeating(kind, position);
             } else if (menu == JSON.MENU.AIRCON) {
-                return updateAircon(kind, position);
-            } else if (menu == JSON.MENU.PURITY) {
-                return updatePurity(kind, position);
+                return updateKnxAircon(kind, position);
+                //return updateAircon(kind, position);
+            } else if (menu == JSON.MENU.VENTI) {
+                return updateVenti(kind, position);
             } else if (menu == JSON.MENU.GAS) {
                 return updateGas(kind, position);
             } else if (menu == JSON.MENU.COOKTOP) {
@@ -1711,6 +1887,9 @@ public class DataSenderService extends Service {
     }
 
     public void deviceApiLoad() {
+        WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
+        int nDPType = wds.Get_DistributionPannelType_Info();
+        wds.closeDB();
         try {
             if (mWallPadAPI.Check_Connect()) {
                 if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
@@ -1752,7 +1931,10 @@ public class DataSenderService extends Service {
                 if (retVentil != null && retVentil[0] == 1) {
                     mVentiAPI = mWallPadAPI.Get_VentiController();
                     if (mVentiAPI != null) {
+                        mVentiControl = new VentiControl(mVentiAPI, mContext);
                         mVentiAPI.Refresh(false);
+                        // 3. Data Copy
+                        //mVentilData.VentilStatus = mVentiAPI.data;
                         mVentilation.OnOff = mVentiAPI.data.OnOff;
                         mVentilation.Wind = mVentiAPI.data.Wind;
                     }
@@ -1772,14 +1954,26 @@ public class DataSenderService extends Service {
                     }
                 }
 
-                //에어컨
-                mSystemAirconAPI = mWallPadAPI.Get_AirconController();
+                if (nDPType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
+                    //에어컨
+                    mKnxSystemAirconAPI = mWallPadAPI.Get_KnxAirconController();
 
-                if (mSystemAirconAPI != null) {
-                    mAirconControl = new AirconControl(mSystemAirconAPI);
-                    mSystemAirconAPI.Refresh(SystemAirconAPI.REFRESH_IDX.ALL, false);
-                    // 4. Data Copy
-                    mAirconData.systemAircon = mSystemAirconAPI.data;
+                    if (mKnxSystemAirconAPI != null) {
+                        mKnxAirconControl = new KnxAirconControl(mKnxSystemAirconAPI);
+                        mKnxSystemAirconAPI.Refresh(SystemAirconAPI.REFRESH_IDX.ALL, false);
+                        // 4. Data Copy
+                        mKnxAirconData.systemAircon = mKnxSystemAirconAPI.data;
+                    }
+                }else{
+                    //에어컨
+                    mSystemAirconAPI = mWallPadAPI.Get_AirconController();
+
+                    if (mSystemAirconAPI != null) {
+                        mAirconControl = new AirconControl(mSystemAirconAPI);
+                        mSystemAirconAPI.Refresh(SystemAirconAPI.REFRESH_IDX.ALL, false);
+                        // 4. Data Copy
+                        mAirconData.systemAircon = mSystemAirconAPI.data;
+                    }
                 }
 
                 startRealtimemeterInfo(); // 실시간 검침기 전송 스타트
@@ -1990,107 +2184,8 @@ public class DataSenderService extends Service {
 
             if (mVentiAPI != null) {
                 mVentiAPI.Refresh(false);
-                boolean bChangeTotalState = false;
-
-                String heaterState = "off";
-                String ventilationState = "off";
-                String schedule = "off";
-                String windPower = "off";
-
-                switch (mVentiAPI.data.HeaterStatus) {
-                    case 0:
-                        heaterState = "off";
-                        break;
-                    case 1:
-                        heaterState = "standby";
-                        break;
-                    case 2:
-                        heaterState = "notsupport";
-                        break;
-                    case 3:
-                        heaterState = "on";
-                        break;
-                }
-
-                switch (mVentiAPI.data.Wind) {
-                    case 0:
-                        heaterState = "off";
-                        break;
-                    case 1:
-                        heaterState = "standby";
-                        break;
-                    case 2:
-                        heaterState = "notsupport";
-                        break;
-                    case 3:
-                        heaterState = "on";
-                        break;
-                }
-
-                if (mVentiAPI.data.OnOff) {
-                    ventilationState = "on";
-                    if (mVentiAPI.data.Reservation) {
-                        schedule = "on";
-                    }
-                } else {
-                    ventilationState = "off";
-                    if (mVentiAPI.data.Reservation) {
-                        schedule = "on";
-                    }
-                }
-
-                JSONArray errorArray = new JSONArray();
-
-                if (mVentiAPI.data.Fault.FilterChangeFree) {
-                    errorArray.put("filter_free");
-                }
-                if (mVentiAPI.data.Fault.FilterChangeMedium) {
-                    errorArray.put("filter_medium");
-                }
-                if (mVentiAPI.data.Fault.MotorError) {
-                    errorArray.put("moter_error");
-                }
-                if (mVentiAPI.data.Fault.TempSensorError) {
-                    errorArray.put("temperature_sensor_error");
-                }
-                if (mVentiAPI.data.Fault.SafeMode) {
-                    errorArray.put("safe_mode");
-                }
-                if (mVentiAPI.data.Fault.SupplyFanError) {
-                    errorArray.put("supply_fan_error");
-                }
-                if (mVentiAPI.data.Fault.ExhaustFanError) {
-                    errorArray.put("return_fan_error");
-                }
-
-                // build jsonObject
-                JSONObject jsonObject = new JSONObject();
-                try {
-                    jsonObject.accumulate("heaterState", heaterState);
-                    jsonObject.accumulate("heaterRemainingTime", mVentiAPI.data.HeaterTimeRemaining);
-                    jsonObject.accumulate("ventilationState", ventilationState);
-                    jsonObject.accumulate("schedule", ventilationState);
-                    jsonObject.accumulate("recirculation", mVentiAPI.data.InnerCycle == true ? "on" : "off");
-                    jsonObject.accumulate("mixCirculation", mVentiAPI.data.OutAirClean == true ? "on" : "off");
-                    jsonObject.accumulate("freshAir", mVentiAPI.data.ByPass == true ? "on" : "off");
-                    jsonObject.accumulate("autoVentilation", mVentiAPI.data.AutoDriving == true ? "on" : "off");
-                    jsonObject.accumulate("bathroomExhaust", mVentiAPI.data.BathRoom == true ? "on" : "off");
-                    jsonObject.accumulate("autoAirCleaning", mVentiAPI.data.AirCleanAuto == true ? "on" : "off");
-                    jsonObject.accumulate("windPower", mVentiAPI.data.Wind);
-                    jsonObject.accumulate("sleepMode", mVentiAPI.data.Sleep == 0 ? "off" : "on");
-                    jsonObject.accumulate("etcControl", mVentiAPI.data.EtcCtr == 0 ? "off" : "on");
-                    jsonObject.accumulate("timer", mVentiAPI.data.Timer);
-                    jsonObject.accumulate("errorCode", errorArray);
-                } catch (JSONException e) {
-                    e.printStackTrace();
-                }
-                SendData("icon", "controller", "ventilation", "control", jsonObject, 2);
-
-                bChangeTotalState = true;
-
-                //데이터 저장
-                if (bChangeTotalState == true) {
-                }
+                // 4. Data Copy
+                //mVentilData.VentilStatus = mVentiAPI.data;
             } else {
                 mVentiAPI = mWallPadAPI.Get_VentiController();
             }
@@ -2877,6 +2972,7 @@ public class DataSenderService extends Service {
                     // 디바이스 연결
                     case define.NOTIFY_DEVICECONNECTED:
                         Log.d(TAG, "[mMobileEventBR] ========== DeviceService Complite!! ==========");
+                        deviceApiLoad();
                         break;
 
                     // 도어락 문열림
@@ -3074,9 +3170,11 @@ public class DataSenderService extends Service {
                     if (mSdb_LivingRoomLightAPI != null)
                         mSdb_LivingRoomLightAPI.regChangedBR(BrID.BR_SDB_LIVING_EVENT);
                     if (mSdbAPI != null) mSdbAPI.regChangedBR(BrID.BR_SDB_EVENT);
+                    if (mAirconData != null) mSystemAirconAPI.regChangedBR(BrID.BR_AIRCON);
                 } else if (nDPType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
                     // KNX 분전반
                     if (mKnxAPI != null) mKnxAPI.regChangedBR(BrID.BR_KNX_EVENT);
+                    if (mKnxAirconData != null) mKnxSystemAirconAPI.regChangedBR(BrID.BR_AIRCON);
                 }
             } else {
 
@@ -3085,9 +3183,8 @@ public class DataSenderService extends Service {
             if (mGasAPI != null) mGasAPI.regChangedBR(BrID.BR_GAS);
             if (mVentiAPI != null) mVentiAPI.regChangedBR(BrID.BR_VENTIL);
             if (mHeatingV2API != null) mHeatingV2API.regChangedBR(BrID.BR_HEATING);
-            if (mAirconData != null) mSystemAirconAPI.regChangedBR(BrID.BR_AIRCON);
-        } catch (
-                Exception e) {
+
+        } catch (Exception e) {
             Log.e(TAG, "[Exception] registerSubcriptionDeviceBR()");
             e.printStackTrace();
         }

+ 0 - 6
WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/control/HeatingControl.java

@@ -166,8 +166,6 @@ public class HeatingControl {
                 ret = Common.JSON.ERROR.Exception;
             }
         }
-        if (ret >= 0) mSound.Play(WpadSound.SND.effect.TOUCH_LATCHED);
-        else mSound.Play(WpadSound.SND.effect.TOUCH_UNLATCHED);
         return ret;
     }
 
@@ -203,8 +201,6 @@ public class HeatingControl {
                 ret = Common.JSON.ERROR.Exception;
             }
         }
-        if (ret >= 0) mSound.Play(WpadSound.SND.effect.TOUCH_LATCHED);
-        else mSound.Play(WpadSound.SND.effect.TOUCH_UNLATCHED);
         return ret;
     }
 
@@ -242,8 +238,6 @@ public class HeatingControl {
                 ret = Common.JSON.ERROR.Exception;
             }
         }
-        if (ret >= 0) mSound.Play(WpadSound.SND.effect.TOUCH_LATCHED);
-        else mSound.Play(WpadSound.SND.effect.TOUCH_UNLATCHED);
         return ret;
     }
 }

+ 4 - 0
WallPadMultiControlService/src/main/java/kr/co/icontrols/wallpadmulticontrolservice/data/RequestData.java

@@ -5,6 +5,7 @@ public class RequestData {
     private int number;
     private int state;
     private double doubleState;
+    private byte[] arrayState;
 
     public String getCategory() {
         return category;
@@ -30,6 +31,9 @@ public class RequestData {
     public void setDoubleState(double doubleState) {
         this.doubleState = doubleState;
     }
+    public byte[] getArrayState() {
+        return arrayState;
+    }
 
     @Override
     public String toString() {