|
@@ -3,6 +3,7 @@ package kr.co.icontrols.v40ioctl;
|
|
|
import android.os.Build;
|
|
|
import android.util.Log;
|
|
|
|
|
|
+import com.util.LogUtil;
|
|
|
import kr.co.icontrols.wallpadsupport.Version;
|
|
|
|
|
|
public class V40IF {
|
|
@@ -45,9 +46,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT = new V40IOInterface2();
|
|
|
else mV40IOIF = new V40IOInterface();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] V40IF()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -55,20 +60,42 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.WpdInterfaceOpen();
|
|
|
else return mV40IOIF.WpdInterfaceOpen();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] WpdInterfaceOpen()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
return -99;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public int WpdInterfaceClose() {
|
|
|
try {
|
|
|
- if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.WpdInterfaceClose();
|
|
|
- else return mV40IOIF.WpdInterfaceClose();
|
|
|
- } catch (Exception e) {
|
|
|
+ if (Build.VERSION.SDK_INT > 23)
|
|
|
+ {
|
|
|
+ if(mV40IOIF_NOUGAT!=null) {
|
|
|
+ return mV40IOIF_NOUGAT.WpdInterfaceClose();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ if(mV40IOIF!=null)
|
|
|
+ return mV40IOIF.WpdInterfaceClose();
|
|
|
+ else
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] WpdInterfaceClose()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
return -99;
|
|
|
}
|
|
|
}
|
|
@@ -77,9 +104,14 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.WpdInterfaceControl(cmd, arg);
|
|
|
else return mV40IOIF.WpdInterfaceControl(cmd, arg);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] WpdInterfaceControl(int cmd, int arg)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
return -99;
|
|
|
}
|
|
|
}
|
|
@@ -88,9 +120,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.SetMacAddr(mac);
|
|
|
else mV40IOIF.SetMacAddr(mac);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] SetMacAddr(String mac)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -98,9 +134,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.IpAddr(ip);
|
|
|
else mV40IOIF.IpAddr(ip);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] IpAddr(String ip)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -108,9 +148,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.GatewayIp(gw);
|
|
|
else mV40IOIF.GatewayIp(gw);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] GatewayIp(String gw)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -118,9 +162,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetMask(mask);
|
|
|
else mV40IOIF.NetMask(mask);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] NetMask(String mask)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -128,9 +176,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetAll(ip, mask, gw, mac);
|
|
|
else mV40IOIF.NetAll(ip, mask, gw, mac);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] NetAll(String ip, String mask, String gw, String mac)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -138,9 +190,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.LiveUpdate();
|
|
|
else mV40IOIF.LiveUpdate();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] LiveUpdate()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -148,9 +204,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.UsbUpdate();
|
|
|
else mV40IOIF.UsbUpdate();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] UsbUpdate()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -158,9 +218,14 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.LcdWakeUp();
|
|
|
else return mV40IOIF.LcdWakeUp();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] LcdWakeUp()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
return -99;
|
|
|
}
|
|
|
}
|
|
@@ -169,9 +234,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.Reboot(sec);
|
|
|
else mV40IOIF.Reboot(sec);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] Reboot(int sec)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -179,9 +248,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetDns1(dns);
|
|
|
else mV40IOIF.NetDns1(dns);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] NetDns1(String dns)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -189,9 +262,13 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) mV40IOIF_NOUGAT.NetDns2(dns);
|
|
|
else mV40IOIF.NetDns2(dns);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] NetDns2(String dns)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -199,9 +276,14 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.sensorread();
|
|
|
else return mV40IOIF.sensorread();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] sensorread()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
return -99;
|
|
|
}
|
|
|
}
|
|
@@ -210,9 +292,14 @@ public class V40IF {
|
|
|
try {
|
|
|
if (Build.VERSION.SDK_INT > 23) return mV40IOIF_NOUGAT.LcdWakeUp();
|
|
|
else return mV40IOIF.LcdWakeUp();
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ return -99;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setLcdWakeUp()");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
return -99;
|
|
|
}
|
|
|
}
|
|
@@ -222,9 +309,13 @@ public class V40IF {
|
|
|
Log.i(TAG, "[setDns] DNS1 : " + dns1 + " / DNS2 : " + dns2);
|
|
|
NetDns1(dns1);
|
|
|
NetDns2(dns2);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setDns(String dns1, String dns2)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -232,9 +323,13 @@ public class V40IF {
|
|
|
try {
|
|
|
Log.i(TAG, "[setV40Reboot] V40 Device will reboot : " +sec + " second !!!");
|
|
|
Reboot(sec);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setV40Reboot(int sec)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -242,9 +337,13 @@ public class V40IF {
|
|
|
try {
|
|
|
Log.i(TAG, "[setMACAddress] strMAC [" + strMAC+ "]");
|
|
|
SetMacAddr(strMAC);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setMACAddress(String strMAC)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -252,9 +351,13 @@ public class V40IF {
|
|
|
try {
|
|
|
Log.i(TAG, "[setIPAddress] strIP [" + strIP + "]");
|
|
|
IpAddr(strIP);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setIPAddress(String strIP)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -262,9 +365,13 @@ public class V40IF {
|
|
|
try {
|
|
|
Log.i(TAG, "[setNetmaskAddress] strNetmask [" + strNetmask + "]");
|
|
|
NetMask(strNetmask);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setNetmaskAddress(String strNetmask)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -272,9 +379,13 @@ public class V40IF {
|
|
|
try {
|
|
|
Log.i(TAG, "[setGatewayAddress] strGateway [" + strGateway+ "]");
|
|
|
GatewayIp(strGateway);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setGatewayAddress(String strGateway)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -283,9 +394,13 @@ public class V40IF {
|
|
|
Log.i(TAG, "[setNetworkInterface] strIP [" + strIP+ "], strNetmask [" + strNetmask+ "], strGateway [" + strGateway+ "], strMAC [" + strMAC+ "]");
|
|
|
|
|
|
NetAll(strIP, strNetmask, strGateway, strMAC);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setNetworkInterface(String strIP, String strNetmask, String strGateway, String strDNS, String strMAC)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -298,9 +413,13 @@ public class V40IF {
|
|
|
GatewayIp(strGateway);
|
|
|
// DNS 설정 JNI method는 아직 없음(2018.02.26)
|
|
|
SetMacAddr(strMAC);
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] setNetworkInterface(String strIP, String strNetmask, String strGateway, String strDNS, String strMAC)");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -310,8 +429,12 @@ public class V40IF {
|
|
|
WpdInterfaceControl(0xFF09, (ctr)?1:0);
|
|
|
WpdInterfaceClose();
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -322,15 +445,12 @@ public class V40IF {
|
|
|
WpdInterfaceClose();
|
|
|
}
|
|
|
|
|
|
- public void setEmergencyType() {
|
|
|
+ public void setEmergencyType(boolean bSet) {
|
|
|
+ int value = bSet ? 1: 0;
|
|
|
WpdInterfaceOpen();
|
|
|
if (Version.getPlatformType() == Version.PLATFORM_TYPE.A40i) {
|
|
|
- Log.d(TAG, "[setEmergencyType] V40 - D101 mode");
|
|
|
- WpdInterfaceControl(IOCTL_EMR_TYPE, 0);
|
|
|
- }
|
|
|
- else {
|
|
|
- Log.d(TAG, "[setEmergencyType] A20 - Previous mode");
|
|
|
- WpdInterfaceControl(IOCTL_EMR_TYPE, 1);
|
|
|
+ Log.d(TAG, "[setEmergencyType] value [" + value + "]");
|
|
|
+ WpdInterfaceControl(IOCTL_EMR_TYPE, value);
|
|
|
}
|
|
|
WpdInterfaceClose();
|
|
|
}
|
|
@@ -382,9 +502,13 @@ public class V40IF {
|
|
|
else {
|
|
|
Log.w(TAG, "[IOInterface] Not supported PLATFORM_TYPE!!");
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ Log.e(TAG, "exception : " + re );
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception] ctrlPopupGUI(boolean bUP");
|
|
|
- e.printStackTrace();
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
}
|
|
|
|