Prechádzať zdrojové kódy

added the code of bridge service exception with Signal정보통신

astrodom 3 rokov pred
rodič
commit
ef15524685

+ 7 - 1
app/src/main/java/org/iotivity/bridge/homeserver/BridgeService.java

@@ -388,6 +388,12 @@ public class BridgeService extends IntentService {
             printLine();
 
             try {
+                if(result_data.startsWith("\"{")){
+                    String result_data_old = result_data;
+                    result_data = result_data.replace("\"{", "{");
+                    result_data = result_data.replace("}\"", "}");
+                    msg("change result_data=" + result_data_old + " => " + result_data);
+                }
                 JSONObject obj = new JSONObject(result_data);
                 if(obj != null) {
                     String tid = obj.getString("tid");              // Transaction Id
@@ -414,7 +420,7 @@ public class BridgeService extends IntentService {
                         }
                     }).start();
                 }
-            } catch (JSONException e) {
+            } catch (Exception e) {
                 Log.e(TAG, "Light Control Service Remote Error : ", e);
             }
         }