Skip to content

Support setting scanner PHY on android #821

Description

@jadejr

A a native implementation is just

 val scanPhy = call.getInt("scanPhy", BluetoothDevice.PHY_LE_1M) as Int
 scanSettings.setPhy(scanPhy)

inside the extended advertising block in getScanSettings and an enum of the PHYs

However, the bluetooth adapter needs to be checked and an error must be thrown
if the coded phy is set according to https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder.html#setPhy(int)
because the controller may not support coded PHY.

I wasn't sure if it was good safe to do that inside (or called via) getScanSettings

Describe the solution you'd like

ble.requestLEScan(
            {
              scanPhy: ScanPhy.PHY_LE_CODED 
              allowExtendedAdvertising: true,
            }
)

I added a simple draft to show it here #822

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions