Implement pairing on Apple (#59)

This commit is contained in:
Foti Dim
2024-08-09 19:17:31 +02:00
committed by Foti Dim
parent 95c0b88181
commit 7606e8fd29
18 changed files with 371 additions and 139 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ class Capabilities {
static bool supportsConnectedDevicesApi = !Platform.isWeb;
static bool supportsPairingApi = !Platform.isWeb && !Platform.isCupertino;
static bool supportsPairingApi = !Platform.isWeb;
static bool supportsRequestMtuApi = !Platform.isWeb;
}
+6 -6
View File
@@ -27,19 +27,19 @@ class MockUniversalBle extends UniversalBlePlatform {
ScanFilter? scanFilter,
PlatformConfig? platformConfig,
}) async =>
onScanResult?.call(_mockBleDevice);
updateScanResult(_mockBleDevice);
@override
Future<void> stopScan() async {}
@override
Future<void> connect(String deviceId, {Duration? connectionTimeout}) async {
onConnectionChange?.call(deviceId, true);
updateConnection(deviceId, true);
}
@override
Future<void> disconnect(String deviceId) async {
onConnectionChange?.call(deviceId, false);
updateConnection(deviceId, false);
}
@override
@@ -99,12 +99,12 @@ class MockUniversalBle extends UniversalBlePlatform {
@override
Future<void> pair(String deviceId) async {
onPairingStateChange?.call(deviceId, true, null);
updatePairingState(deviceId, true, null);
}
@override
Future<void> unPair(String deviceId) async {
onPairingStateChange?.call(deviceId, false, null);
Future<void> unpair(String deviceId) async {
updatePairingState(deviceId, false, null);
}
@override