차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
ko:quick_guide [2019/09/19 17:00]
jbkim
ko:quick_guide [2020/05/13 08:24] (현재)
jbkim [Firmware upgrade]
줄 700: 줄 700:
     SvpManager svpManager = new SvpManager();​     SvpManager svpManager = new SvpManager();​
     private static final String TAG = "​YourApp";​     private static final String TAG = "​YourApp";​
 +    ​
 +    Handler handler = new Handler();
  
     private DeviceListener deviceListener = new DeviceListener() {     private DeviceListener deviceListener = new DeviceListener() {
줄 716: 줄 718:
                  */                  */
                 if (data.result == ErrorCode.SUCCESS ) {                 if (data.result == ErrorCode.SUCCESS ) {
-                    svpManager.rebootDevice();​+                    ​Runnable runnable = new Runnable() { 
 +         @Override 
 +         public void run() { 
 +             ​svpManager.rebootDevice(); 
 +         } 
 +     }; 
 + 
 +     handler.post(runnable) ;
                 }                 }
             }             }
줄 891: 줄 900:
     Button.OnClickListener mClickListener = new View.OnClickListener() {     Button.OnClickListener mClickListener = new View.OnClickListener() {
         public void onClick(View v) {         public void onClick(View v) {
-            ​// set Ethernet config. +            ​boolean useDHCP = false; 
-            ​// @param enableDHCP enable DHCP +            ​String ​ip = "​192.168.1.123";​ 
-            // @param ​ip IP Address +            ​String ​subnet ​= "​255.255.255.0";​ 
-            ​// @param ​subnet ​Subnet Mask +            ​String ​gateway ​= "192.168.1.1"; 
-            ​// @param ​gateway ​Gateway +            String ​dns = "​192.168.1.100";​
-            // @param dnsServer DNS Server +
-            // @return If successfully done, SUCCESS will be returnedIf there is an error, the corresponding error code will be returned+
-            ​// +
-            // public int setEthernetConfig(boolean enableDHCP, ​String ​ip, String subnet, String gateway, String dnsServer)+
  
-            svpManager.setEthernetConfig(false"​192.168.1.123"​"​255.255.255.0"​"​192.168.1.1"​"​192.168.1.100" ​);+            svpManager.setEthernetConfig(useDHCPipsubnetgatewaydns);
         }         }
     };     };
줄 912: 줄 917:
             if (resultCode == RESULT_OK) {             if (resultCode == RESULT_OK) {
                 int result = data.getIntExtra("​result",​ -1);                 int result = data.getIntExtra("​result",​ -1);
-                Toast.makeText(MainActivity.this, "​Result:​ " + result, Toast.LENGTH_SHORT).show();​+                Toast.makeText(this,​ "​Result:​ " + result, Toast.LENGTH_SHORT).show();​
             }             }
             else {             else {
-                Toast.makeText(MainActivity.this, "​Failed",​ Toast.LENGTH_SHORT).show();​+                Toast.makeText(this,​ "​Failed",​ Toast.LENGTH_SHORT).show();​
             }             }
         }         }