From 91faed607ae92d7cd1a17db4ceb06ae71ff2f955 Mon Sep 17 00:00:00 2001 From: Maciej Korzeniewski Date: Wed, 21 Aug 2024 08:56:42 +0300 Subject: [PATCH 1/3] Add public access level for sleep-related fields --- .../sdk/api/model/sleep/PolarSleepData.swift | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift b/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift index 29f23101..47c4afbc 100644 --- a/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift +++ b/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift @@ -40,36 +40,36 @@ public class PolarSleepData { } public struct PolarSleepAnalysisResult { - let sleepStartTime: Date! - let sleepEndTime: Date! - let lastModified: Date! - let sleepGoalMinutes: UInt32! - let sleepWakePhases: [SleepWakePhase]! - let snoozeTime: [Date]? - let alarmTime: Date? - let sleepStartOffsetSeconds: Int32! - let sleepEndOffsetSeconds: Int32! - let userSleepRating: SleepRating? - let deviceId: String? - let batteryRanOut: Bool? - let sleepCycles: [SleepCycle]! - let sleepResultDate: Date? - let originalSleepRange: OriginalSleepRange? + public let sleepStartTime: Date! + public let sleepEndTime: Date! + public let lastModified: Date! + public let sleepGoalMinutes: UInt32! + public let sleepWakePhases: [SleepWakePhase]! + public let snoozeTime: [Date]? + public let alarmTime: Date? + public let sleepStartOffsetSeconds: Int32! + public let sleepEndOffsetSeconds: Int32! + public let userSleepRating: SleepRating? + public let deviceId: String? + public let batteryRanOut: Bool? + public let sleepCycles: [SleepCycle]! + public let sleepResultDate: Date? + public let originalSleepRange: OriginalSleepRange? } struct SleepWakePhase { - var secondsFromSleepStart: UInt32! - var state: SleepWakeState! + public var secondsFromSleepStart: UInt32! + public var state: SleepWakeState! } struct SleepCycle { - let secondsFromSleepStart: UInt32! - let sleepDepthStart: Float! + public let secondsFromSleepStart: UInt32! + public let sleepDepthStart: Float! } struct OriginalSleepRange { - let startTime: Date? - let endTime: Date? + public let startTime: Date? + public let endTime: Date? } From bc5a2fb63354919c91581081d7635e9fcf8cc361 Mon Sep 17 00:00:00 2001 From: Maciej Korzeniewski Date: Wed, 21 Aug 2024 09:04:47 +0300 Subject: [PATCH 2/3] Make SleepWakePhase, SleepCycle & OriginalSleepRange structs public --- .../PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift b/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift index 47c4afbc..5a3808a1 100644 --- a/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift +++ b/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift @@ -39,7 +39,7 @@ public class PolarSleepData { } } - public struct PolarSleepAnalysisResult { + public struct PolarSleepAnalysisResult { public let sleepStartTime: Date! public let sleepEndTime: Date! public let lastModified: Date! @@ -57,17 +57,17 @@ public class PolarSleepData { public let originalSleepRange: OriginalSleepRange? } - struct SleepWakePhase { + public struct SleepWakePhase { public var secondsFromSleepStart: UInt32! public var state: SleepWakeState! } - struct SleepCycle { + public struct SleepCycle { public let secondsFromSleepStart: UInt32! public let sleepDepthStart: Float! } - struct OriginalSleepRange { + public struct OriginalSleepRange { public let startTime: Date? public let endTime: Date? From ef9ab8a4d7dcd9ffb680f29a55a1cb9beea83e61 Mon Sep 17 00:00:00 2001 From: Maciej Korzeniewski Date: Wed, 21 Aug 2024 09:06:11 +0300 Subject: [PATCH 3/3] Make SleepWakeState & SleepRating enums public --- .../PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift b/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift index 5a3808a1..f35823cd 100644 --- a/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift +++ b/sources/iOS/ios-communications/Sources/PolarBleSdk/sdk/api/model/sleep/PolarSleepData.swift @@ -6,7 +6,7 @@ import Foundation public class PolarSleepData { - enum SleepWakeState: Int { + public enum SleepWakeState: Int { case UNKNOWN = 0 case WAKE = -2 case REM = -3 @@ -22,7 +22,7 @@ public class PolarSleepData { } } - enum SleepRating: Int { + public enum SleepRating: Int { case SLEPT_UNDEFINED = -1 case SLEPT_POORLY = 0 case SLEPT_SOMEWHAT_POORLY = 1