LiteBluetooth.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:Bluetooth_BLE 作者:
/**
  * Clears the device cache. After uploading new hello4 the DFU target will have other services than before.
  * 清除设备缓存。 在上传新的hello4之后,DFU目标将具有比以前更多的服务。
  */
 public boolean refreshDeviceCache() {
     /*
      * There is a refresh() method in BluetoothGatt class but for now it's hidden. We will call it using reflections.
      * 使用反射调用
*/
     try {
         final Method refresh = BluetoothGatt.class.getMethod("refresh");
         if (refresh != null) {
             final boolean success = (Boolean) refresh.invoke(getBluetoothGatt());
             Log.i(TAG, "Refreshing result: " + success);
             return success;
         }
     } catch (Exception e) {
         Log.e(TAG, "An exception occured while refreshing device", e);
     }
     return false;
 }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号