From f2c186f93939cabda93bffac3419dc92999eddf3 Mon Sep 17 00:00:00 2001 From: uvok Date: Tue, 29 Jul 2025 14:00:47 +0200 Subject: Longer timeout, probably needed for Android? --- lib/device.dart | 3 ++- lib/main.dart | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/device.dart b/lib/device.dart index 94b2899..6442ee8 100644 --- a/lib/device.dart +++ b/lib/device.dart @@ -85,11 +85,12 @@ class DeviceState extends State { try { logger.i("Try to connect..."); // connect timeout doesn't work under Linux - await dev.connect().timeout(Duration(seconds: 1)); + await dev.connect().timeout(Duration(seconds: 2)); logger.i("Connected!"); connectStatus = "Connected"; } catch (e) { + logger.e(e); dev.disconnect().ignore(); connectStatus = e.toString(); } finally { diff --git a/lib/main.dart b/lib/main.dart index 476d6a7..b503674 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,3 @@ -import 'dart:convert'; - import 'dart:io' show Platform; import 'package:badge/device.dart'; -- cgit v1.2.3