From c57cc778daac6463f1e3c9145b676c4409548c30 Mon Sep 17 00:00:00 2001 From: Foti Dim Date: Thu, 19 Sep 2024 22:36:09 +0200 Subject: [PATCH] Improve supportsInAppPairing documentation --- lib/src/models/ble_capabilities.dart | 17 +++++++++-------- lib/src/universal_ble.dart | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/src/models/ble_capabilities.dart b/lib/src/models/ble_capabilities.dart index 99f58cd..8f31e14 100644 --- a/lib/src/models/ble_capabilities.dart +++ b/lib/src/models/ble_capabilities.dart @@ -2,14 +2,15 @@ import 'package:flutter/foundation.dart'; class BleCapabilities { /// Returns true if pairing is possible either by API or by encrypted characteristic. - /// - /// All platforms support this except Web/Windows and Web/Linux. - /// - /// On `Web/Windows` and `Web/Linux` it is known to only work for devices that require passkey pairing. - /// If your device requires passkey pairing you can consider this true for all platforms. - /// - /// `Web/Linux` could under certain circumstances present a pairing dialog also for devices that do - /// not use passkey pairing but it very unreliable so we consider it unsupported. + /// + /// All platforms return true except Web/Windows and Web/Linux which return false. + /// + /// Under conditions, `Web/Windows` and `Web/Linux` could still trigger in-app pairing. + /// Peripherals that require "Numeric Comparison" or "Passkey Entry" can + /// successfully trigger pairing. + /// + /// `Web/Linux` could also, under certain conditions, trigger "Just Works" pairing + /// but it very unreliable, therefore we return false. static final bool supportsInAppPairing = _triggersPairingWithEncryptedChar || hasSystemPairingApi; diff --git a/lib/src/universal_ble.dart b/lib/src/universal_ble.dart index 5ecf9ae..0fd2b1f 100644 --- a/lib/src/universal_ble.dart +++ b/lib/src/universal_ble.dart @@ -236,7 +236,7 @@ class UniversalBle { /// You can optionally pass a pairingCommand if you know an encrypted read or write characteristic. /// If you do, it returns true if it can successfully execute the command after pairing. /// - /// On `Web/Windows` and `Web/Linux` it is known to work only for devices that require passkey pairing. + /// On `Web/Windows` and `Web/Linux` it does not work for devices that use "Just Works" pairing. static Future pair( String deviceId, { BleCommand? pairingCommand,