|
@@ -1439,14 +1439,55 @@ public final class Global {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static String[] getIPadressDongHo()
|
|
|
+ {
|
|
|
+ String dong = "101";
|
|
|
+ String ho = "101";
|
|
|
+ String[] aDeviceName = new String[3];
|
|
|
+
|
|
|
+ String strIPResult = getIPAddress();
|
|
|
+
|
|
|
+ String[] IP_Parse = strIPResult.split("\\.");
|
|
|
+
|
|
|
+ int iDong = Integer.parseInt(IP_Parse[0]);
|
|
|
+
|
|
|
+ if(Integer.parseInt(IP_Parse[1]) < 10)
|
|
|
+ {
|
|
|
+ iDong = iDong * 10;
|
|
|
+ }
|
|
|
+ else if((Integer.parseInt(IP_Parse[1]) > 11) && (Integer.parseInt(IP_Parse[1]) < 100))
|
|
|
+ {
|
|
|
+ iDong = iDong * 100;
|
|
|
+ }
|
|
|
+ else if (Integer.parseInt(IP_Parse[1]) > 99)
|
|
|
+ {
|
|
|
+ iDong = iDong * 1000;
|
|
|
+ }
|
|
|
+
|
|
|
+ iDong = iDong + Integer.parseInt(IP_Parse[1]);
|
|
|
+
|
|
|
+ dong = Integer.toString(((iDong / 100) * 100) + Integer.parseInt(IP_Parse[1]));
|
|
|
+
|
|
|
+ ho = IP_Parse[2] + ZeroPadding_Head(2, IP_Parse[3]);
|
|
|
+
|
|
|
+ aDeviceName[0] = strIPResult;
|
|
|
+ aDeviceName[1] = dong;
|
|
|
+ aDeviceName[2] = ho;
|
|
|
+
|
|
|
+ return aDeviceName;
|
|
|
+ }
|
|
|
+
|
|
|
public static String getDongString() {
|
|
|
try {
|
|
|
String strResult = "";
|
|
|
- wallpaddbmgr DBMGR = new wallpaddbmgr(mContext);
|
|
|
- AddressSet Addr = DBMGR.getAddressMGR();
|
|
|
- DBMGR.closeDB();
|
|
|
- strResult = Addr.Dong;
|
|
|
+// wallpaddbmgr DBMGR = new wallpaddbmgr(mContext);
|
|
|
+// AddressSet Addr = DBMGR.getAddressMGR();
|
|
|
+// DBMGR.closeDB();
|
|
|
+// strResult = Addr.Dong;
|
|
|
+ strResult = getIPadressDongHo()[1];
|
|
|
+
|
|
|
LOG("[getDongString] strResult [" + strResult + "]");
|
|
|
+
|
|
|
return strResult;
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
@@ -1460,10 +1501,11 @@ public final class Global {
|
|
|
public static String getHoString() {
|
|
|
try {
|
|
|
String strResult = "";
|
|
|
- wallpaddbmgr DBMGR = new wallpaddbmgr(mContext);
|
|
|
- AddressSet Addr = DBMGR.getAddressMGR();
|
|
|
- DBMGR.closeDB();
|
|
|
- strResult = Addr.Ho;
|
|
|
+// wallpaddbmgr DBMGR = new wallpaddbmgr(mContext);
|
|
|
+// AddressSet Addr = DBMGR.getAddressMGR();
|
|
|
+// DBMGR.closeDB();
|
|
|
+// strResult = Addr.Ho;
|
|
|
+ strResult = getIPadressDongHo()[2];
|
|
|
LOG("[getHoString] strResult [" + strResult + "]");
|
|
|
return strResult;
|
|
|
} catch (RuntimeException re) {
|