Skip to content

Commit 63a01c2

Browse files
committed
Merge branch 'master' of github.com:nativescript-community/ble
# Conflicts: # README.md
2 parents 0a3afc0 + 7bb4cfe commit 63a01c2

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Want to dive in quickly? Check out [the demo app](https://github.com/EddyVerbrug
3131

3232
#### Prerequisites
3333
- [isBluetoothEnabled](#isbluetoothenabled)
34-
- [hasCoarseLocationPermission](#hascoarselocationpermission)
3534
- [requestLocationPermission](#requestLocationPermission)
36-
- [turnBluetoothOn](#turnBluetoothOn)
35+
- [hasLocationPermission](#haslocationpermission)
36+
- [enable (Android only)](#enable-android-only)
3737

3838
#### Discovery
3939
- [startScanning](#startscanning)
40-
- [stopScanning](#stopcanning)
40+
- [stopScanning](#stopscanning)
4141

4242
#### Connectivity
4343
- [connect](#connect)
@@ -49,6 +49,9 @@ Want to dive in quickly? Check out [the demo app](https://github.com/EddyVerbrug
4949
- [startNotifying](#startnotifying)
5050
- [stopNotifying](#stopnotifying)
5151

52+
#### Debugging
53+
- [setCharacteristicLogging](#setcharacteristiclogging)
54+
5255

5356
### isBluetoothEnabled
5457
Reports if bluetooth is enabled.
@@ -64,21 +67,21 @@ bluetooth.isBluetoothEnabled().then(
6467
}
6568
);
6669
```
67-
### hasCoarseLocationPermission
70+
### hasLocationPermission
6871
__Since plugin version 1.2.0 the `startScanning` function will handle this internally so it's no longer mandatory to add permission checks to your code.__
6972

7073
On Android 6 you need to request permission to be able to interact with a Bluetooth peripheral (when the app is in the background) when targeting API level 23+. Even if the `uses-permission` tag for `ACCESS_COARSE_LOCATION` is present in `AndroidManifest.xml`.
7174

7275
Note that for `BLUETOOTH` and `BLUETOOTH_ADMIN` you don't require runtime permission; adding those to `AndroidManifest.xml` suffices (which the plugin does for you).
7376

74-
Note that `hasCoarseLocationPermission ` will return true when:
77+
Note that `hasLocationPermission ` will return true when:
7578
* You're running this on iOS, or
7679
* You're targeting an API level lower than 23, or
7780
* You're using a device running Android < 6, or
7881
* You've already granted permission.
7982

8083
```typescript
81-
bluetooth.hasCoarseLocationPermission().then(
84+
bluetooth.hasLocationPermission().then(
8285
function(granted) {
8386
// if this is 'false' you probably want to call 'requestLocationPermission' now
8487
console.log("Has Location Permission? " + granted);

src/bluetooth.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2560,7 +2560,7 @@ export class Bluetooth extends BluetoothCommon {
25602560
}
25612561

25622562
private select2MegPhy(args: { peripheralUUID: string }): Promise<void> {
2563-
if (getAndroidSDK() < OREO) {
2563+
if (getAndroidSDK() < OREO || !this.adapter.isLe2MPhySupported()) {
25642564
return Promise.resolve();
25652565
}
25662566

0 commit comments

Comments
 (0)