|
@@ -45,6 +45,7 @@ import com.artncore.commons.DataClasses;
|
|
|
import com.artncore.commons.DataClasses.HeatingV1;
|
|
|
import com.artncore.commons.DataClasses.HeatingV2;
|
|
|
import com.artncore.commons.DataClasses.MultiSwitch;
|
|
|
+import com.artncore.commons.Sdb_DataClasses;
|
|
|
import com.artncore.commons.define;
|
|
|
import com.artncore.deviceinterface.WallPadInterface;
|
|
|
import com.artncore.wallpadapi.AirQualitySensorAPI;
|
|
@@ -94,6 +95,7 @@ import java.net.ServerSocket;
|
|
|
import java.net.Socket;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.GregorianCalendar;
|
|
@@ -3615,6 +3617,16 @@ public class iMapServer extends Service {
|
|
|
else if (cmd.equalsIgnoreCase("remote_get_home_devices")) {
|
|
|
retXML = iCMDProcDevList(doc);
|
|
|
}
|
|
|
+ else if (cmd.equalsIgnoreCase("remote_get_home_total_device")) {
|
|
|
+ /** adding function by jeff from 2022.04.28 **/
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ retXML = imapRemoteGetHomeTotalDevice(doc);
|
|
|
+ }
|
|
|
+ else if (cmd.equalsIgnoreCase("remote_check_register_device")) {
|
|
|
+ /** adding function by jeff from 2022.04.28 **/
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ retXML = imapRemoteCheckRegisterDevice(elelist);
|
|
|
+ }
|
|
|
else if (cmd.equalsIgnoreCase("remote_access_gas")) {
|
|
|
retXML = iCMDProcGASControl(elelist);
|
|
|
}
|
|
@@ -4080,6 +4092,16 @@ public class iMapServer extends Service {
|
|
|
else if (cmd.equalsIgnoreCase("remote_get_home_devices")) {
|
|
|
retXML = iCMDProcDevList(doc);
|
|
|
}
|
|
|
+ else if (cmd.equalsIgnoreCase("remote_get_home_total_device")) {
|
|
|
+ /** adding function by jeff from 2022.04.28 **/
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ retXML = imapRemoteGetHomeTotalDevice(doc);
|
|
|
+ }
|
|
|
+ else if (cmd.equalsIgnoreCase("remote_check_register_device")) {
|
|
|
+ /** adding function by jeff from 2022.04.28 **/
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ retXML = imapRemoteCheckRegisterDevice(elelist);
|
|
|
+ }
|
|
|
else if (cmd.equalsIgnoreCase("remote_access_gas")) {
|
|
|
retXML = iCMDProcGASControl(elelist);
|
|
|
}
|
|
@@ -4126,8 +4148,21 @@ public class iMapServer extends Service {
|
|
|
retXML = iCMDProcCurtainControl(doc);
|
|
|
}
|
|
|
else if (cmd.equalsIgnoreCase("remote_access_light")) {
|
|
|
- if (ModelType == Version.MODEL_TYPE.IHN_1020GL) {
|
|
|
- retXML = iCMDProcEnergyMeterLightControl(doc);
|
|
|
+ if (ModelType == MODEL_TYPE.IHN_1020GL || ModelType == MODEL_TYPE.IHN_1010GL || ModelType == MODEL_TYPE.IHN_1010GL_I
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443 || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410) {
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ nEnergyProductionUse = devSet.Get_Energy_Devices_Info(); //에너지 제품군
|
|
|
+ devSet.closeDB();
|
|
|
+ devSet = null;
|
|
|
+ //에너지 제품군을 사용하는 경우(에너지미터(신규EMS))
|
|
|
+ if(nEnergyProductionUse == WallpadDeviceSet.DO_USE)
|
|
|
+ {
|
|
|
+ retXML = iCMDProcSDPLightControl(doc);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ retXML = iCMDProcEnergyMeterLightControl(doc);
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
retXML = iCMDProcLightControl(doc);
|
|
@@ -6287,10 +6322,10 @@ public class iMapServer extends Service {
|
|
|
|
|
|
public String iCMDProcDevList(Document ele) {
|
|
|
try {
|
|
|
- String strResult = CheckiCMDProc("remote_get_home_devices");
|
|
|
+ String strResult_ = CheckiCMDProc("remote_get_home_devices");
|
|
|
|
|
|
- if (strResult != null) return strResult;
|
|
|
- else strResult = XMLHeader + " <service type=\"reply\" name=\"remote_get_home_devices\" result=";
|
|
|
+ if (strResult_ != null) return strResult_;
|
|
|
+ else strResult_ = XMLHeader + " <service type=\"reply\" name=\"remote_get_home_devices\" result=";
|
|
|
|
|
|
String target= "null", tid= "null", msgno= "null";
|
|
|
NodeList items = ele.getElementsByTagName("target");
|
|
@@ -6308,7 +6343,7 @@ public class iMapServer extends Service {
|
|
|
|
|
|
// 단지서버 2.0 사용하는 경우, 모바일 인증 또는 단지 웹 제어 비밀번호 인증 필요 (JEFF, 2019.07.26)
|
|
|
if (NewServerUse()) {
|
|
|
- String ServerCheckResult = checkRemoteCtrlAuthentication(strResult, target, ele);
|
|
|
+ String ServerCheckResult = checkRemoteCtrlAuthentication(strResult_, target, ele);
|
|
|
if (!ServerCheckResult.equals(MOBILE_USER_AUTH_PASSED) && !ServerCheckResult.equals(WEB_USER_AUTH_PASSED)) return ServerCheckResult;
|
|
|
}
|
|
|
|
|
@@ -6321,17 +6356,20 @@ public class iMapServer extends Service {
|
|
|
mCooktopAPI = mWallPadAPI.Get_CookTopController();
|
|
|
}
|
|
|
|
|
|
+ String strResult = "";
|
|
|
+ int device_count = 0;
|
|
|
WallpadiCMDParser DevListCMD = new WallpadiCMDParser(ele);
|
|
|
// String[] devlist = {"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop"};
|
|
|
String[] devlist = {"gas", "livinglight", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop"};
|
|
|
- strResult += "\"ok\">\r\n";
|
|
|
- strResult +=" <target name=\""+DevListCMD.target+"\" id=\""+DevListCMD.tid+"\" msg_no=\""+DevListCMD.msgno+"\"/>\r\n";
|
|
|
- strResult += " <devlist total_count=\""+devlist.length+"\"/>\r\n";
|
|
|
+ strResult_ += "\"ok\">\r\n";
|
|
|
+ strResult_ +=" <target name=\""+DevListCMD.target+"\" id=\""+DevListCMD.tid+"\" msg_no=\""+DevListCMD.msgno+"\"/>\r\n";
|
|
|
+ //strResult_ += " <devlist total_count=\""+devlist.length+"\"/>\r\n";
|
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
|
|
|
for (int i = 0; i < devlist.length; i++) {
|
|
|
- if (devlist[i].equals("cooktop")) {
|
|
|
- if (mWallPadAPI.GetGasKind() == 1) {
|
|
|
+ if (devlist[i].equals("gas")) {
|
|
|
+ device_count++;
|
|
|
+ if (true) {
|
|
|
// 가스밸브
|
|
|
int Gasinfo = devSet.Get_GAS_Info();
|
|
|
if (Gasinfo == 1) {
|
|
@@ -6371,6 +6409,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("doorlock")) {
|
|
|
+ device_count++;
|
|
|
try {
|
|
|
int[] DoorLockInfo = devSet.Get_DoorLock_Info();
|
|
|
if ((DoorLockInfo[0] == 1) && (DoorLockInfo[1] == WallpadDeviceSet.DOORLOCK_TYPE_NORMAL)) {
|
|
@@ -6390,6 +6429,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("light")) {
|
|
|
+ device_count++;
|
|
|
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
|
|
@@ -6461,6 +6501,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("livinglight")) {
|
|
|
+ device_count++;
|
|
|
try {
|
|
|
int[] lightinfo = devSet.Get_Light_info();
|
|
|
if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
@@ -6501,6 +6542,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("ventil")) {
|
|
|
+ device_count++;
|
|
|
try {
|
|
|
int[] Ventilinfo = devSet.Get_Ventil_Info();
|
|
|
if (Ventilinfo[0] == 0) strResult +=" <devinfo name=\"ventil\" value=\"0\"/>\r\n";
|
|
@@ -6516,6 +6558,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("thermostat")) {
|
|
|
+ device_count++;
|
|
|
try {
|
|
|
int Temperinfo = devSet.Get_Temper_Info();
|
|
|
int HeatingKind = mWallPadAPI.GetHeatingKind();
|
|
@@ -6549,6 +6592,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("curtain")) {
|
|
|
+ device_count++;
|
|
|
try {
|
|
|
int[] Curtaininfo = devSet.Get_CURTAIN_Info();
|
|
|
if (Curtaininfo[0] == 0) strResult += " <devinfo name=\"curtain\" value=\"0\"/>\r\n";
|
|
@@ -6564,6 +6608,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("electric")) {
|
|
|
+ device_count++;
|
|
|
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
|
|
@@ -6645,6 +6690,7 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
}
|
|
|
else if (devlist[i].equals("smartlight")) {
|
|
|
+ device_count++;
|
|
|
if (!bSmartLightAsNormalLight) {
|
|
|
int nSmartLight = 0;
|
|
|
if (mSdb_LivingRoomLightAPI != null) {
|
|
@@ -6669,7 +6715,11 @@ public class iMapServer extends Service {
|
|
|
}
|
|
|
strResult += " </service>\r\n</imap>\r\n";
|
|
|
devSet.closeDB();
|
|
|
- return strResult;
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ strResult_ += " <devlist total_count=\""+device_count+"\"/>\r\n";
|
|
|
+ strResult_ +=strResult;
|
|
|
+ return strResult_;
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
return null;
|
|
@@ -6681,6 +6731,165 @@ public class iMapServer extends Service {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ public final String BLANK_01 = " ", BLANK_02 = " ", BLANK_03 = " ", BLANK_04 = " ";
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ /**
|
|
|
+ * 원격제어 - 모바일기기 등록여부 확인 요청/응답
|
|
|
+ *
|
|
|
+ **/
|
|
|
+ public String imapRemoteCheckRegisterDevice(Element ele) {
|
|
|
+ String retXML = "";
|
|
|
+ String strDong = "null", strHo = "null", strIP = "null", strType = "null", strTwinID = "null", strReason = "null";
|
|
|
+
|
|
|
+ try {
|
|
|
+ NodeList items = ele.getElementsByTagName("home_info");
|
|
|
+ Node item = items.item(0);
|
|
|
+ NamedNodeMap attrsParam = item.getAttributes();
|
|
|
+
|
|
|
+ // 월패드 주소 정보 확인
|
|
|
+ for (int i = 0; i < attrsParam.getLength(); i++) {
|
|
|
+ Node attr = attrsParam.item(i);
|
|
|
+ if (attr.getNodeName().equalsIgnoreCase("dong")) strDong = trimquotation(attr.getNodeValue());
|
|
|
+ else if (attr.getNodeName().equalsIgnoreCase("ho")) strHo = trimquotation(attr.getNodeValue());
|
|
|
+ else if (attr.getNodeName().equalsIgnoreCase("ip")) strIP = trimquotation(attr.getNodeValue());
|
|
|
+ else if (attr.getNodeName().equalsIgnoreCase("type")) strType = trimquotation(attr.getNodeValue());
|
|
|
+ }
|
|
|
+
|
|
|
+//
|
|
|
+// // 동정보가 다른 경우
|
|
|
+// if (!strDong.equalsIgnoreCase(cv_AddressSet.Dong)) {
|
|
|
+// strReason = "incorrect_info_dong";
|
|
|
+// return imapReplyRemoteCheckRegisterDevice("fail", cv_AddressSet, strType, strTwinID, strReason);
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 호정보가 다른 경우
|
|
|
+// if (!strHo.equalsIgnoreCase(cv_AddressSet.Ho)) {
|
|
|
+// strReason = "incorrect_info_ho";
|
|
|
+// return imapReplyRemoteCheckRegisterDevice("fail", cv_AddressSet, strType, strTwinID, strReason);
|
|
|
+// }
|
|
|
+//
|
|
|
+// // IP 주소가 다른 경우
|
|
|
+// if (!strIP.equalsIgnoreCase(cv_AddressSet.IPAddress)) {
|
|
|
+// strReason = "incorrect_info_ip";
|
|
|
+// return imapReplyRemoteCheckRegisterDevice("fail", cv_AddressSet, strType, strTwinID, strReason);
|
|
|
+// }
|
|
|
+
|
|
|
+ // TwinID 정보 확인
|
|
|
+ items = ele.getElementsByTagName("device_info");
|
|
|
+ item = items.item(0);
|
|
|
+ attrsParam = item.getAttributes();
|
|
|
+
|
|
|
+ for (int i = 0; i < attrsParam.getLength(); i++) {
|
|
|
+ Node attr = attrsParam.item(i);
|
|
|
+ if (attr.getNodeName().equalsIgnoreCase("twinid")) strTwinID = trimquotation(attr.getNodeValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ // TwinID 검색
|
|
|
+ WallpadMobileDeviceData mWallpadMobileDeviceData = new WallpadMobileDeviceData(getApplicationContext());
|
|
|
+ int nCheckResult = mWallpadMobileDeviceData.isExistMobileDevice(strTwinID);
|
|
|
+ mWallpadMobileDeviceData.closeDB();
|
|
|
+
|
|
|
+ WallpadStatusData DBMGR = null;
|
|
|
+ DBMGR = new WallpadStatusData(getApplicationContext());
|
|
|
+ AddressSet addc = DBMGR.getAddressMGR(); //DB에서 동호 정보 받아옴
|
|
|
+ DBMGR.closeDB();
|
|
|
+
|
|
|
+ if (nCheckResult > 0) {
|
|
|
+ // TwinID가 존재하는 경우
|
|
|
+ strReason = "registered_device";
|
|
|
+ return imapReplyRemoteCheckRegisterDevice("ok", addc, strType, strTwinID, strReason);
|
|
|
+ } else {
|
|
|
+ // TwinID가 존재하지 않는 경우
|
|
|
+ strReason = "not_registered_device";
|
|
|
+ return imapReplyRemoteCheckRegisterDevice("fail", addc, strType, strTwinID, strReason);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ strReason = "RuntimeException";
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ strReason = "Exception";
|
|
|
+ }
|
|
|
+
|
|
|
+ retXML = XMLHeader + " <service type = \"reply\" name= \"" + "remote_check_register_device" + "\" result = \"fail\">\r\n";
|
|
|
+ retXML += " <reason>\"" + strReason + "\"</reason>\r\n";
|
|
|
+ retXML += " </service>\r\n</imap>";
|
|
|
+ return retXML;
|
|
|
+ }
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ public String imapReplyRemoteCheckRegisterDevice(String strResult, AddressSet addressSet, String strType, String strTwinID, String strReason) {
|
|
|
+ String retXML = "";
|
|
|
+ try {
|
|
|
+ retXML = XMLHeader + " <service type=\"reply\" name=\"" + "remote_check_register_device" + "\" result=\"" + strResult + "\">\r\n";
|
|
|
+ retXML += " <home_info dong=\"" + addressSet.Dong + "\" ho=\"" + addressSet.Ho + "\" ip=\"" + addressSet.IPAddress + "\" type=\"" + strType + "\"/>\r\n";
|
|
|
+ retXML += " <device_info twinid=\"" + strTwinID + "\" />\r\n";
|
|
|
+ retXML += " <reason>\"" + strReason + "\"</reason>\r\n";
|
|
|
+ retXML += " </service>\r\n</imap>";
|
|
|
+ return retXML;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ retXML = XMLHeader + " <service type = \"reply\" name= \"" + "remote_check_register_device" + "\" result = \"fail\">\r\n";
|
|
|
+ retXML += " </service>\r\n</imap>";
|
|
|
+ return retXML;
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ retXML = XMLHeader + " <service type = \"reply\" name= \"" + "remote_check_register_device" + "\" result = \"fail\">\r\n";
|
|
|
+ retXML += " </service>\r\n</imap>";
|
|
|
+ return retXML;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ * 원격제어 - 전체기기 상태 요청
|
|
|
+ **/
|
|
|
+ public String imapRemoteGetHomeTotalDevice(Document doc) {
|
|
|
+ try {
|
|
|
+ String retStr = CheckiCMDProc("remote_get_home_total_device");
|
|
|
+
|
|
|
+ if (retStr != null) return retStr;
|
|
|
+ else retStr = XMLHeader + BLANK_01 + "<service type=\"reply\" name=\"" + "remote_get_home_total_device"+ "\"";
|
|
|
+
|
|
|
+ String target = "null", tid = "null", msgno = "null";
|
|
|
+ NodeList items = doc.getElementsByTagName("target");
|
|
|
+ Node item = items.item(0);
|
|
|
+ if (item != null) {
|
|
|
+ NamedNodeMap attrs = item.getAttributes();
|
|
|
+ for (int j = 0; j < attrs.getLength(); j++) {
|
|
|
+ Node attr = attrs.item(j);
|
|
|
+
|
|
|
+ if (attr.getNodeName().equalsIgnoreCase("name")) target = attr.getNodeValue();
|
|
|
+ else if (attr.getNodeName().equalsIgnoreCase("id")) tid = attr.getNodeValue();
|
|
|
+ else if (attr.getNodeName().equalsIgnoreCase("msg_no")) msgno = attr.getNodeValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 단지서버 2.0 사용하는 경우, 모바일 인증 또는 단지 웹 제어 비밀번호 인증 필요 (JEFF, 2019.07.26)
|
|
|
+ if (NewServerUse()) {
|
|
|
+ String ServerCheckResult = checkRemoteCtrlAuthentication(retStr, target, doc);
|
|
|
+ if (!ServerCheckResult.equals(MOBILE_USER_AUTH_PASSED) && !ServerCheckResult.equals(WEB_USER_AUTH_PASSED)) return ServerCheckResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ retStr += " result=\"ok\">\r\n";
|
|
|
+ retStr += getRemoteAccessTotalDeviceStatus();
|
|
|
+ retStr += BLANK_01 + "</service>\r\n</imap>";
|
|
|
+
|
|
|
+ return retStr;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] imapRemoteGetHomeTotalDevice(Document ele)");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] imapRemoteGetHomeTotalDevice(Document ele)");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public String iCMDProcMultiSWControl(Document ele) {
|
|
|
try {
|
|
@@ -16701,12 +16910,1623 @@ public class iMapServer extends Service {
|
|
|
|
|
|
|
|
|
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ //2024.08.06 통합앱3.0 관련 기능 함수
|
|
|
+ private String getRemoteAccessTotalDeviceStatus() {
|
|
|
+ try {
|
|
|
+ CheckInfo();
|
|
|
+
|
|
|
+ int[] naLightEnable = null; // 조명 타입
|
|
|
+
|
|
|
+ WallpadDeviceSet wpdds = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ naLightEnable = wpdds.Get_Light_info(); // 조명
|
|
|
+ wpdds.closeDB();
|
|
|
+
|
|
|
+
|
|
|
+ String strICMDBody = "";
|
|
|
+
|
|
|
+ //수정필요
|
|
|
+ //여기서 구분이 필요함
|
|
|
+
|
|
|
+ if (ModelType == MODEL_TYPE.IHN_1020GL || ModelType == MODEL_TYPE.IHN_1010GL || ModelType == MODEL_TYPE.IHN_1010GL_I
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443 || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410) {
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ nEnergyProductionUse = devSet.Get_Energy_Devices_Info(); //에너지 제품군
|
|
|
+ devSet.closeDB();
|
|
|
+ devSet = null;
|
|
|
+ //에너지 제품군을 사용하는 경우(에너지미터(신규EMS))
|
|
|
+ if(nEnergyProductionUse == WallpadDeviceSet.DO_USE)
|
|
|
+ {
|
|
|
+ strICMDBody += getICMDDeviceStatus_SDPLight();
|
|
|
+ strICMDBody += getICMDDeviceStatus_Outlet();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //여기서 구분 다시 필요
|
|
|
+ //기본형
|
|
|
+ if(naLightEnable[1] == WallpadDeviceSet.LIGHT_TYPE_HDC_INTLIGHT_NORMAL)
|
|
|
+ {
|
|
|
+ strICMDBody += getICMDDeviceStatus_LivingLight();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strICMDBody += getICMDDeviceStatus_EnergyMeterLight();
|
|
|
+ strICMDBody += getICMDDeviceStatus_Outlet();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ strICMDBody += getICMDDeviceStatus_Light();
|
|
|
+ }
|
|
|
+ strICMDBody += getICMDDeviceStatus_Cooktop();
|
|
|
+ strICMDBody += getICMDDeviceStatus_Vent();
|
|
|
+ strICMDBody += getICMDDeviceStatus_Heat();
|
|
|
+ //수정필요
|
|
|
+ // strICMDBody += getICMDDeviceStatus_Outlet();
|
|
|
+ strICMDBody += getICMDDeviceStatus_Sensor();
|
|
|
+ strICMDBody += getICMDDeviceStatus_SecurityMode();
|
|
|
+
|
|
|
+ return strICMDBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getRemoteAccessTotalDeviceStatus()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getRemoteAccessTotalDeviceStatus()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nSecurityMode;
|
|
|
+ int cv_nGatewayType;
|
|
|
+ int cv_nInOutMotionSensorUseSetting;
|
|
|
+ boolean cv_bGasAsCooktopOutlet;
|
|
|
+ private IGW200 cv_IGW200API = null; // IGW-200 게이트웨이
|
|
|
+ private IGW300 cv_IGW300API = null; // IGW-300 게이트웨이
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ public void setIGW200Interface() {
|
|
|
+ try {
|
|
|
+ Common.DebugLog("setIGW200Interface");
|
|
|
+ cv_IGW200API = new IGW200(this, mWallPadAPI);
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] setIGW200Interface()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] setIGW200Interface()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ public void setIGW300Interface() {
|
|
|
+ try {
|
|
|
+ Common.DebugLog("setIGW300Interface");
|
|
|
+ cv_IGW300API = new IGW300(this, mWallPadAPI);
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] setIGW300Interface()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private void CheckInfo()
|
|
|
+ {
|
|
|
+ WallpadStatusData mWallpadStatusData = new WallpadStatusData(getApplicationContext());
|
|
|
+ nSecurityMode = mWallpadStatusData.GetAlarmStatus();
|
|
|
+ mWallpadStatusData.closeDB();
|
|
|
+
|
|
|
+ WallpadDeviceSet wds = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ cv_nGatewayType = wds.GetGatewayModelKindInfo();
|
|
|
+ cv_bGasAsCooktopOutlet = wds.Get_CookTopConcent_Use(); //
|
|
|
+ cv_nInOutMotionSensorUseSetting = wds.Get_Sensor_Set();
|
|
|
+ wds.closeDB();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_SDPLight() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+ EnergyMeterAPI energymeter = mWallPadAPI.Get_EnergyMeterController();
|
|
|
+ if (energymeter == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Light] Retry energymeter loading... -> energymeter");
|
|
|
+
|
|
|
+ if (energymeter == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] energymeter is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = energymeter.Refresh((byte)0xFF, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SDPLight] energymeter refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 전체 갯수
|
|
|
+
|
|
|
+ int nEMCnt = energymeter.data.RoomCnt; // 각실EM개수 + 거실EM개수
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light"+ "\" value=\"" + nEMCnt + "\">\r\n";
|
|
|
+
|
|
|
+ for (int i = 0; i < nEMCnt; i++) {
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = energymeter.data.Em.eachRoom[i].LightCnt;
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] nUnitCnt [" + nUnitCnt + "]");
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + mDefaultRoomNameList_Light[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_power = "off";
|
|
|
+ unit_power = energymeter.data.Em.eachRoom[i].LightOnOff[j] ? "on" : "off";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_power + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Light()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Light()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_LivingLight() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+ //EnergyMeterAPI energymeter = mWallPadAPI.Get_EnergyMeterController();
|
|
|
+ IntLightAPI lightCTR = mWallPadAPI.Get_IntLightController();
|
|
|
+ if (lightCTR == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_LivingLight] Retry lightCTR loading... -> energymeter");
|
|
|
+
|
|
|
+ if (lightCTR == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_LivingLight] lightCTR is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "livinglight" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = lightCTR.Refresh(false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SDPLight] energymeter refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "livinglight" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 전체 갯수
|
|
|
+
|
|
|
+ int nEMCnt = lightCTR.data.LightCount; // 각실EM개수 + 거실EM개수
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "light"+ "\" value=\"" + 1 + "\">\r\n";
|
|
|
+//
|
|
|
+ for (int i = 0; i < 1; i++) {
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = nEMCnt;//energymeter.data.Em.eachRoom[i].LightCnt;
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] nUnitCnt [" + nUnitCnt + "]");
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + "거실"+ "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_power = "off";
|
|
|
+ unit_power = lightCTR.data.LightStatus[j]==true?"on":"off";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_power + "\" unit_dimming=\"null\" unit_color=\"null\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+
|
|
|
+ // cv_IntLightAPI.Refresh(false);
|
|
|
+// XmlBody += "<devinfo name = \"" + "light"+ "\" value = \"" + 1 + "\">\r\n";
|
|
|
+// XmlBody += BLANK_03 + "<status_map dev_num=\"" + 1 + "\" unit_cnt=\"" + nEMCnt + "\" room_name=\"" + "거실" + "\">\r\n";
|
|
|
+// for (int i = 0; i < nEMCnt; i++) {
|
|
|
+// String status = "off";
|
|
|
+// //XmlBody += "<status_info name=\"" + "light"+ "\" unit_num=\"" +( i+1 )+ "\">" + (lightCTR.data.LightStatus[i]==true?"on":"off") +"</status>\r\n";
|
|
|
+// XmlBody += BLANK_04 + "<status_info unit_num=\"" + ( i+1 ) + "\" unit_status=\"" + (lightCTR.data.LightStatus[i]==true?"on":"off") + "\"/>\r\n";
|
|
|
+// }
|
|
|
+// XmlBody += "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Light()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Light()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_EnergyMeterLight() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+ EnergyMeterAPI energymeter = mWallPadAPI.Get_EnergyMeterController();
|
|
|
+ if (energymeter == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Light] Retry energymeter loading... -> energymeter");
|
|
|
+
|
|
|
+ if (energymeter == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] energymeter is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = energymeter.Refresh((byte)0xFF, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SDPLight] energymeter refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 전체 갯수
|
|
|
+
|
|
|
+ int nEMCnt = energymeter.data.RoomCnt; // 각실EM개수 + 거실EM개수
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light"+ "\" value=\"" + nEMCnt + "\">\r\n";
|
|
|
+
|
|
|
+ for (int i = 0; i < nEMCnt; i++) {
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = energymeter.data.Em.eachRoom[i].LightCnt;
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] nUnitCnt [" + nUnitCnt + "]");
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + mDefaultRoomNameList_Light[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_power = "off";
|
|
|
+ unit_power = energymeter.data.Em.eachRoom[i].LightOnOff[j] ? "on" : "off";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_power + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Light()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Light()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_Light() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+ MultiSwitchAPI mMultiSwitchAPI = mWallPadAPI.Get_MultiSwitchController();
|
|
|
+ if (mMultiSwitchAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Light] Retry energymeter loading... -> energymeter");
|
|
|
+
|
|
|
+ if (mMultiSwitchAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] energymeter is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = mMultiSwitchAPI.Refresh((byte)0xFF, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SDPLight] energymeter refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
|
|
|
+ // 전체 갯수
|
|
|
|
|
|
+ int nEMCnt = mMultiSwitchAPI.data.DeviceCnt; // 각실EM개수 + 거실EM개수
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "remote_access_light"+ "\" value=\"" + nEMCnt + "\">\r\n";
|
|
|
|
|
|
+ for (int i = 0; i < nEMCnt; i++) {
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = mMultiSwitchAPI.data.Device[i].device.hLightCnt;
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] nUnitCnt [" + nUnitCnt + "]");
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + mDefaultRoomNameList_Light[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_power = "off";
|
|
|
+ unit_power = mMultiSwitchAPI.data.Device[i].device.getLightPower(j) ? "on" : "off";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_power + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Light()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Light()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
+ private String getICMDDeviceStatus_DimLivLight() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ if (cv_nLivLightDimCtrlUsage != WallpadDeviceSet.DEV_DATA_ENABLE) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_DimLivLight] LivDimLight not use!! cv_nLivLightDimCtrlUsage -> " + cv_nLivLightDimCtrlUsage);
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.DIMMING_LIVINGLIGHT.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.NOT_USE_CONFIGURED.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cv_LedDimmingKCC_API == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_DimLivLight] Retry API loading... -> cv_LedDimmingKCC_API");
|
|
|
+ init3rdPartyLightDimCtrlAPI();
|
|
|
+
|
|
|
+ if (cv_LedDimmingKCC_API == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_DimLivLight] cv_LedDimmingKCC_API is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.DIMMING_LIVINGLIGHT.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_LedDimmingKCC_API.Refresh(define.DEVICE_ALL_OR_NOTHING, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_DimLivLight] cv_LedDimmingKCC_API refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.DIMMING_LIVINGLIGHT.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ String strRM_TITLE = "거실";
|
|
|
+ int nDimLivLightCnt = (int) cv_LedDimmingKCC_API.data.DeviceCnt;
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.DIMMING_LIVINGLIGHT.getContents() + "\" value=\"" + nDimLivLightCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nDimLivLightCnt; i++) {
|
|
|
+ int nDevNo = i + 1, nUnitCnt = 1, nUnitNo = 1;
|
|
|
+ String mode = "", unit_mode = "", unit_status = "";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ if (cv_LedDimmingKCC_API.data.Device[i].device.OnOff) unit_status = "on";
|
|
|
+ else unit_status = "off";
|
|
|
+ unit_status += "/" + cv_LedDimmingKCC_API.data.Device[i].device.Level;
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_DimLivLight()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_DimLivLight()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ */
|
|
|
+ /*
|
|
|
+ private String getICMDDeviceStatus_BatchLight() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ if (cv_naBatchLightNSmartSwitchInfo == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_BatchLight] cv_naBatchLightNSmartSwitchInfo is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LIGHTBATCH.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.NOT_USE_CONFIGURED.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cv_naBatchLightNSmartSwitchInfo[0] != WallpadDeviceSet.DO_USE) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_LightBatch] Light not use!! cv_naBatchLightNSmartSwitchInfo[0] -> " + cv_naBatchLightNSmartSwitchInfo[0]);
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LIGHTBATCH.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.NOT_USE_CONFIGURED.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nBatchLightStatus = cv_WallPadAPI.GetBatchSwitchStatus();
|
|
|
+ String unit_status = "null";
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_BatchLight] nBatchLightStatus [" + nBatchLightStatus + "]");
|
|
|
+
|
|
|
+ if (nBatchLightStatus < 0 && 1 < nBatchLightStatus) {
|
|
|
+ // 범위이탈 (이상상태)
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_LightBatch] Out of range!! nBatchLightStatus [" + nBatchLightStatus + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LIGHTBATCH.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.OUT_OF_RANGE_RESULT.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ String strRM_TITLE = "전체";
|
|
|
+ if (nBatchLightStatus == 0) unit_status = "on"; // 일괄소등 설정 상태
|
|
|
+ else if (nBatchLightStatus == 1) unit_status = "off"; // 일괄소등 해제 상태
|
|
|
+ else {
|
|
|
+ // 그외: 에러
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_LightBatch] Out of range!! nBatchLightStatus [" + nBatchLightStatus + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LIGHTBATCH.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.OUT_OF_RANGE_RESULT.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LIGHTBATCH.getContents() + "\" value=\"1\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"1\" unit_cnt=\"1\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"1\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_LightBatch()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_LightBatch()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+*/
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_Cooktop() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ GasAPI cv_GasAPI = null;
|
|
|
+ CooktopAPI HybridCookTopCTR = null;
|
|
|
+ cv_GasAPI = mWallPadAPI.Get_GasController();
|
|
|
+
|
|
|
+ if (true) {
|
|
|
+ // 가스밸브
|
|
|
+ if (cv_GasAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Cooktop] Retry API loading... -> cv_GasAPI");
|
|
|
+
|
|
|
+ if (cv_GasAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Cooktop] cv_GasAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" +"gas"+ "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_GasAPI.Refresh((byte) 0x00, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Cooktop] cv_GasAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "gas" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nGasValveCnt = (int) cv_GasAPI.data.DeviceCnt;
|
|
|
+ int nDevNo = 1, nUnitCnt = 1, nUnitNo = 1; // 가스밸브는 1개만 적용된다.
|
|
|
+ String strRM_TITLE = "주방";
|
|
|
+ if (cv_bGasAsCooktopOutlet) XmlBody += "<devinfo name=\"" + "cooktop" + "\" value=\"" + nGasValveCnt + "\">\r\n";
|
|
|
+ else XmlBody += BLANK_02 + "<devinfo name=\"" + "gas" + "\" value=\"" + nGasValveCnt + "\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ for (int i = 0; i < nGasValveCnt; i++) {
|
|
|
+ cv_GasAPI.Refresh((byte) i, false);
|
|
|
+ String unit_status = "";
|
|
|
+ if (cv_GasAPI.data.Device[i].GasStatus == GasAPI.GASSTATUS.Close) unit_status = "off";
|
|
|
+ else if (cv_GasAPI.data.Device[i].GasStatus == GasAPI.GASSTATUS.Open) unit_status = "on";
|
|
|
+ else if (cv_GasAPI.data.Device[i].GasStatus == GasAPI.GASSTATUS.Operation) unit_status = "operating";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (i + 1) + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ else if (cv_WallPadAPI.GetGasKind() == 2) {
|
|
|
+ // 쿡탑제어기
|
|
|
+ if (cv_CooktopAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Cooktop] Retry API loading... -> cv_CooktopAPI");
|
|
|
+ init3rdPartyGasNCooktopAPI();
|
|
|
+
|
|
|
+ if (cv_CooktopAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Cooktop] cv_CooktopAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.HYBRIDCOOKTOP.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_CooktopAPI.Refresh(define.DEVICE_ALL_OR_NOTHING, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Cooktop] cv_CooktopAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.HYBRIDCOOKTOP.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nCooktopCnt = (int) cv_CooktopAPI.data.DeviceCnt;
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.HYBRIDCOOKTOP.getContents() + "\" value=\"" + nCooktopCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nCooktopCnt; i++) {
|
|
|
+ String strRM_TITLE = "주방";
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = cv_CooktopAPI.data.Device[i].info.hCircuitCnt;
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_status = "";
|
|
|
+ if (cv_CooktopAPI.data.Device[i].circuit[j].getCircuitType() == DataClasses.CooktopCtrl.DEVICE_TYPE.GASVALVE) unit_status = "gas";
|
|
|
+ else if (cv_CooktopAPI.data.Device[i].circuit[j].getCircuitType() == DataClasses.CooktopCtrl.DEVICE_TYPE.OUTLET) unit_status = "cooktop";
|
|
|
+ else unit_status = "unknown";
|
|
|
+
|
|
|
+ if (cv_CooktopAPI.data.Device[i].circuit[j].getCircuitStatus() == DataClasses.CooktopCtrl.DEVICE_STATUS.OPEN) unit_status += "/on";
|
|
|
+ else if (cv_CooktopAPI.data.Device[i].circuit[j].getCircuitStatus() == DataClasses.CooktopCtrl.DEVICE_STATUS.CLOSE) unit_status += "/off";
|
|
|
+ else if (cv_CooktopAPI.data.Device[i].circuit[j].getCircuitStatus() == DataClasses.CooktopCtrl.DEVICE_STATUS.WORKING) unit_status += "/operating";
|
|
|
+ else unit_status += "/unknown";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }*/
|
|
|
+ else {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Cooktop] Not supported cooktop kind!! -> " + mWallPadAPI.GetGasKind());
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "gas" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "not_supported_protocol"+ "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Cooktop()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Cooktop()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_Vent() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ VentiAPI cv_VentiAPI = null; // 환기장비
|
|
|
+ cv_VentiAPI = mWallPadAPI.Get_VentiController();
|
|
|
+ if (cv_VentiAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Vent] Retry API loading... -> cv_VentiAPI");
|
|
|
+
|
|
|
+ if (cv_VentiAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Vent] cv_VentiAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" +"ventil" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_VentiAPI.Refresh(false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Vent] cv_VentiAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "ventil"+ "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ String strRM_TITLE = "실내";
|
|
|
+ int nDevCnt = 1, nDevNo = 1, nUnitCnt = 1, nUnitNo = 1; // 환기장비는 1개만 적용된다.
|
|
|
+ String mode = "", unit_mode = "", unit_status = "";
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "ventil" + "\" value=\"" + nDevCnt + "\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+
|
|
|
+ // 환기장비의 현장 상태값을 가저온다.
|
|
|
+ // 지원모드, 현재 동작 모드
|
|
|
+ if (cv_VentiAPI.data.Support.AutoDriving) {
|
|
|
+ mode = "normal/auto";
|
|
|
+ if (cv_VentiAPI.data.AutoDriving) unit_mode = "auto";
|
|
|
+ else unit_mode = "normal";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ mode = "normal";
|
|
|
+ unit_mode = "normal";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 전원상태, on인경우 풍량
|
|
|
+ if (cv_VentiAPI.data.OnOff == false) unit_status = "off";
|
|
|
+ else if (cv_VentiAPI.data.Wind == VentiAPI.WIND.HI) unit_status = "high";
|
|
|
+ else if (cv_VentiAPI.data.Wind == VentiAPI.WIND.MID) unit_status = "mid";
|
|
|
+ else if (cv_VentiAPI.data.Wind == VentiAPI.WIND.LOW) unit_status = "low";
|
|
|
+ else unit_status = "unknown";
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" mode=\"" + mode + "\" unit_mode=\"" + unit_mode + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Vent()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Vent()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getICMDDeviceStatus_Heat() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "", strOption = "null";
|
|
|
+
|
|
|
+
|
|
|
+ // 난방 종류를 얻어온다.
|
|
|
+ int nHeatProtocolVer = mWallPadAPI.GetHeatingKind();
|
|
|
+
|
|
|
+ HeatingV1API cv_HeatingV1API = null;
|
|
|
+ HeatingV2API cv_HeatingV2API = null;
|
|
|
+
|
|
|
+ // 종류별 API를 로딩한다.
|
|
|
+ if(nHeatProtocolVer == 1) cv_HeatingV1API = mWallPadAPI.Get_HeatingV1Controller();
|
|
|
+ else if(nHeatProtocolVer == 2) cv_HeatingV2API = mWallPadAPI.Get_HeatingV2Controller();
|
|
|
+
|
|
|
+ // 종류별 API를 로딩한다.
|
|
|
+ if (nHeatProtocolVer == 1) {
|
|
|
+ if (cv_HeatingV1API == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Heat] Retry API loading... -> cv_HeatingV1API");
|
|
|
+
|
|
|
+ if (cv_HeatingV1API == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Heat] cv_HeatingV1API is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "multivent" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_HeatingV1API.Refresh(define.DEVICE_ALL_OR_NOTHING, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Heat] cv_HeatingV1API refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "multivent" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nDevCnt = 1;
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "thermostat" + "\" value=\"" + nDevCnt + "\">\r\n";
|
|
|
+
|
|
|
+ for (int i = 0; i < nDevCnt; i++) {
|
|
|
+ int nUnitCnt = (int) cv_HeatingV1API.data.Device.RoomCount;
|
|
|
+ String strStepTemper = "1";
|
|
|
+ if (cv_HeatingV1API.data.Device.SetTempPoint05) strStepTemper = "0.5";
|
|
|
+ strOption = strStepTemper;
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"" + nUnitCnt + "\" option=\"" + strOption + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ String unit_status = ""; // 전원상태/설정온도/현재온도
|
|
|
+ // 전원상태
|
|
|
+ if (cv_HeatingV1API.data.Device.Room[i].bOnOff) unit_status = "on";
|
|
|
+ else unit_status = "off";
|
|
|
+
|
|
|
+ // 설정온도
|
|
|
+ unit_status += "/" + String.valueOf(cv_HeatingV1API.data.Device.Room[i].SetTemp);
|
|
|
+
|
|
|
+ // 현재온도
|
|
|
+ unit_status += "/" + String.valueOf(cv_HeatingV1API.data.Device.Room[i].NowTemp);
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (j + 1) + "\" unit_status=\"" + unit_status + "\" room_name=\"" + mDefaultRoomNameList_Heating[j] + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else if (nHeatProtocolVer == 2) {
|
|
|
+ if (cv_HeatingV2API == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Heat] Retry API loading... -> cv_HeatingV2API");
|
|
|
+
|
|
|
+ if (cv_HeatingV2API == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Heat] cv_HeatingV2API is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "multivent" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_HeatingV2API.Refresh(define.DEVICE_ALL_OR_NOTHING, false);
|
|
|
+
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Heat] cv_HeatingV2API refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "multivent" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nDevCnt = 1;
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "multivent" + "\" value=\"" + nDevCnt + "\">\r\n";
|
|
|
+
|
|
|
+ for (int i = 0; i < nDevCnt; i++) {
|
|
|
+ int nUnitCnt = (int) cv_HeatingV2API.data.Device.info.RoomCount;
|
|
|
+ String strStepTemper = "1";
|
|
|
+ if (cv_HeatingV2API.data.Device.info.Support.SetTempPoint05) strStepTemper = "0.5";
|
|
|
+ strOption = strStepTemper;
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"" + nUnitCnt + "\" option=\"" + strOption + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ String unit_status = ""; // 전원상태/설정온도/현재온도
|
|
|
+
|
|
|
+ // 전원상태
|
|
|
+ if (HeatingV2.MODE.GetOnOff(cv_HeatingV2API.data.Device.Room[j].Mode)) unit_status = "on";
|
|
|
+ else unit_status = "off";
|
|
|
+
|
|
|
+ // 설정온도
|
|
|
+ unit_status += "/" + String.valueOf(cv_HeatingV2API.data.Device.Room[j].SetTemp);
|
|
|
+
|
|
|
+ // 현재온도
|
|
|
+ unit_status += "/" + String.valueOf(cv_HeatingV2API.data.Device.Room[j].NowTemp);
|
|
|
+
|
|
|
+ // 외출모드/일시정지
|
|
|
+ if (cv_HeatingV2API.data.Device.Room[j].Mode == HeatingV2.MODE.Pause || cv_HeatingV2API.data.Device.Room[j].Mode == HeatingV2.MODE.Outing) unit_status += "/on";
|
|
|
+ else unit_status += "/off";
|
|
|
+
|
|
|
+ // 밸브 상태
|
|
|
+ if (cv_HeatingV2API.data.Device.Room[j].bValveStatus) unit_status += "/on";
|
|
|
+ else unit_status += "/off";
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (j + 1) + "\" unit_status=\"" + unit_status + "\" room_name=\"" + mDefaultRoomNameList_Heating[j] + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Heat] Not supported nHeatProtocolVer -> " + nHeatProtocolVer);
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "multivent" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "not_supported_protocol"+ "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Heat()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Heat()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_Outlet() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ nEnergyProductionUse = devSet.Get_Energy_Devices_Info(); //에너지 제품군
|
|
|
+ devSet.closeDB();
|
|
|
+ devSet = null;
|
|
|
+
|
|
|
+ // 분전반 사용유무 확인
|
|
|
+ if (nEnergyProductionUse == WallpadDeviceSet.DO_USE)
|
|
|
+ {
|
|
|
+ EnergyMeterAPI energymeter = mWallPadAPI.Get_EnergyMeterController();
|
|
|
+ // 대외각실형: 멀티스위치
|
|
|
+ if (energymeter == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Outlet] Retry API loading... -> mMultiSwitchAPI");
|
|
|
+
|
|
|
+ if (energymeter == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] cv_MultiSwitchAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "electric" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = energymeter.Refresh((byte)0xFF, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Outlet] cv_MultiSwitchAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "electric" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nMSCnt = energymeter.data.RoomCnt; // 멀티스위치 개수
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "electric" + "\" value=\"" + nMSCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nMSCnt; i++) {
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = energymeter.data.Em.eachRoom[i].ConCnt;
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + mDefaultRoomNameList_Light_HS[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_status = "null", status_mode = "null", status_onoff = "null", status_curpower = "null", status_accpower = "null";
|
|
|
+ boolean Power = energymeter.data.Em.eachRoom[i].ConOnOff[j];
|
|
|
+
|
|
|
+ if (energymeter.data.Em.eachRoom[i].ConMode) status_mode = "unset";
|
|
|
+ else status_mode = "set";
|
|
|
+
|
|
|
+ if (!Power) status_onoff = "on";
|
|
|
+ else status_onoff = "off";
|
|
|
+
|
|
|
+ status_curpower = Double.toString(energymeter.data.Em.eachRoom[i].ConNowPw[j]);
|
|
|
+
|
|
|
+ unit_status = status_mode + "/" + status_onoff + "/" + status_curpower + "/" + status_accpower;
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ MultiSwitchAPI cv_MultiSwitchAPI = null; // 대외향 - 멀티스위치 조명제어기 API
|
|
|
+ cv_MultiSwitchAPI = mWallPadAPI.Get_MultiSwitchController();
|
|
|
+ // 대외각실형: 멀티스위치
|
|
|
+ if (cv_MultiSwitchAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Outlet] Retry API loading... -> mMultiSwitchAPI");
|
|
|
+
|
|
|
+ if (cv_MultiSwitchAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Light] cv_MultiSwitchAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "electric" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_MultiSwitchAPI.Refresh(define.DEVICE_ALL_OR_NOTHING, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Outlet] cv_MultiSwitchAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "electric" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nMSCnt = cv_MultiSwitchAPI.data.DeviceCnt; // 멀티스위치 개수
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "electric" + "\" value=\"" + nMSCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nMSCnt; i++) {
|
|
|
+ int nDevNo = i + 1;
|
|
|
+ int nUnitCnt = cv_MultiSwitchAPI.data.Device[i].device.hOutletCnt;
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + nDevNo + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + mDefaultRoomNameList_Light_HS[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ int nUnitNo = j + 1;
|
|
|
+ String unit_status = "null", status_mode = "null", status_onoff = "null", status_curpower = "null", status_accpower = "null";
|
|
|
+ MultiSwitch.Device.Outlet rv_Outlet = cv_MultiSwitchAPI.data.Device[i].device.getOutletStatus(j);
|
|
|
+
|
|
|
+ if (rv_Outlet.Mode == MultiSwitch.OUTLET_MODE.Always) status_mode = "unset";
|
|
|
+ else status_mode = "set";
|
|
|
+
|
|
|
+ if (rv_Outlet.Status == MultiSwitch.OUTLET_STATUS.On) status_onoff = "on";
|
|
|
+ else status_onoff = "off";
|
|
|
+
|
|
|
+ status_curpower = Double.toString(rv_Outlet.NowPw);
|
|
|
+
|
|
|
+ unit_status = status_mode + "/" + status_onoff + "/" + status_curpower + "/" + status_accpower;
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + nUnitNo + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Outlet()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Outlet()");
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ private String getICMDDeviceStatus_SysAircon() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ if (cv_nSystemAirconUsage < WallpadDeviceSet.SYSTEMAIRCON_SAMSUNG_AIR || WallpadDeviceSet.SYSTEMAIRCON_ETC < cv_nSystemAirconUsage) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SysAircon] SysAircon not use!! cv_nSystemAirconUsage -> " + cv_nSystemAirconUsage);
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.SYSAIRCON.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.NOT_USE_CONFIGURED.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cv_SystemAirconAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_SysAircon] Retry API loading... -> cv_SystemAirconAPI");
|
|
|
+ init3rdPartyAirconAPI();
|
|
|
+
|
|
|
+ if (cv_SystemAirconAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SysAircon] cv_SystemAirconAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.SYSAIRCON.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_SystemAirconAPI.Refresh(define.DEVICE_ALL_OR_NOTHING, false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_SysAircon] cv_SystemAirconAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.SYSAIRCON.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] strRMTitleList = null;
|
|
|
+ if (cv_bRMTitleEditUsage) strRMTitleList = cv_RM_TITLE_V2_AIRCON;
|
|
|
+ else strRMTitleList = mDefaultRoomNameList_SystemAircon;
|
|
|
+
|
|
|
+ int nAirconUnitCnt = cv_SystemAirconAPI.data.Device.info.hInsideAirconCnt;
|
|
|
+ // 에어컨 동작모드 지원 항목
|
|
|
+ String strSupportedMode = "";
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bModeCtrl) {
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bModeAuto) {
|
|
|
+ if (strSupportedMode.equalsIgnoreCase("")) strSupportedMode += "auto";
|
|
|
+ else strSupportedMode += "/auto";
|
|
|
+ }
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bModeCooling) {
|
|
|
+ if (strSupportedMode.equalsIgnoreCase("")) strSupportedMode += "cool";
|
|
|
+ else strSupportedMode += "/cool";
|
|
|
+ }
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bModeHeating) {
|
|
|
+ if (strSupportedMode.equalsIgnoreCase("")) strSupportedMode += "heat";
|
|
|
+ else strSupportedMode += "/heat";
|
|
|
+ }
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bModeDehumidify) {
|
|
|
+ if (strSupportedMode.equalsIgnoreCase("")) strSupportedMode += "dehum";
|
|
|
+ else strSupportedMode += "/dehum";
|
|
|
+ }
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bModeFan) {
|
|
|
+ if (strSupportedMode.equalsIgnoreCase("")) strSupportedMode += "blow";
|
|
|
+ else strSupportedMode += "/blow";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ strSupportedMode = "null";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 에어컨 풍량제어 지원 항목
|
|
|
+ String strDefaultAirVol = "자동/약/중/강";
|
|
|
+ String strSupportedAirVol = "";
|
|
|
+ if (cv_SystemAirconAPI.data.Device.info.Support.bAirVolCtrl) strSupportedAirVol = strDefaultAirVol;
|
|
|
+ else strSupportedAirVol = "null";
|
|
|
+
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.SYSAIRCON.getContents() + "\" value=\"" + nAirconUnitCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nAirconUnitCnt; i++) {
|
|
|
+ String strUnitPower = "null", strUnitMode = "null", strUnitAirVol = "null", strUnitSetTemper = "null", strUnitCurrentTemper = "null", strUnitSwing = "null";
|
|
|
+ // 에어컨 전원 상태
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"1\">\r\n";
|
|
|
+ if (cv_SystemAirconAPI.data.Device.Aircon[i].hPower == DataClasses.SystemAircon.POWER.On) strUnitPower = "on";
|
|
|
+ else strUnitPower = "off";
|
|
|
+
|
|
|
+ // 에어컨 동작 모드 상태
|
|
|
+ strUnitMode = getTextAirconMode(cv_SystemAirconAPI.data.Device.Aircon[i].hMode);
|
|
|
+
|
|
|
+ // 에어컨 풍량상태
|
|
|
+ strUnitAirVol = getTextAirconAirVol(cv_SystemAirconAPI.data.Device.Aircon[i].hAirVol);
|
|
|
+
|
|
|
+ // 에어컨 설정 온도
|
|
|
+ strUnitSetTemper = Integer.toString((int) cv_SystemAirconAPI.data.Device.Aircon[i].hSetTemper);
|
|
|
+
|
|
|
+ // 에어컨 현재 온도
|
|
|
+ strUnitCurrentTemper = Integer.toString((int) cv_SystemAirconAPI.data.Device.Aircon[i].hCurrentTemper);
|
|
|
+
|
|
|
+ // 에어컨 풍향 상태
|
|
|
+ strUnitSwing = cv_SystemAirconAPI.data.Device.info.Support.bAirSwing ? getContentsAirconSwing(cv_SystemAirconAPI.data.Device.Aircon[i].bAirSwing) : "null";
|
|
|
+
|
|
|
+ // 에어컨 상태 종합
|
|
|
+ String strUnitStatus = strUnitPower + "/" + strUnitMode + "/" + strUnitAirVol + "/" + strUnitSetTemper + "/" + strUnitCurrentTemper +"/" + strUnitSwing;
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + strRMTitleList[i] + "\" mode=\"" + strSupportedMode + "\" wind=\"" + strSupportedAirVol + "\" unit_status=\"" + strUnitStatus + "\" room_name=\"" + strRMTitleList[i] + "\"/>\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_SysAircon()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_SysAircon()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ /*
|
|
|
+ private String getICMDDeviceStatus_AirQuality() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ if (cv_bAirQualityEnable && cv_bEnvMultiSensorUsage) {
|
|
|
+ if (cv_AirQualitySensorAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_AirQuality] Retry API loading... -> cv_AirQualitySensorAPI");
|
|
|
+ init3rdPartyAirQualitySensorAPI();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cv_EnvSensorAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_AirQuality] Retry API loading... -> cv_EnvSensorAPI");
|
|
|
+ init3rdPartyEnvSensorAPI();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI == null || cv_EnvSensorAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_AirQualitySensorAPI or cv_EnvSensorAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_AirQualitySensorAPI.Refresh(false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_AirQualitySensorAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ nRet = cv_EnvSensorAPI.Refresh(false, define.DEVICE_ALL_OR_NOTHING);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_EnvSensorAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nDevCnt = cv_EnvSensorAPI.mAPIData.hDevCnt + 1;
|
|
|
+ int nUnitCnt = 1; // 유닛카운트는 1로 고정
|
|
|
+
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"" + nDevCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nDevCnt; i++) {
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + cv_RM_TITLE_V2_VENTI2[i] + "\">\r\n";
|
|
|
+ if (i == 0) {
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ String unit_status = "";
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSensePM10) unit_status = makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.PM10);
|
|
|
+ else unit_status = "null";
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSensePM2p5) unit_status += "/" + makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.PM2p5);
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSensePM1p0) unit_status += "/" + makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.PM1p0);
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSenseCO2) unit_status += "/" + makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.CO2);
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ unit_status += "/null"; // CO
|
|
|
+ unit_status += "/null"; // 습도
|
|
|
+ unit_status += "/null"; // 온도
|
|
|
+ unit_status += "/null"; // TVOC
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (j + 1) + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ String unit_status = "";
|
|
|
+ DataClasses.EnvSensor tv_EnvSensor = cv_EnvSensorAPI.mAPIData.Device[i - 1];
|
|
|
+
|
|
|
+ // PM10
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_PM10) {
|
|
|
+ unit_status = makeEnvSensorStatus(tv_EnvSensor.info.Support.mPM10Props.bPhase, tv_EnvSensor.info.Support.mPM10Props.bValue, tv_EnvSensor.data.mPM10.hPhase, tv_EnvSensor.data.mPM10.nValue);
|
|
|
+ }
|
|
|
+ else unit_status = "null";
|
|
|
+
|
|
|
+ // PM2.5
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_PM2p5) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mPM2p5Props.bPhase, tv_EnvSensor.info.Support.mPM2p5Props.bValue, tv_EnvSensor.data.mPM2p5.hPhase, tv_EnvSensor.data.mPM2p5.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // PM1.0
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_PM1p0) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mPM1p0Props.bPhase, tv_EnvSensor.info.Support.mPM1p0Props.bValue, tv_EnvSensor.data.mPM1p0.hPhase, tv_EnvSensor.data.mPM1p0.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // CO2
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_CO2) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mCO2Props.bPhase, tv_EnvSensor.info.Support.mCO2Props.bValue, tv_EnvSensor.data.mCO2.hPhase, tv_EnvSensor.data.mCO2.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // CO
|
|
|
+ unit_status += "/null";
|
|
|
+
|
|
|
+ // 습도
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_Humidity) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mHumidityProps.bPhase, tv_EnvSensor.info.Support.mHumidityProps.bValue, tv_EnvSensor.data.mHumidity.hPhase, tv_EnvSensor.data.mHumidity.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // 온도
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_Temper) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mTemperProps.bPhase, tv_EnvSensor.info.Support.mTemperProps.bValue, tv_EnvSensor.data.mTemper.hPhase, tv_EnvSensor.data.mTemper.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // TVOC
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_TVOC) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mTVOCProps.bPhase, tv_EnvSensor.info.Support.mTVOCProps.bValue, tv_EnvSensor.data.mTVOC.hPhase, tv_EnvSensor.data.mTVOC.nValue);
|
|
|
+ } else unit_status += "/null";
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (j + 1) + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else if (cv_bAirQualityEnable) {
|
|
|
+ if (cv_AirQualitySensorAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_AirQuality] Retry API loading... -> cv_AirQualitySensorAPI");
|
|
|
+ init3rdPartyAirQualitySensorAPI();
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_AirQualitySensorAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_AirQualitySensorAPI.Refresh(false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_AirQualitySensorAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nDevCnt = 1, nUnitCnt = 1; // 공기질 센서는 1개만 적용
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"" + nDevCnt + "\">\r\n";
|
|
|
+
|
|
|
+ for (int i = 0; i < nDevCnt; i++) {
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + cv_RM_TITLE_V2_VENTI2[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ String unit_status = "";
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSensePM10) unit_status = makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.PM10);
|
|
|
+ else unit_status = "null";
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSensePM2p5) unit_status += "/" + makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.PM2p5);
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSensePM1p0) unit_status += "/" + makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.PM1p0);
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ if (cv_AirQualitySensorAPI.mAirQualityData.info.Support.bSenseCO2) unit_status += "/" + makeAPAirSensorStatus(DataClasses.EnvSensor.ENV_FACTOR.CO2);
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ unit_status += "/null"; // CO
|
|
|
+ unit_status += "/null"; // 습도
|
|
|
+ unit_status += "/null"; // 온도
|
|
|
+ unit_status += "/null"; // TVOC
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (j + 1) + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else if (cv_bEnvMultiSensorUsage) {
|
|
|
+ if (cv_EnvSensorAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_AirQuality] Retry API loading... -> cv_EnvSensorAPI");
|
|
|
+ init3rdPartyEnvSensorAPI();
|
|
|
+
|
|
|
+ if (cv_EnvSensorAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_EnvSensorAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_EnvSensorAPI.Refresh(false, define.DEVICE_ALL_OR_NOTHING);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_EnvSensorAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ int nDevCnt = cv_EnvSensorAPI.mAPIData.hDevCnt;
|
|
|
+
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"" + nDevCnt + "\">\r\n";
|
|
|
+ for (int i = 0; i < nDevCnt; i++) {
|
|
|
+ int nUnitCnt = 1; // 공기질 센서는 1개만 적용
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"" + (i + 1) + "\" unit_cnt=\"" + nUnitCnt + "\" room_name=\"" + cv_RM_TITLE_V2_VENTI2[i] + "\">\r\n";
|
|
|
+ for (int j = 0; j < nUnitCnt; j++) {
|
|
|
+ String unit_status = "";
|
|
|
+ DataClasses.EnvSensor tv_EnvSensor = cv_EnvSensorAPI.mAPIData.Device[i];
|
|
|
+
|
|
|
+ // PM10
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_PM10) {
|
|
|
+ unit_status = makeEnvSensorStatus(tv_EnvSensor.info.Support.mPM10Props.bPhase, tv_EnvSensor.info.Support.mPM10Props.bValue, tv_EnvSensor.data.mPM10.hPhase, tv_EnvSensor.data.mPM10.nValue);
|
|
|
+ }
|
|
|
+ else unit_status = "null";
|
|
|
+
|
|
|
+ // PM2.5
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_PM2p5) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mPM2p5Props.bPhase, tv_EnvSensor.info.Support.mPM2p5Props.bValue, tv_EnvSensor.data.mPM2p5.hPhase, tv_EnvSensor.data.mPM2p5.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // PM1.0
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_PM1p0) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mPM1p0Props.bPhase, tv_EnvSensor.info.Support.mPM1p0Props.bValue, tv_EnvSensor.data.mPM1p0.hPhase, tv_EnvSensor.data.mPM1p0.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // CO2
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_CO2) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mCO2Props.bPhase, tv_EnvSensor.info.Support.mCO2Props.bValue, tv_EnvSensor.data.mCO2.hPhase, tv_EnvSensor.data.mCO2.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // CO
|
|
|
+ unit_status += "/null";
|
|
|
+
|
|
|
+ // 습도
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_Humidity) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mHumidityProps.bPhase, tv_EnvSensor.info.Support.mHumidityProps.bValue, tv_EnvSensor.data.mHumidity.hPhase, tv_EnvSensor.data.mHumidity.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // 온도
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_Temper) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mTemperProps.bPhase, tv_EnvSensor.info.Support.mTemperProps.bValue, tv_EnvSensor.data.mTemper.hPhase, tv_EnvSensor.data.mTemper.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ // TVOC
|
|
|
+ if (tv_EnvSensor.info.Support.bFunc_TVOC) {
|
|
|
+ unit_status += "/" + makeEnvSensorStatus(tv_EnvSensor.info.Support.mTVOCProps.bPhase, tv_EnvSensor.info.Support.mTVOCProps.bValue, tv_EnvSensor.data.mTVOC.hPhase, tv_EnvSensor.data.mTVOC.nValue);
|
|
|
+ }
|
|
|
+ else unit_status += "/null";
|
|
|
+
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"" + (j + 1) + "\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ }
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_AirQuality] cv_bAirQualityEnable [" + cv_bAirQualityEnable + "], cv_bEnvMultiSensorUsage [" + cv_bEnvMultiSensorUsage + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.AIRQUALITY.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + ICMD_RESULT_REASON.NOT_USE_CONFIGURED.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_AirQuality()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_AirQuality()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ /*
|
|
|
+ private String getICMDDeviceStatus_Louver() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ if (cv_nLouver != WallpadDeviceSet.DO_USE) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Louver] cv_nLouver [" + cv_nLouver + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LOUVER.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody +=BLANK_02 + "<reason>" + ICMD_RESULT_REASON.NOT_USE_CONFIGURED.getContents() + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cv_LouverAPI == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Louver] Retry API loading... -> cv_LouverAPI");
|
|
|
+ init3rdPartyLouverAPI();
|
|
|
+
|
|
|
+ if (cv_LouverAPI == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Louver] cv_LouverAPI is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LOUVER.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int nRet = cv_LouverAPI.Refresh(false);
|
|
|
+ if (nRet < 0) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Louver] cv_LouverAPI refresh fail!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LOUVER.getContents() + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ String strRM_TITLE = "실외기실";
|
|
|
+ String unit_status = "";
|
|
|
+ if (cv_LouverAPI.data.Device.device.Status == DataClasses.Louver.LOUVER_STATUS.Close) unit_status = "close";
|
|
|
+ else if (cv_LouverAPI.data.Device.device.Status == DataClasses.Louver.LOUVER_STATUS.Operation) unit_status = "ing";
|
|
|
+ else if (cv_LouverAPI.data.Device.device.Status == DataClasses.Louver.LOUVER_STATUS.Open) unit_status = "open";
|
|
|
+ else unit_status = "null";
|
|
|
+
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + iMAPDefine.DEVICE_TYPE.LOUVER.getContents() + "\" value=\"1\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"1\" unit_cnt=\"1\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"1\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ XmlBody +=BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Louver()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Louver()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_Sensor() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+ if (cv_nGatewayType == Version.GATEWAY_MODEL.OTHER) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] cv_nGatewayType [" + cv_nGatewayType + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "not_use_configured" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ String magnetic = "null", motion_out = "null", motion_in = "null", emergency_io = "null", ladder_up = "null", ladder_my = "null", apu = "null";
|
|
|
+ if (cv_nGatewayType == Version.GATEWAY_MODEL.NON_USE) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Sensor] No gateway!!");
|
|
|
+
|
|
|
+ int sensorMag = 0, sensorIn = 0, sensorOut = 0;
|
|
|
+
|
|
|
+ WallPadInterface wallPadInterface = new WallPadInterface();
|
|
|
+ sensorMag = wallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MAG0_STATE, 0);
|
|
|
+
|
|
|
+ int[] SensorInfoDB;
|
|
|
+ SensorInfoDB = Common.GetInSensorUseOfNotFromDB(getApplicationContext());
|
|
|
+ if (SensorInfoDB[0] == WallpadDeviceSet.DO_USE) {
|
|
|
+ // 내부동체가 사용함이면 상태 검사
|
|
|
+ sensorIn = wallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTIN_STATE, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (SensorInfoDB[1] == WallpadDeviceSet.DO_USE) {
|
|
|
+ // 외부동체가 사용함이면 상태 검사
|
|
|
+ sensorOut = wallPadInterface.DoControl(WallPadInterface.IOCTL_SENSOR_MOTOUT_STATE, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 동체 사용 설정 체크..
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] nInOutMotionSensor = " + cv_nInOutMotionSensorUseSetting);
|
|
|
+
|
|
|
+ // 내부동체 사용안함 이면
|
|
|
+ if ((cv_nInOutMotionSensorUseSetting & WallpadDeviceSet.SET_IN_MOTION) == 0) sensorIn = 0;
|
|
|
+
|
|
|
+ // 외부동체 사용안함 이면
|
|
|
+ if ((cv_nInOutMotionSensorUseSetting & WallpadDeviceSet.SET_OUT_MOTION) == 0) sensorOut = 0;
|
|
|
+
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] sensorMag [" + sensorMag + "], sensorIn [" + sensorIn + "], sensorOut [" + sensorOut + "]");
|
|
|
+
|
|
|
+ // 마그네틱
|
|
|
+ if (sensorMag == 0) magnetic = "normal";
|
|
|
+ else if (sensorMag == 1) magnetic = "detect";
|
|
|
+
|
|
|
+ // 내부동체
|
|
|
+ if (sensorIn == 0) motion_in = "normal";
|
|
|
+ else if (sensorIn == 1) motion_in = "detect";
|
|
|
+
|
|
|
+ // 외부동체
|
|
|
+ if (sensorOut == 0) motion_out = "normal";
|
|
|
+ else if (sensorOut == 1) motion_out = "detect";
|
|
|
+
|
|
|
+ String strRM_TITLE = "전체";
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"1\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"1\" unit_cnt=\"1\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ XmlBody += BLANK_04 + "<status_info magnetic=\"" + 1 + "\" motion_out=\"" + motion_out + "\" motion_in=\"" + motion_in + "\" emergency_io=\"" + emergency_io + "\" ladder_up=\"" + ladder_up + "\" ladder_my=\"" + ladder_my + "\" apu=\"" + apu + "\"/>\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else if (cv_nGatewayType == Version.GATEWAY_MODEL.IGW_300) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Sensor] IGW-300 gateway!!");
|
|
|
+ if (cv_IGW300API == null) {
|
|
|
+ Log.i(TAG, "[getICMDDeviceStatus_Sensor] Retry API loading... -> cv_IGW300API");
|
|
|
+ setIGW300Interface();
|
|
|
+
|
|
|
+ if (cv_IGW300API == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] cv_IGW300API is null!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_null" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // return int[7] = { 마그네틱, 외부동체, 내부동체, 접점비상, 윗집 피난사다리, 우리집 피난사다리, APU }
|
|
|
+ int[] naSensorStatus = cv_IGW300API.getSensorStatus();
|
|
|
+ if (naSensorStatus == null) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] cv_nGatewayType [" + cv_nGatewayType + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (naSensorStatus.length != 7) {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] cv_nGatewayType [" + cv_nGatewayType + "]");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "api_refresh_fail" + "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 마그네틱
|
|
|
+ if (naSensorStatus[0] == cv_IGW300API.SENSOR_NOINFO) magnetic = "do_not_use";
|
|
|
+ else if (naSensorStatus[0] == cv_IGW300API.SENSOR_NOTDETECT) magnetic = "normal";
|
|
|
+ else if (naSensorStatus[0] == cv_IGW300API.SENSOR_DETECT) magnetic = "detect";
|
|
|
+
|
|
|
+ // 외부동체
|
|
|
+ if (naSensorStatus[1] == cv_IGW300API.SENSOR_NOINFO) motion_out = "do_not_use";
|
|
|
+ else if (naSensorStatus[1] == cv_IGW300API.SENSOR_NOTDETECT) motion_out = "normal";
|
|
|
+ else if (naSensorStatus[1] == cv_IGW300API.SENSOR_DETECT) motion_out = "detect";
|
|
|
+
|
|
|
+ // 내부동체
|
|
|
+ if (naSensorStatus[2] == cv_IGW300API.SENSOR_NOINFO) motion_in = "do_not_use";
|
|
|
+ else if (naSensorStatus[2] == cv_IGW300API.SENSOR_NOTDETECT) motion_in = "normal";
|
|
|
+ else if (naSensorStatus[2] == cv_IGW300API.SENSOR_DETECT) motion_in = "detect";
|
|
|
+
|
|
|
+ // 접점비상
|
|
|
+ if (naSensorStatus[3] == cv_IGW300API.SENSOR_NOINFO) emergency_io = "do_not_use";
|
|
|
+ else if (naSensorStatus[3] == cv_IGW300API.SENSOR_NOTDETECT) emergency_io = "normal";
|
|
|
+ else if (naSensorStatus[3] == cv_IGW300API.SENSOR_DETECT) emergency_io = "detect";
|
|
|
+
|
|
|
+ // 윗집 피난사다리
|
|
|
+ if (naSensorStatus[4] == cv_IGW300API.SENSOR_NOINFO) ladder_up = "do_not_use";
|
|
|
+ else if (naSensorStatus[4] == cv_IGW300API.SENSOR_NOTDETECT) ladder_up = "normal";
|
|
|
+ else if (naSensorStatus[4] == cv_IGW300API.SENSOR_DETECT) ladder_up = "detect";
|
|
|
+
|
|
|
+ // 우리집 피난사다리
|
|
|
+ if (naSensorStatus[5] == cv_IGW300API.SENSOR_NOINFO) ladder_my = "do_not_use";
|
|
|
+ else if (naSensorStatus[5] == cv_IGW300API.SENSOR_NOTDETECT) ladder_my = "normal";
|
|
|
+ else if (naSensorStatus[5] == cv_IGW300API.SENSOR_DETECT) ladder_my = "detect";
|
|
|
+
|
|
|
+ // APU
|
|
|
+ if (naSensorStatus[6] == cv_IGW300API.SENSOR_NOINFO) apu = "do_not_use";
|
|
|
+ else if (naSensorStatus[6] == cv_IGW300API.SENSOR_NOTDETECT) apu = "normal";
|
|
|
+ else if (naSensorStatus[6] == cv_IGW300API.SENSOR_DETECT) apu = "detect";
|
|
|
+
|
|
|
+ String strRM_TITLE = "전체";
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"1\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"1\" unit_cnt=\"1\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ XmlBody += BLANK_04 + "<status_info magnetic=\"" + 1 + "\" motion_out=\"" + motion_out + "\" motion_in=\"" + motion_in + "\" emergency_io=\"" + emergency_io + "\" ladder_up=\"" + ladder_up + "\" ladder_my=\"" + ladder_my + "\" apu=\"" + apu + "\" />\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Log.w(TAG, "[getICMDDeviceStatus_Sensor] unknown!!!");
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "sensor" + "\" value=\"0\">\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>" + "not_support"+ "</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+ return XmlBody;
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_Sensor()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_Sensor()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //jglee 2024.09.30.01 프로토콜 추가 처리
|
|
|
+ private String getICMDDeviceStatus_SecurityMode() {
|
|
|
+ try {
|
|
|
+ String XmlBody = "";
|
|
|
+
|
|
|
+ String strRM_TITLE = "전체";
|
|
|
+ String unit_status = "null";
|
|
|
+ if (nSecurityMode == WallpadStatusData.GUARD_IN) unit_status = "occupied";
|
|
|
+ else if (nSecurityMode == WallpadStatusData.GUARD_OUT) unit_status = "unoccupied";
|
|
|
+ else if (nSecurityMode == WallpadStatusData.GUARD_OUT_WAIT) unit_status = "normal";
|
|
|
+ else if (nSecurityMode == WallpadStatusData.ALARM_NONE) unit_status = "normal";
|
|
|
+ else if (nSecurityMode == WallpadStatusData.ALARM_ARISE) unit_status = "emergency";
|
|
|
+
|
|
|
+ XmlBody += BLANK_02 + "<devinfo name=\"" + "security_mode" + "\" value=\"1\">\r\n";
|
|
|
+ XmlBody += BLANK_03 + "<status_map dev_num=\"1\" unit_cnt=\"1\" room_name=\"" + strRM_TITLE + "\">\r\n";
|
|
|
+ XmlBody += BLANK_04 + "<status_info unit_num=\"null\" unit_status=\"" + unit_status + "\"/>\r\n";
|
|
|
+ XmlBody += BLANK_03 + "</status_map>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "<reason>null</reason>\r\n";
|
|
|
+ XmlBody += BLANK_02 + "</devinfo>\r\n";
|
|
|
+
|
|
|
+ return XmlBody;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "[RuntimeException] getICMDDeviceStatus_SecurityMode()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] getICMDDeviceStatus_SecurityMode()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|