Skip to content

Commit 7a5e301

Browse files
authored
Merge pull request #416 from Polidea/release/2.2.0
Release 2.2.0
2 parents 70f6795 + 9ee1603 commit 7a5e301

File tree

90 files changed

+2014
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2014
-385
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ _android_job_template: &android_job_template
2121
android:
2222
components:
2323
- tools
24-
- build-tools-28.0.3
2524
- android-28
25+
- android-29
26+
- build-tools-28.0.3
27+
- build-tools-29.0.5
2628
- extra-android-m2repository
27-
licenses:
28-
- 'android-sdk-license-.+'
2929
env:
3030
global:
3131
- GRADLE_OPTS="-Xms128m"

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Example (debug)",
6+
"request": "launch",
7+
"type": "dart",
8+
"flutterMode": "debug"
9+
}
10+
]
11+
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 2.2.0
2+
3+
* **NEW** operations on descriptors
4+
* **BREAKING FOR BLEMULATOR** BLEmulator versions lower than 1.1.0 are not supported from this release
5+
* Support for AndroidX
6+
* Support for Swift 5
7+
* Lower iOS deployment target to 8.0
8+
19
## 2.1.0
210

311
* **BREAKING** ScanResult.AdvertisementData.ManufacturerData has changed type from Int8List to Uint8List

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ For more informations, see [REFERENCE](https://github.com/Polidea/FlutterBleLib/
3939
### Initialising
4040
```dart
4141
BleManager bleManager = BleManager();
42-
bleManager.createClient(); //ready to go!
42+
await bleManager.createClient(); //ready to go!
4343
// your peripheral logic
4444
bleManager.destroyClient(); //remember to release native resources when you're done!
4545
```
@@ -81,6 +81,8 @@ bleManager.startPeripheralScan(
8181
The snippet above starts peripheral scan and stops it after receiving first result.
8282
It filters the scan results to those that advertise a service with specified UUID.
8383

84+
**NOTE:** `isConnectable` and `overflowServiceUuids` fields of `ScanResult` are iOS-only and remain `null` on Android.
85+
8486
### Connecting to peripheral
8587
First you must obtain a _ScanResult_ from _BleManager.startPeripheralScan()_.
8688
```dart

REFERENCE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ Releases native resources. Should be called once there's no further need for BLE
3434
bool allowDuplicates,
3535
});
3636
```
37-
Returns a stream of objects containing advertisement data of the peripheral and the peripheral itself.
3837
`scanMode` and `callbackType` are Android-specific. [More information in Android documentation](https://developer.android.com/reference/android/bluetooth/le/ScanSettings)
3938
`allowDuplicates` is iOS-specific. [More information in iOS documentation](https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerscanoptionallowduplicateskey)
4039
`uuids` is used to filter peripherals to only return those containing services with specified UUIDs.
4140

41+
Returns a stream of objects containing advertisement data of the peripheral and the peripheral itself called `ScanResult`. The object has two iOS-only fields: `isConnectable` and `overflowServiceUuids`.
42+
4243
```dart
4344
Future<void> stopDeviceScan();
4445
```

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.polidea.flutter_ble_lib'
2-
version '1.0'
2+
version '2.2.0'
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.2.1'
11+
classpath 'com.android.tools.build:gradle:3.5.3'
1212
}
1313
}
1414

@@ -35,6 +35,6 @@ android {
3535
}
3636

3737
dependencies {
38-
implementation 'com.android.support:support-annotations:28.0.0'
39-
implementation 'com.github.Polidea:MultiPlatformBleAdapter:0.1.0'
38+
implementation 'androidx.annotation:annotation:1.1.0'
39+
implementation 'com.github.Polidea:MultiPlatformBleAdapter:0.1.4'
4040
}

android/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
22

3-
android.useAndroidX=false
4-
android.enableJetifier=false
3+
android.useAndroidX=true
4+
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

android/src/main/java/com/polidea/flutter_ble_lib/CharacteristicsResponse.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
import com.polidea.multiplatformbleadapter.Characteristic;
44
import com.polidea.multiplatformbleadapter.Service;
55

6+
import java.util.List;
7+
68
public class CharacteristicsResponse {
7-
private final Characteristic[] characteristics;
9+
private final List<Characteristic> characteristics;
810
private final Service service;
911

10-
public CharacteristicsResponse(Characteristic[] characteristics, Service service) {
12+
public CharacteristicsResponse(List<Characteristic> characteristics, Service service) {
1113
this.characteristics = characteristics;
1214
this.service = service;
1315
}
1416

15-
public Characteristic[] getCharacteristics() {
17+
public List<Characteristic> getCharacteristics() {
1618
return characteristics;
1719
}
1820

android/src/main/java/com/polidea/flutter_ble_lib/FlutterBleLibPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.polidea.flutter_ble_lib;
22

33
import android.content.Context;
4-
import android.support.annotation.NonNull;
54
import android.util.Log;
65

76
import com.polidea.flutter_ble_lib.constant.ArgumentKey;
@@ -10,6 +9,7 @@
109
import com.polidea.flutter_ble_lib.delegate.BluetoothStateDelegate;
1110
import com.polidea.flutter_ble_lib.delegate.CallDelegate;
1211
import com.polidea.flutter_ble_lib.delegate.CharacteristicsDelegate;
12+
import com.polidea.flutter_ble_lib.delegate.DescriptorsDelegate;
1313
import com.polidea.flutter_ble_lib.delegate.DeviceConnectionDelegate;
1414
import com.polidea.flutter_ble_lib.delegate.DevicesDelegate;
1515
import com.polidea.flutter_ble_lib.delegate.LogLevelDelegate;
@@ -31,6 +31,7 @@
3131
import java.util.LinkedList;
3232
import java.util.List;
3333

34+
import androidx.annotation.NonNull;
3435
import io.flutter.plugin.common.EventChannel;
3536
import io.flutter.plugin.common.MethodCall;
3637
import io.flutter.plugin.common.MethodChannel;
@@ -86,6 +87,7 @@ private void setupAdapter(Context context) {
8687
delegates.add(new MtuDelegate(bleAdapter));
8788
delegates.add(new CharacteristicsDelegate(bleAdapter, characteristicsMonitorStreamHandler));
8889
delegates.add(new DevicesDelegate(bleAdapter));
90+
delegates.add(new DescriptorsDelegate(bleAdapter));
8991
}
9092

9193
@Override

0 commit comments

Comments
 (0)