diff --git a/Cartfile b/Cartfile index 1e815ab94e..4f8e32a7af 100644 --- a/Cartfile +++ b/Cartfile @@ -1,5 +1,5 @@ github "LoopKit/LoopKit" == 1.5.6 -github "LoopKit/CGMBLEKit" ~> 2.0 +github "LoopKit/CGMBLEKit" == 2.1 github "i-schuetz/SwiftCharts" == 0.6.1 github "mddub/dexcom-share-client-swift" == 0.4.1 github "mddub/G4ShareSpy" == 0.3.3 diff --git a/Cartfile.resolved b/Cartfile.resolved index 1265693657..5b46c41bb2 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,5 +1,5 @@ github "LoopKit/Amplitude-iOS" "2137d5fd44bf630ed33e1e72d7af6d8f8612f270" -github "LoopKit/CGMBLEKit" "v2.0" +github "LoopKit/CGMBLEKit" "v2.1.0" github "LoopKit/LoopKit" "v1.5.6" github "i-schuetz/SwiftCharts" "6b55a26a7b0b95e49202ddc1db5404702fce114f" github "mddub/G4ShareSpy" "v0.3.3" diff --git a/Carthage/Build/.CGMBLEKit.version b/Carthage/Build/.CGMBLEKit.version index 1e31df3f4e..0e5d1875f6 100644 --- a/Carthage/Build/.CGMBLEKit.version +++ b/Carthage/Build/.CGMBLEKit.version @@ -5,17 +5,17 @@ "watchOS" : [ { "name" : "CGMBLEKit", - "hash" : "575d04bdf7c1104cf77670c7a4298307717595e99a187c613f6059a285e1b994" + "hash" : "ade5de40f0722c07387d73c66678eefb12db2e028e0eb3ced4810ab415469e16" } ], "tvOS" : [ ], - "commitish" : "v2.0", + "commitish" : "v2.1.0", "iOS" : [ { "name" : "CGMBLEKit", - "hash" : "406ed00637ad11854d93d89f6ad171b00e7a48a652475e3fa9bdcb4bc2f1698d" + "hash" : "48dd66b1f45d9e92de8553d4e9f24cb9fb1ff2b1fdf7be0d2b8fda10d1ec8ea7" } ] } \ No newline at end of file diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit b/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit index 9519695f4e..a158773f4f 100755 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit and b/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h b/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h index 1d603aadfd..7c90b3f2f3 100644 --- a/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h +++ b/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h @@ -1,4 +1,4 @@ -// Generated by Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1) +// Generated by Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" @@ -163,6 +163,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if __has_feature(modules) +@import ObjectiveC; @import CoreBluetooth; @import HealthKit; #endif @@ -183,6 +184,63 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif +SWIFT_CLASS("_TtC9CGMBLEKit16BluetoothManager") +@interface BluetoothManager : NSObject +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + + +@class CBCentralManager; +@class CBPeripheral; +@class NSNumber; + +@interface BluetoothManager (SWIFT_EXTENSION(CGMBLEKit)) +- (void)centralManagerDidUpdateState:(CBCentralManager * _Nonnull)central; +- (void)centralManager:(CBCentralManager * _Nonnull)central willRestoreState:(NSDictionary * _Nonnull)dict; +- (void)centralManager:(CBCentralManager * _Nonnull)central didDiscoverPeripheral:(CBPeripheral * _Nonnull)peripheral advertisementData:(NSDictionary * _Nonnull)advertisementData RSSI:(NSNumber * _Nonnull)RSSI; +- (void)centralManager:(CBCentralManager * _Nonnull)central didConnectPeripheral:(CBPeripheral * _Nonnull)peripheral; +- (void)centralManager:(CBCentralManager * _Nonnull)central didDisconnectPeripheral:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error; +- (void)centralManager:(CBCentralManager * _Nonnull)central didFailToConnectPeripheral:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error; +@end + + + + + + + + +SWIFT_CLASS("_TtC9CGMBLEKit17PeripheralManager") +@interface PeripheralManager : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable"); +@end + + + + +@interface PeripheralManager (SWIFT_EXTENSION(CGMBLEKit)) +- (void)centralManagerDidUpdateState:(CBCentralManager * _Nonnull)central; +- (void)centralManager:(CBCentralManager * _Nonnull)central didConnectPeripheral:(CBPeripheral * _Nonnull)peripheral; +@end + + + + + +@class CBService; +@class CBCharacteristic; + +@interface PeripheralManager (SWIFT_EXTENSION(CGMBLEKit)) +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverServices:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverCharacteristicsForService:(CBService * _Nonnull)service error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didWriteValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didReadRSSI:(NSNumber * _Nonnull)RSSI error:(NSError * _Nullable)error; +- (void)peripheralDidUpdateName:(CBPeripheral * _Nonnull)peripheral; +@end diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist b/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist index 3dba5d77bb..4b5b588798 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist and b/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc index 79d030817a..fc491aea5b 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule index 6428b30f47..d3a314d97a 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc index 3da9a2567d..51a1f8d3cc 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule index 9708db49d7..458a8c6327 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc index b33ef2b6a7..4c5006c673 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule index 80d2e01314..f77faf3bac 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc index 2e9075905d..06262088bb 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule index 9e5bf26a39..8da9a201f2 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule differ diff --git a/Loop/Info.plist b/Loop/Info.plist index 86dbc87c54..53e68db275 100644 --- a/Loop/Info.plist +++ b/Loop/Info.plist @@ -37,6 +37,7 @@ LSApplicationQueriesSchemes + dexcomg6 dexcomcgm dexcomshare diff --git a/Loop/Managers/CGM/DexCGMManager.swift b/Loop/Managers/CGM/DexCGMManager.swift index e7b5efc2ba..30fd0fbaa3 100644 --- a/Loop/Managers/CGM/DexCGMManager.swift +++ b/Loop/Managers/CGM/DexCGMManager.swift @@ -183,7 +183,7 @@ final class G5CGMManager: DexCGMManager, TransmitterDelegate { return HKDevice( name: "CGMBLEKit", manufacturer: "Dexcom", - model: "G5 Mobile", + model: "G5/G6 Mobile", hardwareVersion: nil, firmwareVersion: nil, softwareVersion: String(CGMBLEKitVersionNumber), diff --git a/Loop/Managers/DeviceDataManager.swift b/Loop/Managers/DeviceDataManager.swift index e9ee6cae47..eaa78103e2 100644 --- a/Loop/Managers/DeviceDataManager.swift +++ b/Loop/Managers/DeviceDataManager.swift @@ -192,7 +192,7 @@ final class DeviceDataManager { func updateTimerTickPreference() { queue.async { /// Controls the management of the RileyLink timer tick, which is a reliably-changing BLE - /// characteristic which can cause the app to wake. For most users, the G5 Transmitter and + /// characteristic which can cause the app to wake. For most users, the G5/G6 Transmitter and /// G4 Receiver are reliable as hearbeats, but users who find their resources extremely constrained /// due to greedy apps or older devices may choose to always enable the timer by always setting `true` self.rileyLinkManager.timerTickEnabled = self.isPumpDataStale() || !(self.cgmManager?.providesBLEHeartbeat == true) diff --git a/Loop/Models/CGM.swift b/Loop/Models/CGM.swift index ea0488b5be..43710351a4 100644 --- a/Loop/Models/CGM.swift +++ b/Loop/Models/CGM.swift @@ -17,8 +17,15 @@ enum CGM { switch self { case .g4: return URL(string: "dexcomshare://") - case .g5: - return URL(string: "dexcomcgm://") + case .g5(let transmitterID): + if let transmitterID = transmitterID { + if transmitterID.hasPrefix("4") { + return URL(string: "dexcomcgm://") + } else { + return URL(string: "dexcomg6://") + } + } + return nil case .enlite: return nil } diff --git a/Loop/Models/Glucose.swift b/Loop/Models/Glucose.swift index dc614aecef..791ba627f9 100644 --- a/Loop/Models/Glucose.swift +++ b/Loop/Models/Glucose.swift @@ -22,7 +22,7 @@ extension Glucose: SensorDisplayable { case .ok: status = "" case .lowBattery: - status = NSLocalizedString("Low Battery", comment: "The description of a low G5 transmitter battery with a leading space") + status = NSLocalizedString("Low Battery", comment: "The description of a low G5/G6 transmitter battery with a leading space") case .unknown(let value): status = String(format: "%02x", value) } diff --git a/Loop/View Controllers/SettingsTableViewController.swift b/Loop/View Controllers/SettingsTableViewController.swift index 660b64fe18..9965adefdb 100644 --- a/Loop/View Controllers/SettingsTableViewController.swift +++ b/Loop/View Controllers/SettingsTableViewController.swift @@ -231,7 +231,7 @@ final class SettingsTableViewController: UITableViewController, DailyValueSchedu case .g5TransmitterID: let configCell = tableView.dequeueReusableCell(withIdentifier: ConfigCellIdentifier, for: indexPath) - configCell.textLabel?.text = NSLocalizedString("Transmitter ID", comment: "The title text for the Dexcom G5 transmitter ID config value") + configCell.textLabel?.text = NSLocalizedString("Transmitter ID", comment: "The title text for the Dexcom G5/G6 transmitter ID config value") if case .g5(let transmitterID)? = dataManager.cgm { configCell.detailTextLabel?.text = transmitterID ?? TapToSetString @@ -257,7 +257,7 @@ final class SettingsTableViewController: UITableViewController, DailyValueSchedu switchCell.switch?.isOn = false } - switchCell.textLabel?.text = NSLocalizedString("G5 Transmitter", comment: "The title text for the G5 Transmitter switch cell") + switchCell.textLabel?.text = NSLocalizedString("G5/G6 Transmitter", comment: "The title text for the G5/G6 Transmitter switch cell") switchCell.switch?.addTarget(self, action: #selector(g5Changed(_:)), for: .valueChanged) case .dexcomShare, .g5TransmitterID: assertionFailure() diff --git a/Loop/View Controllers/TextFieldTableViewController.swift b/Loop/View Controllers/TextFieldTableViewController.swift index e59b5e5a5c..96bb4e433b 100644 --- a/Loop/View Controllers/TextFieldTableViewController.swift +++ b/Loop/View Controllers/TextFieldTableViewController.swift @@ -40,7 +40,7 @@ extension TextFieldTableViewController { vc.placeholder = NSLocalizedString("Enter the 6-digit transmitter ID", comment: "The placeholder text instructing users how to enter a pump ID") vc.value = value - vc.contextHelp = NSLocalizedString("The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app.", comment: "Instructions on where to find the transmitter ID") + vc.contextHelp = NSLocalizedString("The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app.", comment: "Instructions on where to find the transmitter ID") return vc } diff --git a/Loop/es.lproj/Localizable.strings b/Loop/es.lproj/Localizable.strings index e2cd8898d7..817888c970 100644 --- a/Loop/es.lproj/Localizable.strings +++ b/Loop/es.lproj/Localizable.strings @@ -184,7 +184,7 @@ "G4 Share Receiver" = "Receptor G4 Share"; /* The title text for the G5 Transmitter switch cell */ -"G5 Transmitter" = "Transmisor G5"; +"G5/G6 Transmitter" = "Transmisor G5/G6"; /* The title of the glucose and prediction graph */ "Glucose" = "Glucosa"; @@ -389,7 +389,7 @@ "The pump region can be found printed on the back as part of the model number (REF), for example: MMT-551NAB, or MMT-515LWWS. If the model number contains \"NA\" or \"CA\", then the region is North America. If if contains \"WW\", then the region is World-Wide." = "La región de la microinfusora puede enconstrarse impresa en la parte trasera como parte del código de modelo ( REF ), por ejemplo MMT-551NAB o MMT-515LWWS. Si el código de modelo contiene \"NA\" o \"CA\", la región es Norte América. Si contiene \"WW\" la región es Mundial."; /* Instructions on where to find the transmitter ID */ -"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app." = "El ID de transmisor puede encontrarse impreso en la parte trasera del dispositivo, a un lado de la caja en la que estaba empacado y dentro del menú de ajustes del receptor G5 y la app móvil"; +"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app." = "El ID de transmisor puede encontrarse impreso en la parte trasera del dispositivo, a un lado de la caja en la que estaba empacado y dentro del menú de ajustes del receptor y la app móvil"; /* The description of the switch which toggles retrospective correction effects */ "This will more aggresively increase or decrease basal delivery when glucose movement doesn't match the carbohydrate and insulin-based model." = "Esto incrementará o decrementará mas agresivamente la entrega de basales cuando el movimiento de glucosa no concuerde con el modelo de insulina y carbohidratos."; diff --git a/Loop/it.lproj/Localizable.strings b/Loop/it.lproj/Localizable.strings index 26ebc1abb9..c72c4a1cd8 100644 --- a/Loop/it.lproj/Localizable.strings +++ b/Loop/it.lproj/Localizable.strings @@ -181,7 +181,7 @@ "G4 Share Receiver" = "G4 Ricevitore Share"; /* The title text for the Dexcom G5 transmitter ID config value */ -"G5 Transmitter ID" = "G5 ID Trasmettitore"; +"G5/G6 Transmitter ID" = "G5/G6 ID Trasmettitore"; /* The title of the glucose and prediction graph */ "Glucose" = "Glicemie"; @@ -328,7 +328,7 @@ "The pump ID can be found printed on the back, or near the bottom of the STATUS/Esc screen. It is the strictly numerical portion of the serial number (shown as SN or S/N)." = "L'ID della pompa si trova stampato sul retro, o vicino al fondo della schermata STATO/Esc. È la parte strettamente numerica del numero di serie (indicato come SN o S/N)."; /* Instructions on where to find the transmitter ID */ -"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app." = "L'ID trasmettitore può essere trovato stampato sul retro del dispositivo, sul lato della scatola, e all'interno del menu impostazione del ricevitore G5 all'interno dell'applicazione mobile."; +"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app." = "L'ID trasmettitore può essere trovato stampato sul retro del dispositivo, sul lato della scatola, e all'interno del menu impostazione del ricevitore all'interno dell'applicazione mobile."; /* The description of the switch which toggles retrospective correction effects */ "This will more aggresively increase or decrease basal delivery when glucose movement doesn't match the carbohydrate and insulin-based model." = "Questo sarà più aggressivo all'aumentare o al diminuire della basale quando il movimento di glucosio non corrisponde al modello di carboidrati e al modello insulino-basale"; diff --git a/Loop/ru.lproj/Localizable.strings b/Loop/ru.lproj/Localizable.strings index dde228ab29..69c52f9c02 100644 --- a/Loop/ru.lproj/Localizable.strings +++ b/Loop/ru.lproj/Localizable.strings @@ -197,7 +197,7 @@ "G4 Share Receiver" = "Ресивер G4 Шеар"; /* The title text for the G5 Transmitter switch cell */ -"G5 Transmitter" = "Трансмиттер G5"; +"G5/G6 Transmitter" = "Трансмиттер G5/G6"; /* The title of the glucose and prediction graph */ "Glucose" = "Гликемия"; @@ -254,7 +254,7 @@ /* The notification alert describing a long-lasting loop failure. The substitution parameter is the time interval since the last loop */ "Loop has not completed successfully in %@" = "Ну удалось успешно замкнуть цикл/контур в %@"; -/* The description of a low G5 transmitter battery with a leading space */ +/* The description of a low transmitter battery with a leading space */ "Low Battery" = "Низкий заряд батареи"; /* The title text for the maximum basal rate value */ @@ -399,7 +399,7 @@ "The pump ID can be found printed on the back, or near the bottom of the STATUS/Esc screen. It is the strictly numerical portion of the serial number (shown as SN or S/N)." = "инд номер помпы находится на ее задней стенке или снизу экрана состояния STATUS/ESC. Это исключительно цифровая часть серийного номера (обозначаемого SN или S/N) "; /* Instructions on where to find the transmitter ID */ -"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app." = "Инд. номер трансмиттера находится на задней стенке устройства , сбоку упаковочной коробки, в настроечном меню ресивера G5 и мобильного приложения"; +"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app." = "Инд. номер трансмиттера находится на задней стенке устройства , сбоку упаковочной коробки, в настроечном меню ресивера и мобильного приложения"; /* The description of the switch which toggles retrospective correction effects */ "This will more aggresively increase or decrease basal delivery when glucose movement doesn't match the carbohydrate and insulin-based model." = "Это более радикально понизит или увеличит подачу базала в тех случаях когда динамика гликемии не соответствует моделям основанным на углеводах и инсулине";