Skip to content

Commit

Permalink
refs #2 a bit of scanning debug added
Browse files Browse the repository at this point in the history
  • Loading branch information
truedat101 committed Feb 8, 2024
1 parent b6e8745 commit 9e4b670
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions magnet_app/lib/app_state_model.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -25,7 +26,7 @@ class AppState extends BLEProvider {


Timer? btnStatusTimer;


bool getButtonState() {
return treat_state;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9e4b670

Please sign in to comment.