Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions example/lib/src/ble/ble_device_interactor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BleDeviceInteractor {
_logMessage('Discovering services finished');
return result;
} on Exception catch (e) {
_logMessage('Error occured when discovering services: $e');
_logMessage('Error occurred when discovering services: $e');
rethrow;
}
}
Expand All @@ -62,39 +62,39 @@ class BleDeviceInteractor {
return result;
} on Exception catch (e, s) {
_logMessage(
'Error occured when reading ${characteristic.characteristicId} : $e',
'Error occurred when reading ${characteristic.characteristicId} : $e',
);
// ignore: avoid_print
print(s);
rethrow;
}
}

Future<void> writeCharacterisiticWithResponse(
Future<void> writeCharacteristicWithResponse(
QualifiedCharacteristic characteristic, List<int> value) async {
try {
_logMessage(
'Write with response value : $value to ${characteristic.characteristicId}');
await _writeWithResponse(characteristic, value: value);
} on Exception catch (e, s) {
_logMessage(
'Error occured when writing ${characteristic.characteristicId} : $e',
'Error occurred when writing ${characteristic.characteristicId} : $e',
);
// ignore: avoid_print
print(s);
rethrow;
}
}

Future<void> writeCharacterisiticWithoutResponse(
Future<void> writeCharacteristicWithoutResponse(
QualifiedCharacteristic characteristic, List<int> value) async {
try {
await _writeWithoutResponse(characteristic, value: value);
_logMessage(
'Write without response value: $value to ${characteristic.characteristicId}');
} on Exception catch (e, s) {
_logMessage(
'Error occured when writing ${characteristic.characteristicId} : $e',
'Error occurred when writing ${characteristic.characteristicId} : $e',
);
// ignore: avoid_print
print(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class CharacteristicInteractionDialog extends StatelessWidget {
builder: (context, interactor, _) => _CharacteristicInteractionDialog(
characteristic: characteristic,
readCharacteristic: interactor.readCharacteristic,
writeWithResponse: interactor.writeCharacterisiticWithResponse,
writeWithoutResponse:
interactor.writeCharacterisiticWithoutResponse,
writeWithResponse: interactor.writeCharacteristicWithResponse,
writeWithoutResponse: interactor.writeCharacteristicWithoutResponse,
subscribeToCharacteristic: interactor.subScribeToCharacteristic,
));
}
Expand Down
4 changes: 2 additions & 2 deletions example/lib/src/ui/device_detail/device_interaction_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class _ServiceDiscoveryListState extends State<_ServiceDiscoveryList> {
super.initState();
}

String _charactisticsSummary(DiscoveredCharacteristic c) {
String _characteristicsSummary(DiscoveredCharacteristic c) {
final props = <String>[];
if (c.isReadable) {
props.add("read");
Expand Down Expand Up @@ -215,7 +215,7 @@ class _ServiceDiscoveryListState extends State<_ServiceDiscoveryList> {
deviceId: deviceId),
)),
title: Text(
'${characteristic.characteristicId}\n(${_charactisticsSummary(characteristic)})',
'${characteristic.characteristicId}\n(${_characteristicsSummary(characteristic)})',
style: const TextStyle(
fontSize: 14,
),
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_reactive_ble/lib/src/reactive_ble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FlutterReactiveBle {

factory FlutterReactiveBle() => _sharedInstance;

///Create a new instance where injected depedencies are used.
///Create a new instance where injected dependencies are used.
@visibleForTesting
FlutterReactiveBle.witDependencies({
required DeviceScanner deviceScanner,
Expand Down Expand Up @@ -245,7 +245,7 @@ class FlutterReactiveBle {
/// Disconnecting the device is achieved by cancelling the stream subscription.
///
/// [id] is the unique device id of the BLE device: in iOS this is a uuid and on Android this is
/// a Mac-Adress.
/// a Mac-Address.
/// Use [servicesWithCharacteristicsToDiscover] to scan only for the specific services mentioned in this map,
/// this can improve the connection speed on iOS since no full service discovery will be executed. On Android
/// this variable is ignored since partial discovery is not possible.
Expand All @@ -271,7 +271,7 @@ class FlutterReactiveBle {
///
/// Disconnecting the device is achieved by cancelling the stream subscription.
///
/// The [prescanDuration] is the amount of time BLE disovery should run in order to find the device.
/// The [prescanDuration] is the amount of time BLE discovery should run in order to find the device.
/// Use [servicesWithCharacteristicsToDiscover] to scan only for the specific services mentioned in this map,
/// this can improve the connection speed on iOS since no full service discovery will be executed. On Android
/// this variable is ignored since partial discovery is not possible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _SerialAlreadyDisposed extends Error {
String toString() => "An instance of $_type has already been disposed";
}

/// A [SerialDisposable] that constains an underlying stream subscription.
/// A [SerialDisposable] that contains an underlying stream subscription.
class StreamSubscriptionSerialDisposable
extends SerialDisposable<StreamSubscription> {
StreamSubscriptionSerialDisposable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import class CoreBluetooth.CBPeripheral
//
// Thus this code shadows original property declarations in CoreBluetooth
// and changes their semantics from `unsafe non-optional` to `weak optional`
// to mimic Xcode 13 behaviour.
// to mimic Xcode 13 behavior.
//
// - Note: This code compiles only when using Xcode 12 and below.
// - SeeAlso: https://forums.swift.org/t/is-unowned-unsafe-t-weak-t-a-breaking-change/49917
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum ConnectionPriority {

/// high priority, low latency connection.
highPerformance,
// reduced power, low data rate connennection.
// reduced power, low data rate connection.
lowPower,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:meta/meta.dart';

import 'uuid.dart';

/// Specific BLE characteristic for a BLE device characterised by [deviceId], [serviceId] and
/// Specific BLE characteristic for a BLE device characterized by [deviceId], [serviceId] and
/// [characteristicId].
@immutable
class DiscoveredCharacteristic {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// States the level of debuglogging within this library
/// States the level of debug logging within this library
enum LogLevel {
/// No debugLogging at all. This is the default level within the library.
none,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:meta/meta.dart';

import 'uuid.dart';

/// Specific BLE characteristic for a BLE device characterised by [deviceId], [serviceId] and
/// Specific BLE characteristic for a BLE device characterized by [deviceId], [serviceId] and
/// [characteristicId].
@immutable
class QualifiedCharacteristic {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:meta/meta.dart';

///Result of a ble operation.
///
/// In case the result is succesfull [Failure] is null.
/// In case the result is successful [Failure] is null.
@immutable
class Result<Value, Failure> {
const Result.success(this._value)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
///Android only: mode in which BLE discovery is executed.
/// Android only: mode in which BLE discovery is executed.
enum ScanMode {
/// passively listen for other scan results without starting BLE scan itself.
opportunistic,

/// scanmode which has the lowest battery consumption.
/// Scan mode which has the lowest battery consumption.
lowPower,

/// scanmode that is a good compromise between battery consumption and latency.
/// Scan mode that is a good compromise between battery consumption and latency.
balanced,

///Scanmode with highest battery consumption and lowest latency.
///Should not be used when scanning for a long time.
/// Scan mode with highest battery consumption and lowest latency.
/// Should not be used when scanning for a long time.
lowLatency,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ abstract class ReactiveBlePlatform extends PlatformInterface {
'writeCharacteristicWithoutResponse has not been implemented.');
}

/// Starts subscribing to notifications for a specificied characteristic.
/// Starts subscribing to notifications for a specified characteristic.
///
/// This stream only returns the result of the operation. Value updates should
/// be propagated to [charValueUpdateStream].
Expand All @@ -159,12 +159,12 @@ abstract class ReactiveBlePlatform extends PlatformInterface {
'subscribeToNotifications has not been implemented.');
}

/// Stops subscribing to notifications for a specificied characteristic.
/// Stops subscribing to notifications for a specified characteristic.
Future<void> stopSubscribingToNotifications(
QualifiedCharacteristic characteristic,
) {
throw UnimplementedError(
'stopSubscribingToNotifiations has not been implemented.');
'stopSubscribingToNotifications has not been implemented.');
}

/// Requests a specific MTU for a connected device.
Expand All @@ -179,6 +179,6 @@ abstract class ReactiveBlePlatform extends PlatformInterface {
Future<ConnectionPriorityInfo> requestConnectionPriority(
String deviceId, ConnectionPriority priority) {
throw UnimplementedError(
'requesConnectionPriority has not been implemented.');
'requestConnectionPriority has not been implemented.');
}
}