From aeca9fa6a9979bc6b889c2f19bdedb4b1479cb1d Mon Sep 17 00:00:00 2001 From: fotidim Date: Mon, 16 Feb 2026 07:34:57 +0100 Subject: [PATCH] Add serviceData tracking in Linux advertisements --- example/pubspec.lock | 16 ++++++++-------- .../universal_ble_linux/universal_ble_linux.dart | 16 +++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 203f377..5e4f53b 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" checked_yaml: dependency: transitive description: @@ -337,18 +337,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.18" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: @@ -606,10 +606,10 @@ packages: dependency: transitive description: name: test_api - sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" url: "https://pub.dev" source: hosted - version: "0.7.7" + version: "0.7.9" typed_data: dependency: transitive description: diff --git a/lib/src/universal_ble_linux/universal_ble_linux.dart b/lib/src/universal_ble_linux/universal_ble_linux.dart index 16e1a5c..58c8a99 100644 --- a/lib/src/universal_ble_linux/universal_ble_linux.dart +++ b/lib/src/universal_ble_linux/universal_ble_linux.dart @@ -554,13 +554,13 @@ class UniversalBleLinux extends UniversalBlePlatform { _devices[device.address] = device; // Setup advertisements Listener - _deviceAdvertisementSubscriptions[device.address] ??= device - .propertiesChanged - .where((e) => - e.contains(BluezProperty.rssi) || - e.contains(BluezProperty.manufacturerData) || - e.contains(BluezProperty.uuids)) - .listen((_) { + _deviceAdvertisementSubscriptions[device.address] ??= + device.propertiesChanged.where((e) { + return e.contains(BluezProperty.rssi) || + e.contains(BluezProperty.manufacturerData) || + e.contains(BluezProperty.uuids) || + e.contains(BluezProperty.serviceData); + }).listen((_) { if (_bleFilter.shouldAcceptDevice(bleDevice)) { updateScanResult(device.toBleDevice()); } @@ -588,6 +588,7 @@ class UniversalBleLinux extends UniversalBlePlatform { case BluezProperty.addressType: case BluezProperty.rssi: case BluezProperty.manufacturerData: + case BluezProperty.serviceData: break; default: UniversalLogger.logInfo( @@ -626,6 +627,7 @@ class BluezProperty { static const String txPower = 'TxPower'; static const String bonded = 'Bonded'; static const String manufacturerData = 'ManufacturerData'; + static const String serviceData = 'ServiceData'; static const String legacyPairing = 'LegacyPairing'; static const String servicesResolved = 'ServicesResolved'; static const String paired = 'Paired';