Skip to content

Commit

Permalink
Updated docs to link to the current version of the service, `charac…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen1602 committed Oct 11, 2024
1 parent 4809ee3 commit 95aa771
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* 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.
* Updated docs to link to the current version of the `service`, `characteristic`, and `manufacturer data` blocklists
* https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
* https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt

## 0.2.3

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ You must beforehand specify which services you want to connect to! If you do not
access to a specific service then you won't be able to discover the service!

Some services are also part of a so called blocklist. This is different per browsers and these services are just off
limit.
limit. The Web Bluetooth Community Group has a [list](https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt)
of all block services and characteristics.

```dart
// Define the services you want to communicate with here!
Expand Down
11 changes: 11 additions & 0 deletions lib/src/bluetooth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ class BluetoothService {
/// for this browser. Check [hasIncludedService] to make sure you don't get
/// this error.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
Future<BluetoothService> getIncludedService(final String uuid) async {
try {
final service = await _bluetoothService.getIncludedService(uuid);
Expand Down Expand Up @@ -105,6 +109,10 @@ class BluetoothService {
///
/// - May throw [StateError] if the service is null.
///
/// **NOTE:** Some characteristics are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
Future<BluetoothCharacteristic> getCharacteristic(final String uuid) async {
try {
final characteristic = await _bluetoothService.getCharacteristic(uuid);
Expand Down Expand Up @@ -138,6 +146,9 @@ class BluetoothService {
///
/// - May throw [StateError] if the service is null.
///
/// **NOTE:** Some characteristics are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
Future<List<BluetoothCharacteristic>> getCharacteristics(
{final String? uuid}) async {
Expand Down
29 changes: 29 additions & 0 deletions lib/src/request_options_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ class RequestOptionsBuilder {
/// [optionalServices] is a list of services that are a nice to have. If a
/// device doesn't have this service then the browser won't reject it.
///
/// **NOTE:** For [optionalServices]\: Some services are on a block list,
/// and are thus not available. The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// [optionalManufacturerData] is a list of manufacturer codes. These codes
/// are then used to grand access to specific manufacturer data. This can
/// be a list of either strings in hexadecimal or ints. **NOTE** these values
/// can be a maximum of unsigned 16 bits.
///
/// **NOTE:** For [optionalManufacturerData]\: Some manufacturer data is on a
/// block list, and is thus not available. The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
///
/// **NOTE:** You **NEED** to define a service in either the [requestFilters]
/// or [optionalServices] if you want to be able to communicate with a
/// characteristic in it.
Expand Down Expand Up @@ -67,11 +75,19 @@ class RequestOptionsBuilder {
/// [optionalServices] is a list of services that are a nice to have. If a
/// device doesn't have this service then the browser won't reject it.
///
/// **NOTE:** For [optionalServices]\: Some services are on a block list,
/// and are thus not available. The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// [optionalManufacturerData] is a list of manufacturer codes. These codes
/// are then used to grand access to specific manufacturer data. This can
/// be a list of either strings in hexadecimal or ints. **NOTE** these values
/// can be a maximum of unsigned 16 bits.
///
/// **NOTE:** For [optionalManufacturerData]\: Some manufacturer data is on a
/// block list, and is thus not available. The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
///
/// **NOTE:** You **NEED** to define a service in [optionalServices] if you
/// want to be able to communicate communicate with a
/// characteristic in it.
Expand Down Expand Up @@ -273,6 +289,11 @@ class ServiceDataFilterBuilder {
/// This can be used to define the services that the device should have before
/// being able to communicate with it.
///
///
/// **NOTE:** Some manufacturer data is on a block list, and is thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
///
class ManufacturerDataFilterBuilder {
///
/// The 16 bit identifier of the company that either made the device, or more
Expand Down Expand Up @@ -357,11 +378,19 @@ class RequestFilterBuilder {
/// [services] is a list of service UUIDS. The device must have all the
/// services advertised in the list or it won't be allowed access.
///
/// **NOTE:** For [services]\: Some services are on a block list,
/// and are thus not available. The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// [manufacturerData] is a list of [ManufacturerDataFilterBuilder]
/// for what the manufacture data of the device should match before it shows
/// up in the available devices list. Note that if you set multiple manufacturer
/// data filters then a single device must match all of them.
///
/// **NOTE:** For [manufacturerData]\: Some manufacturer data is on a
/// block list, and is thus not available. The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
///
/// [serviceData] **Note** this is not stable yet and my not be implemented.
/// ignore: deprecated_member_use_from_same_package
/// A list of [ServiceDataFilterBuilder]s for the services that the
Expand Down
8 changes: 8 additions & 0 deletions lib/web/native_bluetooth_remote_gatt_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ class NativeBluetoothRemoteGATTServer {
///
/// - May throw NotFoundError if the services was found.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// See:
///
/// - [getPrimaryServices]
Expand Down Expand Up @@ -134,6 +138,10 @@ class NativeBluetoothRemoteGATTServer {
///
/// - May throw NotFoundError if no services were found.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// See:
///
/// - [getPrimaryService]
Expand Down
16 changes: 16 additions & 0 deletions lib/web/web_bluetooth_remote_gatt_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ class WebBluetoothRemoteGATTService {
///
/// - May throw NotFoundError if the characteristic was not found.
///
/// **NOTE:** Some characteristics are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// See:
///
/// - [getCharacteristics]
Expand Down Expand Up @@ -162,6 +166,10 @@ class WebBluetoothRemoteGATTService {
///
/// - May throw NotFoundError if the characteristic was not found.
///
/// **NOTE:** Some characteristics are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// See:
///
/// - [hasGetCharacteristicsFunction]
Expand Down Expand Up @@ -236,6 +244,10 @@ class WebBluetoothRemoteGATTService {
///
/// - May throw NotFoundError if the service was not found.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// See:
///
/// - [hasGetIncludedServiceFunction]
Expand Down Expand Up @@ -295,6 +307,10 @@ class WebBluetoothRemoteGATTService {
///
/// - May throw NotFoundError if the service was not found.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
/// See:
///
/// - [hasGetIncludedServiceFunction]
Expand Down
8 changes: 8 additions & 0 deletions lib/web/web_bluetooth_request_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class RequestOptions {
/// or [optionalServices] if you want to be able to communicate with a
/// characteristic in it.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
external List<String> get optionalServices;

///
Expand All @@ -51,6 +55,10 @@ class RequestOptions {
/// *NOTE:** You **NEED** to define a manufacturer's code in either the [filters]
/// or [optionalManufacturerData] if you want to be able to get its data.
///
/// **NOTE:** Some manufacturer data is on a block list, and is thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
///
external List<int> get optionalManufacturerData;

///
Expand Down
8 changes: 8 additions & 0 deletions lib/web/web_bluetooth_scan_filters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ class BluetoothScanFilter {
/// A list of UUIDS (should be lower case) of the services that the device
/// must have. A device is only allowed if it has all the services.
///
/// **NOTE:** Some services are on a block list, and are thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
///
external List<String>? get services;

///
Expand All @@ -131,6 +135,10 @@ class BluetoothScanFilter {
/// up in the available devices list. Note that if you set multiple manufacturer
/// data filters then a single device must match all of them.
///
/// **NOTE:** Some manufacturer data is on a block list, and is thus not available.
/// The complete blocklist can be found here:
/// https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
///
external List<BluetoothManufacturerDataFilter>? get manufacturerData;

///
Expand Down

0 comments on commit 95aa771

Please sign in to comment.