main
 1import 'dart:async';
 2
 3import 'package:flutter_blue_plus/flutter_blue_plus.dart';
 4
 5class FakeBleBpCharacteristic implements BluetoothCharacteristic {
 6  final StreamController<List<int>> _valueReceivedController = StreamController.broadcast();
 7
 8  @override
 9  Guid get characteristicUuid => Guid('2A35');
10  @override
11  Guid get uuid => characteristicUuid;
12
13  @override
14  Stream<List<int>> get onValueReceived => _valueReceivedController.stream;
15
16  @override
17  Future<bool> setNotifyValue(bool notify, {int timeout = 15, bool forceIndications = false}) async{
18    if (notify) {
19      _valueReceivedController.add([22, 124, 0, 86, 0, 97, 0, 232, 7, 6, 15, 17, 17, 27, 51, 0, 0, 0]);
20    }
21    return true;
22  }
23
24  @override
25  // TODO: implement descriptors
26  List<BluetoothDescriptor> get descriptors => throw UnimplementedError();
27
28  @override
29  // TODO: implement device
30  BluetoothDevice get device => throw UnimplementedError();
31
32  @override
33  // TODO: implement deviceId
34  DeviceIdentifier get deviceId => throw UnimplementedError();
35
36  @override
37  // TODO: implement isNotifying
38  bool get isNotifying => throw UnimplementedError();
39
40  @override
41  // TODO: implement lastValue
42  List<int> get lastValue => throw UnimplementedError();
43
44  @override
45  // TODO: implement lastValueStream
46  Stream<List<int>> get lastValueStream => throw UnimplementedError();
47
48  @override
49  // TODO: implement onValueChangedStream
50  Stream<List<int>> get onValueChangedStream => throw UnimplementedError();
51
52  @override
53  // TODO: implement properties
54  CharacteristicProperties get properties => throw UnimplementedError();
55
56  @override
57  Future<List<int>> read({int timeout = 15}) {
58    // TODO: implement read
59    throw UnimplementedError();
60  }
61
62  @override
63  // TODO: implement remoteId
64  DeviceIdentifier get remoteId => throw UnimplementedError();
65
66  @override
67  // TODO: implement serviceUuid
68  Guid get serviceUuid => throw UnimplementedError();
69
70  @override
71  // TODO: implement value
72  Stream<List<int>> get value => throw UnimplementedError();
73
74  @override
75  Future<void> write(List<int> value, {bool withoutResponse = false, bool allowLongWrite = false, int timeout = 15}) {
76    // TODO: implement write
77    throw UnimplementedError();
78  }
79
80  @override
81  // TODO: implement primaryServiceUuid
82  Guid? get primaryServiceUuid => throw UnimplementedError();
83
84}