fix: remove BLE scan UUID filter to support non-standard scales (LePulse, etc)
Many consumer scales like LePulse FI2016LB don't advertise standard Weight Scale (0x181D) or Body Composition (0x181B) service UUIDs. Remove the scan filter so all BLE devices are discovered. The GATT fallback already handles proprietary services.
This commit is contained in:
+3
-8
@@ -90,17 +90,12 @@ class BleScaleManager(
|
||||
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
|
||||
.build()
|
||||
|
||||
// Filter for known weight/body-composition services; also allow unfiltered scan
|
||||
val filters: List<ScanFilter> = listOf(
|
||||
ScanFilter.Builder().setServiceUuid(android.os.ParcelUuid(BleUuids.WEIGHT_SCALE_SERVICE)).build(),
|
||||
ScanFilter.Builder().setServiceUuid(android.os.ParcelUuid(BleUuids.BODY_COMPOSITION_SERVICE)).build(),
|
||||
)
|
||||
|
||||
// No service UUID filters — many consumer scales use proprietary UUIDs
|
||||
// and would be invisible with strict filtering. We show all named BLE devices.
|
||||
isScanning = true
|
||||
try {
|
||||
leScanner?.startScan(filters, settings, scanCallback)
|
||||
leScanner?.startScan(null, settings, scanCallback)
|
||||
} catch (e: Exception) {
|
||||
// Some devices reject filtered scan; fall back to unfiltered
|
||||
leScanner?.startScan(scanCallback)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user