Pārlūkot izejas kodu

[WallPadDevService]
1. 환기(Old , New) 버전을 나눔에 따라 처리
- Old : 상태정보를 받아오면 Normal로 변경(기존 코드)
- New : 일반 환기(대체품이 아닌 환기)와 동일하게 동작
2. 최신 jar 등록(Old 환기 와 New 환기 나눔 Jar)
3. 버전업
- 2022.09.19.01 -> 2022.10.19.01
4. 최신 APK 등록

jglee 2 gadi atpakaļ
vecāks
revīzija
fc90c87cb2

BIN
10_Release/WallPadDevService.apk


BIN
WallPadDevService/libs/WallPadAPIforSVC.jar


+ 1 - 1
WallPadDevService/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.artncore.deviceservice"
     android:versionCode="1"
-    android:versionName="2022.08.23.01">
+    android:versionName="2022.10.25.01">
 
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

+ 2 - 2
WallPadDevService/src/main/java/com/artncore/wallpaddevservice/driver/Knx_Ventilation_Controller.java

@@ -242,7 +242,7 @@ public class Knx_Ventilation_Controller extends DeviceManager {
     }
 
     private int mModelType = Version.MODEL_TYPE.OTHER;
-    private static int mVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL;
+    private static int mVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL_NEW;
     /**
      * 예약운전 지원 여부
      */
@@ -2441,7 +2441,7 @@ public class Knx_Ventilation_Controller extends DeviceManager {
      * @return (int) 환기종류
      */
     private int GetVentilInfo() {
-        int retVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL;
+        int retVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL_NEW;
         try {
             WallpadDeviceSet devset = new WallpadDeviceSet(ServiceMain.svcContext);
             int[] setdata = devset.Get_Ventil_Info();

+ 34 - 41
WallPadDevService/src/main/java/com/artncore/wallpaddevservice/driver/Ventilation_Controller.java

@@ -224,10 +224,13 @@ public class Ventilation_Controller extends DeviceManager {
     }
 
     private int mModelType = Version.MODEL_TYPE.OTHER;
-    private static int mVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL;
+    private static int mVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL_OLD;
     /** 예약운전 지원 여부 */
     private boolean mReservationSupport = false;
-    private int VersionRetryCount = 0;
+    //2022.10.11 jglee - 대체품 환기 기존것도 호환되게 하기위해
+    //설정으로 현재환기 인지 예전 환기인지 확인 하는 것 넣음(설정)
+    //private int VersionRetryCount = 0;
+    private boolean mbisOldVentilation = false;
 
     public class Driver {
         private PollingList Polling;
@@ -262,7 +265,6 @@ public class Ventilation_Controller extends DeviceManager {
             public byte Status;
             public int SearchTryCount;
             public long lHDCAutoAirCleanCheckTimeTick;
-            public long lHDCVersionInfoCheckTimeTick;
 
             private PollingList() {
                 Status = STATUS.First;
@@ -312,6 +314,9 @@ public class Ventilation_Controller extends DeviceManager {
 
         /* 환기 타입 가져오기 */
         mVentilInfo = GetVentilInfo();
+        //jglee - 2022.10.11
+        //여기서 초기버전(상태정보 곧바로 가져오는 버전인지 확인 필요
+        if(mVentilInfo == WallpadDeviceSet.VENTIL_TYPE_NORMAL_OLD) mbisOldVentilation = true;
 
         /* 환기가 후드일 경우 ID 교체 */
         if (mVentilInfo == WallpadDeviceSet.VENTIL_TYPE_HOOD) DEVICE_ADDRESS = (byte)0x68;
@@ -376,41 +381,38 @@ public class Ventilation_Controller extends DeviceManager {
             }
             Sleep(100);
 
-            VERSION Version = Send_GetVersion();
-            if (Version != null) {
-                // 지원 상태를 저장한다.
-                mDriver.Status.Support = new DataClasses.Venti.SUPPORT(Version.Support);
-                mDriver.Version = Version;
-                Log.i(TAG, mDriver.Version.ToDebugString());
-
-                // 룸콘트롤러가 없을 경우 DB에 저장된 값이 예약상태이다.
-                if (!mDriver.Status.Support.RoomController) {
-                    mDriver.Status.Reservation = DB_GetVentiReserveOnOff();
-                }
-
-                // 상태를 가져온다.
-                Sleep(150);
+            VERSION Version;
+            if(mbisOldVentilation)
+            {
                 DataClasses.Venti Status = Send_GetStatus();
                 if (Status != null) {
-                    UpdateVariables(Status);
+                    mDriver.Polling.SetStatus(Driver.PollingList.STATUS.Normal);
                 }
-                mDriver.Polling.SetStatus(Driver.PollingList.STATUS.Normal);
-                VersionRetryCount = 0;
             }
-
-            Version = null;
-            
-            // 2세대 처음 들어간 곳 중에, 버전 정보를 물어보지 않는곳이 발생하여 10번 물어본 후 응답이 없으면 환기 상태를 노멀로 확인
-            if(Version == null)
+            else
             {
-                VersionRetryCount ++;
-            }
+                Version = Send_GetVersion();
+                if (Version != null) {
+                    // 지원 상태를 저장한다.
+                    mDriver.Status.Support = new DataClasses.Venti.SUPPORT(Version.Support);
+                    mDriver.Version = Version;
+                    Log.i(TAG, mDriver.Version.ToDebugString());
+
+                    // 룸콘트롤러가 없을 경우 DB에 저장된 값이 예약상태이다.
+                    if (!mDriver.Status.Support.RoomController) {
+                        mDriver.Status.Reservation = DB_GetVentiReserveOnOff();
+                    }
 
-            if(VersionRetryCount == 5)
-            {
-                VersionRetryCount = 0;
-                mDriver.Polling.SetStatus(Driver.PollingList.STATUS.Normal);
+                    // 상태를 가져온다.
+                    Sleep(150);
+                    DataClasses.Venti Status = Send_GetStatus();
+                    if (Status != null) {
+                        UpdateVariables(Status);
+                    }
+                    mDriver.Polling.SetStatus(Driver.PollingList.STATUS.Normal);
+                }
             }
+            Version = null;
         }
         /* [[ Normal ]]
          * 평상시 */
@@ -426,15 +428,6 @@ public class Ventilation_Controller extends DeviceManager {
                 }
             }
 
-            // 2세대 처음 들어간 곳 중에, 버전 정보를 물어보지 않는곳이 발생하여, 1시간 주기로 확인
-            long currentTimeMillis = 0;
-            currentTimeMillis = System.currentTimeMillis();
-            if (Math.abs(currentTimeMillis - mDriver.Polling.lHDCVersionInfoCheckTimeTick) > lHDCVERSIONINFO_CHECK_TIME_TICK) {
-                CheckVersion();
-                mDriver.Polling.lHDCVersionInfoCheckTimeTick = currentTimeMillis;
-                Sleep(100);
-            }
-
 
             // 환기 예약 기능 관련
             ReservationAction(false);
@@ -2306,7 +2299,7 @@ public class Ventilation_Controller extends DeviceManager {
      * @return (int) 환기종류
      */
     private int GetVentilInfo() {
-        int retVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL;
+        int retVentilInfo = WallpadDeviceSet.VENTIL_TYPE_NORMAL_OLD;
         try {
             WallpadDeviceSet devset = new WallpadDeviceSet(ServiceMain.svcContext);
             int[] setdata = devset.Get_Ventil_Info();