Skip to content
Open
Changes from all commits
Commits
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
12 changes: 11 additions & 1 deletion Loop/Managers/DeviceDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,17 @@ extension DeviceDataManager {
}

func updatePumpManagerBLEHeartbeatPreference() {
pumpManager?.setMustProvideBLEHeartbeat(pumpManagerMustProvideBLEHeartbeat)
guard pumpManagerMustProvideBLEHeartbeat else {
pumpManager?.setBLEHeartbeatRequest(nil)
return
}
// Tell the pump when the last CGM reading landed and how often readings are expected, so it can
// schedule its next heartbeat to arrive just after the next reading is due (the pump adds its own
// buffer for the remote CGM value to be fetched and stored).
let request = PumpHeartbeatRequest(
lastCGMReadingDate: glucoseStore.latestGlucose?.startDate,
expectedCGMReadingInterval: cgmManager?.expectedGlucoseSampleInterval ?? .minutes(5))
pumpManager?.setBLEHeartbeatRequest(request)
}
}

Expand Down