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

Pre main qa #281

Merged
merged 68 commits into from
Aug 16, 2024
Merged
Changes from 2 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
810ca89
fix: Date parse error
reasje Jul 18, 2024
8554fa8
fix: uncomment notifications page
reasje Jul 18, 2024
b18bfdf
fix: Handle bluetooth adapter being off
reasje Jul 21, 2024
24b5b2f
fix: Disconnect blueberry when dapp closed
reasje Jul 21, 2024
a2b7a1a
fix: callHandlerWrapper mechanism
reasje Jul 21, 2024
e7879a4
fix: Uninitialized error stream
reasje Jul 21, 2024
64922a1
Merge pull request #257 from MXCzkEVM/blueberry_ring
reasje Jul 22, 2024
3a1fd71
fix: Remove date specific checks
reasje Jul 23, 2024
719e500
Merge pull request #258 from MXCzkEVM/blueberry_ring
reasje Jul 23, 2024
3e120e6
Update pubspec.yaml
SanghamitraBhowmick1993 Jul 23, 2024
a055383
config: IOS config sync task
reasje Jul 24, 2024
36e05ca
feat: Add blueberry ring contracts
reasje Jul 24, 2024
082c47a
feat: Blueberry ring helper
reasje Jul 24, 2024
614ded8
feat: Blueberry ring snack bars
reasje Jul 24, 2024
57f82c4
Merge pull request #260 from MXCzkEVM/blueberry_ring
reasje Jul 26, 2024
1412f42
test: Blueberry ring connection
reasje Jul 26, 2024
5e66996
fix: syntax
reasje Jul 26, 2024
ffc015c
Merge pull request #261 from MXCzkEVM/blueberry_ring
reasje Jul 26, 2024
2515098
feat: blueberry ring auto sync
reasje Jul 26, 2024
0dc64af
Merge pull request #262 from MXCzkEVM/blueberry_ring
reasje Jul 26, 2024
7cc75e4
fix: Update shared
reasje Jul 26, 2024
c8f2cb7
Merge pull request #263 from MXCzkEVM/blueberry_ring
reasje Jul 26, 2024
e555830
fix: Blueberry name filter
reasje Jul 26, 2024
b9fc697
Merge pull request #264 from MXCzkEVM/blueberry_ring
reasje Jul 26, 2024
dbc4be4
fix: Add with keywords
reasje Jul 26, 2024
a1b656a
Merge pull request #265 from MXCzkEVM/blueberry_ring
reasje Jul 26, 2024
2846e84
fix: Data reading from char
reasje Jul 29, 2024
7755fd7
Merge pull request #266 from MXCzkEVM/blueberry_ring
reasje Jul 29, 2024
13c052f
fix: Notif char value
reasje Jul 29, 2024
75654dc
Merge pull request #267 from MXCzkEVM/blueberry_ring
reasje Jul 29, 2024
675556b
fix: empty data
reasje Jul 29, 2024
1a433b5
Merge pull request #268 from MXCzkEVM/blueberry_ring
reasje Jul 29, 2024
48b43dd
fix: ring commands map
reasje Jul 29, 2024
e43f3f2
Merge pull request #269 from MXCzkEVM/blueberry_ring
reasje Jul 29, 2024
05caa21
feat: Add bluetooth connection handler
reasje Jul 29, 2024
4dac62e
fix: Integrate connection handler with blueberry use case
reasje Jul 29, 2024
ef18dce
fix: Integrate connection handler
reasje Jul 29, 2024
67bf716
Merge pull request #270 from MXCzkEVM/blueberry_ring
reasje Jul 29, 2024
80ce9a8
fix: Read battery
reasje Jul 30, 2024
d20228a
Merge pull request #271 from MXCzkEVM/blueberry_ring
reasje Jul 30, 2024
cb5f512
refactor: Fetch data from ring
reasje Jul 31, 2024
9d03c7d
Merge pull request #272 from MXCzkEVM/blueberry_ring
reasje Jul 31, 2024
795d47b
fix: BG fetch data retrieval chunks
reasje Aug 1, 2024
a4b242b
feat: Methods config update
reasje Aug 1, 2024
3d988d0
Merge pull request #273 from MXCzkEVM/blueberry_ring
reasje Aug 1, 2024
1da7bdd
fix: Improve logging
reasje Aug 2, 2024
751ce14
fix: List length error
reasje Aug 2, 2024
5678925
fix: Today check ring notif
reasje Aug 2, 2024
7918c52
Merge pull request #274 from MXCzkEVM/blueberry_ring
reasje Aug 2, 2024
53c953e
feat: Auto sync func imprv
reasje Aug 5, 2024
26e914c
feat: Wallet provider sign message
reasje Aug 6, 2024
9a793ee
Merge pull request #277 from MXCzkEVM/blueberry_ring
reasje Aug 6, 2024
3eb0c61
refactor: JS channel, bluetooth channel, cron channel, panel
reasje Aug 7, 2024
1dd8307
fix: Call sign message
reasje Aug 7, 2024
d9ea3ba
Merge pull request #278 from MXCzkEVM/blueberry_ring
reasje Aug 7, 2024
20c6688
fix: update shared
reasje Aug 7, 2024
8b01dc8
Merge pull request #279 from MXCzkEVM/blueberry_ring
reasje Aug 7, 2024
1d64480
fix: update shared
reasje Aug 7, 2024
9c36a1c
Merge branch 'blueberry_ring' of https://github.com/MXCzkEVM/datadash…
reasje Aug 7, 2024
d67d463
refactor: Wallet provider
reasje Aug 7, 2024
d77a9f0
feat: Add sign personal message
reasje Aug 8, 2024
c41726d
Merge pull request #280 from MXCzkEVM/blueberry_ring
reasje Aug 8, 2024
ac0f580
fix: Navigation bug on pass code change
reasje Aug 15, 2024
565073a
fix: Text alignment
reasje Aug 15, 2024
7d1b7b8
translate: new
Aug 16, 2024
2979cd4
fix: Update version
reasje Aug 16, 2024
c7dad4a
fix: Support http for dapps
reasje Aug 16, 2024
85e4917
Merge branch 'pre_main_qa' of https://github.com/MXCzkEVM/datadash-wa…
reasje Aug 16, 2024
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
@@ -33,7 +33,7 @@ class BlueberryRingUseCase extends ReactiveUseCase {
late final ValueStream<BluetoothCharacteristic?> blueberryRingCharacteristic =
reactive(null);
late final ValueStream<BluetoothCharacteristic?>
blueberryRinCharacteristicNotifications = reactive(null);
blueberryRingNotificationsCharacteristic = reactive(null);

late final ValueStream<BluetoothAdapterState> bluetoothStatus =
reactive(BluetoothAdapterState.off);
@@ -142,6 +142,21 @@ class BlueberryRingUseCase extends ReactiveUseCase {
await getBlueberryRingCharacteristic();
}

final isBlueberryRingNotificationsCharacteristicAvailable =
blueberryRingNotificationsCharacteristic.hasValue;
collectLog(
'checkEstablishment:isBlueberryRingNotificationsCharacteristicAvailable $isBlueberryRingNotificationsCharacteristicAvailable');
if (!isBlueberryRingNotificationsCharacteristicAvailable) {
await getBlueberryRingNotificationsCharacteristic();
}

final isNotifying = blueberryRingNotificationsCharacteristic.value!.isNotifying;
collectLog(
'checkEstablishment:isBlueberryRingNotificationsCharacteristicNotifiying $isNotifying');
if (!isNotifying) {
blueberryRingNotificationsCharacteristic.value!.setNotifyValue(true);
}

return await func();
}

@@ -150,9 +165,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readLevel();
collectLog('readLevel:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readLevel:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readLevel(Uint8List.fromList(value!));
},
);
@@ -163,9 +179,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readVersion();
collectLog('readVersion:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readVersion:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readVersion(Uint8List.fromList(value!));
},
);
@@ -176,9 +193,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readTime();
collectLog('readTime:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readTime:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readTime(Uint8List.fromList(value!));
},
);
@@ -189,9 +207,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readSleep();
collectLog('readSleep:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readSleep:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readSleep(Uint8List.fromList(value!));
},
);
@@ -202,9 +221,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readBloodOxygens();
collectLog('readBloodOxygens:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readBloodOxygens:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readBloodOxygens(Uint8List.fromList(value!));
},
);
@@ -215,9 +235,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readSteps();
collectLog('readSteps:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readSteps:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readSteps(Uint8List.fromList(value!));
},
);
@@ -228,9 +249,10 @@ class BlueberryRingUseCase extends ReactiveUseCase {
() async {
final command = BlueberryCommands.readHeartRates();
collectLog('readHeartRate:command $command');
await blueberryRingCharacteristic.value?.write(command);
final value = blueberryRingCharacteristic.value?.lastValue;
blueberryRingCharacteristic.value?.write(command);
final value = await blueberryRingNotificationsCharacteristic.value?.lastValueStream.first;
collectLog('readHeartRate:value $value');
collectLog('readLevel:lastValue ${blueberryRingNotificationsCharacteristic.value!.lastValue}');
return BlueberryResolves.readHeartRates(Uint8List.fromList(value!));
},
);
@@ -244,22 +266,31 @@ class BlueberryRingUseCase extends ReactiveUseCase {
return resp;
}

Future<BluetoothCharacteristic>
getBlueberryRingCharacteristicNotifications() async {

Future<BluetoothCharacteristic> getBlueberryRingNotificationsCharacteristic() async {
final service = await getBlueberryRingBluetoothService();
final resp = await _getBlueberryRingCharacteristic(
service, bluetoothCharacteristicNotificationUUID);
update(blueberryRinCharacteristicNotifications, resp);
update(blueberryRingNotificationsCharacteristic, resp);
return resp;
}

Future<void> startBlueberryRingCharacteristicNotifications() async {
final characteristicNotifications =
await getBlueberryRingCharacteristicNotifications();
await characteristicNotifications.setNotifyValue(true);
characteristicNotifications.onValueReceived.listen((event) {});
final value = characteristicNotifications.read();
}
// Future<BluetoothCharacteristic>
// getBlueberryRingCharacteristicNotifications() async {
// final service = await getBlueberryRingBluetoothService();
// final resp = await _getBlueberryRingCharacteristic(
// service, bluetoothCharacteristicNotificationUUID);
// update(blueberryRinNotificationsCharacteristic, resp);
// return resp;
// }

// Future<void> startBlueberryRingCharacteristicNotifications() async {
// final characteristicNotifications =
// await getBlueberryRingCharacteristicNotifications();
// await characteristicNotifications.setNotifyValue(true);
// characteristicNotifications.lastValueStream.listen((event) {});
// final value = characteristicNotifications.read();
// }

Future<BluetoothService> _getBlueberryRingPrimaryService(
Guid serviceUUID,