Explorar o código

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

astrodom %!s(int64=3) %!d(string=hai) anos
pai
achega
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);
             }
         }