Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nriedman committed May 20, 2024
1 parent edefb8d commit 4018af0
Show file tree
Hide file tree
Showing 14 changed files with 312 additions and 254 deletions.
34 changes: 17 additions & 17 deletions ENGAGEHF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
4DBDD3442BBFAD64001FB0CA /* InvitationCodeError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DBDD3432BBFAD64001FB0CA /* InvitationCodeError.swift */; };
4DBDD3462BBFAE2D001FB0CA /* InvitationCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DBDD3452BBFAE2D001FB0CA /* InvitationCodeView.swift */; };
4DBDD3482BC073EF001FB0CA /* FirebaseFunctions in Frameworks */ = {isa = PBXBuildFile; productRef = 4DBDD3472BC073EF001FB0CA /* FirebaseFunctions */; };
4DDFC76E2BFAA4AE002B07A1 /* WeightScaleService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DDFC76D2BFAA4AE002B07A1 /* WeightScaleService.swift */; };
4DDFC7702BFAEAD7002B07A1 /* ConfirmMeasurementButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DDFC76F2BFAEAD7002B07A1 /* ConfirmMeasurementButton.swift */; };
4DDFC7762BFB46FF002B07A1 /* MeasurementLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DDFC7752BFB46FF002B07A1 /* MeasurementLayer.swift */; };
4DDFC7792BFB4E7D002B07A1 /* ViewElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DDFC7782BFB4E7D002B07A1 /* ViewElements.swift */; };
56E708352BB06B7100B08F0A /* SpeziLicense in Frameworks */ = {isa = PBXBuildFile; productRef = 56E708342BB06B7100B08F0A /* SpeziLicense */; };
56E7083B2BB06F6F00B08F0A /* SwiftPackageList in Frameworks */ = {isa = PBXBuildFile; productRef = 56E7083A2BB06F6F00B08F0A /* SwiftPackageList */; };
653A2551283387FE005D4D48 /* ENGAGEHF.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A2550283387FE005D4D48 /* ENGAGEHF.swift */; };
Expand Down Expand Up @@ -134,6 +138,10 @@
4DB025D72BBF2EEC002D2545 /* Greeting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Greeting.swift; sourceTree = "<group>"; };
4DBDD3432BBFAD64001FB0CA /* InvitationCodeError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeError.swift; sourceTree = "<group>"; };
4DBDD3452BBFAE2D001FB0CA /* InvitationCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitationCodeView.swift; sourceTree = "<group>"; };
4DDFC76D2BFAA4AE002B07A1 /* WeightScaleService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeightScaleService.swift; sourceTree = "<group>"; };
4DDFC76F2BFAEAD7002B07A1 /* ConfirmMeasurementButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmMeasurementButton.swift; sourceTree = "<group>"; };
4DDFC7752BFB46FF002B07A1 /* MeasurementLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeasurementLayer.swift; sourceTree = "<group>"; };
4DDFC7782BFB4E7D002B07A1 /* ViewElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewElements.swift; sourceTree = "<group>"; };
653A254D283387FE005D4D48 /* ENGAGEHF.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ENGAGEHF.app; sourceTree = BUILT_PRODUCTS_DIR; };
653A2550283387FE005D4D48 /* ENGAGEHF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ENGAGEHF.swift; sourceTree = "<group>"; };
653A255428338800005D4D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -271,6 +279,9 @@
isa = PBXGroup;
children = (
4D19ED002BE5CAFC00CDBAA8 /* MeasurementRecordedView.swift */,
4DDFC76F2BFAEAD7002B07A1 /* ConfirmMeasurementButton.swift */,
4DDFC7752BFB46FF002B07A1 /* MeasurementLayer.swift */,
4DDFC7782BFB4E7D002B07A1 /* ViewElements.swift */,
);
path = Views;
sourceTree = "<group>";
Expand All @@ -285,19 +296,12 @@
path = Bluetooth;
sourceTree = "<group>";
};
4D49AB082BC9DA7D00C77310 /* BloodPressureCuff */ = {
isa = PBXGroup;
children = (
4D49AB0B2BC9DAA100C77310 /* Characteristics */,
);
path = BloodPressureCuff;
sourceTree = "<group>";
};
4D49AB092BC9DA8B00C77310 /* WeightScale */ = {
isa = PBXGroup;
children = (
4D49AB0A2BC9DA9300C77310 /* Characteristics */,
4D49AB052BC9D56900C77310 /* WeightScaleDevice.swift */,
4DDFC76D2BFAA4AE002B07A1 /* WeightScaleService.swift */,
);
path = WeightScale;
sourceTree = "<group>";
Expand All @@ -311,18 +315,10 @@
path = Characteristics;
sourceTree = "<group>";
};
4D49AB0B2BC9DAA100C77310 /* Characteristics */ = {
isa = PBXGroup;
children = (
);
path = Characteristics;
sourceTree = "<group>";
};
4D49AB142BCF6FC400C77310 /* Devices */ = {
isa = PBXGroup;
children = (
4D49AB092BC9DA8B00C77310 /* WeightScale */,
4D49AB082BC9DA7D00C77310 /* BloodPressureCuff */,
);
path = Devices;
sourceTree = "<group>";
Expand Down Expand Up @@ -610,11 +606,14 @@
4D19ED012BE5CAFC00CDBAA8 /* MeasurementRecordedView.swift in Sources */,
2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */,
2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */,
4DDFC76E2BFAA4AE002B07A1 /* WeightScaleService.swift in Sources */,
2FE5DC3829EDD7CA004B9AB4 /* InterestingModules.swift in Sources */,
2FE5DC3529EDD7CA004B9AB4 /* Consent.swift in Sources */,
2FE5DC4529EDD7F2004B9AB4 /* Binding+Negate.swift in Sources */,
4DBDD3442BBFAD64001FB0CA /* InvitationCodeError.swift in Sources */,
2FC975A82978F11A00BA99FE /* Home.swift in Sources */,
4DDFC7792BFB4E7D002B07A1 /* ViewElements.swift in Sources */,
4DDFC7762BFB46FF002B07A1 /* MeasurementLayer.swift in Sources */,
4DB025D52BBF2E08002D2545 /* Dashboard.swift in Sources */,
A9DFE8A92ABE551400428242 /* AccountButton.swift in Sources */,
2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */,
Expand All @@ -629,6 +628,7 @@
2FE5DC4629EDD7F2004B9AB4 /* Bundle+Image.swift in Sources */,
2F4E23832989D51F0013F3D9 /* ENGAGEHFTestingSetup.swift in Sources */,
2F5E32BD297E05EA003432F8 /* ENGAGEHFDelegate.swift in Sources */,
4DDFC7702BFAEAD7002B07A1 /* ConfirmMeasurementButton.swift in Sources */,
A9FE7AD02AA39BAB0077B045 /* AccountSheet.swift in Sources */,
653A2551283387FE005D4D48 /* ENGAGEHF.swift in Sources */,
2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */,
Expand Down Expand Up @@ -957,7 +957,7 @@
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "ENGAGEHF/Supporting Files/Info.plist";
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Application must access bluetooth to connect to data collecting devices.";
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Application must access bluetooth to connect to data collecting devices and retrieve data from weight scales and blood pressure cuffs.";
INFOPLIST_KEY_NSCameraUsageDescription = "This message should never appear. Please adjust this when you start using camera information. We have to put this in here as ResearchKit has the possibility to use it and not putting it here returns an error on AppStore Connect.";
INFOPLIST_KEY_NSHealthShareUsageDescription = "The ENGAGE-HF app uses the step count to demonstrate Spezi's integration with HealthKit.";
INFOPLIST_KEY_NSHealthUpdateUsageDescription = "The ENGAGE-HF app uses the step count to demonstrate Spezi's integration with HealthKit.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "7d2688de038d5484866d835acb47b379722d610e",
"version" : "10.19.0"
"revision" : "076b241a625e25eac22f8849be256dfb960fcdfe",
"version" : "10.19.1"
}
},
{
Expand Down Expand Up @@ -60,8 +60,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "97940381e57703c07f31a8058d8f39ec53b7c272",
"version" : "10.25.0"
"revision" : "9d17b500cd98d9a7009751ad62f802e152e97021",
"version" : "10.26.0"
}
},
{
Expand All @@ -87,8 +87,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "8e5d57ed87057cd7b0e4e8f474d9e78f73eb85f7",
"version" : "7.13.2"
"revision" : "57a1d307f42df690fdef2637f3e5b776da02aad6",
"version" : "7.13.3"
}
},
{
Expand Down Expand Up @@ -141,8 +141,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/llama.cpp",
"state" : {
"revision" : "7bfd6d4b5bbc9fd47bd023bdbb35f96c827977f3",
"version" : "0.2.1"
"revision" : "6839853a321778906e210a33ee2c6aec52f34c97",
"version" : "0.3.3"
}
},
{
Expand All @@ -159,8 +159,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordBDHG/OpenAI",
"state" : {
"revision" : "29316babb446c34bb07bf528d96de7eb41e7b03c",
"version" : "0.2.8"
"revision" : "1ad95dd531d7c854a3f98f588b0eb68fa83e8a8c",
"version" : "0.2.9"
}
},
{
Expand Down Expand Up @@ -195,8 +195,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/SourceKitten.git",
"state" : {
"revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56",
"version" : "0.34.1"
"revision" : "fd4df99170f5e9d7cf9aa8312aa8506e0e7a44e7",
"version" : "0.35.0"
}
},
{
Expand All @@ -213,17 +213,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziAccount.git",
"state" : {
"revision" : "83f505c69865d5aaacf71fd5ae8d2ffb8c3187d8",
"version" : "1.2.3"
"revision" : "2de07209430fe7b13c44790eab948b30482fcb9d",
"version" : "1.2.4"
}
},
{
"identity" : "spezibluetooth",
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziBluetooth.git",
"state" : {
"revision" : "3178bc1184dc6636e8112694e09fdfca7cbcf7d7",
"version" : "1.0.2"
"revision" : "8e94fc71720ef3fcf7f5d9dba9eef603c5151d7a",
"version" : "1.3.0"
}
},
{
Expand Down Expand Up @@ -303,8 +303,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/StanfordSpezi/SpeziLLM.git",
"state" : {
"revision" : "cbaf20496e600c985dea2358f35a497fe4964116",
"version" : "0.8.1"
"revision" : "3663884f23e55c67c875a97c5da08ed172ea02ac",
"version" : "0.8.3"
}
},
{
Expand Down Expand Up @@ -355,10 +355,10 @@
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
"revision" : "46989693916f56d1186bd59ac15124caef896560",
"version" : "1.3.1"
}
},
{
Expand Down Expand Up @@ -411,26 +411,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
"revision" : "303e5c5c36d6a558407d364878df131c3546fad8",
"version" : "510.0.2"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
"version" : "1.2.1"
"revision" : "f9266c85189c2751589a50ea5aec72799797e471",
"version" : "1.3.0"
}
},
{
"identity" : "swiftlint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/SwiftLint.git",
"state" : {
"revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee",
"version" : "0.54.0"
"revision" : "b515723b16eba33f15c4677ee65f3fef2ce8c255",
"version" : "0.55.1"
}
},
{
Expand Down
26 changes: 6 additions & 20 deletions ENGAGEHF/Bluetooth/Devices/WeightScale/WeightScaleDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,16 @@
//

import BluetoothServices
import class CoreBluetooth.CBUUID
import FirebaseCore
import FirebaseFirestore
import Foundation
import SpeziBluetooth


// The primary Weight Scale Service
// Note: Access properties: R: read, W: write, N: notify
class WeightScaleService: BluetoothService {
static var id = CBUUID(string: "181D")

// 2 characteristics as defined in the manual:

// Characteristic 1: Weight Scale Feature, R
@Characteristic(id: "2A9E") var weightScaleFeature: WeightScaleFeature?

// Characteristic 2: Weight Measurement, N
@Characteristic(id: "2A9D", notify: true) var weightMeasurement: WeightMeasurement?

init() {}
}


//
// A bluetooth peripheral representing a Weight Scale
//
// On new measurement, loads the measurement into the MeasurementManager
// as a HealthKit HKQuantitySample
//
class WeightScaleDevice: BluetoothDevice, Identifiable {
@DeviceState(\.id) var id: UUID
@DeviceState(\.name)var name: String?
Expand Down
28 changes: 28 additions & 0 deletions ENGAGEHF/Bluetooth/Devices/WeightScale/WeightScaleService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// This source file is part of the ENGAGE-HF project based on the Stanford Spezi Template Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// SPDX-License-Identifier: MIT
//

import BluetoothServices
import class CoreBluetooth.CBUUID
import SpeziBluetooth


// The primary Weight Scale Service
// Note: Access properties: R: read, W: write, N: notify
class WeightScaleService: BluetoothService {
static var id = CBUUID(string: "181D")

// 2 characteristics as defined in the manual:

// Characteristic 1: Weight Scale Feature, R
@Characteristic(id: "2A9E") var weightScaleFeature: WeightScaleFeature?

// Characteristic 2: Weight Measurement, N
@Characteristic(id: "2A9D", notify: true) var weightMeasurement: WeightMeasurement?

init() {}
}
Loading

0 comments on commit 4018af0

Please sign in to comment.