main
1import 'dart:typed_data';
2
3import 'package:blood_pressure_app/config.dart';
4import 'package:blood_pressure_app/features/bluetooth/backend/bluetooth_connection.dart';
5import 'package:blood_pressure_app/features/bluetooth/backend/bluetooth_device.dart';
6import 'package:blood_pressure_app/features/bluetooth/backend/bluetooth_manager.dart';
7import 'package:blood_pressure_app/features/bluetooth/backend/bluetooth_service.dart';
8
9/// Placeholder [BluetoothDevice] implementation that can f.e. be used for testing
10final class MockBluetoothDevice extends BluetoothDevice<BluetoothManager, BluetoothService, BluetoothCharacteristic, String> {
11 /// Initialize Placeholder [BluetoothDevice] implementation that can f.e. be used for testing
12 MockBluetoothDevice(super.manager, super.source): assert(isTestingEnvironment, 'consider whether a blanket implementation is appropriate');
13
14 @override
15 String get deviceId => super.source;
16
17 @override
18 String get name => super.source;
19
20 @override
21 Stream<BluetoothConnectionState> get connectionStream => const Stream<BluetoothConnectionState>.empty();
22
23 @override
24 Future<void> backendConnect() async {}
25
26 @override
27 Future<void> backendDisconnect() async {}
28
29 @override
30 Future<void> dispose() async {}
31
32 @override
33 Future<List<BluetoothService<dynamic, BluetoothCharacteristic>>?> discoverServices() =>
34 Future.value(<BluetoothService<dynamic, BluetoothCharacteristic>>[]);
35
36 @override
37 Future<bool> getCharacteristicValue(BluetoothCharacteristic characteristic, void Function(Uint8List value) onValue) async => true;
38}