|
@@ -495,13 +495,13 @@ public class DataSenderService extends Service {
|
|
|
"{ \"hID\" : 3, \"hStatus\" : 2, \"hType\" : " + iValue + ", \"hErrorStatus\" : 0} ]" +
|
|
|
"}";
|
|
|
|
|
|
- //outputStream.writeObject(result.toString());
|
|
|
+ outputStream.writeObject(result.toString());
|
|
|
String resultTemp;
|
|
|
if (menu == 1003) resultTemp = sampleHeatingResult;
|
|
|
else if (menu == 1001) resultTemp = sampleLightResult;
|
|
|
else if (menu == 1006) resultTemp = sampleCookTopResult;
|
|
|
else resultTemp = sampleAirconResult;
|
|
|
- outputStream.writeObject(resultTemp);
|
|
|
+ //outputStream.writeObject(resultTemp);
|
|
|
outputStream.close();
|
|
|
Log.d("ServerThread", "result 보냄 : " + resultTemp);
|
|
|
} catch (Exception e) {
|
|
@@ -1557,7 +1557,7 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
+ //서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
if (strValue != null) {
|
|
|
strHeating = strValue[1].substring((strValue[1].indexOf("난방(") + 3), (strValue[1].indexOf(")에어컨(")));
|
|
|
|
|
@@ -1984,18 +1984,29 @@ public class DataSenderService extends Service {
|
|
|
|
|
|
private String getDeviceInfo(int index) {
|
|
|
String strResult = "";
|
|
|
+ String strLight = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
+ String strHeating = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
+ String strAircon = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
+ Log.d(TAG, "[getDeviceInfo] Start !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
|
try {
|
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
int nConcentEnable = devSet.Get_Concent_Info(); // 콘센트 사용 유무
|
|
|
+ int Gasinfo = devSet.Get_GAS_Info();
|
|
|
+ int[] DoorLockInfo = devSet.Get_DoorLock_Info();
|
|
|
+ int[] lightinfo = devSet.Get_Light_info();
|
|
|
+ int[] Ventilinfo = devSet.Get_Ventil_Info();
|
|
|
+ int Temperinfo = devSet.Get_Temper_Info();
|
|
|
+ int[] Curtaininfo = devSet.Get_CURTAIN_Info();
|
|
|
String[] strDeviceSeqValue = devSet.GetSettingData("UI순서");
|
|
|
-
|
|
|
- String strLight = strDeviceSeqValue[1].substring( (strDeviceSeqValue[1].indexOf("조명(") + 3) , (strDeviceSeqValue[1].indexOf(")난방(")));
|
|
|
- String strHeating = strDeviceSeqValue[1].substring( (strDeviceSeqValue[1].indexOf("난방(") + 3) , (strDeviceSeqValue[1].indexOf(")에어컨(")));
|
|
|
- String strAircon = strDeviceSeqValue[1].substring( (strDeviceSeqValue[1].indexOf("에어컨(") + 4) , (strDeviceSeqValue[1].indexOf("))")));
|
|
|
-
|
|
|
- strLight = (strLight.substring(strLight.indexOf(":")+1)).replaceAll("_","/");
|
|
|
- strHeating = (strHeating.substring(strHeating.indexOf(":")+1)).replaceAll("_","/");
|
|
|
- strAircon = (strAircon.substring(strAircon.indexOf(":")+1)).replaceAll("_","/");
|
|
|
+ devSet.closeDB();
|
|
|
+ if(strDeviceSeqValue!=null) {
|
|
|
+ strLight = strDeviceSeqValue[1].substring((strDeviceSeqValue[1].indexOf("조명(") + 3), (strDeviceSeqValue[1].indexOf(")난방(")));
|
|
|
+ strHeating = strDeviceSeqValue[1].substring((strDeviceSeqValue[1].indexOf("난방(") + 3), (strDeviceSeqValue[1].indexOf(")에어컨(")));
|
|
|
+ strAircon = strDeviceSeqValue[1].substring((strDeviceSeqValue[1].indexOf("에어컨(") + 4), (strDeviceSeqValue[1].indexOf("))")));
|
|
|
+ strLight = (strLight.substring(strLight.indexOf(":") + 1)).replaceAll("_", "/");
|
|
|
+ strHeating = (strHeating.substring(strHeating.indexOf(":") + 1)).replaceAll("_", "/");
|
|
|
+ strAircon = (strAircon.substring(strAircon.indexOf(":") + 1)).replaceAll("_", "/");
|
|
|
+ }
|
|
|
|
|
|
String[] devlist;
|
|
|
if(nConcentEnable==1){
|
|
@@ -2008,7 +2019,6 @@ public class DataSenderService extends Service {
|
|
|
if (devlist[i].equals("cooktop")) {
|
|
|
if (mWallPadAPI.GetGasKind() == 1) {
|
|
|
// 가스밸브
|
|
|
- int Gasinfo = devSet.Get_GAS_Info();
|
|
|
if (Gasinfo == 1) {
|
|
|
// 사용함
|
|
|
if (bGasAsCooktopOutlet) {
|
|
@@ -2046,7 +2056,6 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
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\" order=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
} else {
|
|
@@ -2063,7 +2072,7 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
else if (devlist[i].equals("light")) {
|
|
|
try {
|
|
|
- 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 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
strResult += " <devinfo name=\"light\" value=\"0\" order=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
@@ -2080,8 +2089,8 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
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
|
|
|
+
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
strResult += " <devinfo name=\"livinglight\" value=\"0\" order=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
@@ -2098,7 +2107,6 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
else if (devlist[i].equals("ventil")) {
|
|
|
try {
|
|
|
- int[] Ventilinfo = devSet.Get_Ventil_Info();
|
|
|
if (Ventilinfo[0] == 0)
|
|
|
strResult += " <devinfo name=\"ventil\" value=\"0\" order=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
else
|
|
@@ -2114,7 +2122,6 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
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;
|
|
@@ -2135,7 +2142,6 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
else if (devlist[i].equals("curtain")) {
|
|
|
try {
|
|
|
- int[] Curtaininfo = devSet.Get_CURTAIN_Info();
|
|
|
if (Curtaininfo[0] == 0)
|
|
|
strResult += " <devinfo name=\"curtain\" value=\"0\" order=\"1\" floor=\"" + index + "\"/>\r\n";
|
|
|
else
|
|
@@ -2164,7 +2170,7 @@ public class DataSenderService extends Service {
|
|
|
BadConcentCount++;
|
|
|
}
|
|
|
}
|
|
|
- Log.e(TAG, "[yskim] iCMDProcDevList() electric : " + BadConcentCount);
|
|
|
+ Log.d(TAG, "[yskim] iCMDProcDevList() electric : " + BadConcentCount);
|
|
|
strResult += " <devinfo name=\"electric\" value=\"" + BadConcentCount + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
@@ -2181,9 +2187,9 @@ public class DataSenderService extends Service {
|
|
|
try {
|
|
|
if (mKnxAPI != null) {
|
|
|
if (mKnxAPI.data == null)
|
|
|
- Log.e(TAG, "[yskim] iCMDProcDevList KnxApi.data == null");
|
|
|
+ Log.d(TAG, "[yskim] iCMDProcDevList KnxApi.data == null");
|
|
|
if (mKnxAPI.data.MasterController == null)
|
|
|
- Log.e(TAG, "[yskim] iCMDProcDevList KnxApi.data.MasterController == null");
|
|
|
+ Log.d(TAG, "[yskim] iCMDProcDevList KnxApi.data.MasterController == null");
|
|
|
int LivingLightCount = 0;
|
|
|
if (mKnxAPI.data.LivingRoom_EnergyMeter.Info.Install == false) {
|
|
|
Log.w(TAG, "[Registration_Light_NewLiv]mData.LivingRoom_EnergyMeter.Info.Install == false");
|
|
@@ -2203,7 +2209,7 @@ public class DataSenderService extends Service {
|
|
|
KnxSystemAirconAPI airconAPI = mWallPadAPI.Get_KnxAirconController();
|
|
|
if (airconAPI != null) {
|
|
|
int nCount = airconAPI.data.Device.info.InsideAirconCount;
|
|
|
- Log.e(TAG, "[yskim] iCMDProcDevList() sysaircon : " + nCount);
|
|
|
+ Log.d(TAG, "[yskim] iCMDProcDevList() sysaircon : " + nCount);
|
|
|
// 현대건설 에어컨 처리, 포트가 다르기 때문에 구분해서 처리 필요, 에어컨 API가 동일하다면 그럴 필요는 없음
|
|
|
strResult += " <devinfo name=\"sysaircon\" value=\"" + nCount + "\" order=\"" + strAircon + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
} else {
|
|
@@ -2214,8 +2220,6 @@ public class DataSenderService extends Service {
|
|
|
//방범, 센서 여부 응답(고급주택은 사용하지 않아 value 0으로 처리
|
|
|
strResult += " <devinfo name=\"mode\" value=\"" + 0 + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
strResult += " <devinfo name=\"sensor\" value=\"" + 0 + "\" floor=\"" + index + "\"/>\r\n";
|
|
|
- devSet.closeDB();
|
|
|
-
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return strResult;
|
|
@@ -2283,7 +2287,7 @@ public class DataSenderService extends Service {
|
|
|
int nDPType = wds.Get_DistributionPannelType_Info();
|
|
|
wds.closeDB();
|
|
|
if (mWallPadAPI.Check_Connect()) {
|
|
|
- if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
if (nDPType == Version.DISTRIBUTION_MODEL.SMART_DIST) {
|
|
@@ -2328,7 +2332,7 @@ public class DataSenderService extends Service {
|
|
|
int nDPType = wds.Get_DistributionPannelType_Info();
|
|
|
wds.closeDB();
|
|
|
if (mWallPadAPI.Check_Connect()) {
|
|
|
- if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
deviceApiLoadLight();
|
|
@@ -2384,11 +2388,6 @@ public class DataSenderService extends Service {
|
|
|
mHeatingControl = new HeatingControl(mHeatingV2API, mContext);
|
|
|
mHeatingV2API.Refresh(HeatingV2API.REFRESH_IDX.ALL, false);
|
|
|
int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
|
- for (int i = 0; i < roomCount; i++) {
|
|
|
- mHeating.eachRoom[i].mode = mHeatingV2API.data.Device.Room[i].Mode;
|
|
|
- mHeating.eachRoom[i].curTemper = mHeatingV2API.data.Device.Room[i].NowTemp;
|
|
|
- mHeating.eachRoom[i].setTemper = mHeatingV2API.data.Device.Room[i].SetTemp;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
if (nDPType == Version.DISTRIBUTION_MODEL.KNX_DIST) {
|
|
@@ -2733,42 +2732,7 @@ public class DataSenderService extends Service {
|
|
|
Log.i(TAG, "[checkChangedHeating] ===== START =====");
|
|
|
if (mHeatingV2API != null) {
|
|
|
mHeatingV2API.Refresh(HeatingV2API.REFRESH_IDX.ALL, false);
|
|
|
- boolean bChangeUnitState = false;
|
|
|
- boolean bChangeTotalState = false;
|
|
|
-
|
|
|
- int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
|
-
|
|
|
- for (int i = 0; i < roomCount; i++) {
|
|
|
- bChangeUnitState = false;
|
|
|
- // 전원 상태 변화 확인
|
|
|
- if (mHeating.eachRoom[i].mode != mHeatingV2API.data.Device.Room[i].Mode) {
|
|
|
- bChangeUnitState = true;
|
|
|
- }
|
|
|
-
|
|
|
- // 0.5 도 단위로 전송
|
|
|
- double old_temer = mHeating.eachRoom[i].curTemper;
|
|
|
- double new_temer = mHeatingV2API.data.Device.Room[i].NowTemp;
|
|
|
- double diff = old_temer - new_temer;
|
|
|
-
|
|
|
- // 현재온도 변화 확인
|
|
|
- if (diff > 0.5 || diff < -0.5) {
|
|
|
- bChangeTotalState = true;
|
|
|
- }
|
|
|
-
|
|
|
- // 설정온도 변화 확인
|
|
|
- if (mHeating.eachRoom[i].setTemper != mHeatingV2API.data.Device.Room[i].SetTemp) {
|
|
|
- bChangeUnitState = true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //데이터 저장
|
|
|
- if (bChangeTotalState == true) {
|
|
|
- for (int i = 0; i < roomCount; i++) {
|
|
|
- mHeating.eachRoom[i].mode = mHeatingV2API.data.Device.Room[i].Mode;
|
|
|
- mHeating.eachRoom[i].curTemper = mHeatingV2API.data.Device.Room[i].NowTemp;
|
|
|
- mHeating.eachRoom[i].setTemper = mHeatingV2API.data.Device.Room[i].SetTemp;
|
|
|
- }
|
|
|
- }
|
|
|
+ mHeatingV2API.Refresh(HeatingV2API.REFRESH_IDX.BOILER, false);
|
|
|
} else {
|
|
|
mHeatingV2API = mWallPadAPI.Get_HeatingV2Controller();
|
|
|
}
|
|
@@ -3108,13 +3072,6 @@ public class DataSenderService extends Service {
|
|
|
deviceApiLoad();
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
- // 디바이스 연결
|
|
|
- case define.NOTIFY_DEVICECONNECTED:
|
|
|
- Log.d(TAG, "[mMobileEventBR] ========== DeviceService Complite!! ==========");
|
|
|
- deviceApiLoad();
|
|
|
- break;
|
|
|
-
|
|
|
// 도어락 문열림
|
|
|
case define.NOTIFY_RFDOORLOCK_OPEN:
|
|
|
// Log.d(TAG, "********************* NOTIFY_RFDOORLOCK_OPEN ********************");
|
|
@@ -3260,7 +3217,7 @@ public class DataSenderService extends Service {
|
|
|
IntentFilter mIntentFilter = new IntentFilter();
|
|
|
mIntentFilter.addAction(define.NOTIFY_ACNAME);
|
|
|
mIntentFilter.addAction(Common.BR_MAIN_NOTI.ACNAME_MAIN_NOTI);
|
|
|
- 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 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I) {
|
|
|
if (nDPType == Version.DISTRIBUTION_MODEL.SMART_DIST) {
|
|
|
// 스마트 분전반
|
|
@@ -3304,7 +3261,7 @@ public class DataSenderService extends Service {
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I) {
|
|
|
if (mEnergyMeterAPI != null) mEnergyMeterAPI.regChangedBR(BrID.BR_ENERGY_METER);
|
|
|
- } else if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|
+ } else if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I_LX2
|
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I) {
|
|
|
if (nDPType == Version.DISTRIBUTION_MODEL.SMART_DIST) {
|
|
|
// 스마트 분전반
|