From 203b0dc8fffce8e4607344ab135c65ba7589fe84 Mon Sep 17 00:00:00 2001 From: Dominik Czupryna Date: Tue, 17 Oct 2023 10:40:59 +0200 Subject: [PATCH] chore: update docs --- INTRO.md | 4 +++ docs/index.html | 73 +++++++++++++++++++++++++++++++++++++++++++ src/TypeDefinition.js | 7 +++++ 3 files changed, 84 insertions(+) diff --git a/INTRO.md b/INTRO.md index 1bf80a1c5..fcde8afce 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 798ab7c34..e0cdb1252 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 +
    +
    +