Skip to content

Commit 607b802

Browse files
committed
chore: rename connectionState to bondState in BondStateUpdate
1 parent bd1a18b commit 607b802

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

example/lib/src/ble/ble_device_bond_monitor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BleDeviceBondMonitor implements ReactiveState<DeviceBondState> {
1919
void startMonitoringDevice(String deviceId) {
2020
_bondStateSubscription ??= _ble.bondUpdateStream
2121
.where((update) => update.deviceId == deviceId)
22-
.map((update) => update.connectionState)
22+
.map((update) => update.bondState)
2323
.listen(_bondStateController.add);
2424
}
2525

packages/reactive_ble_mobile/lib/src/converter/protobuf_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ProtobufConverterImpl implements ProtobufConverter {
8484
final message = pb.BondInfo.fromBuffer(data);
8585
return BondStateUpdate(
8686
deviceId: message.id,
87-
connectionState: selectFrom(
87+
bondState: selectFrom(
8888
DeviceBondState.values,
8989
index: message.bondState,
9090
fallback: (_) => DeviceBondState.unknown,

packages/reactive_ble_mobile/lib/src/reactive_ble_mobile_platform.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ReactiveBleMobilePlatform extends ReactiveBlePlatform {
5151
_bondUpdateRawStream.map(_protobufConverter.bondUpdateFrom).map(
5252
(update) {
5353
_logger?.log(
54-
'Received $BondStateUpdate(deviceId: ${update.deviceId}, connectionState: ${update.connectionState})',
54+
'Received $BondStateUpdate(deviceId: ${update.deviceId}, connectionState: ${update.bondState})',
5555
);
5656
return update;
5757
},

packages/reactive_ble_mobile/test/reactive_ble_platform_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,12 @@ void main() {
628628
group('bond status', () {
629629
const status1 = BondStateUpdate(
630630
deviceId: '123',
631-
connectionState: DeviceBondState.unknown,
631+
bondState: DeviceBondState.unknown,
632632
);
633633

634634
const status2 = BondStateUpdate(
635635
deviceId: '123',
636-
connectionState: DeviceBondState.bonding,
636+
bondState: DeviceBondState.bonding,
637637
);
638638

639639
Stream<BondStateUpdate>? _bondUpdateStream;

packages/reactive_ble_platform_interface/lib/src/model/bond_state_update.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ part 'bond_state_update.g.dart';
99
@FunctionalData()
1010
class BondStateUpdate extends $BondStateUpdate {
1111
final String deviceId;
12-
final DeviceBondState connectionState;
12+
final DeviceBondState bondState;
1313

1414
const BondStateUpdate({
1515
required this.deviceId,
16-
required this.connectionState,
16+
required this.bondState,
1717
});
1818
}
1919

packages/reactive_ble_platform_interface/lib/src/model/bond_state_update.g.dart

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)