Skip to content

Commit

Permalink
chore: rename connectionState to bondState in BondStateUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorbell committed Jan 7, 2025
1 parent bd1a18b commit 607b802
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion example/lib/src/ble/ble_device_bond_monitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BleDeviceBondMonitor implements ReactiveState<DeviceBondState> {
void startMonitoringDevice(String deviceId) {
_bondStateSubscription ??= _ble.bondUpdateStream
.where((update) => update.deviceId == deviceId)
.map((update) => update.connectionState)
.map((update) => update.bondState)
.listen(_bondStateController.add);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ProtobufConverterImpl implements ProtobufConverter {
final message = pb.BondInfo.fromBuffer(data);
return BondStateUpdate(
deviceId: message.id,
connectionState: selectFrom(
bondState: selectFrom(
DeviceBondState.values,
index: message.bondState,
fallback: (_) => DeviceBondState.unknown,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ReactiveBleMobilePlatform extends ReactiveBlePlatform {
_bondUpdateRawStream.map(_protobufConverter.bondUpdateFrom).map(
(update) {
_logger?.log(
'Received $BondStateUpdate(deviceId: ${update.deviceId}, connectionState: ${update.connectionState})',
'Received $BondStateUpdate(deviceId: ${update.deviceId}, connectionState: ${update.bondState})',
);
return update;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,12 @@ void main() {
group('bond status', () {
const status1 = BondStateUpdate(
deviceId: '123',
connectionState: DeviceBondState.unknown,
bondState: DeviceBondState.unknown,
);

const status2 = BondStateUpdate(
deviceId: '123',
connectionState: DeviceBondState.bonding,
bondState: DeviceBondState.bonding,
);

Stream<BondStateUpdate>? _bondUpdateStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ part 'bond_state_update.g.dart';
@FunctionalData()
class BondStateUpdate extends $BondStateUpdate {
final String deviceId;
final DeviceBondState connectionState;
final DeviceBondState bondState;

const BondStateUpdate({
required this.deviceId,
required this.connectionState,
required this.bondState,
});
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 607b802

Please sign in to comment.