From 65e295f16deac019639c13c776f0b531d2f67341 Mon Sep 17 00:00:00 2001 From: Yandrik Date: Thu, 23 Apr 2026 21:33:34 +0200 Subject: [PATCH] feat: check for abawo manu data --- lib/pages/devices_page.dart | 3 ++- lib/util/constants.dart | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/pages/devices_page.dart b/lib/pages/devices_page.dart index eecdfb6..b8291c1 100644 --- a/lib/pages/devices_page.dart +++ b/lib/pages/devices_page.dart @@ -153,7 +153,8 @@ class _ConnectDevicePageState extends ConsumerState final isAlreadyConnected = connectedDeviceAddresses.contains(device.id); final abawoDevice = - device.serviceUuids.any(isAbawoDeviceGuid); + // device.serviceUuids.any(isAbawoDeviceGuid); + isAbawoDeviceIdent(device.manufacturerData); final connectable = device.serviceUuids .any(isConnectableAbawoDeviceGuid); final deviceName = device.name.isEmpty diff --git a/lib/util/constants.dart b/lib/util/constants.dart index 9f46373..2bb47a3 100644 --- a/lib/util/constants.dart +++ b/lib/util/constants.dart @@ -4,6 +4,8 @@ const abawoServiceBtUUIDPrefix = '0993826f-0ee4-4b37-9614'; const abawoUniversalShiftersServiceBtUUID = '0993826f-0ee4-4b37-9614-d13ecba4ffc2'; +const abawoManuIdentData = [0x41, 0x28, 0x18, 0xA9]; + bool isAbawoDeviceGuid(Uuid guid) { return guid .toString() @@ -19,3 +21,11 @@ bool isAbawoUniversalShiftersDeviceGuid(Uuid guid) { bool isConnectableAbawoDeviceGuid(Uuid guid) { return isAbawoUniversalShiftersDeviceGuid(guid); } + +bool isAbawoDeviceIdent(List manuData) { + if (manuData.length < abawoManuIdentData.length) return false; + for (int i = 0; i < abawoManuIdentData.length; i++) { + if (manuData[i] != abawoManuIdentData[i]) return false; + } + return true; +}