From 098dcbbfac422d6888d277cd0bc0f4b0d28dd9d1 Mon Sep 17 00:00:00 2001 From: uvok Date: Sun, 3 May 2026 15:55:08 +0200 Subject: Update UniversalBle --- .../motive_selection/universal_blue_motive_selection.dart | 12 +++++++++--- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/model/motive_selection/universal_blue_motive_selection.dart b/lib/model/motive_selection/universal_blue_motive_selection.dart index 084541a..e523d91 100644 --- a/lib/model/motive_selection/universal_blue_motive_selection.dart +++ b/lib/model/motive_selection/universal_blue_motive_selection.dart @@ -21,6 +21,9 @@ import 'package:uvok_epaper_badge/badge_exception.dart'; import 'package:uvok_epaper_badge/model/badge_motive.dart'; import 'package:uvok_epaper_badge/model/device/universal_ble_device.dart'; import 'package:uvok_epaper_badge/model/motive_selection/badge_motive_selection.dart'; +import 'package:uvok_epaper_badge/log.dart'; + +var logger = fileLogger(); class UniversalBlueMotiveSelection with BadgeParser @@ -65,7 +68,8 @@ class UniversalBlueMotiveSelection (bm) => bm.id == currentMotive, orElse: () => throw BadgeException("Selected motive not in templates"), ); - } on NotFoundException { + } on UniversalBleException catch (e) { + logger.e(e.toString()); throw BadgeException("Characeristic/Service not found."); } } @@ -81,7 +85,8 @@ class UniversalBlueMotiveSelection ); var val = await c.read(); _cachedMotives = parseBadgeMotives(val); - } on NotFoundException { + } on UniversalBleException catch (e) { + logger.e(e.toString()); throw BadgeException("Characeristic/Service not found."); } @@ -104,7 +109,8 @@ class UniversalBlueMotiveSelection ); await c.write(ascii.encode(motive.id.toString()), withResponse: true); - } on NotFoundException { + } on UniversalBleException catch (e) { + logger.e(e.toString()); throw BadgeException("Characeristic/Service not found."); } } diff --git a/pubspec.lock b/pubspec.lock index 81a8149..78bcc9d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -377,10 +377,10 @@ packages: dependency: "direct main" description: name: universal_ble - sha256: "6a5c6c1fb295015934a5aef3dc751ae7e00721535275f8478bfe74db77b238c5" + sha256: "8325ca9f5cce2fba2b4efef74a4fcfe7144f303b409d6fc6ed16197b00a1a241" url: "https://pub.dev" source: hosted - version: "0.21.1" + version: "1.2.0" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 75a8033..2d8e40b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: permission_handler: ^12.0.1 logger: ^2.6.1 meta: ^1.16.0 - universal_ble: ^0.21.0 + universal_ble: ^1.2.0 rxdart: ^0.28.0 dev_dependencies: -- cgit v1.2.3