|
@@ -15,6 +15,7 @@ import android.util.Log;
|
|
import com.artncore.WallPadDataMgr.WallpadDeviceSet;
|
|
import com.artncore.WallPadDataMgr.WallpadDeviceSet;
|
|
import com.artncore.WallPadDataMgr.WallpadStatusData;
|
|
import com.artncore.WallPadDataMgr.WallpadStatusData;
|
|
import com.artncore.WallPadDataMgr.wallpaddbmgr;
|
|
import com.artncore.WallPadDataMgr.wallpaddbmgr;
|
|
|
|
+import com.artncore.commons.API_Menu;
|
|
import com.artncore.commons.DataClasses;
|
|
import com.artncore.commons.DataClasses;
|
|
import com.artncore.commons.KNX_DataClasses;
|
|
import com.artncore.commons.KNX_DataClasses;
|
|
import com.artncore.commons.define;
|
|
import com.artncore.commons.define;
|
|
@@ -25,6 +26,7 @@ import com.artncore.wallpadapi.GasAPI;
|
|
import com.artncore.wallpadapi.HeatingV2API;
|
|
import com.artncore.wallpadapi.HeatingV2API;
|
|
import com.artncore.wallpadapi.IGW300API;
|
|
import com.artncore.wallpadapi.IGW300API;
|
|
import com.artncore.wallpadapi.KnxAPI;
|
|
import com.artncore.wallpadapi.KnxAPI;
|
|
|
|
+import com.artncore.wallpadapi.KnxSystemAirconAPI;
|
|
import com.artncore.wallpadapi.RealTimeMeterAPI;
|
|
import com.artncore.wallpadapi.RealTimeMeterAPI;
|
|
import com.artncore.wallpadapi.SdbAPI;
|
|
import com.artncore.wallpadapi.SdbAPI;
|
|
import com.artncore.wallpadapi.Sdb_LivingRoomLightAPI;
|
|
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.AirconControl;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.control.HeatingControl;
|
|
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.LightControl;
|
|
|
|
+import kr.co.icontrols.wallpadmulticontrolservice.control.VentiControl;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.data.BasicData;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.data.BasicData;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.data.RequestData;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.data.RequestData;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.Common.JSON;
|
|
import kr.co.icontrols.wallpadmulticontrolservice.Common.JSON;
|
|
@@ -111,7 +115,22 @@ public class DataSenderService extends Service {
|
|
|
|
|
|
// 환기
|
|
// 환기
|
|
private VentiAPI mVentiAPI = null;
|
|
private VentiAPI mVentiAPI = null;
|
|
|
|
+ private VentiControl mVentiControl;
|
|
public Ventilation mVentilation = new Ventilation();
|
|
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 {
|
|
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 분전반)
|
|
//조명(KNX 분전반)
|
|
private KnxAPI mKnxAPI = null;
|
|
private KnxAPI mKnxAPI = null;
|
|
private LightControl mLightControl;
|
|
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) {
|
|
} else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getReason() == JSON.REASON.Status) {
|
|
try {
|
|
try {
|
|
JSONObject result = updateRequest(basicData.getMenu(), basicData.getKind(), basicData.getPosition());
|
|
JSONObject result = updateRequest(basicData.getMenu(), basicData.getKind(), basicData.getPosition());
|
|
- mSound.Play(WpadSound.SND.effect.TOUCH_LATCHED);
|
|
|
|
Random rand = new Random();
|
|
Random rand = new Random();
|
|
int iValue = rand.nextInt(4); // 0 <= iValue < 10
|
|
int iValue = rand.nextInt(4); // 0 <= iValue < 10
|
|
int menu = basicData.getMenu();
|
|
int menu = basicData.getMenu();
|
|
@@ -351,6 +382,7 @@ public class DataSenderService extends Service {
|
|
"\"timestamp\" : \"2020-09-08T03:03:04\", " +
|
|
"\"timestamp\" : \"2020-09-08T03:03:04\", " +
|
|
"\"ip\" : \"52.33.222.11\", " +
|
|
"\"ip\" : \"52.33.222.11\", " +
|
|
"\"menu\" : 1004, " +
|
|
"\"menu\" : 1004, " +
|
|
|
|
+ "\"aircon_status\" : 3, " +
|
|
"\"support_auto\" : true, " +
|
|
"\"support_auto\" : true, " +
|
|
"\"support_cooling\" : true, " +
|
|
"\"support_cooling\" : true, " +
|
|
"\"support_dehumidify\" : true, " +
|
|
"\"support_dehumidify\" : true, " +
|
|
@@ -1184,11 +1216,66 @@ public class DataSenderService extends Service {
|
|
return result;
|
|
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) {
|
|
private int controlPurity(int kind, RequestData reqData) {
|
|
int result = JSON.ERROR.ResultFail;
|
|
int result = JSON.ERROR.ResultFail;
|
|
String category = reqData.getCategory();
|
|
String category = reqData.getCategory();
|
|
if (kind == 0) {
|
|
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) {
|
|
} else if (kind == 1) {
|
|
//개별 제어
|
|
//개별 제어
|
|
if (category.equalsIgnoreCase("switch")) {
|
|
if (category.equalsIgnoreCase("switch")) {
|
|
@@ -1252,8 +1339,9 @@ public class DataSenderService extends Service {
|
|
return controlHeating(kind, pos, reqData);
|
|
return controlHeating(kind, pos, reqData);
|
|
} else if (menu == JSON.MENU.AIRCON) {
|
|
} 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);
|
|
return controlPurity(kind, reqData);
|
|
} else if (menu == JSON.MENU.GAS) {
|
|
} else if (menu == JSON.MENU.GAS) {
|
|
@@ -1262,10 +1350,10 @@ public class DataSenderService extends Service {
|
|
}
|
|
}
|
|
} catch (JSONException e) {
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- return -1000;
|
|
|
|
|
|
+ return JSON.ERROR.JsonException;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- return -1000;
|
|
|
|
|
|
+ return JSON.ERROR.Exception;
|
|
}
|
|
}
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
@@ -1490,9 +1578,96 @@ public class DataSenderService extends Service {
|
|
return jsonObject;
|
|
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();
|
|
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;
|
|
return jsonObject;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1585,9 +1760,10 @@ public class DataSenderService extends Service {
|
|
} else if (menu == JSON.MENU.HEATING) {
|
|
} else if (menu == JSON.MENU.HEATING) {
|
|
return updateHeating(kind, position);
|
|
return updateHeating(kind, position);
|
|
} else if (menu == JSON.MENU.AIRCON) {
|
|
} 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) {
|
|
} else if (menu == JSON.MENU.GAS) {
|
|
return updateGas(kind, position);
|
|
return updateGas(kind, position);
|
|
} else if (menu == JSON.MENU.COOKTOP) {
|
|
} else if (menu == JSON.MENU.COOKTOP) {
|
|
@@ -1711,6 +1887,9 @@ public class DataSenderService extends Service {
|
|
}
|
|
}
|
|
|
|
|
|
public void deviceApiLoad() {
|
|
public void deviceApiLoad() {
|
|
|
|
+ WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
|
|
|
|
+ int nDPType = wds.Get_DistributionPannelType_Info();
|
|
|
|
+ wds.closeDB();
|
|
try {
|
|
try {
|
|
if (mWallPadAPI.Check_Connect()) {
|
|
if (mWallPadAPI.Check_Connect()) {
|
|
if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
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) {
|
|
if (retVentil != null && retVentil[0] == 1) {
|
|
mVentiAPI = mWallPadAPI.Get_VentiController();
|
|
mVentiAPI = mWallPadAPI.Get_VentiController();
|
|
if (mVentiAPI != null) {
|
|
if (mVentiAPI != null) {
|
|
|
|
+ mVentiControl = new VentiControl(mVentiAPI, mContext);
|
|
mVentiAPI.Refresh(false);
|
|
mVentiAPI.Refresh(false);
|
|
|
|
+ // 3. Data Copy
|
|
|
|
+ //mVentilData.VentilStatus = mVentiAPI.data;
|
|
mVentilation.OnOff = mVentiAPI.data.OnOff;
|
|
mVentilation.OnOff = mVentiAPI.data.OnOff;
|
|
mVentilation.Wind = mVentiAPI.data.Wind;
|
|
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(); // 실시간 검침기 전송 스타트
|
|
startRealtimemeterInfo(); // 실시간 검침기 전송 스타트
|
|
@@ -1990,107 +2184,8 @@ public class DataSenderService extends Service {
|
|
|
|
|
|
if (mVentiAPI != null) {
|
|
if (mVentiAPI != null) {
|
|
mVentiAPI.Refresh(false);
|
|
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 {
|
|
} else {
|
|
mVentiAPI = mWallPadAPI.Get_VentiController();
|
|
mVentiAPI = mWallPadAPI.Get_VentiController();
|
|
}
|
|
}
|
|
@@ -2877,6 +2972,7 @@ public class DataSenderService extends Service {
|
|
// 디바이스 연결
|
|
// 디바이스 연결
|
|
case define.NOTIFY_DEVICECONNECTED:
|
|
case define.NOTIFY_DEVICECONNECTED:
|
|
Log.d(TAG, "[mMobileEventBR] ========== DeviceService Complite!! ==========");
|
|
Log.d(TAG, "[mMobileEventBR] ========== DeviceService Complite!! ==========");
|
|
|
|
+ deviceApiLoad();
|
|
break;
|
|
break;
|
|
|
|
|
|
// 도어락 문열림
|
|
// 도어락 문열림
|
|
@@ -3074,9 +3170,11 @@ public class DataSenderService extends Service {
|
|
if (mSdb_LivingRoomLightAPI != null)
|
|
if (mSdb_LivingRoomLightAPI != null)
|
|
mSdb_LivingRoomLightAPI.regChangedBR(BrID.BR_SDB_LIVING_EVENT);
|
|
mSdb_LivingRoomLightAPI.regChangedBR(BrID.BR_SDB_LIVING_EVENT);
|
|
if (mSdbAPI != null) mSdbAPI.regChangedBR(BrID.BR_SDB_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) {
|
|
} else if (nDPType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
|
|
// KNX 분전반
|
|
// KNX 분전반
|
|
if (mKnxAPI != null) mKnxAPI.regChangedBR(BrID.BR_KNX_EVENT);
|
|
if (mKnxAPI != null) mKnxAPI.regChangedBR(BrID.BR_KNX_EVENT);
|
|
|
|
+ if (mKnxAirconData != null) mKnxSystemAirconAPI.regChangedBR(BrID.BR_AIRCON);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
|
|
@@ -3085,9 +3183,8 @@ public class DataSenderService extends Service {
|
|
if (mGasAPI != null) mGasAPI.regChangedBR(BrID.BR_GAS);
|
|
if (mGasAPI != null) mGasAPI.regChangedBR(BrID.BR_GAS);
|
|
if (mVentiAPI != null) mVentiAPI.regChangedBR(BrID.BR_VENTIL);
|
|
if (mVentiAPI != null) mVentiAPI.regChangedBR(BrID.BR_VENTIL);
|
|
if (mHeatingV2API != null) mHeatingV2API.regChangedBR(BrID.BR_HEATING);
|
|
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()");
|
|
Log.e(TAG, "[Exception] registerSubcriptionDeviceBR()");
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|