feat: check for abawo manu data
This commit is contained in:
@ -153,7 +153,8 @@ class _ConnectDevicePageState extends ConsumerState<ConnectDevicePage>
|
|||||||
final isAlreadyConnected =
|
final isAlreadyConnected =
|
||||||
connectedDeviceAddresses.contains(device.id);
|
connectedDeviceAddresses.contains(device.id);
|
||||||
final abawoDevice =
|
final abawoDevice =
|
||||||
device.serviceUuids.any(isAbawoDeviceGuid);
|
// device.serviceUuids.any(isAbawoDeviceGuid);
|
||||||
|
isAbawoDeviceIdent(device.manufacturerData);
|
||||||
final connectable = device.serviceUuids
|
final connectable = device.serviceUuids
|
||||||
.any(isConnectableAbawoDeviceGuid);
|
.any(isConnectableAbawoDeviceGuid);
|
||||||
final deviceName = device.name.isEmpty
|
final deviceName = device.name.isEmpty
|
||||||
|
|||||||
@ -4,6 +4,8 @@ const abawoServiceBtUUIDPrefix = '0993826f-0ee4-4b37-9614';
|
|||||||
const abawoUniversalShiftersServiceBtUUID =
|
const abawoUniversalShiftersServiceBtUUID =
|
||||||
'0993826f-0ee4-4b37-9614-d13ecba4ffc2';
|
'0993826f-0ee4-4b37-9614-d13ecba4ffc2';
|
||||||
|
|
||||||
|
const abawoManuIdentData = [0x41, 0x28, 0x18, 0xA9];
|
||||||
|
|
||||||
bool isAbawoDeviceGuid(Uuid guid) {
|
bool isAbawoDeviceGuid(Uuid guid) {
|
||||||
return guid
|
return guid
|
||||||
.toString()
|
.toString()
|
||||||
@ -19,3 +21,11 @@ bool isAbawoUniversalShiftersDeviceGuid(Uuid guid) {
|
|||||||
bool isConnectableAbawoDeviceGuid(Uuid guid) {
|
bool isConnectableAbawoDeviceGuid(Uuid guid) {
|
||||||
return isAbawoUniversalShiftersDeviceGuid(guid);
|
return isAbawoUniversalShiftersDeviceGuid(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isAbawoDeviceIdent(List<int> 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;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user