|
@@ -376,8 +376,7 @@ public class DataSenderService extends Service {
|
|
|
outputStream.writeObject(json);
|
|
|
outputStream.close();
|
|
|
Log.d("ServerThread", "result 보냄 : " + result);
|
|
|
- }
|
|
|
- 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 {
|
|
|
JSONObject result = updateRequest(basicData.getMenu(), basicData.getKind(), basicData.getPosition());
|
|
|
Random rand = new Random();
|
|
@@ -415,8 +414,8 @@ public class DataSenderService extends Service {
|
|
|
"\"support_ai\" : true, " +
|
|
|
"\"support_outsidetempuse\" : true, " +
|
|
|
"\"support_boiler\" : true, " +
|
|
|
- "\"boiler_heatwater_temp\" : 60, " +
|
|
|
- "\"boiler_hotwater_temp\" : 50, " +
|
|
|
+ "\"boiler_heatwater_temp\" : 44, " +
|
|
|
+ "\"boiler_hotwater_temp\" : 33, " +
|
|
|
"\"boiler_frost_protect\" : true, " +
|
|
|
"\"boiler_error_code\" : 0, " +
|
|
|
"\"data_seq\" : \"2_3_1_0\", " +
|
|
@@ -424,7 +423,11 @@ public class DataSenderService extends Service {
|
|
|
"{ \"roomNumber\" : 1, \"mode\" : " + 1 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 20, \"reservationArray\" : [0,1,2,3,20], \"sleepTemp\" : 1, \"sleepTime\" : 1 }," +
|
|
|
"{ \"roomNumber\" : 2, \"mode\" : " + 2 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 21, \"reservationArray\" : [0,1,2,3,21], \"sleepTemp\" : 2, \"sleepTime\" : 2 }," +
|
|
|
"{ \"roomNumber\" : 3, \"mode\" : " + 5 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 22, \"reservationArray\" : [0,1,2,3,22], \"sleepTemp\" : 3, \"sleepTime\" : 3 }," +
|
|
|
- "{ \"roomNumber\" : 4, \"mode\" : " + 6 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 23, \"reservationArray\" : [0,1,2,3,23], \"sleepTemp\" : 1, \"sleepTime\" : 4 } ]" +
|
|
|
+ "{ \"roomNumber\" : 4, \"mode\" : " + 6 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 23, \"reservationArray\" : [0,1,2,3,23], \"sleepTemp\" : 1, \"sleepTime\" : 4 }," +
|
|
|
+ "{ \"roomNumber\" : 5, \"mode\" : " + 1 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 24, \"reservationArray\" : [0,1,2,3,20], \"sleepTemp\" : 1, \"sleepTime\" : 1 }," +
|
|
|
+ "{ \"roomNumber\" : 6, \"mode\" : " + 2 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 25, \"reservationArray\" : [0,1,2,3,21], \"sleepTemp\" : 2, \"sleepTime\" : 2 }," +
|
|
|
+ "{ \"roomNumber\" : 7, \"mode\" : " + 5 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 26, \"reservationArray\" : [0,1,2,3,22], \"sleepTemp\" : 3, \"sleepTime\" : 3 }," +
|
|
|
+ "{ \"roomNumber\" : 8, \"mode\" : " + 6 + ", \"setTemp\" : " + iValue + ",\"nowTemp\" : 27, \"reservationArray\" : [0,1,2,3,23], \"sleepTemp\" : 1, \"sleepTime\" : 4 } ]" +
|
|
|
"}";
|
|
|
|
|
|
iValue = rand.nextInt(2);
|
|
@@ -507,8 +510,7 @@ public class DataSenderService extends Service {
|
|
|
outputStream.close();
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }
|
|
|
- else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getMenu() == JSON.MENU.PASSWORD) {
|
|
|
+ } else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getMenu() == JSON.MENU.PASSWORD) {
|
|
|
//비밀번호 변경 요청
|
|
|
int result = passwordChangeRequest(basicData.getNumber());
|
|
|
String json = "";
|
|
@@ -536,8 +538,7 @@ public class DataSenderService extends Service {
|
|
|
outputStream.writeObject(json);
|
|
|
outputStream.close();
|
|
|
Log.d("ServerThread", "result 보냄 : " + result);
|
|
|
- }
|
|
|
- else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getMenu() == JSON.MENU.MOBILE) {
|
|
|
+ } else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getMenu() == JSON.MENU.MOBILE) {
|
|
|
//모바일 등록 관련
|
|
|
int result = updateMobile(basicData.getReason(), basicData.getName(), basicData.getId());
|
|
|
String json = "";
|
|
@@ -565,8 +566,7 @@ public class DataSenderService extends Service {
|
|
|
outputStream.writeObject(json);
|
|
|
outputStream.close();
|
|
|
Log.d("ServerThread", "result 보냄 : " + result);
|
|
|
- }
|
|
|
- else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getMenu() == JSON.MENU.DEVICE_INFO) {
|
|
|
+ } else if (data != null && !data.trim().equals("") && basicData.getType().equalsIgnoreCase("request") && basicData.getMenu() == JSON.MENU.DEVICE_INFO) {
|
|
|
//제어 디바이스 목록 가져오기
|
|
|
String result = getDeviceInfo(basicData.getPosition());
|
|
|
outputStream.writeObject(result);
|
|
@@ -1269,7 +1269,7 @@ public class DataSenderService extends Service {
|
|
|
int mode = reqData.getNumber();
|
|
|
if (kind == 0) { //전체 제어
|
|
|
if (category.equalsIgnoreCase("switch")) {
|
|
|
- result = mKnxAirconControl.Device_AllControl((byte)state);
|
|
|
+ result = mKnxAirconControl.Device_AllControl((byte) state);
|
|
|
}
|
|
|
} else if (kind == 1) {//개별 제어
|
|
|
if (category.equalsIgnoreCase("switch")) {
|
|
@@ -1322,8 +1322,8 @@ public class DataSenderService extends Service {
|
|
|
} else if (category.equalsIgnoreCase("save_shedule")) {
|
|
|
ArrayList<Integer> arrayState = reqData.getArrayState();
|
|
|
byte[] byteArrayState = new byte[arrayState.size()];
|
|
|
- for(int i=0; i<arrayState.size() ; i++){
|
|
|
- byteArrayState[i]=(byte)arrayState.get(i).intValue();
|
|
|
+ for (int i = 0; i < arrayState.size(); i++) {
|
|
|
+ byteArrayState[i] = (byte) arrayState.get(i).intValue();
|
|
|
}
|
|
|
result = mVentiControl.Device_SaveSchedule(byteArrayState);
|
|
|
}
|
|
@@ -1516,7 +1516,7 @@ public class DataSenderService extends Service {
|
|
|
jsonObject.accumulate("support_ai", mHeatingV2API.data.Device.info.Support.AI);
|
|
|
jsonObject.accumulate("support_outsidetempuse", mHeatingV2API.data.Device.info.Support.OutsideTempUse);
|
|
|
jsonObject.accumulate("support_boiler", mHeatingV2API.data.Device.info.Support.Boiler);
|
|
|
- if(mHeatingV2API.data.Device.info.Support.Boiler==true) {
|
|
|
+ if (mHeatingV2API.data.Device.info.Support.Boiler == true) {
|
|
|
jsonObject.accumulate("boiler_heatwater_temp", mHeatingV2API.data.Boiler.HeatingWater.SetTemp);
|
|
|
jsonObject.accumulate("boiler_hotwater_temp", mHeatingV2API.data.Boiler.HotWater.SetTemp);
|
|
|
jsonObject.accumulate("boiler_frost_protect", mHeatingV2API.data.Boiler.bFrostProtectMode);
|
|
@@ -1533,6 +1533,7 @@ public class DataSenderService extends Service {
|
|
|
dataObject.accumulate("mode", mHeatingV2API.data.Device.Room[i].Mode);
|
|
|
dataObject.accumulate("setTemp", mHeatingV2API.data.Device.Room[i].SetTemp);
|
|
|
dataObject.accumulate("nowTemp", mHeatingV2API.data.Device.Room[i].NowTemp);
|
|
|
+ dataObject.accumulate("valveStatus", mHeatingV2API.data.Device.Room[i].bValveStatus);
|
|
|
JSONArray reserveArray = new JSONArray();
|
|
|
for (int j = 0; j < 24; j++) {
|
|
|
if (mHeatingV2API.data.Device.Room[i].Reservation.getSchedule(j)) {
|
|
@@ -1812,24 +1813,18 @@ public class DataSenderService extends Service {
|
|
|
try {
|
|
|
if (menu == JSON.MENU.LIGHT) {
|
|
|
return updateLight(kind, position);
|
|
|
- }
|
|
|
- else if (menu == JSON.MENU.CONCENT) {
|
|
|
+ } else if (menu == JSON.MENU.CONCENT) {
|
|
|
return updateConcent(kind, position);
|
|
|
- }
|
|
|
- else if (menu == JSON.MENU.HEATING) {
|
|
|
+ } else if (menu == JSON.MENU.HEATING) {
|
|
|
return updateHeating(kind, position);
|
|
|
- }
|
|
|
- else if (menu == JSON.MENU.AIRCON) {
|
|
|
+ } else if (menu == JSON.MENU.AIRCON) {
|
|
|
return updateKnxAircon(kind, position);
|
|
|
//return updateAircon(kind, position);
|
|
|
- }
|
|
|
- else if (menu == JSON.MENU.VENTI) {
|
|
|
+ } 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);
|
|
|
- }
|
|
|
- else if (menu == JSON.MENU.COOKTOP) {
|
|
|
+ } else if (menu == JSON.MENU.COOKTOP) {
|
|
|
return updateCookTop(kind, position);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -1862,10 +1857,9 @@ public class DataSenderService extends Service {
|
|
|
//모바일 등록
|
|
|
//DB에 저장 필요
|
|
|
wallpadMobileDeviceData.Register(id, name);
|
|
|
- }
|
|
|
- else if (reason == JSON.REASON.MobileDelete) {
|
|
|
+ } else if (reason == JSON.REASON.MobileDelete) {
|
|
|
//모바일 전체 삭제
|
|
|
- if(id.equals("all")){
|
|
|
+ if (id.equals("all")) {
|
|
|
wallpadMobileDeviceData.UnRegisterAll();
|
|
|
}
|
|
|
//모바일 개별 삭제
|
|
@@ -1882,10 +1876,11 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
|
|
|
private String getDeviceInfo(int index) {
|
|
|
- String strResult = null;
|
|
|
+ String strResult = "";
|
|
|
try {
|
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
- String[] devlist = {"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop"};
|
|
|
+ String[] devlist = {"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop", "sysaircon"};
|
|
|
+
|
|
|
for (int i = 0; i < devlist.length; i++) {
|
|
|
if (devlist[i].equals("cooktop")) {
|
|
|
if (mWallPadAPI.GetGasKind() == 1) {
|
|
@@ -1894,142 +1889,135 @@ public class DataSenderService extends Service {
|
|
|
if (Gasinfo == 1) {
|
|
|
// 사용함
|
|
|
if (bGasAsCooktopOutlet) {
|
|
|
- strResult +=" <devinfo name=\"gas\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- strResult +=" <devinfo name=\"cooktop\" value=\"1\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- else {
|
|
|
- strResult +=" <devinfo name=\"gas\" value=\"1\" floor=\""+index+"\"/>\r\n";
|
|
|
- strResult +=" <devinfo name=\"cooktop\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"gas\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"cooktop\" value=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } else {
|
|
|
+ strResult += " <devinfo name=\"gas\" value=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"cooktop\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
// 사용안함
|
|
|
- strResult +=" <devinfo name=\"gas\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- strResult +=" <devinfo name=\"cooktop\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"gas\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"cooktop\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- }
|
|
|
- else if (mWallPadAPI.GetGasKind() == 2) {
|
|
|
+ } else if (mWallPadAPI.GetGasKind() == 2) {
|
|
|
// 하이브리드 쿡탑
|
|
|
if (mCooktopAPI != null) {
|
|
|
- int nGas = 0; int nOutlet = 0;
|
|
|
+ int nGas = 0;
|
|
|
+ int nOutlet = 0;
|
|
|
for (int j = 0; j < mCooktopAPI.data.DeviceCnt; j++) {
|
|
|
for (int k = 0; k < mCooktopAPI.data.DeviceCnt; k++) {
|
|
|
- if (mCooktopAPI.data.Device[j].circuit[i].hType == DataClasses.CooktopCtrl.DEVICE_TYPE.GASVALVE) nGas++;
|
|
|
- else if (mCooktopAPI.data.Device[j].circuit[i].hType == DataClasses.CooktopCtrl.DEVICE_TYPE.OUTLET) nOutlet++;
|
|
|
+ if (mCooktopAPI.data.Device[j].circuit[i].hType == DataClasses.CooktopCtrl.DEVICE_TYPE.GASVALVE)
|
|
|
+ nGas++;
|
|
|
+ else if (mCooktopAPI.data.Device[j].circuit[i].hType == DataClasses.CooktopCtrl.DEVICE_TYPE.OUTLET)
|
|
|
+ nOutlet++;
|
|
|
}
|
|
|
}
|
|
|
- strResult +=" <devinfo name=\"gas\" value=\"" + nGas + "\" floor=\""+index+"\"/>\r\n";
|
|
|
- strResult +=" <devinfo name=\"cooktop\" value=\"" + nOutlet + "\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"gas\" value=\"" + nGas + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"cooktop\" value=\"" + nOutlet + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
+ } else {
|
|
|
+ strResult += " <devinfo name=\"gas\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"cooktop\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- else {
|
|
|
- strResult +=" <devinfo name=\"gas\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- strResult +=" <devinfo name=\"cooktop\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- }
|
|
|
- else if (devlist[i].equals("doorlock")) {
|
|
|
+ } else if (devlist[i].equals("doorlock")) {
|
|
|
try {
|
|
|
int[] DoorLockInfo = devSet.Get_DoorLock_Info();
|
|
|
if ((DoorLockInfo[0] == 1) && (DoorLockInfo[1] == WallpadDeviceSet.DOORLOCK_TYPE_NORMAL)) {
|
|
|
- strResult +=" <devinfo name=\"doorlock\" value=\"1\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- else {
|
|
|
- strResult +=" <devinfo name=\"doorlock\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"doorlock\" value=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } else {
|
|
|
+ strResult += " <devinfo name=\"doorlock\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult +=" <devinfo name=\"doorlock\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"doorlock\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult +=" <devinfo name=\"doorlock\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"doorlock\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- }
|
|
|
- else if (devlist[i].equals("light")) {
|
|
|
+ } else if (devlist[i].equals("light")) {
|
|
|
try {
|
|
|
if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
- strResult += " <devinfo name=\"light\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- Log.w(TAG, "[iCMDProcDevList] Not supported!!");
|
|
|
+ strResult += " <devinfo name=\"light\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ Log.w(TAG, "[iCMDProcDevList] Not supported!!");
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult +=" <devinfo name=\"light\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"light\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult +=" <devinfo name=\"light\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"light\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- }
|
|
|
- else if (devlist[i].equals("livinglight")) {
|
|
|
+ } else if (devlist[i].equals("livinglight")) {
|
|
|
try {
|
|
|
int[] lightinfo = devSet.Get_Light_info();
|
|
|
if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
- strResult += " <devinfo name=\"livinglight\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- Log.w(TAG, "[iCMDProcDevList] Not supported!!");
|
|
|
+ strResult += " <devinfo name=\"livinglight\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ Log.w(TAG, "[iCMDProcDevList] Not supported!!");
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult +=" <devinfo name=\"livinglight\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"livinglight\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult +=" <devinfo name=\"livinglight\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"livinglight\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- }
|
|
|
- else if (devlist[i].equals("ventil")) {
|
|
|
+ } else if (devlist[i].equals("ventil")) {
|
|
|
try {
|
|
|
int[] Ventilinfo = devSet.Get_Ventil_Info();
|
|
|
- if (Ventilinfo[0] == 0) strResult +=" <devinfo name=\"ventil\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- else strResult +=" <devinfo name=\"ventil\" value=\"1\" floor=\""+index+"\"/>\r\n";
|
|
|
+ if (Ventilinfo[0] == 0)
|
|
|
+ strResult += " <devinfo name=\"ventil\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ else
|
|
|
+ strResult += " <devinfo name=\"ventil\" value=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult +=" <devinfo name=\"ventil\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"ventil\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult +=" <devinfo name=\"ventil\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"ventil\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- }
|
|
|
- else if (devlist[i].equals("thermostat")) {
|
|
|
+ } else if (devlist[i].equals("thermostat")) {
|
|
|
try {
|
|
|
int Temperinfo = devSet.Get_Temper_Info();
|
|
|
byte RoomCount = 0;
|
|
|
if (mHeatingV2API != null) {
|
|
|
RoomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
|
}
|
|
|
- if (Temperinfo == 0) strResult += " <devinfo name=\"thermostat\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- else strResult +=" <devinfo name=\"thermostat\" value=\""+RoomCount+"\" floor=\""+index+"\"/>\r\n";
|
|
|
+ if (Temperinfo == 0)
|
|
|
+ strResult += " <devinfo name=\"thermostat\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ else
|
|
|
+ strResult += " <devinfo name=\"thermostat\" value=\"" + RoomCount + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult += " <devinfo name=\"thermostat\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"thermostat\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult += " <devinfo name=\"thermostat\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"thermostat\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("curtain")) {
|
|
|
try {
|
|
|
int[] Curtaininfo = devSet.Get_CURTAIN_Info();
|
|
|
- if (Curtaininfo[0] == 0) strResult += " <devinfo name=\"curtain\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- else strResult += " <devinfo name=\"curtain\" value=\"1\" floor=\""+index+"\"/>\r\n";
|
|
|
+ if (Curtaininfo[0] == 0)
|
|
|
+ strResult += " <devinfo name=\"curtain\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ else
|
|
|
+ strResult += " <devinfo name=\"curtain\" value=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult += " <devinfo name=\"curtain\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"curtain\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult += " <devinfo name=\"curtain\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"curtain\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("electric")) {
|
|
@@ -2037,10 +2025,10 @@ public class DataSenderService extends Service {
|
|
|
// 콘센트 처리
|
|
|
int BadConcentCount = 0;
|
|
|
if (mKnxAPI != null) {
|
|
|
- if (mKnxAPI.data.LivingRoom_EnergyMeter!=null&&mKnxAPI.data.LivingRoom_EnergyMeter.Info.ConcentCount > 0) {
|
|
|
+ if (mKnxAPI.data.LivingRoom_EnergyMeter != null && mKnxAPI.data.LivingRoom_EnergyMeter.Info.ConcentCount > 0) {
|
|
|
BadConcentCount = 1;
|
|
|
}
|
|
|
- if(mKnxAPI.data.MasterController!=null) {
|
|
|
+ if (mKnxAPI.data.MasterController != null) {
|
|
|
int BadConCount = mKnxAPI.data.MasterController.Info.Bad_EnergyMeterCount;
|
|
|
for (int k = 0; k < BadConCount; k++) {
|
|
|
if (mKnxAPI.data.BadRoom_EnergyMeter[k].Info.ConcentCount > 0)
|
|
@@ -2048,20 +2036,19 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
}
|
|
|
Log.e(TAG, "[yskim] iCMDProcDevList() electric : " + BadConcentCount);
|
|
|
- strResult += " <devinfo name=\"electric\" value=\"" + BadConcentCount + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"electric\" value=\"" + BadConcentCount + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- strResult += " <devinfo name=\"electric\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
- }
|
|
|
- catch (Exception e) {
|
|
|
+ strResult += " <devinfo name=\"electric\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } catch (Exception e) {
|
|
|
//e.printStackTrace();
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- strResult += " <devinfo name=\"electric\" value=\"0\" floor=\""+index+"\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"electric\" value=\"0\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("smartlight")) {
|
|
|
- // KNX 조명 처리
|
|
|
+ // KNX 조명 처리
|
|
|
try {
|
|
|
if (mKnxAPI != null) {
|
|
|
if (mKnxAPI.data == null)
|
|
@@ -2072,18 +2059,31 @@ public class DataSenderService extends Service {
|
|
|
if (mKnxAPI.data.LivingRoom_EnergyMeter.Info.Install == false) {
|
|
|
Log.w(TAG, "[Registration_Light_NewLiv]mData.LivingRoom_EnergyMeter.Info.Install == false");
|
|
|
} else {
|
|
|
- if(mKnxAPI.data.LivingRoom_EnergyMeter.Info.LightCount > 0)
|
|
|
+ if (mKnxAPI.data.LivingRoom_EnergyMeter.Info.LightCount > 0)
|
|
|
LivingLightCount = 1;
|
|
|
}
|
|
|
- int AllEMcount = LivingLightCount + mKnxAPI.data.MasterController.Info.Bad_EnergyMeterCount ; // + KnxApi.data.MasterController.Info.Liv_EnergyMeterCount;
|
|
|
- strResult += " <devinfo name=\"smartlight\" value=\"" + AllEMcount + "\"/>\r\n";
|
|
|
+ int AllEMcount = LivingLightCount + mKnxAPI.data.MasterController.Info.Bad_EnergyMeterCount; // + KnxApi.data.MasterController.Info.Liv_EnergyMeterCount;
|
|
|
+ strResult += " <devinfo name=\"smartlight\" value=\"" + AllEMcount + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
+ } catch (Exception ek) {
|
|
|
+ strResult += " <devinfo name=\"smartlight\" value=\"" + AllEMcount + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
- catch( Exception ek )
|
|
|
- {
|
|
|
-
|
|
|
+ }
|
|
|
+ else if (devlist[i].equals("sysaircon")) {
|
|
|
+ // 에어컨 처리
|
|
|
+ KnxSystemAirconAPI airconAPI = mWallPadAPI.Get_KnxAirconController();
|
|
|
+ if (airconAPI != null) {
|
|
|
+ int nCount = airconAPI.data.Device.info.InsideAirconCount;
|
|
|
+ Log.e(TAG, "[yskim] iCMDProcDevList() sysaircon : " + nCount);
|
|
|
+ // 현대건설 에어컨 처리, 포트가 다르기 때문에 구분해서 처리 필요, 에어컨 API가 동일하다면 그럴 필요는 없음
|
|
|
+ strResult += " <devinfo name=\"sysaircon\" value=\"" + nCount + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ } else {
|
|
|
+ strResult += " <devinfo name=\"sysaircon\" value=\"" + 0 + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
}
|
|
|
+ //방범, 센서 여부 응답(고급주택은 사용하지 않아 value 0으로 처리
|
|
|
+ strResult += " <devinfo name=\"mode\" value=\"" + 0 + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
+ strResult += " <devinfo name=\"sensor\" value=\"" + 0 + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
devSet.closeDB();
|
|
|
|
|
@@ -2188,7 +2188,9 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /** 가스밸브를 쿡탑콘센트로 사용 */
|
|
|
+ /**
|
|
|
+ * 가스밸브를 쿡탑콘센트로 사용
|
|
|
+ */
|
|
|
private boolean bGasAsCooktopOutlet = false; // 쿡탑콘센트에 가스밸브 프로토콜이 적용된 경우
|
|
|
|
|
|
public void deviceApiLoad() {
|
|
@@ -2270,7 +2272,7 @@ public class DataSenderService extends Service {
|
|
|
// 4. Data Copy
|
|
|
mKnxAirconData.systemAircon = mKnxSystemAirconAPI.data;
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//에어컨
|
|
|
mSystemAirconAPI = mWallPadAPI.Get_AirconController();
|
|
|
|