diff --git a/Crypto/Info.plist b/Crypto/Info.plist
index 60a3de6ca..18ddd1816 100644
--- a/Crypto/Info.plist
+++ b/Crypto/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
diff --git a/MinimedKit/Info.plist b/MinimedKit/Info.plist
index dc5b11a8c..bce3c53ce 100644
--- a/MinimedKit/Info.plist
+++ b/MinimedKit/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/MinimedKit/PumpEventType.swift b/MinimedKit/PumpEventType.swift
index 4543354b7..f28056e84 100644
--- a/MinimedKit/PumpEventType.swift
+++ b/MinimedKit/PumpEventType.swift
@@ -20,6 +20,7 @@ public enum PumpEventType: UInt8 {
case selectBasalProfile = 0x14
case tempBasalDuration = 0x16
case changeTime = 0x17
+ case newTime = 0x18
case journalEntryPumpLowBattery = 0x19
case battery = 0x1a
case setAutoOff = 0x1b
diff --git a/MinimedKitTests/Info.plist b/MinimedKitTests/Info.plist
index 65f6ba11e..8b49dd2e7 100644
--- a/MinimedKitTests/Info.plist
+++ b/MinimedKitTests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/MinimedKitTests/Messages/ReadTempBasalCarelinkMessageBodyTests.swift b/MinimedKitTests/Messages/ReadTempBasalCarelinkMessageBodyTests.swift
index 95b6350c3..a8492895b 100644
--- a/MinimedKitTests/Messages/ReadTempBasalCarelinkMessageBodyTests.swift
+++ b/MinimedKitTests/Messages/ReadTempBasalCarelinkMessageBodyTests.swift
@@ -33,4 +33,14 @@ class ReadTempBasalCarelinkMessageBodyTests: XCTestCase {
XCTAssertEqual(0, body.rate)
XCTAssertEqual(ReadTempBasalCarelinkMessageBody.RateType.absolute, body.rateType)
}
+
+ func testReadHighTempBasalRate() {
+ let message = PumpMessage(rxData: Data(hexadecimalString: "a7754838980600000550001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012")!)!
+
+ let body = message.messageBody as! ReadTempBasalCarelinkMessageBody
+
+ XCTAssertEqual(TimeInterval(30 * 60), body.timeRemaining)
+ XCTAssertEqual(34, body.rate)
+ XCTAssertEqual(ReadTempBasalCarelinkMessageBody.RateType.absolute, body.rateType)
+ }
}
diff --git a/NightscoutUploadKit/Info.plist b/NightscoutUploadKit/Info.plist
index dc5b11a8c..bce3c53ce 100644
--- a/NightscoutUploadKit/Info.plist
+++ b/NightscoutUploadKit/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/NightscoutUploadKitTests/Info.plist b/NightscoutUploadKitTests/Info.plist
index 2d2210c87..a35e864f0 100644
--- a/NightscoutUploadKitTests/Info.plist
+++ b/NightscoutUploadKitTests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/RileyLink.xcodeproj/project.pbxproj b/RileyLink.xcodeproj/project.pbxproj
index 5f21121da..165a60f62 100644
--- a/RileyLink.xcodeproj/project.pbxproj
+++ b/RileyLink.xcodeproj/project.pbxproj
@@ -2132,11 +2132,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2160,11 +2160,11 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2223,11 +2223,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2254,11 +2254,11 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2321,12 +2321,12 @@
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Crypto/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -2349,12 +2349,12 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Crypto/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -2375,11 +2375,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2405,11 +2405,11 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2484,7 +2484,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -2531,7 +2531,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -2635,11 +2635,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
@@ -2665,11 +2665,11 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 20;
+ DYLIB_CURRENT_VERSION = 21;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
diff --git a/RileyLink/RileyLink-Info.plist b/RileyLink/RileyLink-Info.plist
index 3bb36da07..7863d0c7a 100644
--- a/RileyLink/RileyLink-Info.plist
+++ b/RileyLink/RileyLink-Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/RileyLinkBLEKit/Info.plist b/RileyLinkBLEKit/Info.plist
index dc5b11a8c..bce3c53ce 100644
--- a/RileyLinkBLEKit/Info.plist
+++ b/RileyLinkBLEKit/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/RileyLinkBLEKitTests/Info.plist b/RileyLinkBLEKitTests/Info.plist
index 65f6ba11e..8b49dd2e7 100644
--- a/RileyLinkBLEKitTests/Info.plist
+++ b/RileyLinkBLEKitTests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/RileyLinkKit/Info.plist b/RileyLinkKit/Info.plist
index dc5b11a8c..bce3c53ce 100644
--- a/RileyLinkKit/Info.plist
+++ b/RileyLinkKit/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/RileyLinkKit/PumpState.swift b/RileyLinkKit/PumpState.swift
index 219e5b1bc..645540f46 100644
--- a/RileyLinkKit/PumpState.swift
+++ b/RileyLinkKit/PumpState.swift
@@ -83,6 +83,21 @@ public class PumpState {
}
+extension PumpState: CustomDebugStringConvertible {
+ public var debugDescription: String {
+ return [
+ "## PumpState",
+ "timeZone: \(timeZone)",
+ "pumpRegion: \(pumpRegion)",
+ "pumpModel: \(pumpModel?.rawValue ?? "")",
+ "lastHistoryDump: \(lastHistoryDump ?? .distantPast)",
+ "awakeUntil: \(awakeUntil ?? .distantPast)",
+ "lastWakeAttempt: \(lastWakeAttempt)",
+ ].joined(separator: "\n")
+ }
+}
+
+
extension Notification.Name {
/// Posted when values of the properties of the PumpState object have changed.
/// The `userInfo` dictionary contains the following keys: `PropertyKey` and `ValueChangeOldKey`
diff --git a/RileyLinkKit/RileyLinkDevice.swift b/RileyLinkKit/RileyLinkDevice.swift
index 8cd4d9656..97f3685c1 100644
--- a/RileyLinkKit/RileyLinkDevice.swift
+++ b/RileyLinkKit/RileyLinkDevice.swift
@@ -143,6 +143,22 @@ public class RileyLinkDevice {
}
+extension RileyLinkDevice: CustomDebugStringConvertible {
+ public var debugDescription: String {
+ return [
+ "## RileyLinkDevice",
+ "name: \(name ?? "")",
+ "RSSI: \(RSSI ?? 0)",
+ "lastIdle: \(lastIdle ?? .distantPast)",
+ "lastTuned: \(lastTuned ?? .distantPast)",
+ "radioFrequency: \(radioFrequency ?? 0)",
+ "firmwareVersion: \(firmwareVersion ?? "")",
+ "state: \(peripheral.state.description)"
+ ].joined(separator: "\n")
+ }
+}
+
+
extension Notification.Name {
public static let RileyLinkDeviceDidReceiveIdleMessage = NSNotification.Name(rawValue: "com.rileylink.RileyLinkKit.RileyLinkDeviceDidReceiveIdleMessageNotification")
diff --git a/RileyLinkKit/RileyLinkDeviceManager.swift b/RileyLinkKit/RileyLinkDeviceManager.swift
index 08cd46c27..43c6d76e6 100644
--- a/RileyLinkKit/RileyLinkDeviceManager.swift
+++ b/RileyLinkKit/RileyLinkDeviceManager.swift
@@ -144,6 +144,23 @@ public class RileyLinkDeviceManager {
}
+extension RileyLinkDeviceManager: CustomDebugStringConvertible {
+ public var debugDescription: String {
+ var report = [
+ "## RileyLinkDeviceManager",
+ "timerTickEnabled: \(timerTickEnabled)",
+ "idleListeningEnabled: \(idleListeningEnabled)"
+ ]
+
+ for device in devices {
+ report.append(device.debugDescription)
+ }
+
+ return report.joined(separator: "\n\n")
+ }
+}
+
+
extension Notification.Name {
public static let DeviceManagerDidDiscoverDevice = Notification.Name(rawValue: "com.rileylink.RileyLinkKit.DidDiscoverDeviceNotification")
diff --git a/RileyLinkKit/UI/CommandResponseViewController.swift b/RileyLinkKit/UI/CommandResponseViewController.swift
index 29bef04d1..2d740ea73 100644
--- a/RileyLinkKit/UI/CommandResponseViewController.swift
+++ b/RileyLinkKit/UI/CommandResponseViewController.swift
@@ -50,14 +50,14 @@ class CommandResponseViewController: UIViewController, UIActivityItemSource {
// MARK: - UIActivityItemSource
func activityViewControllerPlaceholderItem(_ activityViewController: UIActivityViewController) -> Any {
- return title ?? textView.text
+ return title ?? textView.text ?? ""
}
func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType) -> Any? {
- return textView.attributedText
+ return textView.attributedText ?? ""
}
func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivityType?) -> String {
- return title ?? textView.text
+ return title ?? textView.text ?? ""
}
}
diff --git a/RileyLinkKitTests/Info.plist b/RileyLinkKitTests/Info.plist
index 65f6ba11e..8b49dd2e7 100644
--- a/RileyLinkKitTests/Info.plist
+++ b/RileyLinkKitTests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion
diff --git a/RileyLinkTests/RileyLinkTests-Info.plist b/RileyLinkTests/RileyLinkTests-Info.plist
index c579e2118..c243dff0a 100644
--- a/RileyLinkTests/RileyLinkTests-Info.plist
+++ b/RileyLinkTests/RileyLinkTests-Info.plist
@@ -13,7 +13,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 0.12.3
+ 0.12.4
CFBundleSignature
????
CFBundleVersion