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 @@
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
+)
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:
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.
+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(),
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 @@
Use legacyScan (default true) [Android only] +https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder#setLegacy(boolean)
+ ++ Type: + boolean +
+ + + + + + + + + + + + + + + + + + + + diff --git a/src/TypeDefinition.js b/src/TypeDefinition.js index 4ff09d3e..615e7ea9 100644 --- a/src/TypeDefinition.js +++ b/src/TypeDefinition.js @@ -178,6 +178,13 @@ export interface ScanOptions { * @instance */ callbackType?: $Values