Skip to content

Commit

Permalink
Fix meal marker high bit parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ps2 committed Aug 21, 2016
1 parent 7a41c31 commit 0b58038
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct JournalEntryMealMarkerPumpEvent: TimestampedPumpEvent {
let useExchangesBit = ((availableData[8] as UInt8) >> 1) & 0b1
carbUnits = (useExchangesBit != 0) ? .Exchanges : .Grams

let carbHighBit = (availableData[8] as UInt8) & 0b1
let carbHighBit = (availableData[1] as UInt8) & 0b1
let carbLowBits = availableData[7] as UInt8

if carbUnits == .Exchanges {
Expand Down
2 changes: 1 addition & 1 deletion MinimedKitTests/HistoryPageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class HistoryPageTests: XCTestCase {
let mealMarker = events[75] as! JournalEntryMealMarkerPumpEvent

XCTAssertEqual(JournalEntryMealMarkerPumpEvent.CarbUnits.Grams, mealMarker.carbUnits)
XCTAssertEqual(268, mealMarker.carbohydrates)
XCTAssertEqual(12, mealMarker.carbohydrates)


XCTAssertEqual(NSDateComponents(gregorianYear: 2016, month: 7, day: 11, hour: 5, minute: 9, second: 29), mealMarker.timestamp)
Expand Down

0 comments on commit 0b58038

Please sign in to comment.