- Changed from
dart:html
todart:js_interop
to support wasm builds. - Dependencies:
- Bluetooth advertisements
- Breaking:
src/AdvertisementReceivedEvent
no longer extendsweb/AdvertisementReceivedEventInterface
src/AdvertisementReceivedEvent
now has awithMemory
constructor- Breaking:
web/AdvertisementReceivedEventInterface
no longer exists - Breaking:
web/WebAdvertisementReceivedEvent
has been renamed toweb/BluetoothAdvertisementReceivedEvent
- Breaking:
web/WebAdvertisementReceivedEvent.fromJSObject
constructor no longer exists - Breaking:
web/WebAdvertisementReceivedEvent.withMemory
constructor no longer exists
- Breaking:
- Bluetooth filters:
web/BluetoothScanFilterHelper
is now deprecated. Useweb/BluetoothManufacturerDataFilter.create()
,web/BluetoothServiceDataFilter.create()
, andweb/BluetoothScanFilter.create()
instead.- Breaking:
web/BluetoothServiceDataFilter
now requires a service UUID. Following spec - Breaking:
web/BluetoothManufacturerDataFilter
now requires a company identifier. Following spec - Breaking:
src/ServiceDataFilterBuilder
now requires a service UUID. Following spec - Breaking:
src/ManufacturerDataFilterBuilder
now requires a company identifier. Following spec
- Breaking:
web/js/AbortController
has been removed in favor of the implementation form theweb
package - Breaking:
web/js/JSUtils
has been removed (this was an internal library so it shouldn't have any impact on most projects) - Breaking:
web/NativeBluetooth
now returnsJSPromises
and other native objects instead ofobject
- Breaking:
web/testingSetNavigator()
now requires that you set aweb
navigator object. - Breaking:
web/*
alladdEventListener
andremoveEventListener
functions now extend fromweb/EventTarget
- Breaking:
web/*
all objects now implementJSObject
and have been marked with@JS
. This also removes allfromJSObject
constructors. - Breaking: removed
web/WebBluetoothConverters
web/WatchAdvertisementsOptions
the signal property is now nullable. Following the spec.web/*
created event streams usingBluetoothEventStreamProviders
.- created
web/WebBluetoothValueEvent
for theavailabilitychanged
event. - Changed example project to also use
dart:js_interop
instead ofdart:html
. - Breaking: Removed all deprecated
BluetoothDefaultManufacturerIdentifiers
cases. That were deprecated pre this release. - Breaking: Removed all deprecated
BluetoothDefaultServiceUUIDS
cases. That were deprecated pre this release.
- Updated
BluetoothDefaultManufacturerIdentifiers
, some identifiers have been renamed, the old names have been marked as deprecated.- Use
BluetoothDefaultManufacturerIdentifiers.manufacturerIdentifiers
to get a list of all the non-deprecated identifiers.
- Use
- Updated
BluetoothDefaultServiceUUIDS
with the latest service UUIDS. Some services now use the official name from the Bluetooth SIG, the old names have been marked as deprecated.- Use
BluetoothDefaultServiceUUIDS.services
to get a list of all the non-deprecated service UUIDS. - Added the
id
field to the enum, this contains the official Bluetooth SIG id of the UUID.
- Use
- Updated
BluetoothDefaultCharacteristicUUIDS
with the latest characteristic UUIDS. Some characteristic now use the official name from the Bluetooth SIG, some characteristics no longer exist in the spec. The old names and values have been marked as deprecated- Use
BluetoothDefaultCharacteristicUUIDS.characteristics
to get a list of all the non-deprecated characteristic UUIDS. - Added the
id
field to the enum, this contains the official Bluetooth SIG id of the UUID.
- Use
- Updated docs to link to the current version of the
service
,characteristic
, andmanufacturer data
blocklists
- Added
optionalManufacturerData
toRequestOptions
. This is needed to get the manufacture data when watching advertisements. - Added
BluetoothDefaultManufacturerIdentifiers
enum with all the registered manufacturer identifiers - Fixed the conversion from a JS map to a dart map for manufacturer data and service data. If you are listening to advertisements then these values will now be returned correctly.
- Update dependencies.
- Added
exclusionFilters
toRequestOptionsBuilder
. - Added new MissingUserGestureError that you may need to handle.
- Updated dependencies to be more broad. (The minimum versions are still supported.)
- Updated dependencies.
- Breaking Removed SNAKE_CASE uuids.
- The default uuids are now an enum since dart supports enums with values.
- If you were using
defaultUuid.ordinal
then you should now usedefaultUuid.index
. - Some names may slightly differ.
- Breaking Upgraded minimum dart sdk to
2.17
- Added
forget
to aBluetoothDevice
, to forget a device.
- Breaking in
Bluetooth.requestDevice()
theRequestOptions
are no longer nullable. - Breaking
BluetoothDevice.gatt
is no longer marked as deprecated, it is still marked asvisibleForTesting
. - Added bluetooth advertisements event to a bluetooth device. (Note this is still behind a flag in most browsers.)
- Support the newest version of logging.
- Added
requestLEScan
toBluetooth
andFlutterWebBluetooth
. You can now scan for devices advertisements without needing to pair with each device. However, a normal pair does need to happen before characteristics can be used. - Continuing with the IOS Bluefy browser fix for characteristic properties.
- Added
has
methods for all the fields in characteristic properties. - Return
false
as default value when a property doesn't exist. - Added
hasProperties
method to check if there are any properties at all. Use this to test if the properties are even reliable. - You can remove any try-catch logic around reading properties if you added those for the mitigation.
- Added
- The next version of the library will probably upgrade the minimum SDK from
2.12
to2.17
to keep up with other packages. If there are any good reasons to not do this then please create an issue on Github.
- Added a hotfix for the IOS Bluefy browser. As a side effect none of the characteristic properties are required anymore, but there are no methods yet to check if the properties exist. So add a try-catch around these methods for now!
- Updated dependencies to work with Flutter 3.3.0
- Added manufacturer scan filters and service scan filters
- Added
getCharacteristics
to the bluetooth service to get all the characteristics. - Set target platform to web for pub.dev target platform list (it will still compile when used in non-native programs.)
- Added documentation to the last few public interfaces
- Fixed the behavior subject stream not returning the stored value causing some implementations to wait forever.
- Fixed the library trying to add the
availabilitychanged
event on unsupported platforms.
- Removed RxDart as a dependency
- Added Dart Meta annotations to help with avoiding methods only meant for testing
- Added a lot of documentation
- Added more error handling and descriptions for when these errors may occur and how to avoid them
- Added characteristic descriptor
- Deprecated SNAKE_CASE for default uuids. Use the camelCase version instead
- Switched to using
logger
instead ofprint
statements. This allows other developers to decide what to do with the log messages
- Fixed typo in
characteristicvaluechanged
for theBluetoothCharacteristic.startNotifications()
. ( Thanks AshTerry.) - Fixed crash when the device name of a bluetooth device is null. ( Thanks alextekartik.)
- A lot of small lint fixes, but that shouldn't impact a project based on this library. ( Thanks alextekartik.)
- Fixed call to
navigator.bluetooth.getDevices
in browsers that don't support it. - Added more documentation
- Forgot some Flutter dependency
- Removed Flutter as a dependency
- Added characteristic properties
- Added toLowerCase to every call that requires a UUID, because the web api expects only lower case UUIDS.
- Added Bluetooth descriptors.
- Basic support for web bluetooth api