diff --git a/INTRO.md b/INTRO.md index 1bf80a1c..fcde8afc 100644 --- a/INTRO.md +++ b/INTRO.md @@ -128,6 +128,10 @@ It is worth to note that scanning function may emit one device multiple times. H when device is connected it won't broadcast and needs to be disconnected from central to be scanned again. Only one scanning listener can be registered. +### Bluetooth 5 Advertisements in Android + +To see devices that use Bluetooth 5 Advertising Extension you have to set the `legacyScan` variable to `false` in {@link #scanoptions|Scan options} when you are starting {@link #blemanagerstartdevicescan|BleManager.startDeviceScan()}, + ## Connecting and discovering services and characteristics Once device is scanned it is in disconnected state. We need to connect to it and discover diff --git a/docs/index.html b/docs/index.html index 798ab7c3..e0cdb125 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1723,6 +1723,12 @@

react-native-ble-plx

#callbackType +
  • + #legacyScan +
  • + @@ -2006,6 +2012,16 @@

    Ask for permissions

    return false } +

    With neverForLocation flag active, you can remove ACCESS_FINE_LOCATION permissions ask e.g.:

    +
    const result = await PermissionsAndroid.requestMultiple([
    +  PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
    +  PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT
    +])
    +
    +return (
    +  result['android.permission.BLUETOOTH_CONNECT'] === PermissionsAndroid.RESULTS.GRANTED &&
    +  result['android.permission.BLUETOOTH_SCAN'] === PermissionsAndroid.RESULTS.GRANTED
    +)

    Waiting for Powered On state

    When iOS application launches BLE stack is not immediately available and we need to check its status. To detect current state and following state changes we can use onStateChange() function:

    @@ -2041,6 +2057,8 @@

    Scanning devices

    It is worth to note that scanning function may emit one device multiple times. However when device is connected it won't broadcast and needs to be disconnected from central to be scanned again. Only one scanning listener can be registered.

    +

    Bluetooth 5 Advertisements

    +

    To see devices that use Bluetooth 5 Advertising Extension you have to set the legacyScan variable to false in Scan options when you are starting BleManager.startDeviceScan(),

    Connecting and discovering services and characteristics

    Once device is scanned it is in disconnected state. We need to connect to it and discover all services and characteristics it contains. Services may be understood @@ -16323,6 +16341,61 @@

    + + + + + + + + + + + + + + +
    +
    +
    + + legacyScan +
    +
    +