diff options
Diffstat (limited to 'lib/control/scanner_controller.dart')
-rw-r--r-- | lib/control/scanner_controller.dart | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/control/scanner_controller.dart b/lib/control/scanner_controller.dart new file mode 100644 index 0000000..75711d6 --- /dev/null +++ b/lib/control/scanner_controller.dart @@ -0,0 +1,16 @@ +import 'dart:async'; + +import 'package:badge/model/device.dart'; + +/// Represents the scan status. +enum ScanStatus { idle, scanning, finished, error } + +/// Represents a scanner controller. +/// It emits devices which may be connected to later. +abstract class ScannerController { + Stream<List<Device>> get scanResultsStream; + Stream<ScanStatus> get statusStream; + Future<void> startScan({Duration timeout}); + Future<void> stopScan(); + void dispose(); +} |