Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: Data reading from char #266

Merged
merged 1 commit into from
Jul 29, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readLevel();
collectLog('readLevel:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readLevel:value $value');
return BlueberryResolves.readLevel(Uint8List.fromList(value!));
},
Expand All @@ -164,7 +164,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readVersion();
collectLog('readVersion:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readVersion:value $value');
return BlueberryResolves.readVersion(Uint8List.fromList(value!));
},
Expand All @@ -177,7 +177,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readTime();
collectLog('readTime:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readTime:value $value');
return BlueberryResolves.readTime(Uint8List.fromList(value!));
},
Expand All @@ -190,7 +190,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readSleep();
collectLog('readSleep:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readSleep:value $value');
return BlueberryResolves.readSleep(Uint8List.fromList(value!));
},
Expand All @@ -203,7 +203,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readBloodOxygens();
collectLog('readBloodOxygens:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readBloodOxygens:value $value');
return BlueberryResolves.readBloodOxygens(Uint8List.fromList(value!));
},
Expand All @@ -216,7 +216,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readSteps();
collectLog('readSteps:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readSteps:value $value');
return BlueberryResolves.readSteps(Uint8List.fromList(value!));
},
Expand All @@ -229,7 +229,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
final command = BlueberryCommands.readHeartRates();
collectLog('readHeartRate:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingCharacteristic.value?.read();
final value = blueberryRingCharacteristic.value?.lastValue;
collectLog('readHeartRate:value $value');
return BlueberryResolves.readHeartRates(Uint8List.fromList(value!));
},
Expand Down
Loading