replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / android / examples / simplebase / src / main / java / org / iotivity / base / examples / BluetoothFragment.java
index 30b3d0e..21e727e 100644 (file)
@@ -178,7 +178,6 @@ public class BluetoothFragment extends Fragment implements
         super.onDestroy();
         CaInterface.stopBtPairingService();
         CaInterface.stopManagerService();
-        CaBtPairingInterface.destroyEdrInterface();
         if (mGatt != null) {
             mGatt.close();
             mGatt = null;
@@ -267,6 +266,7 @@ public class BluetoothFragment extends Fragment implements
                 sb.append("Set Connect with : ");
                 try {
                     final String address = mBluetoothDevices.get(pos).getAddress();
+                    Common.setLeAddress(address);
                     CaInterface.setAutoConnectionDevice(address);
                     OcPlatform.OnResourceFoundListener resourceFoundListener =
                             new OcPlatform.OnResourceFoundListener() {
@@ -274,6 +274,12 @@ public class BluetoothFragment extends Fragment implements
                         public void onResourceFound(OcResource ocResource) {
                             Log.i(TAG, "onResourceFound : " + ocResource.getUri());
                         }
+
+                        @Override
+                        public void onFindResourceFailed(Throwable throwable, String uri) {
+                           Log.i(TAG, "findResource request has failed");
+                           Log.e(TAG, throwable.toString());
+                        }
                     };
                     OcPlatform.findResource("", address + OcPlatform.WELL_KNOWN_QUERY,
                                             EnumSet.of(OcConnectivityType.CT_ADAPTER_GATT_BTLE),