clearGattCache method

Future<void> clearGattCache()

Refresh ble services & characteristics (Android Only)

Implementation

Future<void> clearGattCache() async {
  // check android
  if (kIsWeb || !Platform.isAndroid) {
    throw FlutterBluePlusException(ErrorPlatform.fbp, "clearGattCache",
        FbpErrorCode.androidOnly.index, "android-only");
  }

  // check connected
  if (isDisconnected) {
    throw FlutterBluePlusException(ErrorPlatform.fbp, "clearGattCache",
        FbpErrorCode.deviceIsDisconnected.index, "device is not connected");
  }

  // invoke
  await FlutterBluePlus._invokeMethod(() => FlutterBluePlusPlatform.instance
      .clearGattCache(BmClearGattCacheRequest(remoteId: remoteId)));
}