|
|
@@ -18,8 +18,8 @@ public class HomeAutomation_Call {
|
|
|
/** BR Action Name <br>
|
|
|
* 본 Action Name을 BroadcastReceiver에 getAction 후 문자열 비교 등록 후 일치 시 사용해야 한다.
|
|
|
* **/
|
|
|
- public static final String BR_ACTION_NAME = "HOME_AUTOMATION_CALL";
|
|
|
- public static final String BR_ACTION_NAME_OPTION = "HOME_AUTOMATION_CALL_OPTION";
|
|
|
+ public static final String BR_HOME_AUTOMATION_CALL = "BR_HOME_AUTOMATION_CALL";
|
|
|
+ public static final String BR_HOME_AUTOMATION_CALL_OPTION = "BR_HOME_AUTOMATION_CALL_OPTION";
|
|
|
|
|
|
/** BR Data Type **/
|
|
|
public static final String BR_DEVICE = "DEVICE";
|
|
|
@@ -96,22 +96,21 @@ public class HomeAutomation_Call {
|
|
|
* @param intent -> 수신 받은 intent 원형
|
|
|
* @param AppName -> 본 함수 사용하는 APP의 Name ("WallPadDevService or WallPadCall")
|
|
|
* **/
|
|
|
- int m_nCallType = 0;
|
|
|
public Call_Info BR_Parsing(Intent intent, String AppName) {
|
|
|
- Log.e(TAG, "[BR_Parsing] AppName : " + AppName);
|
|
|
+ Log.i(TAG, "[BR_Parsing] AppName : " + AppName);
|
|
|
Call_Info call_info = null;
|
|
|
|
|
|
// 1. 디바이스 정보 범위 체크
|
|
|
int Device = intent.getIntExtra(BR_DEVICE, DEVICE_NONE);
|
|
|
if ((Device < DEVICE_NONE) || (Device > DEVICE_NEIBOR)) {
|
|
|
- Log.e(TAG, "BR_Parsing - Device is error : " + Device);
|
|
|
+ Log.e(TAG, "[BR_Parsing] Device is error : " + Device);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
// 2. 통화 정보 범위 체크
|
|
|
int CallType = intent.getIntExtra(BR_TYPE_CALL, CALLTYPE_NONE);
|
|
|
if ((CallType < CALLTYPE_NONE) || (CALLTYPE_RECEIVE_DOOR_OPEN_ACK < CallType)) {
|
|
|
- Log.e(TAG, "BR_Parsing - CallType is error : " + CallType);
|
|
|
+ Log.e(TAG, "[BR_Parsing] CallType is error : " + CallType);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -127,7 +126,7 @@ public class HomeAutomation_Call {
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
- Log.e(TAG, "BR_Parsing - " + APP_NAME_WALLPADDEVSERVICE + " - CallType is error : " + CallType);
|
|
|
+ Log.e(TAG, "[BR_Parsing] " + APP_NAME_WALLPADDEVSERVICE + " - CallType is error : " + CallType);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
@@ -144,7 +143,7 @@ public class HomeAutomation_Call {
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
- Log.e(TAG, "BR_Parsing - " + APP_NAME_WALLPADCALL + " - CallType is error : " + CallType);
|
|
|
+ Log.e(TAG, "[BR_Parsing] " + APP_NAME_WALLPADCALL + " - CallType is error : " + CallType);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
@@ -152,13 +151,13 @@ public class HomeAutomation_Call {
|
|
|
// 3. 동 정보 범위 체크
|
|
|
int Dong = intent.getIntExtra(BR_ID_DONG, -1);
|
|
|
if ((Dong < 0) || (Dong > 9999)) {
|
|
|
- Log.e(TAG, "BR_Parsing - Dong is error : " + Dong);
|
|
|
+ Log.e(TAG, "[BR_Parsing] Dong is error : " + Dong);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
if (Device == DEVICE_GUARD) {
|
|
|
if (Dong != 0) {
|
|
|
- Log.e(TAG, "BR_Parsing - Dong is error : " + Dong + "(DEVICE_GUARD)");
|
|
|
+ Log.e(TAG, "[BR_Parsing] Dong is error : " + Dong + "(DEVICE_GUARD)");
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
@@ -166,7 +165,7 @@ public class HomeAutomation_Call {
|
|
|
// 4. 호 정보 범위 체크
|
|
|
int Ho = intent.getIntExtra(BR_ID_HO, -1);
|
|
|
if ((Ho < 0) || (Ho > 9999)) {
|
|
|
- Log.e(TAG, "BR_Parsing - Ho is error : " + Ho);
|
|
|
+ Log.e(TAG, "[BR_Parsing] Ho is error : " + Ho);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -177,10 +176,10 @@ public class HomeAutomation_Call {
|
|
|
call_info.ID_Dong = Dong;
|
|
|
call_info.ID_Ho = Ho;
|
|
|
|
|
|
- Log.d(TAG, "BR_Parsing - call_info.Type_Device : " + call_info.Type_Device);
|
|
|
- Log.d(TAG, "BR_Parsing - call_info.Type_Call : " + call_info.Type_Call);
|
|
|
- Log.d(TAG, "BR_Parsing - call_info.ID_Dong : " + call_info.ID_Dong);
|
|
|
- Log.d(TAG, "BR_Parsing - call_info.ID_Ho : " + call_info.ID_Ho);
|
|
|
+ Log.d(TAG, "[BR_Parsing] call_info.Type_Device : " + call_info.Type_Device);
|
|
|
+ Log.d(TAG, "[BR_Parsing] call_info.Type_Call : " + call_info.Type_Call);
|
|
|
+ Log.d(TAG, "[BR_Parsing] call_info.ID_Dong : " + call_info.ID_Dong);
|
|
|
+ Log.d(TAG, "[BR_Parsing] call_info.ID_Ho : " + call_info.ID_Ho);
|
|
|
|
|
|
return call_info;
|
|
|
}
|
|
|
@@ -191,98 +190,96 @@ public class HomeAutomation_Call {
|
|
|
*
|
|
|
* @return boolean -> true(정상), false(송신 실패)
|
|
|
*
|
|
|
- * @param DeviceType -> 디바이스 종류
|
|
|
- * @param CallType -> 통화 종류
|
|
|
- * @param ID_Dong -> 동 ID (경비실인 경우는 무시)
|
|
|
- * @param ID_Ho -> 호 ID (로비, 경비인 경우는 ID로 사용됨)
|
|
|
+ * @param nDeviceType -> 디바이스 종류
|
|
|
+ * @param nCallType -> 통화 종류
|
|
|
+ * @param nID_Dong -> 동 ID (경비실인 경우는 무시)
|
|
|
+ * @param nID_Ho -> 호 ID (로비, 경비인 경우는 ID로 사용됨)
|
|
|
* **/
|
|
|
- public boolean BR_Send(int DeviceType, int CallType, int ID_Dong, int ID_Ho) {
|
|
|
+ public boolean sendHomeAutoCallBR(int nDeviceType, int nCallType, int nID_Dong, int nID_Ho) {
|
|
|
/** param check **/
|
|
|
/*
|
|
|
- if(CallType == CALLTYPE_SEND_CALL_END || CallType == CALLTYPE_SEND_CALL_ACK_FAIL ||
|
|
|
- CallType == CALLTYPE_RECEIVE_CALL_END || CallType == CALLTYPE_RECEIVE_CALL_ACK_FAIL ||
|
|
|
- CallType == CALLTYPE_SEND_DOOR_OPEN || CallType == CALLTYPE_RECEIVE_DOOR_OPEN_ACK)
|
|
|
+ if(nCallType == CALLTYPE_SEND_CALL_END || nCallType == CALLTYPE_SEND_CALL_ACK_FAIL ||
|
|
|
+ nCallType == CALLTYPE_RECEIVE_CALL_END || nCallType == CALLTYPE_RECEIVE_CALL_ACK_FAIL ||
|
|
|
+ nCallType == CALLTYPE_SEND_DOOR_OPEN || nCallType == CALLTYPE_RECEIVE_DOOR_OPEN_ACK)
|
|
|
{
|
|
|
m_nCallType = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- m_nCallType = CallType;
|
|
|
+ m_nCallType = nCallType;
|
|
|
}
|
|
|
*/
|
|
|
// 1. 디바이스 정보 범위 체크
|
|
|
- if ((DeviceType < DEVICE_NONE) || (DeviceType > DEVICE_NEIBOR)) {
|
|
|
- Log.e(TAG, "BR_Send - DeviceType is error : " + DeviceType);
|
|
|
+ if ((nDeviceType < DEVICE_NONE) || (nDeviceType > DEVICE_NEIBOR)) {
|
|
|
+ Log.e(TAG, "[sendHomeAutoCallBR] nDeviceType is error : " + nDeviceType);
|
|
|
//m_nCallType = 0;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 2. 통화 정보 범위 체크
|
|
|
- if ((CallType < CALLTYPE_NONE) || (CallType > CALLTYPE_RECEIVE_DOOR_OPEN_ACK)) {
|
|
|
- Log.e(TAG, "BR_Send - CallType is error : " + CallType);
|
|
|
+ if ((nCallType < CALLTYPE_NONE) || (nCallType > CALLTYPE_RECEIVE_DOOR_OPEN_ACK)) {
|
|
|
+ Log.e(TAG, "[sendHomeAutoCallBR] nCallType is error : " + nCallType);
|
|
|
//m_nCallType = 0;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 3. 동 정보 범위 체크
|
|
|
- if ((ID_Dong < 0) || (ID_Dong > 9999)) {
|
|
|
- Log.e(TAG, "BR_Send - ID_Dong is error : " + ID_Dong);
|
|
|
+ if ((nID_Dong < 0) || (nID_Dong > 9999)) {
|
|
|
+ Log.e(TAG, "[sendHomeAutoCallBR] nID_Dong is error : " + nID_Dong);
|
|
|
//m_nCallType = 0;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if (DeviceType == DEVICE_GUARD) {
|
|
|
- if (ID_Dong != 0) {
|
|
|
- Log.e(TAG, "BR_Send - ID_Dong is error : " + ID_Dong + "(DEVICE_GUARD)");
|
|
|
+ if (nDeviceType == DEVICE_GUARD) {
|
|
|
+ if (nID_Dong != 0) {
|
|
|
+ Log.e(TAG, "[sendHomeAutoCallBR] nID_Dong is error : " + nID_Dong + "(DEVICE_GUARD)");
|
|
|
//m_nCallType = 0;
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 4. 호 정보 범위 체크
|
|
|
- if ((ID_Ho < 0) || (ID_Ho > 9999)) {
|
|
|
- Log.e(TAG, "BR_Send - ID_Dong is error : " + ID_Ho);
|
|
|
+ if ((nID_Ho < 0) || (nID_Ho > 9999)) {
|
|
|
+ Log.e(TAG, "[sendHomeAutoCallBR] nID_Dong is error : " + nID_Ho);
|
|
|
//m_nCallType = 0;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- Log.d(TAG, "BR_Send - DeviceType : " + DeviceType);
|
|
|
- Log.d(TAG, "BR_Send - CallType : " + CallType);
|
|
|
- Log.d(TAG, "BR_Send - ID_Dong : " + ID_Dong);
|
|
|
- Log.d(TAG, "BR_Send - ID_Ho : " + ID_Ho);
|
|
|
+ Log.d(TAG, "[sendHomeAutoCallBR] nDeviceType [" + nDeviceType + "], nCallType [" + nCallType + "], nID_Dong [" + nID_Dong + "], nID_Ho [" + nID_Ho + "]");
|
|
|
|
|
|
//5. Broadcast 전송
|
|
|
- sendCallBR(DeviceType, CallType, ID_Dong, ID_Ho);
|
|
|
+ sendCallBR(nDeviceType, nCallType, nID_Dong, nID_Ho);
|
|
|
|
|
|
|
|
|
/*
|
|
|
- if(CallType == CALLTYPE_SEND_CALL_END || CallType == CALLTYPE_SEND_CALL_ACK_FAIL ||
|
|
|
- CallType == CALLTYPE_RECEIVE_CALL_END || CallType == CALLTYPE_RECEIVE_CALL_ACK_FAIL ||
|
|
|
- CallType == CALLTYPE_SEND_DOOR_OPEN || CallType == CALLTYPE_RECEIVE_DOOR_OPEN_ACK)
|
|
|
+ if(nCallType == CALLTYPE_SEND_CALL_END || nCallType == CALLTYPE_SEND_CALL_ACK_FAIL ||
|
|
|
+ nCallType == CALLTYPE_RECEIVE_CALL_END || nCallType == CALLTYPE_RECEIVE_CALL_ACK_FAIL ||
|
|
|
+ nCallType == CALLTYPE_SEND_DOOR_OPEN || nCallType == CALLTYPE_RECEIVE_DOOR_OPEN_ACK)
|
|
|
{
|
|
|
m_nCallType = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- m_nCallType = CallType;
|
|
|
+ m_nCallType = nCallType;
|
|
|
}
|
|
|
*/
|
|
|
//Log.d(TAG, "BR_Send - CallType1 : " + m_nCallType);
|
|
|
|
|
|
// Intent mIntent = new Intent();
|
|
|
// mIntent.setAction(BR_ACTION_NAME);
|
|
|
-// mIntent.putExtra(BR_DEVICE, DeviceType);
|
|
|
-// mIntent.putExtra(BR_TYPE_CALL, ID_Dong);
|
|
|
+// mIntent.putExtra(BR_DEVICE, nDeviceType);
|
|
|
+// mIntent.putExtra(BR_TYPE_CALL, nID_Dong);
|
|
|
// mIntent.putExtra(BR_ID_DONG, nDong);
|
|
|
-// mIntent.putExtra(BR_ID_HO, ID_Ho);
|
|
|
+// mIntent.putExtra(BR_ID_HO, nID_Ho);
|
|
|
// context.sendBroadcast(mIntent);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public void setCallStaus(int nStatus) {
|
|
|
- m_nCallType = nStatus;
|
|
|
- Log.d(TAG, "BR_Send - CallType1 : " + m_nCallType);
|
|
|
+ boolean bWallPadCallLive = false;
|
|
|
+ public void setWallPadCallLive(boolean bCallWAppLive) {
|
|
|
+ bWallPadCallLive = bCallWAppLive;
|
|
|
+ Log.d(TAG, "[setWallPadCallLive] bWallPadCallLive [" + bWallPadCallLive + "]");
|
|
|
}
|
|
|
|
|
|
public void sendCallBR(int nCallType, int nEventType, int nDong, int nHo) {
|
|
|
@@ -296,7 +293,7 @@ public class HomeAutomation_Call {
|
|
|
}
|
|
|
else {
|
|
|
Intent mIntent = new Intent();
|
|
|
- mIntent.setAction(BR_ACTION_NAME);
|
|
|
+ mIntent.setAction(BR_HOME_AUTOMATION_CALL);
|
|
|
mIntent.putExtra(BR_DEVICE, nCallType);
|
|
|
mIntent.putExtra(BR_TYPE_CALL, nEventType);
|
|
|
mIntent.putExtra(BR_ID_DONG, nDong);
|
|
|
@@ -313,7 +310,7 @@ public class HomeAutomation_Call {
|
|
|
try {
|
|
|
Log.i(TAG, "[sendBlockCallFalg] bBlock [" + bBlock + "], nAutoReleaseSec [" + nAutoReleaseSec + "]");
|
|
|
Intent mIntent = new Intent();
|
|
|
- mIntent.setAction(BR_ACTION_NAME_OPTION);
|
|
|
+ mIntent.setAction(BR_HOME_AUTOMATION_CALL_OPTION);
|
|
|
mIntent.putExtra(BR_BLOCK_NEWCALL, bBlock);
|
|
|
mIntent.putExtra(BR_BLOCK_NEWCALL_RELEASESEC, nAutoReleaseSec);
|
|
|
context.sendBroadcast(mIntent);
|
|
|
@@ -328,7 +325,7 @@ public class HomeAutomation_Call {
|
|
|
|
|
|
public void receiveNewCall(int nCallType, int nEventType, int nDong, int nHo) {
|
|
|
try {
|
|
|
- Log.i(TAG, "[receiveNewCall] nCallType [" + nCallType + "], nEventType [" + nEventType + "], nDong [" + nDong + "], nHo [" + nHo + "]" + "], m_nCallType [" + m_nCallType + "]");
|
|
|
+ Log.i(TAG, "[receiveNewCall] nCallType [" + nCallType + "], nEventType [" + nEventType + "], nDong [" + nDong + "], nHo [" + nHo + "]");
|
|
|
CALLEVENTTYPE eEventType = CALLEVENTTYPE.RECEIVE_CALL;
|
|
|
CALLTYPE eCallType = CALLTYPE.NONE;
|
|
|
if (nCallType == DEVICE_LOBBY) eCallType = CALLTYPE.LOBBY;
|
|
|
@@ -340,7 +337,7 @@ public class HomeAutomation_Call {
|
|
|
}
|
|
|
|
|
|
//if (isCallAppRunning()) {
|
|
|
- if (m_nCallType == 0) {
|
|
|
+ if (!bWallPadCallLive) {
|
|
|
// 통화어플을 실행시킨다.
|
|
|
//m_nCallType = 1;
|
|
|
Log.w(TAG, "[runCallMainActivity] ########## START ##########");
|
|
|
@@ -371,7 +368,7 @@ public class HomeAutomation_Call {
|
|
|
Log.w(TAG, "[runCallMainActivity] wallpadcall is already running!!");
|
|
|
Log.e(TAG, "[runCallMainActivity] ############################## RUNNING ##############################");
|
|
|
Intent mIntent = new Intent();
|
|
|
- mIntent.setAction(BR_ACTION_NAME);
|
|
|
+ mIntent.setAction(BR_HOME_AUTOMATION_CALL);
|
|
|
mIntent.putExtra(BR_DEVICE, nCallType);
|
|
|
mIntent.putExtra(BR_TYPE_CALL, nEventType);
|
|
|
mIntent.putExtra(BR_ID_DONG, nDong);
|
|
|
@@ -406,7 +403,7 @@ public class HomeAutomation_Call {
|
|
|
Log.i(TAG, "[sendDirectACKBR] nCallType [" + nCallType + "], nEventType [" + nEventType + "], nDong [" + nDong + "], nHo [" + nHo + "]");
|
|
|
// Thread.sleep(500);
|
|
|
Intent mIntent = new Intent();
|
|
|
- mIntent.setAction(BR_ACTION_NAME);
|
|
|
+ mIntent.setAction(BR_HOME_AUTOMATION_CALL);
|
|
|
mIntent.putExtra(BR_DEVICE, nCallType);
|
|
|
mIntent.putExtra(BR_TYPE_CALL, nEventType);
|
|
|
mIntent.putExtra(BR_ID_DONG, nDong);
|