Skip to content

Fix BLE scanning fallback for devices without extended advertising#53

Open
juhapellotsalo wants to merge 1 commit intoruuvi:masterfrom
juhapellotsalo:fix/ble5-extended-advertising-fallback
Open

Fix BLE scanning fallback for devices without extended advertising#53
juhapellotsalo wants to merge 1 commit intoruuvi:masterfrom
juhapellotsalo:fix/ble5-extended-advertising-fallback

Conversation

@juhapellotsalo
Copy link

Check isLeExtendedAdvertisingSupported before disabling legacy mode, allowing devices to fall back to legacy scanning when extended advertising is not supported.

Check isLeExtendedAdvertisingSupported before disabling legacy mode,
allowing devices to fall back to legacy scanning when extended
advertising is not supported.
@andreevdenis
Copy link
Collaborator

scanSettings.setLegacy(false) - won't disable legacy advertisments .

setLegacy
Set whether only legacy advertisments should be returned in scan results. Legacy advertisements include advertisements as specified by the Bluetooth core specification 4.2 and below. This is true by default for compatibility with older apps.
Params:
legacy – true if only legacy advertisements will be returned

setLegacy(false) - enables extended advertisments (+legacy)

In my opinion in some cases bluetoothManager.adapter.isLeExtendedAdvertisingSupported returns true but phone actually can't receive extended for some reason. Need to figure out more reliable way to detect if extended supported or not.

@andreevdenis
Copy link
Collaborator

andreevdenis commented Jan 5, 2026

My try here. We ignore 3 first seconds of legacy data (for Air). If no extended received - we start working with legacy.
48e41a2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants