Skip to content

Commit dbfc8e1

Browse files
committed
Merge branch 'master' of https://github.com/pauldemarco/flutter_blue into pauldemarco-master
# Conflicts: # CHANGELOG.md # README.md # android/build.gradle # android/gradle/wrapper/gradle-wrapper.properties # android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java # example/android/app/src/main/java/com/pauldemarco/flutter_blue_example/MainActivity.java # example/android/gradle/wrapper/gradle-wrapper.properties # example/ios/Podfile # example/ios/Runner.xcodeproj/project.pbxproj # example/lib/main.dart # ios/flutter_blue.podspec # lib/gen/flutterblue.pb.dart # lib/gen/flutterblue.pbjson.dart # lib/src/bluetooth_device.dart # pubspec.yaml
2 parents a5081fc + 63a1002 commit dbfc8e1

37 files changed

+2222
-741
lines changed

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: f53b32eb2317ba09137969999d130c24a6314997
8+
channel: master
9+
10+
project_type: plugin

CHANGELOG.md

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1+
## 0.7.2
2+
* Add `allowDuplicates` option to `startScan`.
3+
* Fix performance issue with GUID initializers.
4+
5+
## 0.7.1+1
6+
* Fix for FlutterBlue constructor when running on emulator.
7+
* Return error when attempting to `discoverServices` while not connected.
8+
9+
## 0.7.1
10+
* Fix incorrect value notification when write is performed.
11+
* Add `toString` to each bluetooth class.
12+
* Various other bug fixes.
13+
14+
## 0.7.0
15+
* Support v2 android embedding.
16+
* Various bug and documentation fixes.
17+
118
## 0.6.3+1
2-
* Fix compilation issue with iOS
3-
* Bump protobuf version to 1.0.0
19+
* Fix compilation issue with iOS.
20+
* Bump protobuf version to 1.0.0.
421

522
## 0.6.3
6-
* Update project files for Android and iOS
7-
* Remove dependency on protoc for iOS
23+
* Update project files for Android and iOS.
24+
* Remove dependency on protoc for iOS.
825

926
## 0.6.2
10-
* Add `mtu` and `requestMtu` to BluetoothDevice
27+
* Add `mtu` and `requestMtu` to BluetoothDevice.
1128

1229
## 0.6.0+4
1330
* Fix duplicate characteristic notifications when connection lost.
1431
* Fix duplicate characteristic notifications when reconnecting.
1532
* Add minimum SDK version of 18 for the plugin.
16-
* Documentation updates
33+
* Documentation updates.
1734

1835
## 0.6.0
19-
* **Breaking change**. API refactoring with RxDart (see example)
36+
* **Breaking change**. API refactoring with RxDart (see example).
2037
* Log a more detailed warning at build time about the previous AndroidX migration.
2138
* Ensure that all channel calls to the Dart side from the Java side are done on the UI thread.
2239
This change allows Transactions to work with upcoming Engine restrictions, which require
@@ -31,14 +48,14 @@
3148
using the original support library.
3249

3350
## 0.4.2+1
34-
* Upgrade Android Gradle plugin to 3.3.0
35-
* Refresh iOS build files
51+
* Upgrade Android Gradle plugin to 3.3.0.
52+
* Refresh iOS build files.
3653

3754
## 0.4.2
38-
* Set the verbosity of log messages with `setLogLevel`
39-
* Updated iOS and Android project files
40-
* `autoConnect` now configurable for Android
41-
* Various bug fixes
55+
* Set the verbosity of log messages with `setLogLevel`.
56+
* Updated iOS and Android project files.
57+
* `autoConnect` now configurable for Android.
58+
* Various bug fixes.
4259

4360
## 0.4.1
4461
* Fixed bug where setNotifyValue wasn't properly awaitable.
@@ -52,28 +69,28 @@
5269
* Various other bug fixes.
5370

5471
## 0.3.4
55-
* Updated to use the latest protobuf (^0.9.0+1)
56-
* Updated other dependencies
72+
* Updated to use the latest protobuf (^0.9.0+1).
73+
* Updated other dependencies.
5774

5875
## 0.3.3
59-
* `scan` `withServices` to filter by service UUID's (iOS)
60-
* Error handled when trying to scan with adapter off (Android)
76+
* `scan` `withServices` to filter by service UUID's (iOS).
77+
* Error handled when trying to scan with adapter off (Android).
6178

6279
## 0.3.2
63-
* Runtime permissions for Android
64-
* `scan` `withServices` to filter by service UUID's (Android)
65-
* Scan mode can be specified (Android)
66-
* Now targets the latest android SDK
67-
* Dart 2 compatibility
80+
* Runtime permissions for Android.
81+
* `scan` `withServices` to filter by service UUID's (Android).
82+
* Scan mode can be specified (Android).
83+
* Now targets the latest android SDK.
84+
* Dart 2 compatibility.
6885

6986
## 0.3.1
70-
* Now allows simultaneous notifications of characteristics
71-
* Fixed bug on iOS that was returning `discoverServices` too early
87+
* Now allows simultaneous notifications of characteristics.
88+
* Fixed bug on iOS that was returning `discoverServices` too early.
7289

7390
## 0.3.0
74-
* iOS support added
75-
* Bug fixed in example causing discoverServices to be called multiple times
76-
* Various other bug fixes
91+
* iOS support added.
92+
* Bug fixed in example causing discoverServices to be called multiple times.
93+
* Various other bug fixes.
7794

7895
## 0.2.4
7996
* **Breaking change**. Upgraded to Gradle 4.1 and Android Studio Gradle plugin
@@ -86,26 +103,26 @@
86103

87104
## 0.2.2
88105
* **Breaking changes**:
89-
* `startScan` renamed to `scan`
90-
* `ScanResult` now returns a `BluetoothDevice`
91-
* `connect` now takes a `BluetoothDevice` and returns Stream<BluetoothDeviceState>
92-
* Added parameter `timeout` to `connect`
93-
* Automatic disconnect on deviceConnection.cancel()
106+
* `startScan` renamed to `scan`.
107+
* `ScanResult` now returns a `BluetoothDevice`.
108+
* `connect` now takes a `BluetoothDevice` and returns Stream<BluetoothDeviceState>.
109+
* Added parameter `timeout` to `connect`.
110+
* Automatic disconnect on deviceConnection.cancel().
94111

95112
## 0.2.1
96-
* **Breaking change**. Removed `stopScan` from API, use `scanSubscription.cancel()` instead
97-
* Automatically stops scan when `startScan` subscription is canceled (thanks to @brianegan)
98-
* Added `timeout` parameter to `startScan`
99-
* Updated example app to show new scan functionality
113+
* **Breaking change**. Removed `stopScan` from API, use `scanSubscription.cancel()` instead.
114+
* Automatically stops scan when `startScan` subscription is canceled (thanks to @brianegan).
115+
* Added `timeout` parameter to `startScan`.
116+
* Updated example app to show new scan functionality.
100117

101118
## 0.2.0
102119

103-
* Added state and onStateChanged for BluetoothDevice
104-
* Updated example to show new functionality
120+
* Added state and onStateChanged for BluetoothDevice.
121+
* Updated example to show new functionality.
105122

106123
## 0.1.1
107124

108-
* Fixed image for pub.dartlang.org
125+
* Fixed image for pub.dartlang.org.
109126

110127
## 0.1.0
111128

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ FlutterBlue flutterBlue = FlutterBlue.instance;
3838
flutterBlue.startScan(timeout: Duration(seconds: 4));
3939
4040
// Listen to scan results
41-
var subscription = flutterBlue.scanResults.listen((scanResult) {
42-
// do something with scan result
43-
device = scanResult.device;
44-
print('${device.name} found! rssi: ${scanResult.rssi}');
41+
var subscription = flutterBlue.scanResults.listen((results) {
42+
// do something with scan results
43+
for (ScanResult r in results) {
44+
print('${r.device.name} found! rssi: ${r.rssi}');
45+
}
4546
});
4647
4748
// Stop scanning
@@ -104,7 +105,7 @@ characteristic.value.listen((value) {
104105
final mtu = await device.mtu.first;
105106
await device.requestMtu(512);
106107
```
107-
Note that iOS will not allow that you request the MTU size, but will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185)
108+
Note that iOS will not allow requests of MTU size, and will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185)
108109

109110
## Reference
110111
### FlutterBlue API

android/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222

2323
dependencies {
24-
classpath 'com.android.tools.build:gradle:3.5.0'
24+
classpath 'com.android.tools.build:gradle:3.5.2'
2525
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
2626
}
2727
}
@@ -78,5 +78,6 @@ protobuf {
7878

7979
dependencies {
8080
implementation 'com.google.protobuf:protobuf-lite:3.0.1'
81-
implementation 'androidx.core:core:1.1.0'
81+
implementation 'androidx.appcompat:appcompat:1.0.0'
82+
api 'androidx.core:core:1.0.1'
8283
}

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\://downloads.gradle-dn.com/distributions/gradle-5.6.4-all.zip

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
package="com.pauldemarco.flutter_blue">
33
<uses-permission android:name="android.permission.BLUETOOTH" />
44
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
5-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
5+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
66
</manifest>

0 commit comments

Comments
 (0)