|
@@ -2135,7 +2135,12 @@ public class KNX_Controller extends DeviceManager {
|
|
return "FAIL;" + APIErrorCode.DEVICEISNOTREADY;
|
|
return "FAIL;" + APIErrorCode.DEVICEISNOTREADY;
|
|
}
|
|
}
|
|
|
|
|
|
- CtrDevFormat ctrDevFormat = GetCtrDevParamParsing(StrArg, 5);
|
|
|
|
|
|
+ CtrDevFormat ctrDevFormat;
|
|
|
|
+ if(StrArg.contains("SetEntireLivlight")){
|
|
|
|
+ ctrDevFormat = GetCtrDevParamParsing(StrArg, 13);
|
|
|
|
+ } else {
|
|
|
|
+ ctrDevFormat = GetCtrDevParamParsing(StrArg, 5);
|
|
|
|
+ }
|
|
if (ctrDevFormat.ret != APIErrorCode.C_SUCCESS) {
|
|
if (ctrDevFormat.ret != APIErrorCode.C_SUCCESS) {
|
|
Log.w(TAG, "[NoSinkCtrl] GetCtrDevParamParsing Error (ret:" + ctrDevFormat.ret + ")");
|
|
Log.w(TAG, "[NoSinkCtrl] GetCtrDevParamParsing Error (ret:" + ctrDevFormat.ret + ")");
|
|
return "FAIL;" + APIErrorCode.DEFAULT_PARSING_ERR;
|
|
return "FAIL;" + APIErrorCode.DEFAULT_PARSING_ERR;
|
|
@@ -2207,8 +2212,13 @@ public class KNX_Controller extends DeviceManager {
|
|
Log.w(TAG, "[do_ctrEmm] - Not Yet !!!");
|
|
Log.w(TAG, "[do_ctrEmm] - Not Yet !!!");
|
|
return SHMem.retVal = "FAIL;" + APIErrorCode.DEVICEISNOTREADY;
|
|
return SHMem.retVal = "FAIL;" + APIErrorCode.DEVICEISNOTREADY;
|
|
}
|
|
}
|
|
-
|
|
|
|
- CtrDevFormat ctrDevFormat = GetCtrDevParamParsing(SHMem.StrArg, 5);
|
|
|
|
|
|
+ CtrDevFormat ctrDevFormat;
|
|
|
|
+ if(SHMem.StrArg.contains("SetEntireLivlight")){
|
|
|
|
+ ctrDevFormat = GetCtrDevParamParsing(SHMem.StrArg, 13);
|
|
|
|
+ } else {
|
|
|
|
+ ctrDevFormat = GetCtrDevParamParsing(SHMem.StrArg, 5);
|
|
|
|
+ }
|
|
|
|
+ //CtrDevFormat ctrDevFormat = GetCtrDevParamParsing(SHMem.StrArg, 5);
|
|
if (ctrDevFormat.ret != APIErrorCode.C_SUCCESS) {
|
|
if (ctrDevFormat.ret != APIErrorCode.C_SUCCESS) {
|
|
Log.w(TAG, "[do_ctrEmm] GetCtrDevParamParsing Error (ret:" + ctrDevFormat.ret + ")");
|
|
Log.w(TAG, "[do_ctrEmm] GetCtrDevParamParsing Error (ret:" + ctrDevFormat.ret + ")");
|
|
return SHMem.retVal = "FAIL;" + APIErrorCode.DEFAULT_PARSING_ERR;
|
|
return SHMem.retVal = "FAIL;" + APIErrorCode.DEFAULT_PARSING_ERR;
|
|
@@ -2432,8 +2442,8 @@ public class KNX_Controller extends DeviceManager {
|
|
byte hLightCnt = ahCtrlData[nIndex];
|
|
byte hLightCnt = ahCtrlData[nIndex];
|
|
|
|
|
|
int nExpectedLength = (hLightCnt * 3) + 1;
|
|
int nExpectedLength = (hLightCnt * 3) + 1;
|
|
- if (hLightCnt != nExpectedLength) {
|
|
|
|
- Log.w(TAG, "[do_ctrEmm] SetEntireLivlight -> wrong param: nExpectedLength [" + nExpectedLength + "], hLightCnt [" + hLightCnt + "]");
|
|
|
|
|
|
+ if (ahCtrlData.length != nExpectedLength) {
|
|
|
|
+ Log.w(TAG, "[do_ctrEmm] SetEntireLivlight -> wrong param: nExpectedLength [" + nExpectedLength + "], ahCtrlData.length [" + ahCtrlData.length + "]");
|
|
return SHMem.retVal = "FAIL;" + APIErrorCode.INVALIDPARAMETER;
|
|
return SHMem.retVal = "FAIL;" + APIErrorCode.INVALIDPARAMETER;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4577,9 +4587,17 @@ public class KNX_Controller extends DeviceManager {
|
|
int nReqDataLength = 4 + (nLightCnt * 3);
|
|
int nReqDataLength = 4 + (nLightCnt * 3);
|
|
byte[] ReqData = new byte[nReqDataLength];
|
|
byte[] ReqData = new byte[nReqDataLength];
|
|
|
|
|
|
- ReqData[0] = EM_FIX_INDEX_LIVING; // 거실EM ID
|
|
|
|
- ReqData[1] = (byte) 0x00; // 미사용 필드
|
|
|
|
- System.arraycopy(ahCtrlData, 0, ReqData, 2, ahCtrlData.length); // 조명 상태값 배열 복사
|
|
|
|
|
|
+ int index = 0;
|
|
|
|
+
|
|
|
|
+ ReqData[index++] = EM_FIX_INDEX_LIVING; // 거실EM ID
|
|
|
|
+ ReqData[index++] = (byte) 0x00; // 미사용 필드
|
|
|
|
+ ReqData[index++] = ahCtrlData[0]; // 조명 개수
|
|
|
|
+ for(int i=0; i<nLightCnt;i++){
|
|
|
|
+ ReqData[index++] = ahCtrlData[i+1];
|
|
|
|
+ ReqData[index++] = ahCtrlData[i+5];
|
|
|
|
+ ReqData[index++] = ahCtrlData[i+9];
|
|
|
|
+ }
|
|
|
|
+ //System.arraycopy(ahCtrlData, 0, ReqData, 2, ahCtrlData.length); // 조명 상태값 배열 복사
|
|
ReqData[ReqData.length - 1] = (byte) 0x00; // 콘센트 개수
|
|
ReqData[ReqData.length - 1] = (byte) 0x00; // 콘센트 개수
|
|
|
|
|
|
// 3. 데이터 전송 및 응답
|
|
// 3. 데이터 전송 및 응답
|