Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: julienzarka/flutter_blue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: tidbyt/flutter_blue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Mar 31, 2020

  1. Copy the full SHA
    6adc2b3 View commit details
  2. Copy the full SHA
    b990eed View commit details
  3. Copy the full SHA
    203b304 View commit details
  4. Bump compile and target Sdk versions to 29.

    This is related to issue #486.
    pauldemarco committed Mar 31, 2020
    Copy the full SHA
    b9b8568 View commit details
  5. Readme code fix (pauldemarco#466)

    * Fixed the device retrieval from scan result
    
    * Fixed the rssi retrieval from scan result
    alxkzmn authored Mar 31, 2020
    Copy the full SHA
    6ab5a72 View commit details
  6. Copy the full SHA
    a3120f2 View commit details
  7. Copy the full SHA
    3141a82 View commit details
  8. Upgrade gradle to 5.6.2

    pauldemarco committed Mar 31, 2020
    Copy the full SHA
    9778cf2 View commit details
  9. Updates to build.gradle.

    pauldemarco committed Mar 31, 2020
    Copy the full SHA
    e7d3f97 View commit details
  10. Support v2 android embedding and add smoke test.

    This update adds support for Flutter's version 2 Android embedder.
    In order to update a project created prior to flutter version 1.12,
    follow this guide: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
    
    Initial e2e test is included as a template for adding future tests.
    Follow the section for testing here:
    https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration#testing-your-plugin
    pauldemarco committed Mar 31, 2020
    Copy the full SHA
    419c17b View commit details
  11. Copy the full SHA
    ce9bcd2 View commit details
  12. Copy the full SHA
    8a6c7e9 View commit details
  13. Bump version to 0.7.0

    pauldemarco committed Mar 31, 2020
    Copy the full SHA
    47aee02 View commit details
  14. Copy the full SHA
    07cd496 View commit details

Commits on Apr 1, 2020

  1. Flatten Protos subspec in podspec.

    Pin to specific protobuf version.
    pauldemarco committed Apr 1, 2020
    Copy the full SHA
    1f2d7f3 View commit details
  2. Copy the full SHA
    1403ecb View commit details
  3. Copy the full SHA
    cc65e15 View commit details

Commits on Apr 2, 2020

  1. Avoid Range error when no BT adapter is available, e.g. when running …

    …on emulator (pauldemarco#431)
    
    Signed-off-by: Bernhard Bender <ber.droid@googlemail.com>
    berdroid authored Apr 2, 2020
    Copy the full SHA
    64893c4 View commit details
  2. Move Protobuf back to subspec and set requires_arc to false.

    Setting requires_arc to false at the top level caused crashes when using the plugin.
    pauldemarco committed Apr 2, 2020
    Copy the full SHA
    ed17284 View commit details
  3. Copy the full SHA
    5e15126 View commit details
  4. Stop notifying of value changes when a write happens (pauldemarco#526)

    * Stop writes from triggering value changes. Fixes #311, #378, #351.
    
    * Read after write to automatically update the UI.
    pauldemarco authored Apr 2, 2020
    Copy the full SHA
    487d98e View commit details
  5. Format example main.dart

    pauldemarco committed Apr 2, 2020
    Copy the full SHA
    e646920 View commit details

Commits on Apr 4, 2020

  1. Bump version to 0.7.1

    pauldemarco committed Apr 4, 2020
    Copy the full SHA
    04f5596 View commit details

Commits on Apr 8, 2020

  1. Only set the log level *if* bluetooth is available. (pauldemarco#288)

    * Only set the log level *if* bluetooh is available. Otherwise, setLogLevel throws a PlatformException.
    
    * Update changelog and bumped version.
    
    * Removed changelog and version update based on feedback because ‾\_(ツ)_/‾
    efortuna authored Apr 8, 2020
    Copy the full SHA
    df44e5c View commit details
  2. Copy the full SHA
    b5d4289 View commit details
  3. Bump version to 0.7.1+1

    pauldemarco committed Apr 8, 2020
    Copy the full SHA
    69db6dc View commit details

Commits on Apr 18, 2020

  1. Performance fix for Guid initializers (pauldemarco#552)

    * faster implementation of Guid._fromString
    
    * also improved Guid._fromMacString
    
    * faster non-hex char replacement method
    ezamagni authored Apr 18, 2020
    Copy the full SHA
    47067e4 View commit details

Commits on Apr 20, 2020

  1. AllowDuplicates option in scan function (pauldemarco#460)

    * added variable to enable or disable duplicate bluetooth devices
    
    * updated proto with new allowDuplicates field in ScanSettings
    
    * implemented allowDuplicates opts in FlutterBluePlugin.m
    
    * implementing allowDuplicates opt in dart
    
    * android: connected allowDuplicates
    
    * missing parameter in startScan method
    
    * fix typo
    
    Co-Authored-By: Maurits van Beusekom <maurits@baseflow.com>
    
    Co-authored-by: Simone Venturini <simone.venturini87@gmail.com>
    Co-authored-by: Enrico Zamagni <ezamagni@technogym.com>
    Co-authored-by: Maurits van Beusekom <maurits@baseflow.com>
    4 people authored Apr 20, 2020
    Copy the full SHA
    453dc5a View commit details
  2. Copy the full SHA
    7aeb171 View commit details
  3. Copy the full SHA
    0e1bf3a View commit details
  4. Copy the full SHA
    2cf9b20 View commit details
  5. Copy the full SHA
    fbad7d1 View commit details
  6. Bump version to 0.7.2

    * Add `allowDuplicates` option to `startScan`.
    * Fix performance issue with GUID initializers.
    pauldemarco committed Apr 20, 2020
    Copy the full SHA
    63a1002 View commit details

Commits on Jun 3, 2020

  1. Don't initiliazie CBCentralManager until needed

    By deferring the initialization of `CBCentralManager`, we are able to
    defer prompting for Bluetooth permission on iOS until a flutter_blue
    method is called. Otherwise, the Bluetooth permission prompt appears
    right when the app starts up.
    rohansingh committed Jun 3, 2020
    Copy the full SHA
    4ed5e99 View commit details
Showing with 2,167 additions and 700 deletions.
  1. +56 −39 CHANGELOG.md
  2. +6 −5 README.md
  3. +3 −1 android/build.gradle
  4. +1 −1 android/gradle/wrapper/gradle-wrapper.properties
  5. +1 −2 android/src/main/AndroidManifest.xml
  6. +128 −24 android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java
  7. +1 −0 example/.gitignore
  8. +4 −4 example/android/app/build.gradle
  9. +14 −0 example/android/app/src/androidTest/java/com/pauldemarco/flutter_blue/EmbeddingV1ActivityTest.java
  10. +12 −0 example/android/app/src/androidTest/java/com/pauldemarco/flutter_blue/FlutterActivityTest.java
  11. +9 −1 example/android/app/src/main/AndroidManifest.xml
  12. +15 −0 example/android/app/src/main/java/com/pauldemarco/flutter_blue_example/EmbeddingV1Activity.java
  13. +0 −13 example/android/app/src/main/java/com/pauldemarco/flutter_blue_example/MainActivity.java
  14. +11 −5 example/ios/Podfile.lock
  15. +4 −0 example/ios/Runner/Info.plist
  16. +9 −4 example/lib/main.dart
  17. +5 −3 example/pubspec.yaml
  18. +8 −3 ios/Classes/FlutterBluePlugin.m
  19. +6 −6 ios/flutter_blue.podspec
  20. +4 −1 ios/gen/Flutterblue.pbobjc.h
  21. +11 −1 ios/gen/Flutterblue.pbobjc.m
  22. +1,385 −472 lib/gen/flutterblue.pb.dart
  23. +49 −27 lib/gen/flutterblue.pbenum.dart
  24. +326 −44 lib/gen/flutterblue.pbjson.dart
  25. +0 −1 lib/gen/flutterblue.pbserver.dart
  26. +10 −5 lib/src/bluetooth_characteristic.dart
  27. +5 −0 lib/src/bluetooth_descriptor.dart
  28. +10 −0 lib/src/bluetooth_device.dart
  29. +5 −0 lib/src/bluetooth_service.dart
  30. +28 −4 lib/src/flutter_blue.dart
  31. +19 −30 lib/src/guid.dart
  32. +1 −0 protos/flutterblue.proto
  33. +8 −4 pubspec.yaml
  34. +13 −0 test/flutter_blue_test_e2e.dart
95 changes: 56 additions & 39 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
## 0.7.2
* Add `allowDuplicates` option to `startScan`.
* Fix performance issue with GUID initializers.

## 0.7.1+1
* Fix for FlutterBlue constructor when running on emulator.
* Return error when attempting to `discoverServices` while not connected.

## 0.7.1
* Fix incorrect value notification when write is performed.
* Add `toString` to each bluetooth class.
* Various other bug fixes.

## 0.7.0
* Support v2 android embedding.
* Various bug and documentation fixes.

## 0.6.3+1
* Fix compilation issue with iOS
* Bump protobuf version to 1.0.0
* Fix compilation issue with iOS.
* Bump protobuf version to 1.0.0.

## 0.6.3
* Update project files for Android and iOS
* Remove dependency on protoc for iOS
* Update project files for Android and iOS.
* Remove dependency on protoc for iOS.

## 0.6.2
* Add `mtu` and `requestMtu` to BluetoothDevice
* Add `mtu` and `requestMtu` to BluetoothDevice.

## 0.6.0+4
* Fix duplicate characteristic notifications when connection lost.
* Fix duplicate characteristic notifications when reconnecting.
* Add minimum SDK version of 18 for the plugin.
* Documentation updates
* Documentation updates.

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

## 0.4.2+1
* Upgrade Android Gradle plugin to 3.3.0
* Refresh iOS build files
* Upgrade Android Gradle plugin to 3.3.0.
* Refresh iOS build files.

## 0.4.2
* Set the verbosity of log messages with `setLogLevel`
* Updated iOS and Android project files
* `autoConnect` now configurable for Android
* Various bug fixes
* Set the verbosity of log messages with `setLogLevel`.
* Updated iOS and Android project files.
* `autoConnect` now configurable for Android.
* Various bug fixes.

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

## 0.3.4
* Updated to use the latest protobuf (^0.9.0+1)
* Updated other dependencies
* Updated to use the latest protobuf (^0.9.0+1).
* Updated other dependencies.

## 0.3.3
* `scan` `withServices` to filter by service UUID's (iOS)
* Error handled when trying to scan with adapter off (Android)
* `scan` `withServices` to filter by service UUID's (iOS).
* Error handled when trying to scan with adapter off (Android).

## 0.3.2
* Runtime permissions for Android
* `scan` `withServices` to filter by service UUID's (Android)
* Scan mode can be specified (Android)
* Now targets the latest android SDK
* Dart 2 compatibility
* Runtime permissions for Android.
* `scan` `withServices` to filter by service UUID's (Android).
* Scan mode can be specified (Android).
* Now targets the latest android SDK.
* Dart 2 compatibility.

## 0.3.1
* Now allows simultaneous notifications of characteristics
* Fixed bug on iOS that was returning `discoverServices` too early
* Now allows simultaneous notifications of characteristics.
* Fixed bug on iOS that was returning `discoverServices` too early.

## 0.3.0
* iOS support added
* Bug fixed in example causing discoverServices to be called multiple times
* Various other bug fixes
* iOS support added.
* Bug fixed in example causing discoverServices to be called multiple times.
* Various other bug fixes.

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

## 0.2.2
* **Breaking changes**:
* `startScan` renamed to `scan`
* `ScanResult` now returns a `BluetoothDevice`
* `connect` now takes a `BluetoothDevice` and returns Stream<BluetoothDeviceState>
* Added parameter `timeout` to `connect`
* Automatic disconnect on deviceConnection.cancel()
* `startScan` renamed to `scan`.
* `ScanResult` now returns a `BluetoothDevice`.
* `connect` now takes a `BluetoothDevice` and returns Stream<BluetoothDeviceState>.
* Added parameter `timeout` to `connect`.
* Automatic disconnect on deviceConnection.cancel().

## 0.2.1
* **Breaking change**. Removed `stopScan` from API, use `scanSubscription.cancel()` instead
* Automatically stops scan when `startScan` subscription is canceled (thanks to @brianegan)
* Added `timeout` parameter to `startScan`
* Updated example app to show new scan functionality
* **Breaking change**. Removed `stopScan` from API, use `scanSubscription.cancel()` instead.
* Automatically stops scan when `startScan` subscription is canceled (thanks to @brianegan).
* Added `timeout` parameter to `startScan`.
* Updated example app to show new scan functionality.

## 0.2.0

* Added state and onStateChanged for BluetoothDevice
* Updated example to show new functionality
* Added state and onStateChanged for BluetoothDevice.
* Updated example to show new functionality.

## 0.1.1

* Fixed image for pub.dartlang.org
* Fixed image for pub.dartlang.org.

## 0.1.0

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -38,10 +38,11 @@ FlutterBlue flutterBlue = FlutterBlue.instance;
flutterBlue.startScan(timeout: Duration(seconds: 4));
// Listen to scan results
var subscription = flutterBlue.scanResults.listen((scanResult) {
// do something with scan result
device = scanResult.device;
print('${device.name} found! rssi: ${scanResult.rssi}');
var subscription = flutterBlue.scanResults.listen((results) {
// do something with scan results
for (ScanResult r in results) {
print('${r.device.name} found! rssi: ${r.rssi}');
}
});
// Stop scanning
@@ -104,7 +105,7 @@ characteristic.value.listen((value) {
final mtu = await device.mtu.first;
await device.requestMtu(512);
```
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)
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)

## Reference
### FlutterBlue API
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
}
}
@@ -78,4 +78,6 @@ protobuf {

dependencies {
implementation 'com.google.protobuf:protobuf-lite:3.0.1'
implementation 'androidx.appcompat:appcompat:1.0.0'
api 'androidx.core:core:1.0.1'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pauldemarco.flutter_blue">
<uses-sdk android:minSdkVersion="18" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</manifest>
Loading