f4b197f8ae
* feat: add requestConnectionPriority - Add BleConnectionPriority enum (balanced, highPerformance, lowPower) - Add BleCapabilities.supportsConnectionPriorityApi flag - Implement on Android via BluetoothGatt.requestConnectionPriority() - Throw notSupported on iOS, macOS, Windows, Linux, and Web - Update pigeon definition and regenerate platform channel files - Bump version 1.2.0 -> 1.3.0 * fix: improve requestConnectionPriority implementation - Remove redundant BleCapabilities guard in Dart layer (native handles it) - Add BleConnectionPriority Kotlin enum mirroring Dart enum - Map to explicit Android SDK constants via when expression - Add firstOrNull with ILLEGAL_ARGUMENT for unknown priority values - Add catch (e: Exception) block for broader error handling - Fix enum doc comment (throws belongs on method, not enum) - Remove stale capability check guidance from docs and README --------- Co-authored-by: aqeel-bmec-co <aqeel@bmec.co> Co-authored-by: aqeel-bmec-co <85945830+aqeel-bmec-co@users.noreply.github.com>
114 lines
2.4 KiB
Dart
114 lines
2.4 KiB
Dart
import 'dart:typed_data';
|
|
import 'package:universal_ble/universal_ble.dart';
|
|
|
|
abstract class UniversalBlePlatformMock extends UniversalBlePlatform {
|
|
@override
|
|
Future<void> connect(String deviceId,
|
|
{bool autoConnect = false, Duration? connectionTimeout}) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<bool> disableBluetooth() {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> disconnect(String deviceId) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<List<BleService>> discoverServices(
|
|
String deviceId, bool withDescriptors) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<bool> enableBluetooth() {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<AvailabilityState> getBluetoothAvailabilityState() {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<BleConnectionState> getConnectionState(String deviceId) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<List<BleDevice>> getSystemDevices(List<String>? withServices) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<bool> isPaired(String deviceId) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<bool> pair(String deviceId) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<Uint8List> readValue(
|
|
String deviceId, String service, String characteristic,
|
|
{Duration? timeout}) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<int> requestMtu(String deviceId, int expectedMtu) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> requestConnectionPriority(
|
|
String deviceId,
|
|
BleConnectionPriority priority,
|
|
) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> setNotifiable(String deviceId, String service,
|
|
String characteristic, BleInputProperty bleInputProperty) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> startScan(
|
|
{ScanFilter? scanFilter, PlatformConfig? platformConfig}) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> stopScan() {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> unpair(String deviceId) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<void> writeValue(
|
|
String deviceId,
|
|
String service,
|
|
String characteristic,
|
|
Uint8List value,
|
|
BleOutputProperty bleOutputProperty) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
@override
|
|
Future<bool> isScanning() {
|
|
throw UnimplementedError();
|
|
}
|
|
}
|