-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from ps2/dev
v0.12.3
- Loading branch information
Showing
25 changed files
with
216 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// Mystery69PumpEvent.swift | ||
// RileyLink | ||
// | ||
// Created by Pete Schwamb on 9/23/16. | ||
// Copyright © 2016 Pete Schwamb. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct BolusReminderPumpEvent: TimestampedPumpEvent { | ||
public let length: Int | ||
public let rawData: Data | ||
public let timestamp: DateComponents | ||
|
||
public init?(availableData: Data, pumpModel: PumpModel) { | ||
if pumpModel.larger { | ||
length = 9 | ||
} else { | ||
length = 7 // This may not actually occur, as I don't think x22 and earlier pumps have missed bolus reminders. | ||
} | ||
|
||
guard length <= availableData.count else { | ||
return nil | ||
} | ||
|
||
rawData = availableData.subdata(in: 0..<length) | ||
|
||
timestamp = DateComponents(pumpEventData: availableData, offset: 2) | ||
} | ||
|
||
public var dictionaryRepresentation: [String: Any] { | ||
return [ | ||
"_type": "BolusReminder", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.