diff options
author | uvok | 2025-08-01 19:49:51 +0200 |
---|---|---|
committer | uvok | 2025-08-01 19:49:51 +0200 |
commit | 20b327cdd003d087cfeee4c4a89bb6034b0406f3 (patch) | |
tree | da307cd75d6fc7bb7d752cd7a9b64bc5809f0867 /lib | |
parent | aa7a3935e053e3ab7294ce60b767632943fc682b (diff) |
UB: Write needs response
Diffstat (limited to 'lib')
-rw-r--r-- | lib/model/motive_selection/universal_blue_motive_selection.dart | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/model/motive_selection/universal_blue_motive_selection.dart b/lib/model/motive_selection/universal_blue_motive_selection.dart index 43b717e..607d429 100644 --- a/lib/model/motive_selection/universal_blue_motive_selection.dart +++ b/lib/model/motive_selection/universal_blue_motive_selection.dart @@ -14,7 +14,6 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. import 'dart:convert'; -import 'dart:io'; import 'package:universal_ble/universal_ble.dart'; import 'package:uvok_epaper_badge/string_ext.dart'; @@ -54,6 +53,7 @@ class UniversalBlueMotiveSelection implements BadgeMotiveSelection { _currentMotiveCharacteristic, service: _badgeService, ); + var val = await c.read(); int? currentMotive = int.tryParse(ascii.decode(val)); if (currentMotive == null) { @@ -112,7 +112,7 @@ class UniversalBlueMotiveSelection implements BadgeMotiveSelection { service: _badgeService, ); - await c.write(ascii.encode(motive.id.toString()), withResponse: false); + await c.write(ascii.encode(motive.id.toString()), withResponse: true); } on NotFoundException { throw BadgeException("Characeristic/Service not found."); } |