From e74e886d2a0d47cd5ffecd77fe2f4cd669c3b1ac Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 25 Sep 2016 00:07:13 -0500 Subject: [PATCH 1/2] Use high bits of temp basal to correctly decode temp basal rates up to 34U/hr --- .../PumpEvents/TempBasalPumpEvent.swift | 2 +- MinimedKitTests/HistoryPageTests.swift | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/MinimedKit/PumpEvents/TempBasalPumpEvent.swift b/MinimedKit/PumpEvents/TempBasalPumpEvent.swift index afcaa5231..3dd0e7be1 100644 --- a/MinimedKit/PumpEvents/TempBasalPumpEvent.swift +++ b/MinimedKit/PumpEvents/TempBasalPumpEvent.swift @@ -37,7 +37,7 @@ public struct TempBasalPumpEvent: TimestampedPumpEvent { rateType = (d(7) >> 3) == 0 ? .Absolute : .Percent if rateType == .Absolute { - rate = Double(d(1)) / 40.0 + rate = Double(((d(7) & 0b111) << 8) + d(1)) / 40.0 } else { rate = Double(d(1)) } diff --git a/MinimedKitTests/HistoryPageTests.swift b/MinimedKitTests/HistoryPageTests.swift index 9001a04c4..16b192478 100644 --- a/MinimedKitTests/HistoryPageTests.swift +++ b/MinimedKitTests/HistoryPageTests.swift @@ -348,4 +348,25 @@ class HistoryPageTests: XCTestCase { let displayedType = json["_type"] as! String XCTAssertEqual("saveSettings", displayedType) } + + func testHighBitsOfTempBasalRate() throws { + let pumpModel = PumpModel.Model522 + + let page = try HistoryPage(pageData: Data(hexadecimalString: "0615050d0040600105062f1873004020c105062f0c5b004020c105062f0c6c004020c105062f0c7d004020c105062f0c8e004020c105062f0c9f004020c105062f0cc3004020c105062f0cd4004020c10506110ce3004020c105061504e9004040a1050c1516400001056400194300010517001d430001051800004300010521000343000105030000001208432001052c501852a0010524e530530001051a000d570201050603050d0d576201050c030c4000010564000d40000105170022400001051800804a021710070000003601856d0185050c00e8000000000036003664000000000000000000000000000000000000000000000c00e8000000070000025097906d9790050c00e8000000000250025064000000000000000000000000000000000000000000000c00e800000060019d600018106001a0600018106001a2610018103102b6570118105b00b6570118100150082178000100000000017801010100b657211810010a0a00ba5c2118105e01ab5d0118103102865e01181035008040021810010a0a0f865e6118103375a5650c1810081601a5650c18103300b4650c1810081600b4650c18106200b8650c1810333485660c181000160185660c18105b00b36e0e1810025008217800020000000002785c1402671402851402991402ad1402c11402df143200907a0e18106101907a0e18106a00b07a0e18106100b07a0e1810324f8c400f181061018c400f1810350080422f18101e00af450f181001030104b36e6e18101f00ba450f18103102936d1418105b00936d141810065008217800070000000007785c0502661401070700936d541810010d0d008d495518103500804f151810011b1b0098435618103300827b165810001601827b1658106a4fb8611718106100b861171810334a856317181005160185631718103300b36a171810001600b36a1718103390986b171810011601986b1718103300a66d171810001600a66d17181033c8b76d171810001601b76d1718103300b173171810001600b17317181033908174171810011601817417181033008974171810001600897417181033209a741718100316019a741718103300a674171810001600a6741718103350ae74171810051601ae74171810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e1f7")!, pumpModel: pumpModel) + let events = page.events + + XCTAssertEqual(84, events.count) + + let event1 = events[82] as! TempBasalPumpEvent + XCTAssertEqual(34.0, event1.rate) + + let event2 = events[78] as! TempBasalPumpEvent + XCTAssertEqual(20.0, event2.rate) + + let event3 = events[74] as! TempBasalPumpEvent + XCTAssertEqual(10.0, event3.rate) + + let event4 = events[70] as! TempBasalPumpEvent + XCTAssertEqual(5, event4.rate) + } } From c77fdd35d9af4822414f966bf40bfd8e3b264802 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 25 Sep 2016 01:45:47 -0500 Subject: [PATCH 2/2] agvtool new-marketing-version 0.12.2 && agvtool bump --- Crypto/Info.plist | 2 +- MinimedKit/Info.plist | 2 +- MinimedKitTests/Info.plist | 2 +- NightscoutUploadKit/Info.plist | 2 +- NightscoutUploadKitTests/Info.plist | 2 +- RileyLink.xcodeproj/project.pbxproj | 44 ++++++++++++------------ RileyLink/RileyLink-Info.plist | 2 +- RileyLinkBLEKit/Info.plist | 2 +- RileyLinkBLEKitTests/Info.plist | 2 +- RileyLinkKit/Info.plist | 2 +- RileyLinkKitTests/Info.plist | 2 +- RileyLinkTests/RileyLinkTests-Info.plist | 2 +- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Crypto/Info.plist b/Crypto/Info.plist index 62e6a2b1d..48b6ff10e 100644 --- a/Crypto/Info.plist +++ b/Crypto/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/MinimedKit/Info.plist b/MinimedKit/Info.plist index f7f7ce7fd..2d956da28 100644 --- a/MinimedKit/Info.plist +++ b/MinimedKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/MinimedKitTests/Info.plist b/MinimedKitTests/Info.plist index 2aeac0f3d..8adba24f6 100644 --- a/MinimedKitTests/Info.plist +++ b/MinimedKitTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/NightscoutUploadKit/Info.plist b/NightscoutUploadKit/Info.plist index f7f7ce7fd..2d956da28 100644 --- a/NightscoutUploadKit/Info.plist +++ b/NightscoutUploadKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/NightscoutUploadKitTests/Info.plist b/NightscoutUploadKitTests/Info.plist index 6330adafb..3e648c5d9 100644 --- a/NightscoutUploadKitTests/Info.plist +++ b/NightscoutUploadKitTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/RileyLink.xcodeproj/project.pbxproj b/RileyLink.xcodeproj/project.pbxproj index 715714e3e..2c1e8ddd2 100644 --- a/RileyLink.xcodeproj/project.pbxproj +++ b/RileyLink.xcodeproj/project.pbxproj @@ -2128,11 +2128,11 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2156,11 +2156,11 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2219,11 +2219,11 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2250,11 +2250,11 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2317,12 +2317,12 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Crypto/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -2345,12 +2345,12 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Crypto/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -2371,11 +2371,11 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2401,11 +2401,11 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2480,7 +2480,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -2527,7 +2527,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -2631,11 +2631,11 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -2661,11 +2661,11 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 18; + CURRENT_PROJECT_VERSION = 19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 18; + DYLIB_CURRENT_VERSION = 19; 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 f405a779d..a400d83f6 100644 --- a/RileyLink/RileyLink-Info.plist +++ b/RileyLink/RileyLink-Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/RileyLinkBLEKit/Info.plist b/RileyLinkBLEKit/Info.plist index f7f7ce7fd..2d956da28 100644 --- a/RileyLinkBLEKit/Info.plist +++ b/RileyLinkBLEKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/RileyLinkBLEKitTests/Info.plist b/RileyLinkBLEKitTests/Info.plist index 2aeac0f3d..8adba24f6 100644 --- a/RileyLinkBLEKitTests/Info.plist +++ b/RileyLinkBLEKitTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/RileyLinkKit/Info.plist b/RileyLinkKit/Info.plist index f7f7ce7fd..2d956da28 100644 --- a/RileyLinkKit/Info.plist +++ b/RileyLinkKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/RileyLinkKitTests/Info.plist b/RileyLinkKitTests/Info.plist index 2aeac0f3d..8adba24f6 100644 --- a/RileyLinkKitTests/Info.plist +++ b/RileyLinkKitTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion diff --git a/RileyLinkTests/RileyLinkTests-Info.plist b/RileyLinkTests/RileyLinkTests-Info.plist index d214d2802..2948317fd 100644 --- a/RileyLinkTests/RileyLinkTests-Info.plist +++ b/RileyLinkTests/RileyLinkTests-Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.12.1 + 0.12.2 CFBundleSignature ???? CFBundleVersion