Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6424587
MinimedPumpManager changes for PumpManager protocol updates
ps2 Feb 1, 2019
564abbd
devicesSectionIndex is not changed after initialization
ps2 Feb 1, 2019
2dc8509
Bump LoopKit rev
ps2 Feb 1, 2019
b132c15
Fix handling settings completion
ps2 Feb 1, 2019
01159ac
Don't push root viewcontroller
ps2 Feb 1, 2019
e4f042b
Wrap unsuspend for bolus errors in SetBolusError.certain
ps2 Feb 2, 2019
25d41ae
Allow PumpState mock creation
ps2 Feb 2, 2019
221c371
Create suspend resume cell via cell reuse
ps2 Feb 3, 2019
5100e25
Remove unused argument
ps2 Feb 3, 2019
34f5fbb
Use higher res delivery for x23 pumps for roundToDeliveryIncrement
ps2 Feb 3, 2019
f0bf9b8
Guard access to MinimedPumpManagerState
ps2 Feb 4, 2019
06c0bf8
Merge branch 'pumpmanager-changes' of github.com:ps2/rileylink_ios in…
ps2 Feb 4, 2019
adc3c5d
Code organization
ps2 Feb 4, 2019
1f8cfb7
dequeue SuspendResumeTableViewCell
ps2 Feb 4, 2019
c7ff61a
Remove unneeded conditional let
ps2 Feb 4, 2019
1bb899f
Fix typo
ps2 Feb 4, 2019
ef2cc39
Make some properties immutable on MinimedPumpManagerState
ps2 Feb 5, 2019
cdbce96
Add notes about thread issues
ps2 Feb 5, 2019
fa73f29
Include dose in enactBolus completion
ps2 Feb 5, 2019
0ceb0a0
Dismiss settings controller on minimed pumpmanager delete
ps2 Feb 5, 2019
2f1454d
Bump LoopKit rev
ps2 Feb 5, 2019
cae8c40
Setup controller is presented modally
ps2 Feb 7, 2019
d7db293
Merge branch 'pumpmanager-changes' of github.com:ps2/rileylink_ios in…
ps2 Feb 7, 2019
f3dd601
x23 pumps speed up bolus delivery to fit in 5 minute window
ps2 Feb 11, 2019
419d705
present instead of show settings vc
ps2 Feb 11, 2019
a4e39c1
Remove zero bolus error; use assertionFailure instead
ps2 Feb 11, 2019
a597a86
Fix vc present() call
ps2 Feb 11, 2019
3cf7bae
ReservoirVolumeHUDView interface changed
ps2 Feb 14, 2019
d49332c
Merge branch 'pumpmanager-changes' of github.com:ps2/rileylink_ios in…
ps2 Feb 14, 2019
f6df287
Use active flag instead of appear/disapper methods
ps2 Feb 15, 2019
546c989
Bump loopkit rev
ps2 Feb 15, 2019
fe2e7a2
HUDProvider active -> visible
ps2 Feb 16, 2019
abf7c9c
Add Comparable.clamped(to:) method
ps2 Feb 17, 2019
1e1228b
Updates from @mpangburn's review
ps2 Feb 18, 2019
ca28260
Remove another unnecessary optional let
ps2 Feb 18, 2019
2032cc6
Bump LoopKit rev
ps2 Feb 18, 2019
69491b0
use dev LoopKit
ps2 Feb 18, 2019
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
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "LoopKit/LoopKit" ~> 2.0
github "LoopKit/LoopKit" "dev"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "LoopKit/LoopKit" "v2.2.1"
github "LoopKit/LoopKit" "bf4166bc77f89e22971f2030ad006967881ff082"
21 changes: 21 additions & 0 deletions Common/Comparable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Comparable.swift
// RileyLink
//
// Created by Pete Schwamb on 2/17/19.
// Copyright © 2019 Pete Schwamb. All rights reserved.
//

import Foundation

extension Comparable {
func clamped(to range: ClosedRange<Self>) -> Self {
if self < range.lowerBound {
return range.lowerBound
} else if self > range.upperBound {
return range.upperBound
} else {
return self
}
}
}
27 changes: 27 additions & 0 deletions MinimedKit/Messages/GetPumpFirmwareVersionMessageBody.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// GetPumpFirmwareVersionMessageBody.swift
// MinimedKit
//
// Created by Pete Schwamb on 10/10/18.
// Copyright © 2018 Pete Schwamb. All rights reserved.
//

import Foundation

public class GetPumpFirmwareVersionMessageBody: CarelinkLongMessageBody {
public let version: String

public required init?(rxData: Data) {
let stringEnd = rxData.firstIndex(of: 0) ?? rxData.count
guard rxData.count == type(of: self).length,
let vsn = String(data: rxData.subdata(in: 1..<stringEnd), encoding: String.Encoding.ascii) else {
return nil
}
version = vsn
super.init(rxData: rxData)
}

public required init?(rxData: NSData) {
fatalError("init(rxData:) has not been implemented")
}
}
5 changes: 5 additions & 0 deletions MinimedKit/Messages/MessageType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public enum MessageType: UInt8 {
case selectBasalProfile = 0x4a

case changeTempBasal = 0x4c
case suspendResume = 0x4d

case PumpExperiment_OP80 = 0x50
case setRemoteControlID = 0x51 // CMD_SET_RF_REMOTE_ID
Expand Down Expand Up @@ -141,6 +142,10 @@ public enum MessageType: UInt8 {
return ReadOtherDevicesStatusMessageBody.self
case .readRemoteControlIDs:
return ReadRemoteControlIDsMessageBody.self
case .suspendResume:
return SuspendResumeMessageBody.self
case .readFirmwareVersion:
return GetPumpFirmwareVersionMessageBody.self
default:
return UnknownMessageBody.self
}
Expand Down
1 change: 0 additions & 1 deletion MinimedKit/Messages/Models/BasalSchedule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public struct BasalSchedule {
}
}


extension BasalSchedule {
static let rawValueLength = 192
public typealias RawValue = Data
Expand Down
25 changes: 25 additions & 0 deletions MinimedKit/Messages/SuspendResumeMessageBody.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// SuspendResumeMessageBody.swift
// MinimedKit
//
// Created by Pete Schwamb on 10/1/18.
// Copyright © 2018 Pete Schwamb. All rights reserved.
//

import Foundation

public class SuspendResumeMessageBody: CarelinkLongMessageBody {

public enum SuspendResumeState: UInt8 {
case suspend = 0x01
case resume = 0x00
}

public convenience init(state: SuspendResumeState) {
let numArgs = 1
let data = Data(hexadecimalString: String(format: "%02x%02x", numArgs, state.rawValue))!

self.init(rxData: data)!
}

}
12 changes: 12 additions & 0 deletions MinimedKit/Models/PumpModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ public enum PumpModel: String {
}
}

public var constrainsBolusDeliveryTimeTo5Minutes: Bool {
return generation >= 23
}

public var pulsesPerUnit: Int {
if generation >= 23 {
return 40
} else {
return 20
}
}

/// Even though this is capped by the system at 250 / 10 U, the message takes a UInt16.
var usesTwoBytesForMaxBolus: Bool {
return generation >= 23
Expand Down
Loading