From 9e4b6701ddda1e420a942323ce73e2b389f86f44 Mon Sep 17 00:00:00 2001 From: David J Kordsmeier Date: Wed, 7 Feb 2024 23:09:34 -0800 Subject: [PATCH] refs #2 a bit of scanning debug added --- magnet_app/lib/app_state_model.dart | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/magnet_app/lib/app_state_model.dart b/magnet_app/lib/app_state_model.dart index 72b5976..f5d455b 100644 --- a/magnet_app/lib/app_state_model.dart +++ b/magnet_app/lib/app_state_model.dart @@ -1,4 +1,5 @@ import 'dart:io' show Platform, sleep; +// import 'dart:js_interop'; import 'dart:math'; import 'package:flutter_neumorphic/flutter_neumorphic.dart'; import 'package:provider/provider.dart'; @@ -25,7 +26,7 @@ class AppState extends BLEProvider { Timer? btnStatusTimer; - + bool getButtonState() { return treat_state; @@ -98,15 +99,22 @@ class AppState extends BLEProvider { scanDeviceStream = ble.scanForDevices( withServices: [], // [serviceUuid] scanMode: ScanMode.lowLatency).listen((device) { - print("examinging new device"); + print("examining new device"); print("---------------------"); + if (device.id == deviceId) { print("--------------> Found match!!!!"); } else { + device.serviceData.forEach((k, v) { + print('{ key: $k, value: $v }'); + }); + print(device.name + - " " + + " UUIDs: " + + device.serviceUuids.toString() + + " MfgData: " + device.manufacturerData.toString() + - " " + + " ID: " + device.id); } // print(device.id);