Ver Fonte

[WallPadAPI]
1. define 추가
- 원래 아이피 주소
- 기축세대 아이피 주소

2. WallPadiMAPClient
- 기축세대일 경우 아이피 주소가 새로 지정된 아이피에 연결

[ManagerSetting]
1. 신형단지서버 세팅 시, ServerVersion도 데이터 입력되게끔 수정

jglee há 3 anos atrás
pai
commit
79d510b16e

BIN
ManagerSetting/libs/WallPadAPI.jar


+ 12 - 18
ManagerSetting/src/main/java/com/artncore/managersetting/ui/fragments/SettingDetailFunctionFragment.java

@@ -2806,24 +2806,18 @@ public class SettingDetailFunctionFragment extends Fragment
             case DETAIL_TYPE_NEWSERVER:
                 //단지서버 방식 변경
 //                mMainDatabaseManager.updateSetUsedToSubDeviceSwitchButtonOnOff(MainDatabaseManager.SETTING_ITEM_SUB_DEVICE_NEWSERVER, position);
-//                if( itemName.equalsIgnoreCase("1.0"))
-//                {
-//                    WallpadStatusData DBcc = new WallpadStatusData(mActivity.getApplicationContext());
-//                    DBcc.SetServerVer("1.0");
-//                    DBcc.closeDB();
-//                }
-//                else if( itemName.equalsIgnoreCase("2.0"))
-//                {
-//                    WallpadStatusData DBcc = new WallpadStatusData(mActivity.getApplicationContext());
-//                    DBcc.SetServerVer("2.0");
-//                    DBcc.closeDB();
-//                }
-//                else
-//                {
-//                    WallpadStatusData DBcc = new WallpadStatusData(mActivity.getApplicationContext());
-//                    DBcc.SetServerVer("Blended");
-//                    DBcc.closeDB();
-//                }
+                if( itemName.equalsIgnoreCase("1.0"))
+                {
+                    WallpadStatusData DBcc = new WallpadStatusData(mActivity.getApplicationContext());
+                    DBcc.SetServerVer("1.0");
+                    DBcc.closeDB();
+                }
+                else
+                {
+                    WallpadStatusData DBcc = new WallpadStatusData(mActivity.getApplicationContext());
+                    DBcc.SetServerVer("2.0");
+                    DBcc.closeDB();
+                }
 
                 //신형단지 서버 유무
                 //"1(1:신형단지서버(사용함)종류(기축))";

+ 5 - 1
WallPadAPI/src/main/java/com/artncore/commons/define.java

@@ -719,5 +719,9 @@ public class define {
 	/**
 	 * 단지서버 2.0 IP Address
 	 */
-	public static final String NewDanjiServerIP = "";
+	public static final String NewDanjiServerIP = "10.0.2.1";
+	public static final String DanjiServerIP = "10.0.1.1";
+	public static final int DanjiServer1 = 1;
+	public static final int DanjiServer2 = 2;
+	public static final int DanjiServerBlended = 0;
 }

+ 10 - 5
WallPadAPI/src/main/java/com/artncore/wallpadimap/WallPadiMAPClient.java

@@ -209,17 +209,18 @@ public class WallPadiMAPClient {
 			/////////////////////////////////////////////////////////////////////
 			// mContext 가 설정되었을 경우 신형 단지서버 사용 유무를 가져온다.
 			/////////////////////////////////////////////////////////////////////
+			int danjiserverType = define.DanjiServerBlended;
 			if (mContext != null) {
 				try {
 					WallpadDeviceSet wallpadDeviceSet = new WallpadDeviceSet(mContext);
 					//bNewDanjiServer = wallpadDeviceSet.GetNewDanjiServer();
 					bNewDanjiServer = false;
-					int danjiserverType = wallpadDeviceSet.GetNewDanjiServer();
-					if(danjiserverType == 1)
+					danjiserverType = wallpadDeviceSet.GetNewDanjiServer();
+					if(danjiserverType == define.DanjiServer1)
 					{
 						bNewDanjiServer = false;
 					}
-					else if(danjiserverType == 2)
+					else if(danjiserverType == define.DanjiServer2)
 					{
 						bNewDanjiServer = true;
 					}
@@ -245,11 +246,15 @@ public class WallPadiMAPClient {
 				//                   사용중일 경우 암호화 소켓을 생성한다.
 				/////////////////////////////////////////////////////////////////////
 				Log.i(TAG, "[socketThread.run()] bNewDanjiServer [" + bNewDanjiServer + "]");
-				if(bNewDanjiServer && SoIPa.equals(define.NewDanjiServerIP)){
+				if(bNewDanjiServer && SoIPa.equals("10.0.1.1")){
 					// 신형 단지서버를 사용중일 경우 SSL Socket 을 생성하여 통신한다.
 					int port = SoIPport + 1000;
 					Log.i(TAG, "[socketThread.run()] SSLClient > Target [" + SoIPa + ":" + port + "]");
-					SSLClient sslClientSocket = new SSLClient(SoIPa, port);
+					String TargetIP = SoIPa;
+					if(danjiserverType == define.DanjiServerBlended)
+						TargetIP = define.NewDanjiServerIP;
+
+					SSLClient sslClientSocket = new SSLClient(TargetIP, port);
 					isock = sslClientSocket.getSocket();
 					if(isock!=null)
 					{