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

Commit

Permalink
fix: Data reading from char
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed Jul 29, 2024
1 parent dbc4be4 commit 2846e84
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 2846e84

Please sign in to comment.