one transmitter type for Dexcom G5 and G6
This commit is contained in:
parent
76b04a0703
commit
bdfbb143c3
|
@ -226,11 +226,8 @@
|
|||
F82437D324CB7A9900BED341 /* Soft_Marimba_Pad_Positive.caf in Resources */ = {isa = PBXBuildFile; fileRef = F824376824CB7A9800BED341 /* Soft_Marimba_Pad_Positive.caf */; };
|
||||
F82437D424CB7A9900BED341 /* Siri_Alert_Low_Glucose.caf in Resources */ = {isa = PBXBuildFile; fileRef = F824376924CB7A9800BED341 /* Siri_Alert_Low_Glucose.caf */; };
|
||||
F8252867243E50FE0067AF77 /* ConstantsLibre.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8252866243E50FE0067AF77 /* ConstantsLibre.swift */; };
|
||||
F825286A2443AE190067AF77 /* DexcomG6BluetoothPeripheralViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82528692443AE190067AF77 /* DexcomG6BluetoothPeripheralViewModel.swift */; };
|
||||
F825286C2443BEDC0067AF77 /* CGMG6TransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F825286B2443BEDC0067AF77 /* CGMG6TransmitterDelegate.swift */; };
|
||||
F8284230274ED56A0097E0C9 /* DexcomCalibrationParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = F828422F274ED56A0097E0C9 /* DexcomCalibrationParameters.swift */; };
|
||||
F82842322752CBE00097E0C9 /* DexcomSessionStopTxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82842312752CBE00097E0C9 /* DexcomSessionStopTxMessage.swift */; };
|
||||
F82842352753D0340097E0C9 /* CGMG6FireflyTransmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82842342753D0340097E0C9 /* CGMG6FireflyTransmitter.swift */; };
|
||||
F8297F4E238DCAD800D74D66 /* BluetoothPeripheralsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8297F4B238DCAD800D74D66 /* BluetoothPeripheralsViewController.swift */; };
|
||||
F8297F4F238DCAD800D74D66 /* BluetoothPeripheralNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8297F4C238DCAD800D74D66 /* BluetoothPeripheralNavigationController.swift */; };
|
||||
F8297F52238ECA3200D74D66 /* BluetoothPeripheralViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8297F51238ECA3200D74D66 /* BluetoothPeripheralViewController.swift */; };
|
||||
|
@ -315,7 +312,6 @@
|
|||
F8A2BC3325DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMDexcomG4TransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2425DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMDexcomG4TransmitterDelegate.swift */; };
|
||||
F8A2BC3425DB0D6D001D1E78 /* BluetoothPeripheralManager+WatlaaBluetoothTransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2525DB0D6D001D1E78 /* BluetoothPeripheralManager+WatlaaBluetoothTransmitterDelegate.swift */; };
|
||||
F8A2BC3525DB0D6D001D1E78 /* BluetoothPeripheralManager+BluetoothTransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2625DB0D6D001D1E78 /* BluetoothPeripheralManager+BluetoothTransmitterDelegate.swift */; };
|
||||
F8A2BC3625DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG6TransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2725DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG6TransmitterDelegate.swift */; };
|
||||
F8A2BC3725DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMMiaoMiaoTransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2825DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMMiaoMiaoTransmitterDelegate.swift */; };
|
||||
F8A2BC3825DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMBluconTransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2925DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMBluconTransmitterDelegate.swift */; };
|
||||
F8A2BC3925DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMLibre2TransmitterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8A2BC2A25DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMLibre2TransmitterDelegate.swift */; };
|
||||
|
@ -430,7 +426,6 @@
|
|||
F8CB59CA27405A6800BA199E /* DexcomCalibrationTxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8CB59C927405A6800BA199E /* DexcomCalibrationTxMessage.swift */; };
|
||||
F8CB59CC2744471100BA199E /* DexcomSessionStartResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8CB59CB2744471000BA199E /* DexcomSessionStartResponse.swift */; };
|
||||
F8CB59CE27444D6300BA199E /* DexcomSessionStopResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8CB59CD27444D6300BA199E /* DexcomSessionStopResponse.swift */; };
|
||||
F8CB59D12745D3FE00BA199E /* DexcomG6FireflyBluetoothPeripheralViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8CB59D02745D3FE00BA199E /* DexcomG6FireflyBluetoothPeripheralViewModel.swift */; };
|
||||
F8CB59D3274D94AF00BA199E /* DexcomSessionStartTxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8CB59D2274D94AE00BA199E /* DexcomSessionStartTxMessage.swift */; };
|
||||
F8D0587C24BCB570008C8734 /* SettingsViewHomeScreenSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D0587B24BCB570008C8734 /* SettingsViewHomeScreenSettingsViewModel.swift */; };
|
||||
F8DF765323E34F4500063910 /* DexcomG5+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8DF765223E34F4500063910 /* DexcomG5+CoreDataClass.swift */; };
|
||||
|
@ -481,7 +476,6 @@
|
|||
F8F971B623A5914D00C3F17D /* M5Stack+BluetoothPeripheral.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971B123A5914C00C3F17D /* M5Stack+BluetoothPeripheral.swift */; };
|
||||
F8F971B723A5914D00C3F17D /* BluetoothPeripheralType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971B423A5914C00C3F17D /* BluetoothPeripheralType.swift */; };
|
||||
F8F971B823A5914D00C3F17D /* BluetoothPeripheral.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971B523A5914C00C3F17D /* BluetoothPeripheral.swift */; };
|
||||
F8F9720223A5915900C3F17D /* CGMG6Transmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971BD23A5915900C3F17D /* CGMG6Transmitter.swift */; };
|
||||
F8F9720323A5915900C3F17D /* CGMG5Transmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971BF23A5915900C3F17D /* CGMG5Transmitter.swift */; };
|
||||
F8F9720423A5915900C3F17D /* TransmitterVersionTxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971C123A5915900C3F17D /* TransmitterVersionTxMessage.swift */; };
|
||||
F8F9720523A5915900C3F17D /* TransmitterMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8F971C223A5915900C3F17D /* TransmitterMessage.swift */; };
|
||||
|
@ -1033,11 +1027,8 @@
|
|||
F824376824CB7A9800BED341 /* Soft_Marimba_Pad_Positive.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Soft_Marimba_Pad_Positive.caf; sourceTree = "<group>"; };
|
||||
F824376924CB7A9800BED341 /* Siri_Alert_Low_Glucose.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Siri_Alert_Low_Glucose.caf; sourceTree = "<group>"; };
|
||||
F8252866243E50FE0067AF77 /* ConstantsLibre.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstantsLibre.swift; sourceTree = "<group>"; };
|
||||
F82528692443AE190067AF77 /* DexcomG6BluetoothPeripheralViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomG6BluetoothPeripheralViewModel.swift; sourceTree = "<group>"; };
|
||||
F825286B2443BEDC0067AF77 /* CGMG6TransmitterDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGMG6TransmitterDelegate.swift; sourceTree = "<group>"; };
|
||||
F828422F274ED56A0097E0C9 /* DexcomCalibrationParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomCalibrationParameters.swift; sourceTree = "<group>"; };
|
||||
F82842312752CBE00097E0C9 /* DexcomSessionStopTxMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomSessionStopTxMessage.swift; sourceTree = "<group>"; };
|
||||
F82842342753D0340097E0C9 /* CGMG6FireflyTransmitter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGMG6FireflyTransmitter.swift; sourceTree = "<group>"; };
|
||||
F8297F4B238DCAD800D74D66 /* BluetoothPeripheralsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BluetoothPeripheralsViewController.swift; sourceTree = "<group>"; };
|
||||
F8297F4C238DCAD800D74D66 /* BluetoothPeripheralNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BluetoothPeripheralNavigationController.swift; sourceTree = "<group>"; };
|
||||
F8297F51238ECA3200D74D66 /* BluetoothPeripheralViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BluetoothPeripheralViewController.swift; sourceTree = "<group>"; };
|
||||
|
@ -1156,7 +1147,6 @@
|
|||
F8A2BC2425DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMDexcomG4TransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+CGMDexcomG4TransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
F8A2BC2525DB0D6D001D1E78 /* BluetoothPeripheralManager+WatlaaBluetoothTransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+WatlaaBluetoothTransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
F8A2BC2625DB0D6D001D1E78 /* BluetoothPeripheralManager+BluetoothTransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+BluetoothTransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
F8A2BC2725DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG6TransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+CGMG6TransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
F8A2BC2825DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMMiaoMiaoTransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+CGMMiaoMiaoTransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
F8A2BC2925DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMBluconTransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+CGMBluconTransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
F8A2BC2A25DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMLibre2TransmitterDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "BluetoothPeripheralManager+CGMLibre2TransmitterDelegate.swift"; sourceTree = "<group>"; };
|
||||
|
@ -1316,7 +1306,6 @@
|
|||
F8CB59C927405A6800BA199E /* DexcomCalibrationTxMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomCalibrationTxMessage.swift; sourceTree = "<group>"; };
|
||||
F8CB59CB2744471000BA199E /* DexcomSessionStartResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomSessionStartResponse.swift; sourceTree = "<group>"; };
|
||||
F8CB59CD27444D6300BA199E /* DexcomSessionStopResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomSessionStopResponse.swift; sourceTree = "<group>"; };
|
||||
F8CB59D02745D3FE00BA199E /* DexcomG6FireflyBluetoothPeripheralViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomG6FireflyBluetoothPeripheralViewModel.swift; sourceTree = "<group>"; };
|
||||
F8CB59D2274D94AE00BA199E /* DexcomSessionStartTxMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DexcomSessionStartTxMessage.swift; sourceTree = "<group>"; };
|
||||
F8D0587B24BCB570008C8734 /* SettingsViewHomeScreenSettingsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewHomeScreenSettingsViewModel.swift; sourceTree = "<group>"; };
|
||||
F8DF765223E34F4500063910 /* DexcomG5+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DexcomG5+CoreDataClass.swift"; sourceTree = "<group>"; };
|
||||
|
@ -1373,7 +1362,6 @@
|
|||
F8F971B123A5914C00C3F17D /* M5Stack+BluetoothPeripheral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "M5Stack+BluetoothPeripheral.swift"; sourceTree = "<group>"; };
|
||||
F8F971B423A5914C00C3F17D /* BluetoothPeripheralType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BluetoothPeripheralType.swift; sourceTree = "<group>"; };
|
||||
F8F971B523A5914C00C3F17D /* BluetoothPeripheral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BluetoothPeripheral.swift; sourceTree = "<group>"; };
|
||||
F8F971BD23A5915900C3F17D /* CGMG6Transmitter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGMG6Transmitter.swift; sourceTree = "<group>"; };
|
||||
F8F971BF23A5915900C3F17D /* CGMG5Transmitter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGMG5Transmitter.swift; sourceTree = "<group>"; };
|
||||
F8F971C123A5915900C3F17D /* TransmitterVersionTxMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransmitterVersionTxMessage.swift; sourceTree = "<group>"; };
|
||||
F8F971C223A5915900C3F17D /* TransmitterMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransmitterMessage.swift; sourceTree = "<group>"; };
|
||||
|
@ -1825,23 +1813,6 @@
|
|||
path = Speak;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F82528682443AE040067AF77 /* DexcomG6 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F82528692443AE190067AF77 /* DexcomG6BluetoothPeripheralViewModel.swift */,
|
||||
);
|
||||
path = DexcomG6;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F82842332753CFED0097E0C9 /* G6Firefly */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F82842342753D0340097E0C9 /* CGMG6FireflyTransmitter.swift */,
|
||||
);
|
||||
name = G6Firefly;
|
||||
path = Generic/G6Firefly;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8297F42238DC4AC00D74D66 /* BluetoothPeripheral */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -2061,7 +2032,6 @@
|
|||
F8A2BC2425DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMDexcomG4TransmitterDelegate.swift */,
|
||||
F8A2BC2525DB0D6D001D1E78 /* BluetoothPeripheralManager+WatlaaBluetoothTransmitterDelegate.swift */,
|
||||
F8A2BC2625DB0D6D001D1E78 /* BluetoothPeripheralManager+BluetoothTransmitterDelegate.swift */,
|
||||
F8A2BC2725DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG6TransmitterDelegate.swift */,
|
||||
F8A2BC2825DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMMiaoMiaoTransmitterDelegate.swift */,
|
||||
F8A2BC2925DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMBluconTransmitterDelegate.swift */,
|
||||
F8A2BC2A25DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMLibre2TransmitterDelegate.swift */,
|
||||
|
@ -2473,14 +2443,6 @@
|
|||
path = MiaoMiao;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8CB59CF2745D3D000BA199E /* DexcomG6Firefly */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8CB59D02745D3FE00BA199E /* DexcomG6FireflyBluetoothPeripheralViewModel.swift */,
|
||||
);
|
||||
path = DexcomG6Firefly;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8DF765923E350B100063910 /* Dexcom */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -2510,8 +2472,6 @@
|
|||
F8DF766A23ED9AF100063910 /* Dexcom */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8CB59CF2745D3D000BA199E /* DexcomG6Firefly */,
|
||||
F82528682443AE040067AF77 /* DexcomG6 */,
|
||||
F816E12F2439E2A0009EE65B /* DexcomG4 */,
|
||||
F8DF766B23ED9AF100063910 /* DexcomG5 */,
|
||||
);
|
||||
|
@ -2791,22 +2751,11 @@
|
|||
F8AF11F924B1FB3500AE5BA2 /* DexcomError.swift */,
|
||||
F8F971D423A5915900C3F17D /* G4 */,
|
||||
F8F971BE23A5915900C3F17D /* G5 */,
|
||||
F8F971BC23A5915900C3F17D /* G6 */,
|
||||
F82842332753CFED0097E0C9 /* G6Firefly */,
|
||||
F8F1670F27274067001AA3D8 /* Generic */,
|
||||
);
|
||||
path = Dexcom;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8F971BC23A5915900C3F17D /* G6 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F8F971BD23A5915900C3F17D /* CGMG6Transmitter.swift */,
|
||||
F825286B2443BEDC0067AF77 /* CGMG6TransmitterDelegate.swift */,
|
||||
);
|
||||
path = G6;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F8F971BE23A5915900C3F17D /* G5 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -3434,13 +3383,11 @@
|
|||
F8B955EB2591355200C06016 /* CGMLibre2Transmitter+TestData.swift in Sources */,
|
||||
F8B3A85B2280CCD1004BA588 /* AlertSettingsViewController.swift in Sources */,
|
||||
F8F9722E23A5915900C3F17D /* M5StackTransmitterOpCode.swift in Sources */,
|
||||
F8F9720223A5915900C3F17D /* CGMG6Transmitter.swift in Sources */,
|
||||
F816E0E22432A4D1009EE65B /* Blucon+BluetoothPeripheral.swift in Sources */,
|
||||
F897E24B23FC86CF0075E0E8 /* CGMG5TransmitterDelegate.swift in Sources */,
|
||||
F816E0F12433C31B009EE65B /* Blucon+CoreDataClass.swift in Sources */,
|
||||
F8F9723323A5915900C3F17D /* M5StackBluetoothTransmitterDelegate.swift in Sources */,
|
||||
F8B3A81B227DEC92004BA588 /* SensorsAccessor.swift in Sources */,
|
||||
F8CB59D12745D3FE00BA199E /* DexcomG6FireflyBluetoothPeripheralViewModel.swift in Sources */,
|
||||
F8F9721E23A5915900C3F17D /* LibreSensorState.swift in Sources */,
|
||||
F8B3A85D22821BB6004BA588 /* Int.swift in Sources */,
|
||||
F808D2CE2403292C0084B5DB /* Bubble+CoreDataProperties.swift in Sources */,
|
||||
|
@ -3582,7 +3529,6 @@
|
|||
F8F7B8E6259A6EBF00C47B04 /* LibreSmoothing.swift in Sources */,
|
||||
F808D2CA240325E40084B5DB /* CGMBubbleTransmitterDelegate.swift in Sources */,
|
||||
F804870C2336D90200EBDDB7 /* M5Stack+CoreDataClass.swift in Sources */,
|
||||
F825286C2443BEDC0067AF77 /* CGMG6TransmitterDelegate.swift in Sources */,
|
||||
F8CB59C22738206D00BA199E /* DexcomGlucoseDataTxMessage.swift in Sources */,
|
||||
F8C97854242AA70D00A09483 /* MiaoMiao+CoreDataProperties.swift in Sources */,
|
||||
F8F9720A23A5915900C3F17D /* DexcomTransmitterOpCode.swift in Sources */,
|
||||
|
@ -3591,7 +3537,6 @@
|
|||
F8F1671927288FC6001AA3D8 /* DexcomSessionStartRxMessage.swift in Sources */,
|
||||
F804870D2336D90200EBDDB7 /* M5Stack+CoreDataProperties.swift in Sources */,
|
||||
F85FF3CD252F9FD7004E6FF1 /* SnoozeParameters+CoreDataProperties.swift in Sources */,
|
||||
F82842352753D0340097E0C9 /* CGMG6FireflyTransmitter.swift in Sources */,
|
||||
F8F9722F23A5915900C3F17D /* M5StackPacket.swift in Sources */,
|
||||
F821CF8E22AB090C005C1E43 /* DatePickerViewController.swift in Sources */,
|
||||
F8AF11F324B1279500AE5BA2 /* TextsLibreErrors.swift in Sources */,
|
||||
|
@ -3662,7 +3607,6 @@
|
|||
F8E51D67244BAE0E001C9E5A /* WatlaaBluetoothTransmitterMaster+CGMTransmitter.swift in Sources */,
|
||||
F81FA0002289E4990028C70F /* AlertSettingsViewControllerData.swift in Sources */,
|
||||
F80D916024F45EB3006840B5 /* LibreError.swift in Sources */,
|
||||
F8A2BC3625DB0D6D001D1E78 /* BluetoothPeripheralManager+CGMG6TransmitterDelegate.swift in Sources */,
|
||||
F856CE5B22EDC8E50083E436 /* ConstantsBluetoothPairing.swift in Sources */,
|
||||
F8F971B823A5914D00C3F17D /* BluetoothPeripheral.swift in Sources */,
|
||||
F8F9721723A5915900C3F17D /* CGMDroplet1Transmitter.swift in Sources */,
|
||||
|
@ -3734,7 +3678,6 @@
|
|||
F8AF120124B9082000AE5BA2 /* Calibration+NightScout.swift in Sources */,
|
||||
F808D2D2240329E80084B5DB /* Bubble+BluetoothPeripheral.swift in Sources */,
|
||||
F8025C1321DA683400ECF0C0 /* Data.swift in Sources */,
|
||||
F825286A2443AE190067AF77 /* DexcomG6BluetoothPeripheralViewModel.swift in Sources */,
|
||||
F80859272364355F00F3829D /* ConstantsGlucoseChart.swift in Sources */,
|
||||
F816E10324367389009EE65B /* GNSEntryBluetoothPeripheralViewModel.swift in Sources */,
|
||||
F8E51D5D2448D8B5001C9E5A /* LoopManager.swift in Sources */,
|
||||
|
|
|
@ -5,11 +5,7 @@ extension DexcomG5: BluetoothPeripheral {
|
|||
|
||||
func bluetoothPeripheralType() -> BluetoothPeripheralType {
|
||||
|
||||
if isDexcomG6 {return .DexcomG6Type}
|
||||
|
||||
if isFirefly {return .DexcomG6FireflyType}
|
||||
|
||||
return .DexcomG5Type
|
||||
return .DexcomType
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -22,14 +22,8 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
/// bubble
|
||||
case BubbleType = "Bubble / Bubble Mini"
|
||||
|
||||
/// DexcomG6
|
||||
case DexcomG6Type = "Dexcom G6"
|
||||
|
||||
/// Dexcom G6 firefly
|
||||
case DexcomG6FireflyType = "Dexcom G6 Firefly"
|
||||
|
||||
/// DexcomG5
|
||||
case DexcomG5Type = "Dexcom G5"
|
||||
/// Dexcom
|
||||
case DexcomType = "Dexcom"
|
||||
|
||||
/// DexcomG4
|
||||
case DexcomG4Type = "Dexcom G4 (Bridge)"
|
||||
|
@ -66,7 +60,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
case .WatlaaType:
|
||||
return WatlaaBluetoothPeripheralViewModel()
|
||||
|
||||
case .DexcomG5Type:
|
||||
case .DexcomType:
|
||||
return DexcomG5BluetoothPeripheralViewModel()
|
||||
|
||||
case .BubbleType:
|
||||
|
@ -90,12 +84,6 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
case .DexcomG4Type:
|
||||
return DexcomG4BluetoothPeripheralViewModel()
|
||||
|
||||
case .DexcomG6Type:
|
||||
return DexcomG6BluetoothPeripheralViewModel()
|
||||
|
||||
case .DexcomG6FireflyType:
|
||||
return DexcomG6FireflyBluetoothPeripheralViewModel()
|
||||
|
||||
case .Libre2Type:
|
||||
return Libre2BluetoothPeripheralViewModel()
|
||||
|
||||
|
@ -127,36 +115,10 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
|
||||
return Watlaa(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
|
||||
|
||||
case .DexcomG5Type:
|
||||
case .DexcomType:
|
||||
|
||||
return DexcomG5(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
|
||||
|
||||
case .DexcomG6Type:
|
||||
|
||||
// DexcomG6 is a DexcomG5 with isDexcomG6 set to true
|
||||
|
||||
// the cgm transmitter itself will use the transmitter id to determine that firefly logic needs to be used
|
||||
// which means, a user could add a Dexcom G6 Firefly as a Dexcom G6 or even a Dexcom G5, the class CGMG5Transmitter will find out it's a firefly, based on transmitter id and handle it as a firefly
|
||||
// It plays only a role in the RootViewController that a G6 Firefly is selected, because then also the user needs to add a code
|
||||
|
||||
let dexcomG6 = DexcomG5(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
|
||||
dexcomG6.isDexcomG6 = true
|
||||
|
||||
return dexcomG6
|
||||
|
||||
case .DexcomG6FireflyType:
|
||||
|
||||
// DexcomG6 Firefly is a DexcomG5 with isFirefly set to true
|
||||
|
||||
// the cgm transmitter itself will use the transmitter id to determine that firefly logic needs to be used
|
||||
// which means, a user could add a Dexcom G6 Firefly as a Dexcom G6 or even a Dexcom G5, the class CGMG5Transmitter will find out it's a firefly, based on transmitter id and handle it as a firefly
|
||||
// It plays only a role in the RootViewController that a G6 Firefly is selected, because then also the user needs to add a code
|
||||
|
||||
let dexcomG6Firefly = DexcomG5(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
|
||||
dexcomG6Firefly.isFirefly = true
|
||||
|
||||
return dexcomG6Firefly
|
||||
|
||||
case .BubbleType:
|
||||
|
||||
return Bubble(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
|
||||
|
@ -205,7 +167,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
case .M5StackType, .M5StickCType:
|
||||
return .M5Stack
|
||||
|
||||
case .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type, .WatlaaType, .Libre2Type, .AtomType, .DexcomG6FireflyType:
|
||||
case .DexcomType, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .WatlaaType, .Libre2Type, .AtomType:
|
||||
return .CGM
|
||||
|
||||
}
|
||||
|
@ -220,7 +182,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
case .M5StackType, .M5StickCType, .WatlaaType, .BubbleType, .MiaoMiaoType, .GNSentryType, .BlueReaderType, .DropletType, .Libre2Type, .AtomType:
|
||||
return false
|
||||
|
||||
case .DexcomG5Type, .BluconType, .DexcomG4Type, .DexcomG6Type, .DexcomG6FireflyType:
|
||||
case .DexcomType, .BluconType, .DexcomG4Type:
|
||||
return true
|
||||
|
||||
}
|
||||
|
@ -233,7 +195,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
|
||||
switch self {
|
||||
|
||||
case .DexcomG5Type, .DexcomG6Type, .DexcomG6FireflyType:
|
||||
case .DexcomType:
|
||||
|
||||
// length for G5 and G6 is 6
|
||||
if transmitterId.count != 6 {
|
||||
|
@ -285,10 +247,10 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
|
||||
switch self {
|
||||
|
||||
case .M5StackType, .M5StickCType, .WatlaaType, .DexcomG4Type, .DexcomG5Type, .DexcomG6Type, .BluconType, .BlueReaderType, .DropletType , .GNSentryType, .DexcomG6FireflyType:
|
||||
case .M5StackType, .M5StickCType, .WatlaaType, .DexcomG4Type, .BluconType, .BlueReaderType, .DropletType , .GNSentryType:
|
||||
return false
|
||||
|
||||
case .BubbleType, .MiaoMiaoType, .AtomType:
|
||||
case .BubbleType, .MiaoMiaoType, .AtomType, .DexcomType:
|
||||
return true
|
||||
|
||||
case .Libre2Type:
|
||||
|
@ -304,7 +266,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
|
|||
|
||||
switch self {
|
||||
|
||||
case .M5StackType, .M5StickCType, .DexcomG4Type, .DexcomG5Type, .DexcomG6Type, .DexcomG6FireflyType:
|
||||
case .M5StackType, .M5StickCType, .DexcomG4Type, .DexcomType:
|
||||
return false
|
||||
|
||||
case .BubbleType, .MiaoMiaoType, .WatlaaType, .BluconType, .BlueReaderType, .DropletType , .GNSentryType, .AtomType:
|
||||
|
|
|
@ -16,9 +16,6 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
/// created public because inheriting classes need it
|
||||
var transmitterStartDate: Date?
|
||||
|
||||
/// if true, then firefly flow will be used, even if the transmitter id < 8G
|
||||
var isFireflyNoMatterTransmitterId: Bool = false
|
||||
|
||||
/// CGMG5TransmitterDelegate
|
||||
public weak var cGMG5TransmitterDelegate: CGMG5TransmitterDelegate?
|
||||
|
||||
|
@ -132,7 +129,17 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
private var calibrationToSendToTransmitter: Calibration?
|
||||
|
||||
/// if the user starts the sensor via xDrip4iOS, then only after having receivec a confirmation from the transmitter, then sensorStartDate will be assigned to the actual sensor start date
|
||||
private var sensorStartDate: Date?
|
||||
/// - if set then call cGMG5TransmitterDelegate.received(sensorStartDate
|
||||
private var sensorStartDate: Date? {
|
||||
|
||||
didSet {
|
||||
|
||||
cGMG5TransmitterDelegate?.received(sensorStartDate: sensorStartDate, cGMG5Transmitter: self)
|
||||
|
||||
timeStampLastSensorStartTimeRead = Date(timeIntervalSince1970: 0)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// to temporary store the received SensorStartDate. Will be compared to sensorStartDate only after having received a glucoseRx message with a valid algorithm status
|
||||
private var receivedSensorStartDate: Date?
|
||||
|
@ -149,6 +156,9 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
/// to use in firefly flow, if true, then sensor status is ok, backfill request can be sent
|
||||
private var okToRequestBackfill = false
|
||||
|
||||
/// is the transmitter oop web enabled or not
|
||||
private var webOOPEnabled: Bool
|
||||
|
||||
// MARK: - public functions
|
||||
|
||||
/// - parameters:
|
||||
|
@ -161,7 +171,8 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
/// - transmitterStartDate : transmitter start date, optional - actual transmitterStartDate is received from transmitter itself, and stored in coredata. The stored value iss given here as parameter in the initializer. Means at app start up, it's read from core data and added here as parameter
|
||||
/// - sensorStartDate : should be sensorStartDate of active sensor. If a different sensor start date is received from the transmitter, then we know a new senosr was started
|
||||
/// - calibrationToSendToTransmitter : used to send calibration done by user via xDrip4iOS to Dexcom transmitter. For example, user may have give a calibration in the app, but it's not yet send to the transmitter. This needs to be verified in CGMG5Transmitter, which is why it's given here as parameter - when initializing, assign last known calibration for the active sensor, even if it's already sent.
|
||||
init(address:String?, name: String?, transmitterID:String, bluetoothTransmitterDelegate: BluetoothTransmitterDelegate, cGMG5TransmitterDelegate: CGMG5TransmitterDelegate, cGMTransmitterDelegate:CGMTransmitterDelegate, transmitterStartDate: Date?, sensorStartDate: Date?, calibrationToSendToTransmitter: Calibration?, firmware: String?) {
|
||||
/// - webOOPEnabled : enabled or not, if nil then default false
|
||||
init(address:String?, name: String?, transmitterID:String, bluetoothTransmitterDelegate: BluetoothTransmitterDelegate, cGMG5TransmitterDelegate: CGMG5TransmitterDelegate, cGMTransmitterDelegate:CGMTransmitterDelegate, transmitterStartDate: Date?, sensorStartDate: Date?, calibrationToSendToTransmitter: Calibration?, firmware: String?, webOOPEnabled: Bool?) {
|
||||
|
||||
// assign addressname and name or expected devicename
|
||||
var newAddressAndName:BluetoothTransmitter.DeviceAddressAndName = BluetoothTransmitter.DeviceAddressAndName.notYetConnected(expectedName: "DEXCOM" + transmitterID[transmitterID.index(transmitterID.startIndex, offsetBy: 4)..<transmitterID.endIndex])
|
||||
|
@ -169,6 +180,9 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
newAddressAndName = BluetoothTransmitter.DeviceAddressAndName.alreadyConnectedBefore(address: address, name: name)
|
||||
}
|
||||
|
||||
// initialize webOOPEnabled
|
||||
self.webOOPEnabled = webOOPEnabled ?? false
|
||||
|
||||
//assign transmitterId
|
||||
self.transmitterId = transmitterID
|
||||
|
||||
|
@ -222,6 +236,25 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
// for G5, the scaling is independent of the firmwareVersion
|
||||
// and there's no scaling to do
|
||||
if transmitterId.startsWith("4") {
|
||||
|
||||
return rawValue
|
||||
|
||||
}
|
||||
|
||||
// so it's G6 (non firefly)
|
||||
guard let firmwareVersion = firmwareVersion else { return rawValue }
|
||||
|
||||
if firmwareVersion.starts(with: "1.") {
|
||||
|
||||
return rawValue * 34.0
|
||||
|
||||
} else if firmwareVersion.starts(with: "2.") {
|
||||
|
||||
return (rawValue - 1151500000.0) / 110.0
|
||||
|
||||
}
|
||||
|
||||
return rawValue
|
||||
|
||||
}
|
||||
|
@ -231,13 +264,6 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
G5ResetRequested = requested
|
||||
}
|
||||
|
||||
/// verifies if it's a firefly based on transmitterId, if >= 8G then considered to be a Firefly
|
||||
func useFireflyFlow() -> Bool {
|
||||
|
||||
return transmitterId.uppercased().compare("8G") == .orderedDescending || isFireflyNoMatterTransmitterId
|
||||
|
||||
}
|
||||
|
||||
// MARK: - deinit
|
||||
|
||||
deinit {
|
||||
|
@ -320,7 +346,7 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
// is it a firefly ?
|
||||
// if no treat it as a G5, with own calibration
|
||||
if !useFireflyFlow() {
|
||||
if !webOOPEnabled {
|
||||
|
||||
// send SensorTxMessage to transmitter
|
||||
getSensorData()
|
||||
|
@ -458,11 +484,6 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
case .sensorDataRx:
|
||||
|
||||
if useOtherApp {
|
||||
trace(" sensorDataRx, useOtherApp = true, no further processing", log: log, category: ConstantsLog.categoryCGMG5, type: .info)
|
||||
return
|
||||
}
|
||||
|
||||
// if this is the first sensorDataRx after a successful pairing, then inform delegate that pairing is finished
|
||||
if waitingPairingConfirmation {
|
||||
waitingPairingConfirmation = false
|
||||
|
@ -527,7 +548,7 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
}
|
||||
|
||||
} else {
|
||||
trace(" sensorDataRxMessagee is nil", log: log, category: ConstantsLog.categoryCGMG5, type: .error)
|
||||
trace(" sensorDataRxMessage is nil", log: log, category: ConstantsLog.categoryCGMG5, type: .error)
|
||||
}
|
||||
|
||||
case .resetRx:
|
||||
|
@ -539,14 +560,14 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
processBatteryStatusRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .transmitterVersionRx:
|
||||
|
||||
processTransmitterVersionRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .keepAliveRx:
|
||||
|
||||
|
@ -555,11 +576,6 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
case .pairRequestRx:
|
||||
|
||||
if useOtherApp {
|
||||
trace(" pairRequestRx, useOtherApp = true, no further processing", log: log, category: ConstantsLog.categoryCGMG5, type: .info)
|
||||
return
|
||||
}
|
||||
|
||||
// don't know if the user accepted the pairing request or not, we can only know by trying to subscribe to writeControlCharacteristic - if the device is paired, we'll receive a sensorDataRx message, if not paired, then a disconnect will happen
|
||||
|
||||
// set status to waitingForPairingConfirmation
|
||||
|
@ -577,21 +593,21 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
processTransmitterTimeRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .glucoseBackfillRx:
|
||||
|
||||
processGlucoseBackfillRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .glucoseRx:
|
||||
|
||||
processGlucoseDataRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .glucoseG6Rx:
|
||||
// received when relying on official Dexcom app, ie in mode useOtherApp = true
|
||||
|
@ -599,28 +615,28 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
processGlucoseG6DataRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .calibrateGlucoseRx:
|
||||
|
||||
processCalibrateGlucoseRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .sessionStopRx:
|
||||
|
||||
processSessionStopRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
case .sessionStartRx:
|
||||
|
||||
processSessionStartRxMessage(value: value)
|
||||
|
||||
// if firefly continue with the firefly message flow
|
||||
if useFireflyFlow() { fireflyMessageFlow() }
|
||||
if webOOPEnabled { fireflyMessageFlow() }
|
||||
|
||||
default:
|
||||
trace(" unknown opcode received ", log: log, category: ConstantsLog.categoryCGMG5, type: .error)
|
||||
|
@ -758,14 +774,38 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
// MARK: - CGMTransmitter protocol functions
|
||||
|
||||
func setWebOOPEnabled(enabled: Bool) {
|
||||
|
||||
if webOOPEnabled != enabled {
|
||||
|
||||
trace("in setWebOOPEnabled, new value for webOOPEnabled = %{public}@", log: log, category: ConstantsLog.categoryCGMG5, type: .info, webOOPEnabled.description)
|
||||
|
||||
// reset sensor start date, because changing webOOPEnabled value stops the sensor
|
||||
sensorStartDate = nil
|
||||
|
||||
// as sensor is stopped, also set sensorStatus to nil
|
||||
cGMG5TransmitterDelegate?.received(sensorStatus: nil, cGMG5Transmitter: self)
|
||||
|
||||
}
|
||||
|
||||
webOOPEnabled = enabled
|
||||
|
||||
}
|
||||
|
||||
func isWebOOPEnabled() -> Bool {
|
||||
|
||||
return webOOPEnabled
|
||||
|
||||
}
|
||||
|
||||
func cgmTransmitterType() -> CGMTransmitterType {
|
||||
return .dexcomG5
|
||||
return .dexcom
|
||||
}
|
||||
|
||||
func overruleIsWebOOPEnabled() -> Bool {
|
||||
|
||||
// only firefly allow calibration
|
||||
return useFireflyFlow()
|
||||
// dexcom transmitters an be calibrated, even if dexcom algorithm is used
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
|
@ -834,7 +874,6 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
}
|
||||
|
||||
|
||||
// MARK: - private helper functions
|
||||
|
||||
/// sends SensorTxMessage to transmitter
|
||||
|
@ -844,7 +883,7 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
|
||||
if let writeControlCharacteristic = writeControlCharacteristic {
|
||||
|
||||
_ = writeDataToPeripheral(data: SensorDataTxMessage().data, characteristicToWriteTo: writeControlCharacteristic, type: .withResponse)
|
||||
_ = super.writeDataToPeripheral(data: SensorDataTxMessage().data, characteristicToWriteTo: writeControlCharacteristic, type: .withResponse)
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -1405,8 +1444,11 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
private func batteryStatusRequested() -> Bool {
|
||||
|
||||
if Date() > Date(timeInterval: ConstantsDexcomG5.batteryReadPeriod, since: UserDefaults.standard.timeStampOfLastBatteryReading != nil ? UserDefaults.standard.timeStampOfLastBatteryReading! : Date(timeIntervalSince1970: 0)) {
|
||||
|
||||
trace(" last battery reading was long time ago, requesting now", log: log, category: ConstantsLog.categoryCGMG5, type: .info)
|
||||
|
||||
if let writeControlCharacteristic = writeControlCharacteristic {
|
||||
|
||||
_ = super.writeDataToPeripheral(data: BatteryStatusTxMessage().data, characteristicToWriteTo: writeControlCharacteristic, type: .withResponse)
|
||||
|
||||
return true
|
||||
|
@ -1445,7 +1487,7 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
}
|
||||
|
||||
// if firefly, then subscribe to backfillCharacteristic
|
||||
if useFireflyFlow(), let backfillCharacteristic = backfillCharacteristic {
|
||||
if webOOPEnabled, let backfillCharacteristic = backfillCharacteristic {
|
||||
|
||||
trace(" calling setNotifyValue true for characteristic %{public}@", log: log, category: ConstantsLog.categoryCGMG5, type: .info, CBUUID_Characteristic_UUID.CBUUID_Backfill.description)
|
||||
|
||||
|
@ -1464,7 +1506,7 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
private func fireflyMessageFlow() {
|
||||
|
||||
// first of all check that the transmitter is really a firefly, if not stop processing
|
||||
if !useFireflyFlow() { return }
|
||||
if !webOOPEnabled { return }
|
||||
|
||||
trace(" start of firefly flow", log: log, category: ConstantsLog.categoryCGMG5, type: .info)
|
||||
|
||||
|
@ -1598,7 +1640,7 @@ class CGMG5Transmitter:BluetoothTransmitter, CGMTransmitter {
|
|||
/// - reset backFillStream, lastGlucoseInSensorDataRxReading, backfillTxSent, glucoseTxSent
|
||||
private func sendGlucoseDataToDelegate() {
|
||||
|
||||
guard useFireflyFlow() else {return}
|
||||
guard webOOPEnabled else {return}
|
||||
|
||||
// transmitterDate should be non nil
|
||||
guard let transmitterStartDate = transmitterStartDate else {
|
||||
|
|
|
@ -15,10 +15,12 @@ protocol CGMG5TransmitterDelegate: AnyObject {
|
|||
func reset(for cGMG5Transmitter: CGMG5Transmitter, successful: Bool)
|
||||
|
||||
/// sensor start time as received from transmitter
|
||||
func received(sensorStartDate: Date, cGMG5Transmitter: CGMG5Transmitter)
|
||||
/// - sensorStartDate = nil for sensorStop
|
||||
func received(sensorStartDate: Date?, cGMG5Transmitter: CGMG5Transmitter)
|
||||
|
||||
/// sensor status as received from the transmitter
|
||||
func received(sensorStatus: String, cGMG5Transmitter: CGMG5Transmitter)
|
||||
/// - sensorStatus if not known
|
||||
func received(sensorStatus: String?, cGMG5Transmitter: CGMG5Transmitter)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
import Foundation
|
||||
|
||||
class CGMG6Transmitter: CGMG5Transmitter {
|
||||
|
||||
/// - parameters:
|
||||
/// - address: if already connected before, then give here the address that was received during previous connect, if not give nil
|
||||
/// - name : if already connected before, then give here the name that was received during previous connect, if not give nil
|
||||
/// - transmitterID: expected transmitterID, 6 characters
|
||||
/// - bluetoothTransmitterDelegate : a NluetoothTransmitterDelegate
|
||||
/// - cGMTransmitterDelegate : a CGMTransmitterDelegate
|
||||
/// - cGMG5TransmitterDelegate : a CGMG5TransmitterDelegate
|
||||
/// - transmitterStartDate : transmitter start date, optional - actual transmitterStartDate is received from transmitter itself, and stored in coredata. The stored value iss given here as parameter in the initializer. Means at app start up, it's read from core data and added here as parameter
|
||||
/// - sensorStartDate : if the user starts the sensor via xDrip4iOS, then only after having receivec a confirmation from the transmitter, then sensorStartDate will be assigned to the actual sensor start date
|
||||
/// - calibrationToSendToTransmitter : used to send calibration done by user via xDrip4iOS to Dexcom transmitter. For example, user may have give a calibration in the app, but it's not yet send to the transmitter. This needs to be verified in CGMG5Transmitter, which is why it's given here as parameter - when initializing, assign last known calibration for the active sensor, even if it's already sent.
|
||||
init(address:String?, name: String?, transmitterID:String, bluetoothTransmitterDelegate: BluetoothTransmitterDelegate, cGMG6TransmitterDelegate: CGMG6TransmitterDelegate, cGMTransmitterDelegate:CGMTransmitterDelegate, transmitterStartDate: Date?, sensorStartDate: Date?, calibrationToSendToTransmitter: Calibration?, firmware: String?) {
|
||||
|
||||
// call super.init
|
||||
super.init(address: address, name: name, transmitterID: transmitterID, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate, cGMG5TransmitterDelegate: cGMG6TransmitterDelegate, cGMTransmitterDelegate: cGMTransmitterDelegate, transmitterStartDate: transmitterStartDate, sensorStartDate: sensorStartDate, calibrationToSendToTransmitter: calibrationToSendToTransmitter, firmware: firmware)
|
||||
|
||||
}
|
||||
|
||||
override func scaleRawValue(firmwareVersion: String?, rawValue: Double) -> Double {
|
||||
|
||||
guard let firmwareVersion = firmwareVersion else { return rawValue }
|
||||
|
||||
if firmwareVersion.starts(with: "1.") {
|
||||
|
||||
return rawValue * 34.0
|
||||
|
||||
} else if firmwareVersion.starts(with: "2.") {
|
||||
|
||||
return (rawValue - 1151500000.0) / 110.0
|
||||
|
||||
}
|
||||
|
||||
return rawValue
|
||||
|
||||
}
|
||||
|
||||
override func cgmTransmitterType() -> CGMTransmitterType {
|
||||
|
||||
return .dexcomG6
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import Foundation
|
||||
|
||||
protocol CGMG6TransmitterDelegate: CGMG5TransmitterDelegate {
|
||||
|
||||
|
||||
}
|
|
@ -44,7 +44,7 @@ enum DexcomAlgorithmState: UInt8, CustomStringConvertible {
|
|||
case .excessNoise: return "excess Noise"
|
||||
case .FirstofTwoBGsNeeded: return "First of Two BGs Needed"
|
||||
case .SecondofTwoBGsNeeded: return "Second of Two BGs Needed"
|
||||
case .okay: return "In Calibration"
|
||||
case .okay: return "In Calibration/Okay"
|
||||
case .needsCalibration: return "needs Calibration"
|
||||
case .CalibrationError1: return "Calibration Error 1"
|
||||
case .CalibrationError2: return "Calibration Error "
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
import Foundation
|
||||
|
||||
class CGMG6FireflyTransmitter: CGMG5Transmitter {
|
||||
|
||||
/// - parameters:
|
||||
/// - address: if already connected before, then give here the address that was received during previous connect, if not give nil
|
||||
/// - name : if already connected before, then give here the name that was received during previous connect, if not give nil
|
||||
/// - transmitterID: expected transmitterID, 6 characters
|
||||
/// - bluetoothTransmitterDelegate : a NluetoothTransmitterDelegate
|
||||
/// - cGMTransmitterDelegate : a CGMTransmitterDelegate
|
||||
/// - cGMG5TransmitterDelegate : a CGMG5TransmitterDelegate
|
||||
/// - transmitterStartDate : transmitter start date, optional - actual transmitterStartDate is received from transmitter itself, and stored in coredata. The stored value iss given here as parameter in the initializer. Means at app start up, it's read from core data and added here as parameter
|
||||
/// - sensorStartDate : if the user starts the sensor via xDrip4iOS, then only after having receivec a confirmation from the transmitter, then sensorStartDate will be assigned to the actual sensor start date
|
||||
/// - calibrationToSendToTransmitter : used to send calibration done by user via xDrip4iOS to Dexcom transmitter. For example, user may have give a calibration in the app, but it's not yet send to the transmitter. This needs to be verified in CGMG5Transmitter, which is why it's given here as parameter - when initializing, assign last known calibration for the active sensor, even if it's already sent.
|
||||
/// - useOtherApp : if true, then used in parallel with other app
|
||||
init(address:String?, name: String?, transmitterID:String, bluetoothTransmitterDelegate: BluetoothTransmitterDelegate, cGMG6TransmitterDelegate: CGMG6TransmitterDelegate, cGMTransmitterDelegate:CGMTransmitterDelegate, transmitterStartDate: Date?, sensorStartDate: Date?, calibrationToSendToTransmitter: Calibration?, firmware: String?, useOtherApp: Bool) {
|
||||
|
||||
// call super.init
|
||||
super.init(address: address, name: name, transmitterID: transmitterID, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate, cGMG5TransmitterDelegate: cGMG6TransmitterDelegate, cGMTransmitterDelegate: cGMTransmitterDelegate, transmitterStartDate: transmitterStartDate, sensorStartDate: sensorStartDate, calibrationToSendToTransmitter: calibrationToSendToTransmitter, firmware: firmware)
|
||||
|
||||
isFireflyNoMatterTransmitterId = true
|
||||
|
||||
self.useOtherApp = useOtherApp
|
||||
|
||||
}
|
||||
|
||||
override func cgmTransmitterType() -> CGMTransmitterType {
|
||||
|
||||
return .dexcomG6Firefly
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -20,12 +20,12 @@ protocol CGMTransmitter:AnyObject {
|
|||
/// --- for transmitters who support webOOP (Bubble, MiaoMiao, ..) this should be implemented
|
||||
func setWebOOPEnabled(enabled:Bool)
|
||||
|
||||
/// - is the CGMTransmitter web oop enabled or not
|
||||
/// is the CGMTransmitter web oop enabled or not
|
||||
/// - webOOPEnabled means actually the transmitter sends calibrated data (which is the case also for Dexcom G6 firefly for example, and Libre 2 using Libre algorithm)
|
||||
/// - default implementation returns false
|
||||
func isWebOOPEnabled() -> Bool
|
||||
|
||||
/// - if true then the calibration is possible, even though the transmitter sends calibrated values (which is the case for Dexcom G6 firefly)
|
||||
/// if true then the calibration is possible, even though the transmitter sends calibrated values (which is the case for Dexcom G6 firefly)
|
||||
/// - default false
|
||||
func overruleIsWebOOPEnabled() -> Bool
|
||||
|
||||
|
@ -35,18 +35,18 @@ protocol CGMTransmitter:AnyObject {
|
|||
/// only applicable for Libre transmitters. To request a new reading.
|
||||
func requestNewReading()
|
||||
|
||||
/// - maximum sensor age in days, nil if no maximum
|
||||
/// maximum sensor age in days, nil if no maximum
|
||||
/// - default implementation returns nil
|
||||
func maxSensorAgeInDays() -> Int?
|
||||
|
||||
/// - to send a start sensor command to the transmitter
|
||||
/// to send a start sensor command to the transmitter
|
||||
/// - only useful for Dexcom - firefly type of transmitters, other transmitter types will have an empty implementation
|
||||
/// - parameters:
|
||||
/// - sensorCode : only to be filled in if code known, only applicable for Dexcom firefly
|
||||
/// - startDate : sensor start timeStamp
|
||||
func startSensor(sensorCode: String?, startDate: Date)
|
||||
|
||||
/// - to send a stop sensor command to the transmitter
|
||||
/// to send a stop sensor command to the transmitter
|
||||
/// - only useful for Dexcom type of transmitters, other transmitter types will have an empty implementation
|
||||
func stopSensor(stopDate: Date)
|
||||
|
||||
|
@ -54,6 +54,14 @@ protocol CGMTransmitter:AnyObject {
|
|||
/// - only useful for Dexcom type of transmitters, other transmitter types will have an empty implementation
|
||||
func calibrate(calibration: Calibration)
|
||||
|
||||
/// - should user give sensor start time when starting a sensor
|
||||
/// - default true
|
||||
func needsSensorStartTime() -> Bool
|
||||
|
||||
/// - should user give sensor start code when starting a sensor
|
||||
/// - default false
|
||||
func needsSensorStartCode() -> Bool
|
||||
|
||||
}
|
||||
|
||||
/// cgm transmitter types
|
||||
|
@ -62,15 +70,8 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
/// dexcom G4 using xdrip, xbridge, ...
|
||||
case dexcomG4 = "Dexcom G4"
|
||||
|
||||
/// dexcom G5
|
||||
case dexcomG5 = "Dexcom G5"
|
||||
|
||||
/// - dexcom G6 - for non Firefly - although it can also be used for firefly
|
||||
/// - only difference with firefly, is that sensorCode will not be asked (which is needed for firefly), and user will be asked to set a sensor start time (in case of firefly it's always the actual time that is used as start time)
|
||||
case dexcomG6 = "Dexcom G6"
|
||||
|
||||
/// dexcom G6 firefly
|
||||
case dexcomG6Firefly = "Dexcom G6 Firefly"
|
||||
/// dexcom G5, G6
|
||||
case dexcom = "Dexcom"
|
||||
|
||||
/// miaomiao
|
||||
case miaomiao = "MiaoMiao"
|
||||
|
@ -104,7 +105,7 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
|
||||
switch self {
|
||||
|
||||
case .dexcomG4, .dexcomG5, .dexcomG6, .dexcomG6Firefly :
|
||||
case .dexcomG4, .dexcom:
|
||||
return .Dexcom
|
||||
|
||||
case .miaomiao, .Bubble, .GNSentry, .Droplet1, .blueReader, .watlaa, .Blucon, .Libre2, .Atom:
|
||||
|
@ -126,11 +127,9 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
case .dexcomG4:
|
||||
return false
|
||||
|
||||
case .dexcomG5, .dexcomG6:
|
||||
return false
|
||||
|
||||
case .dexcomG6Firefly:
|
||||
// for firefly, we receive the sensorStart time from the transmitter, this will be used to determine if a new sensor is received
|
||||
case .dexcom:
|
||||
// for dexcom in native algorithm mode, we receive the sensorStart time from the transmitter, this will be used to determine if a new sensor is received
|
||||
// the others will not send sensorStart and will also not send sensorAge
|
||||
return true
|
||||
|
||||
case .miaomiao, .Bubble:
|
||||
|
@ -167,10 +166,7 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
|
||||
switch self {
|
||||
|
||||
case .dexcomG4, .dexcomG5, .dexcomG6, .GNSentry, .Droplet1, .blueReader, .watlaa:
|
||||
return true
|
||||
|
||||
case .dexcomG6Firefly:
|
||||
case .dexcomG4, .dexcom, .GNSentry, .Droplet1, .blueReader, .watlaa:
|
||||
return true
|
||||
|
||||
case .miaomiao, .Bubble, .Blucon, .Libre2, .Atom:
|
||||
|
@ -187,7 +183,7 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
case .dexcomG4:
|
||||
return ConstantsDefaultAlertLevels.defaultBatteryAlertLevelDexcomG4
|
||||
|
||||
case .dexcomG5, .dexcomG6, .dexcomG6Firefly:
|
||||
case .dexcom:
|
||||
return ConstantsDefaultAlertLevels.defaultBatteryAlertLevelDexcomG5
|
||||
|
||||
case .miaomiao:
|
||||
|
@ -230,7 +226,7 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
case .dexcomG4:
|
||||
return ""
|
||||
|
||||
case .dexcomG5, .dexcomG6, .dexcomG6Firefly:
|
||||
case .dexcom:
|
||||
return "voltA"
|
||||
|
||||
case .miaomiao, .Bubble, .Droplet1:
|
||||
|
@ -257,37 +253,6 @@ enum CGMTransmitterType:String, CaseIterable {
|
|||
}
|
||||
}
|
||||
|
||||
/// - if user starts, sensor, does it require a code?
|
||||
/// - only true for Dexcom G6 firefly type of transmitters
|
||||
func needsSensorStartCode() -> Bool {
|
||||
|
||||
switch self {
|
||||
|
||||
case .dexcomG6Firefly:
|
||||
return true
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// - if user starts, sensor, does it require to give the start time?
|
||||
/// - only false for Dexcom G6 type of transmitters - all other true
|
||||
func needsSensorStartTime() -> Bool {
|
||||
|
||||
switch self {
|
||||
|
||||
case .dexcomG6Firefly:
|
||||
return false
|
||||
|
||||
default:
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension CGMTransmitter {
|
||||
|
@ -322,4 +287,10 @@ extension CGMTransmitter {
|
|||
// default implementation, does nothing
|
||||
func calibrate(calibration: Calibration) {}
|
||||
|
||||
// default implementation, returns true
|
||||
func needsSensorStartTime() -> Bool {return true}
|
||||
|
||||
// default implementation, returns false
|
||||
func needsSensorStartCode() -> Bool {return false}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class DexcomG5: NSManagedObject {
|
|||
|
||||
super.init(entity: entity, insertInto: nsManagedObjectContext)
|
||||
|
||||
blePeripheral = BLEPeripheral(address: address, name: name, alias: nil, bluetoothPeripheralType: .DexcomG5Type, nsManagedObjectContext: nsManagedObjectContext)
|
||||
blePeripheral = BLEPeripheral(address: address, name: name, alias: nil, bluetoothPeripheralType: .DexcomType, nsManagedObjectContext: nsManagedObjectContext)
|
||||
}
|
||||
|
||||
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?) {
|
||||
|
|
|
@ -26,10 +26,6 @@ extension DexcomG5 {
|
|||
|
||||
@NSManaged public var lastResetTimeStamp: Date?
|
||||
|
||||
@NSManaged public var isDexcomG6: Bool
|
||||
|
||||
@NSManaged public var isFirefly: Bool
|
||||
|
||||
@NSManaged public var transmitterStartDate: Date?
|
||||
|
||||
/// - contains sensor start date, received from transmitter
|
||||
|
|
|
@ -104,8 +104,6 @@
|
|||
<attribute name="batteryStatus" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="batteryTemperature" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||
<attribute name="firmwareVersion" optional="YES" attributeType="String"/>
|
||||
<attribute name="isDexcomG6" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="isFirefly" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
|
||||
<attribute name="lastResetTimeStamp" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||
<attribute name="sensorStartDate" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||
<attribute name="sensorStatus" optional="YES" attributeType="String"/>
|
||||
|
@ -171,7 +169,7 @@
|
|||
<element name="Bubble" positionX="-657" positionY="189" width="128" height="88"/>
|
||||
<element name="Calibration" positionX="-859.21484375" positionY="46.21484375" width="128" height="299"/>
|
||||
<element name="DexcomG4" positionX="-621" positionY="225" width="128" height="58"/>
|
||||
<element name="DexcomG5" positionX="-648" positionY="198" width="128" height="254"/>
|
||||
<element name="DexcomG5" positionX="-648" positionY="198" width="128" height="224"/>
|
||||
<element name="Droplet" positionX="-630" positionY="216" width="128" height="58"/>
|
||||
<element name="GNSEntry" positionX="-648" positionY="198" width="128" height="103"/>
|
||||
<element name="Libre2" positionX="-648" positionY="198" width="128" height="58"/>
|
||||
|
|
|
@ -58,7 +58,7 @@ extension BluetoothPeripheralManager: CGMG5TransmitterDelegate {
|
|||
|
||||
}
|
||||
|
||||
func received(sensorStartDate: Date, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
func received(sensorStartDate: Date?, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
|
||||
guard let dexcomG5 = getDexcomG5(cGMG5Transmitter: cGMG5Transmitter) else {return}
|
||||
|
||||
|
@ -68,7 +68,7 @@ extension BluetoothPeripheralManager: CGMG5TransmitterDelegate {
|
|||
|
||||
}
|
||||
|
||||
func received(sensorStatus: String, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
func received(sensorStatus: String?, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
|
||||
guard let dexcomG5 = getDexcomG5(cGMG5Transmitter: cGMG5Transmitter) else {return}
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
import Foundation
|
||||
|
||||
extension BluetoothPeripheralManager: CGMG6TransmitterDelegate {
|
||||
|
||||
// apparently conforms by conforming to CGMG5TransmitterDelegate, as I see no compile errors
|
||||
|
||||
}
|
|
@ -157,9 +157,8 @@ class BluetoothPeripheralManager: NSObject {
|
|||
|
||||
}
|
||||
|
||||
case .DexcomG5Type, .DexcomG6Type, .DexcomG6FireflyType:
|
||||
case .DexcomType:
|
||||
|
||||
// both DexcomG5Type and DexcomG6Type are stored in blePeripheral as dexcomG5
|
||||
if let dexcomG5orG6 = blePeripheral.dexcomG5 {
|
||||
|
||||
// add it to the list of bluetoothPeripherals
|
||||
|
@ -169,22 +168,10 @@ class BluetoothPeripheralManager: NSObject {
|
|||
|
||||
if let transmitterId = dexcomG5orG6.blePeripheral.transmitterId {
|
||||
|
||||
// create an instance of CGMG5Transmitter (or CGMG6Transmitter), CGMG5Transmitter (or CGMG6Transmitter) will automatically try to connect to the dexcom with the address that is stored in dexcom
|
||||
// create an instance of CGMG5Transmitter, will automatically try to connect to the dexcom with the address that is stored in dexcom
|
||||
// add it to the array of bluetoothTransmitters
|
||||
if !dexcomG5orG6.isDexcomG6 && !dexcomG5orG6.isFirefly {
|
||||
|
||||
bluetoothTransmitters.insert(CGMG5Transmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG5TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion), at: index)
|
||||
|
||||
} else if !dexcomG5orG6.isFirefly {
|
||||
|
||||
bluetoothTransmitters.insert(CGMG6Transmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG6TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion), at: index)
|
||||
bluetoothTransmitters.insert(CGMG5Transmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG5TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion, webOOPEnabled: dexcomG5orG6.blePeripheral.webOOPEnabled), at: index)
|
||||
|
||||
} else {
|
||||
|
||||
bluetoothTransmitters.insert(CGMG6FireflyTransmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG6TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion, useOtherApp: dexcomG5orG6.useOtherApp), at: index)
|
||||
|
||||
}
|
||||
|
||||
// if DexcomG5Type is of type CGM, then assign the address to currentCgmTransmitterAddress, there shouldn't be any other bluetoothPeripherals of type .CGM with shouldconnect = true
|
||||
if bluetoothPeripheralType.category() == .CGM {
|
||||
currentCgmTransmitterAddress = blePeripheral.address
|
||||
|
@ -525,7 +512,7 @@ class BluetoothPeripheralManager: NSObject {
|
|||
// no need to send reading to watlaa in master mode
|
||||
break
|
||||
|
||||
case .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type, .Libre2Type, .AtomType, .DexcomG6FireflyType:
|
||||
case .DexcomType, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .Libre2Type, .AtomType:
|
||||
// cgm's don't receive reading, they send it
|
||||
break
|
||||
|
||||
|
@ -592,25 +579,13 @@ class BluetoothPeripheralManager: NSObject {
|
|||
|
||||
}
|
||||
|
||||
case .DexcomG5Type, .DexcomG6Type, .DexcomG6FireflyType:
|
||||
case .DexcomType:
|
||||
|
||||
if let dexcomG5orG6 = bluetoothPeripheral as? DexcomG5 {
|
||||
|
||||
if let transmitterId = dexcomG5orG6.blePeripheral.transmitterId, let cgmTransmitterDelegate = cgmTransmitterDelegate {
|
||||
|
||||
if !dexcomG5orG6.isDexcomG6 && !dexcomG5orG6.isFirefly {
|
||||
|
||||
newTransmitter = CGMG5Transmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG5TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion)
|
||||
|
||||
} else if !dexcomG5orG6.isFirefly {
|
||||
|
||||
newTransmitter = CGMG6Transmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG6TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion)
|
||||
|
||||
} else {
|
||||
|
||||
newTransmitter = CGMG6FireflyTransmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG6TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion, useOtherApp: dexcomG5orG6.useOtherApp)
|
||||
|
||||
}
|
||||
newTransmitter = CGMG5Transmitter(address: dexcomG5orG6.blePeripheral.address, name: dexcomG5orG6.blePeripheral.name, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMG5TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: dexcomG5orG6.transmitterStartDate, sensorStartDate: dexcomG5orG6.sensorStartDate, calibrationToSendToTransmitter: calibrationsAccessor.lastCalibrationForActiveSensor(withActivesensor: sensorsAccessor.fetchActiveSensor()), firmware: dexcomG5orG6.firmwareVersion, webOOPEnabled: dexcomG5orG6.blePeripheral.webOOPEnabled)
|
||||
|
||||
|
||||
} else {
|
||||
|
@ -789,20 +764,10 @@ class BluetoothPeripheralManager: NSObject {
|
|||
return .WatlaaType
|
||||
}
|
||||
|
||||
case .DexcomG5Type:
|
||||
// every CGMG6Transmitter and CGMG6FireflyTransmitter is CGMG5Transmitter, check that
|
||||
if bluetoothTransmitter is CGMG5Transmitter && !(bluetoothTransmitter is CGMG6Transmitter) && !(bluetoothTransmitter is CGMG6FireflyTransmitter){
|
||||
return .DexcomG5Type
|
||||
}
|
||||
|
||||
case .DexcomG6Type:
|
||||
if bluetoothTransmitter is CGMG6Transmitter {
|
||||
return .DexcomG6Type
|
||||
}
|
||||
|
||||
case .DexcomG6FireflyType:
|
||||
if bluetoothTransmitter is CGMG6FireflyTransmitter {
|
||||
return .DexcomG6FireflyType
|
||||
case .DexcomType:
|
||||
|
||||
if bluetoothTransmitter is CGMG5Transmitter {
|
||||
return .DexcomType
|
||||
}
|
||||
|
||||
case .BubbleType:
|
||||
|
@ -874,29 +839,13 @@ class BluetoothPeripheralManager: NSObject {
|
|||
|
||||
return WatlaaBluetoothTransmitter(address: nil, name: nil, cgmTransmitterDelegate: cgmTransmitterDelegate, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate ?? self, watlaaBluetoothTransmitterDelegate: self, sensorSerialNumber: nil, webOOPEnabled: nil, nonFixedSlopeEnabled: nil)
|
||||
|
||||
case .DexcomG5Type:
|
||||
case .DexcomType:
|
||||
|
||||
guard let transmitterId = transmitterId, let cgmTransmitterDelegate = cgmTransmitterDelegate else {
|
||||
fatalError("in createNewTransmitter, type DexcomG5Type, transmitterId is nil or cgmTransmitterDelegate is nil")
|
||||
fatalError("in createNewTransmitter, type DexcomType, transmitterId is nil or cgmTransmitterDelegate is nil")
|
||||
}
|
||||
|
||||
return CGMG5Transmitter(address: nil, name: nil, transmitterID: transmitterId, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate ?? self, cGMG5TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: nil, sensorStartDate: nil, calibrationToSendToTransmitter: nil, firmware: nil)
|
||||
|
||||
case .DexcomG6Type:
|
||||
|
||||
guard let transmitterId = transmitterId, let cgmTransmitterDelegate = cgmTransmitterDelegate else {
|
||||
fatalError("in createNewTransmitter, type DexcomG6Type, transmitterId is nil or cgmTransmitterDelegate is nil")
|
||||
}
|
||||
|
||||
return CGMG6Transmitter(address: nil, name: nil, transmitterID: transmitterId, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate ?? self, cGMG6TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: nil, sensorStartDate: nil, calibrationToSendToTransmitter: nil, firmware: nil)
|
||||
|
||||
case .DexcomG6FireflyType:
|
||||
|
||||
guard let transmitterId = transmitterId, let cgmTransmitterDelegate = cgmTransmitterDelegate else {
|
||||
fatalError("in createNewTransmitter, type DexcomG6FireflyType, transmitterId is nil or cgmTransmitterDelegate is nil")
|
||||
}
|
||||
|
||||
return CGMG6FireflyTransmitter(address: nil, name: nil, transmitterID: transmitterId, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate ?? self, cGMG6TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: nil, sensorStartDate: nil, calibrationToSendToTransmitter: nil, firmware: nil, useOtherApp: false)
|
||||
return CGMG5Transmitter(address: nil, name: nil, transmitterID: transmitterId, bluetoothTransmitterDelegate: bluetoothTransmitterDelegate ?? self, cGMG5TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, transmitterStartDate: nil, sensorStartDate: nil, calibrationToSendToTransmitter: nil, firmware: nil, webOOPEnabled: nil)
|
||||
|
||||
case .BubbleType:
|
||||
|
||||
|
@ -1201,7 +1150,7 @@ class BluetoothPeripheralManager: NSObject {
|
|||
bluetoothPeripheral.blePeripheral.parameterUpdateNeededAtNextConnect = true
|
||||
}
|
||||
|
||||
case .WatlaaType, .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type, .Libre2Type, .AtomType, .DexcomG6FireflyType:
|
||||
case .WatlaaType, .DexcomType, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .Libre2Type, .AtomType:
|
||||
|
||||
// nothing to check
|
||||
break
|
||||
|
|
|
@ -27,10 +27,8 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "رقم هوية جهاز الإرسال";
|
||||
"settingsviews_givetransmitterid" = "أدخل رقم هوية جهاز الإرسال";
|
||||
"settingsviews_resettransmitter" = "إعادة تعيين جهاز الإرسال";
|
||||
"settingsviews_webooptransmitter" = "استخدم خوارزمية ليبري?";
|
||||
"settingsviews_nonfixedtransmitter" = "تفعيل المعايرة متعددة النقاط ?";
|
||||
"settingsviews_labelNonFixed" = "المعايرة متعددة النقاط";
|
||||
"settingsviews_labelWebOOP" = "خوارزمية xDrip أو Libre";
|
||||
"settingsviews_sectiontitlealerting" = "التنبيهات";
|
||||
"settingsviews_row_alert_types" = "أنواع التنبيهات";
|
||||
"settingsviews_row_alerts" = "التنبيهات";
|
||||
|
|
|
@ -62,9 +62,6 @@
|
|||
/// name of setting for back ground color
|
||||
"m5stack_settingsviews_backGroundColor" = "Hintergrund Farbe";
|
||||
|
||||
/// weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section
|
||||
"settingsviews_labelWebOOP" = "xDrip oder Libre Algorithmus";
|
||||
|
||||
/// nightscout settings, section title
|
||||
"settingsviews_sectiontitlenightscout" = "NightScout";
|
||||
|
||||
|
@ -158,9 +155,6 @@
|
|||
/// dexcom share settings, pop up that asks user to enter dexcom share password
|
||||
"settingsviews_giveDexcomSharePassword" = "Eingabe Dexcom Share Passwort";
|
||||
|
||||
/// web oop settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_webooptransmitter" = "Libre Algorithmus benutzen?";
|
||||
|
||||
/// When creating schedule for Nightscout or Dexcom Share upload, this is the top label text
|
||||
"timeScheduleViewTitle" = "An/Aus für geplanten upload ";
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "Transmitter ID";
|
||||
"settingsviews_givetransmitterid" = "Enter Transmitter ID";
|
||||
"settingsviews_resettransmitter" = "Reset Transmitter";
|
||||
"settingsviews_webooptransmitter" = "Use Libre Algorithm?";
|
||||
"settingsviews_webooptransmitter" = "Use Transmitter Algorithm?";
|
||||
"settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?";
|
||||
"settingsviews_labelNonFixed" = "Multi-point Calibration";
|
||||
"settingsviews_labelWebOOP" = "xDrip or Libre Algorithm";
|
||||
"settingsviews_labelWebOOP" = "xDrip or Transmitter Algorithm";
|
||||
"settingsviews_sectiontitlealerting" = "Alarms";
|
||||
"settingsviews_row_alert_types" = "Alarm Types";
|
||||
"settingsviews_row_alerts" = "Alarms";
|
||||
|
|
|
@ -32,10 +32,8 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "ID del Transmisor";
|
||||
"settingsviews_givetransmitterid" = "ID del Transmisor";
|
||||
"settingsviews_resettransmitter" = "Resetear Transmisor";
|
||||
"settingsviews_webooptransmitter" = "Usar Algoritmo Libre?";
|
||||
"settingsviews_nonfixedtransmitter" = "Habilitar Calibración Multi-punto?";
|
||||
"settingsviews_labelNonFixed" = "Calibración Multi-punto";
|
||||
"settingsviews_labelWebOOP" = "Algoritmo xDrip o Libre";
|
||||
"settingsviews_sectiontitlealerting" = "Alarmas";
|
||||
"settingsviews_row_alert_types" = "Tipos de Alarmas";
|
||||
"settingsviews_row_alerts" = "Alarmas";
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "Lähettimen ID";
|
||||
"settingsviews_givetransmitterid" = "Anna lähetettimen ID";
|
||||
"settingsviews_resettransmitter" = "Nollaa lähetin";
|
||||
"settingsviews_webooptransmitter" = "Käytä Libre algorithmiä?";
|
||||
"settingsviews_nonfixedtransmitter" = "Käytä monipistekalibrointia?";
|
||||
"settingsviews_labelNonFixed" = "Monipistekalibrointi";
|
||||
"settingsviews_labelWebOOP" = "xDrip vai Libre algorithmi";
|
||||
"settingsviews_sectiontitlealerting" = "Hälytys";
|
||||
"settingsviews_row_alert_types" = "Hälytystyypit";
|
||||
"settingsviews_row_alerts" = "Hälytykset";
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "Transmetteur ID";
|
||||
"settingsviews_givetransmitterid" = "Entrer Transmetteur ID";
|
||||
"settingsviews_resettransmitter" = "Réinitialiser Transmetteur";
|
||||
"settingsviews_webooptransmitter" = "Utiliser l'algorithme Libre?";
|
||||
"settingsviews_labelWebOOP" = "Algorithme xDrip ou Libre";
|
||||
"settingsviews_sectiontitlealerting" = "Alarme";
|
||||
"settingsviews_row_alert_types" = "Types d'alarme";
|
||||
"settingsviews_row_alerts" = "Alarmes";
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
/// non fixed calibration slopes settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?";
|
||||
|
||||
/// web oop settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_webooptransmitter" = "Use Libre Algorithm?";
|
||||
|
||||
/// speak settings, where enable or disable speak trend
|
||||
"settingsviews_speakTrend" = "Speak Trend?";
|
||||
|
||||
|
@ -78,9 +75,6 @@
|
|||
/// speak settings, where user can enable or disable speak delta
|
||||
"settingsviews_speakDelta" = "Speak Delta?";
|
||||
|
||||
/// weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section
|
||||
"settingsviews_labelWebOOP" = "xDrip or Libre Algorithm";
|
||||
|
||||
/// nightscout or dexcom share settings, where user can select to edit the schedule
|
||||
"schedule" = "Schedule:";
|
||||
|
||||
|
|
|
@ -32,10 +32,8 @@
|
|||
"settingsviews_sectiontitletransmitter" = "Transmitter";
|
||||
"settingsviews_givetransmitterid" = "Voer Transmitter ID In";
|
||||
"settingsviews_resettransmitter" = "Reset Transmitter";
|
||||
"settingsviews_webooptransmitter" = "Gebruik Libre Algoritme?";
|
||||
"settingsviews_nonfixedtransmitter" = "Schakel Meerpuntskalibratie In?";
|
||||
"settingsviews_labelNonFixed" = "Meerpuntskalibratie";
|
||||
"settingsviews_labelWebOOP" = "xDrip of Libre Algoritme";
|
||||
"settingsviews_sectiontitlealerting" = "Alarmen";
|
||||
"settingsviews_row_alert_types" = "Alarm Types";
|
||||
"settingsviews_row_alerts" = "Alarmen";
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
/// non fixed calibration slopes settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?";
|
||||
|
||||
/// web oop settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_webooptransmitter" = "Use Libre Algorithm?";
|
||||
|
||||
/// speak settings, where enable or disable speak trend
|
||||
"settingsviews_speakTrend" = "Speak Trend?";
|
||||
|
||||
|
@ -78,9 +75,6 @@
|
|||
/// speak settings, where user can enable or disable speak delta
|
||||
"settingsviews_speakDelta" = "Speak Delta?";
|
||||
|
||||
/// weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section
|
||||
"settingsviews_labelWebOOP" = "xDrip or Libre Algorithm";
|
||||
|
||||
/// nightscout or dexcom share settings, where user can select to edit the schedule
|
||||
"schedule" = "Schedule:";
|
||||
|
||||
|
|
|
@ -34,10 +34,8 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "ID de Transmissor";
|
||||
"settingsviews_givetransmitterid" = "Introduzir ID Transmissor";
|
||||
"settingsviews_resettransmitter" = "Repor Transmissor:";
|
||||
"settingsviews_webooptransmitter" = "Utilizar Algoritmo do Libre?";
|
||||
"settingsviews_nonfixedtransmitter" = "Activar Calibração Multi-ponto?";
|
||||
"settingsviews_labelNonFixed" = "Calibração Multi-ponto";
|
||||
"settingsviews_labelWebOOP" = "xDrip ou Algoritmo do Libre";
|
||||
"settingsviews_sectiontitlealerting" = "Alarme";
|
||||
"settingsviews_row_alert_types" = "Tipos de Alarmes";
|
||||
"settingsviews_row_alerts" = "Alarmes";
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
/// non fixed calibration slopes settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?";
|
||||
|
||||
/// web oop settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_webooptransmitter" = "Use Libre Algorithm?";
|
||||
|
||||
/// speak settings, where enable or disable speak trend
|
||||
"settingsviews_speakTrend" = "Speak Trend?";
|
||||
|
||||
|
@ -78,9 +75,6 @@
|
|||
/// speak settings, where user can enable or disable speak delta
|
||||
"settingsviews_speakDelta" = "Speak Delta?";
|
||||
|
||||
/// weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section
|
||||
"settingsviews_labelWebOOP" = "xDrip or Libre Algorithm";
|
||||
|
||||
/// nightscout or dexcom share settings, where user can select to edit the schedule
|
||||
"schedule" = "Schedule:";
|
||||
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
/// non fixed calibration slopes settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?";
|
||||
|
||||
/// web oop settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_webooptransmitter" = "Use Libre Algorithm?";
|
||||
|
||||
/// speak settings, where enable or disable speak trend
|
||||
"settingsviews_speakTrend" = "Speak Trend?";
|
||||
|
||||
|
@ -78,9 +75,6 @@
|
|||
/// speak settings, where user can enable or disable speak delta
|
||||
"settingsviews_speakDelta" = "Speak Delta?";
|
||||
|
||||
/// weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section
|
||||
"settingsviews_labelWebOOP" = "xDrip or Libre Algorithm";
|
||||
|
||||
/// nightscout or dexcom share settings, where user can select to edit the schedule
|
||||
"schedule" = "Schedule:";
|
||||
|
||||
|
|
|
@ -31,10 +31,8 @@
|
|||
"settingsviews_transmitterid_text_for_button" = "Sändar-ID";
|
||||
"settingsviews_givetransmitterid" = "Ange sändar-ID";
|
||||
"settingsviews_resettransmitter" = "Återställ sändare";
|
||||
"settingsviews_webooptransmitter" = "Använd Libre-algoritm?";
|
||||
"settingsviews_nonfixedtransmitter" = "Använd flerpunktskalibrering?";
|
||||
"settingsviews_labelNonFixed" = "Flerpunktskalibrering";
|
||||
"settingsviews_labelWebOOP" = "xDrip- eller Libre-algoritm";
|
||||
"settingsviews_sectiontitlealerting" = "Larm";
|
||||
"settingsviews_row_alert_types" = "Typ av larm";
|
||||
"settingsviews_row_alerts" = "Larm";
|
||||
|
|
|
@ -57,9 +57,6 @@
|
|||
/// non fixed calibration slopes settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_nonfixedtransmitter" = "Enable Multi-point Calibration?";
|
||||
|
||||
/// web oop settings in bluetooth peripheral view : enabled or not
|
||||
"settingsviews_webooptransmitter" = "Use Libre Algorithm?";
|
||||
|
||||
/// Apple Watch Settings - text in row where user needs to say if unit should be displayed or not
|
||||
"displayUnitInCalendarEvent" = "Display Unit?";
|
||||
|
||||
|
@ -90,9 +87,6 @@
|
|||
///
|
||||
"settingsviews_urgentLowValue" = "Urgent Low Value:";
|
||||
|
||||
/// weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section
|
||||
"settingsviews_labelWebOOP" = "xDrip or Libre Algorithm";
|
||||
|
||||
/// nightscout or dexcom share settings, where user can select to edit the schedule
|
||||
"schedule" = "Schedule:";
|
||||
|
||||
|
|
|
@ -172,11 +172,11 @@ class Texts_SettingsView {
|
|||
}()
|
||||
|
||||
static let labelWebOOPTransmitter:String = {
|
||||
return NSLocalizedString("settingsviews_webooptransmitter", tableName: filename, bundle: Bundle.main, value: "Use Libre Algorithm?", comment: "web oop settings in bluetooth peripheral view : enabled or not")
|
||||
return NSLocalizedString("settingsviews_webooptransmitter", tableName: filename, bundle: Bundle.main, value: "Use Transmitter Algorithm?", comment: "web oop settings in bluetooth peripheral view : enabled or not")
|
||||
}()
|
||||
|
||||
static let labelWebOOP:String = {
|
||||
return NSLocalizedString("settingsviews_labelWebOOP", tableName: filename, bundle: Bundle.main, value: "xDrip or Libre Algorithm", comment: "weboop settings, title of the dialogs where site and token are asked - also used when viewing bluetoothperipheral settings, the title of the section")
|
||||
return NSLocalizedString("settingsviews_labelWebOOP", tableName: filename, bundle: Bundle.main, value: "xDrip or Transmitter Algorithm", comment: "weboop settings, title of the dialogs where user can select between xdrip or transmitter algorithm")
|
||||
}()
|
||||
|
||||
static let labelNonFixedTransmitter:String = {
|
||||
|
|
|
@ -363,7 +363,7 @@ class Trace {
|
|||
|
||||
}
|
||||
|
||||
case .DexcomG5Type, .DexcomG6Type, .DexcomG6FireflyType:
|
||||
case .DexcomType:
|
||||
if let dexcomG5 = blePeripheral.dexcomG5 {
|
||||
|
||||
traceInfo.appendStringAndNewLine(" type = " + bluetoothPeripheralType.rawValue)
|
||||
|
|
|
@ -264,27 +264,39 @@ class BluetoothPeripheralViewController: UIViewController {
|
|||
|
||||
// bluetoothPeripheral already known
|
||||
|
||||
// if it's a cgm transmitter type that supports web oop and non fixed slopes
|
||||
// then show the webOOP section and nonFixed section
|
||||
if let expectedBluetoothPeripheralType = expectedBluetoothPeripheralType, expectedBluetoothPeripheralType.canWebOOP(), expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
|
||||
// mark web oop and non fixed slope settings sections as shown
|
||||
webOOPSettingsSectionIsShown = true
|
||||
nonFixedSettingsSectionIsShown = true
|
||||
|
||||
return 3
|
||||
|
||||
// if bluetoothPeripheral already known,
|
||||
// and it's a cgm transmitter type that supports non fixed slopes but doesn't support weboop
|
||||
// then show only the nonFixed section
|
||||
} else if let expectedBluetoothPeripheralType = expectedBluetoothPeripheralType, expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
|
||||
// mark web oop and non fixed slope settings sections as not shown
|
||||
webOOPSettingsSectionIsShown = false
|
||||
nonFixedSettingsSectionIsShown = true
|
||||
|
||||
return 2
|
||||
|
||||
// unwrap expectedBluetoothPeripheralType
|
||||
if let expectedBluetoothPeripheralType = expectedBluetoothPeripheralType {
|
||||
// zzz : hier op basis van cgmtransmitter eventueel canweboop op false zetten
|
||||
if expectedBluetoothPeripheralType.canWebOOP(), expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
|
||||
// mark web oop and non fixed slope settings sections as shown
|
||||
webOOPSettingsSectionIsShown = true
|
||||
nonFixedSettingsSectionIsShown = true
|
||||
|
||||
return 3
|
||||
|
||||
} else if expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
|
||||
// mark web oop and non fixed slope settings sections as not shown
|
||||
webOOPSettingsSectionIsShown = false
|
||||
nonFixedSettingsSectionIsShown = true
|
||||
|
||||
return 2
|
||||
|
||||
} else if expectedBluetoothPeripheralType.canWebOOP() {
|
||||
|
||||
// mark web oop and non fixed slope settings sections as not shown
|
||||
webOOPSettingsSectionIsShown = true
|
||||
nonFixedSettingsSectionIsShown = false
|
||||
|
||||
return 2
|
||||
|
||||
} else {
|
||||
|
||||
return 1
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -805,29 +817,30 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
|
||||
if section == 1 {
|
||||
|
||||
// if the bluetoothperipheral type supports non fixed then this is the non fixed
|
||||
if expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
// if the bluetoothperipheral type supports non fixed slope or oopweb then this section is one of them, number of rows is 1
|
||||
if expectedBluetoothPeripheralType.canUseNonFixedSlope() || expectedBluetoothPeripheralType.canWebOOP() {
|
||||
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
|
||||
// so it's section 1 (ie the second section), and both canUseNonFixedSlope and canWebOOP are false, means it's none of those two sections, so it's bluetoothperipheral type specific section
|
||||
// don't return any, will jump to bluetoothPeripheralViewModel.numberOfSettings(inSection: section)
|
||||
|
||||
}
|
||||
|
||||
} else if section == 2 {
|
||||
|
||||
// if the bluetoothperipheral type supports oopweb then this is the oop web section
|
||||
if expectedBluetoothPeripheralType.canWebOOP() {
|
||||
|
||||
// check if weboopenabled and if yes return the number of settings in that section
|
||||
if let bluetoothPeripheral = bluetoothPeripheral {
|
||||
|
||||
if bluetoothPeripheral.blePeripheral.webOOPEnabled {
|
||||
return WebOOPSettings.allCases.count
|
||||
}
|
||||
}
|
||||
|
||||
// weboop supported by the peripheral but not enabled
|
||||
// if the bluetoothperipheral type supports oopweb and canUseNonFixedSlope, then this is the oopwebsection
|
||||
if expectedBluetoothPeripheralType.canWebOOP() && expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
|
||||
/// there's only one row in that section
|
||||
return 1
|
||||
|
||||
} else {
|
||||
|
||||
// don't return any, will jump to bluetoothPeripheralViewModel.numberOfSettings(inSection: section)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -956,7 +969,8 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
|
||||
}
|
||||
|
||||
} else if indexPath.section == 1 {
|
||||
} else if indexPath.section == 1 && nonFixedSettingsSectionIsShown {
|
||||
|
||||
// non fixed calibration slope settings
|
||||
|
||||
guard let setting = NonFixedCalibrationSlopesSettings(rawValue: indexPath.row) else { fatalError("BluetoothPeripheralViewController cellForRowAt, Unexpected setting, row = " + indexPath.row.description) }
|
||||
|
@ -999,7 +1013,7 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
cell.accessoryType = .none
|
||||
|
||||
}
|
||||
} else if indexPath.section == 2 {
|
||||
} else if (indexPath.section == 1 && webOOPSettingsSectionIsShown) || (indexPath.section == 2 && webOOPSettingsSectionIsShown && nonFixedSettingsSectionIsShown) {
|
||||
|
||||
// web oop settings
|
||||
|
||||
|
@ -1033,17 +1047,17 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
|
||||
// if user switches on web oop, then we need to force also use of non-fixed slopes to off
|
||||
if isOn {
|
||||
|
||||
|
||||
bluetoothPeripheral.blePeripheral.nonFixedSlopeEnabled = false
|
||||
|
||||
bluetoothPeripheralManager.receivedNewValue(nonFixedSlopeEnabled: false, for: bluetoothPeripheral)
|
||||
|
||||
}
|
||||
|
||||
|
||||
// reload the section for nonFixedSettingsSectionNumber, even though the value may not have changed, because possibly isUserInteractionEnabled needs to be set to false for the nonFixedSettingsSectionNumber UISwitch
|
||||
// also reload webOOPSettingsSectionNumber
|
||||
tableView.reloadSections(IndexSet(arrayLiteral: self.nonFixedSettingsSectionNumber, self.webOOPSettingsSectionNumber), with: .none)
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -1051,6 +1065,10 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
cell.accessoryType = .none
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else if indexPath.section == 2 {
|
||||
// there should not be any other case
|
||||
|
||||
}
|
||||
|
||||
|
@ -1156,31 +1174,12 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
requestTransmitterId()
|
||||
}
|
||||
|
||||
} else if indexPath.section == 1 {
|
||||
// non fixed slopes settings
|
||||
} else {
|
||||
// it's either oop web setting or non-fixed slope setting
|
||||
|
||||
guard let setting = NonFixedCalibrationSlopesSettings(rawValue: indexPath.row) else { fatalError("BluetoothPeripheralViewController didSelectRowAt, Unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
||||
case .nonFixedSlopeEnabled:
|
||||
// this is a uiswitch, user needs to click the uiswitch, not just the row
|
||||
return
|
||||
}
|
||||
} else if indexPath.section == 2 {
|
||||
|
||||
// web oop settings
|
||||
|
||||
guard let setting = WebOOPSettings(rawValue: indexPath.row) else { fatalError("BluetoothPeripheralViewController didSelectRowAt, Unexpected setting") }
|
||||
|
||||
switch setting {
|
||||
|
||||
case .webOOPEnabled:
|
||||
// this is a uiswitch, user needs to click the uiswitch, not just the row
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
// this is a uiswitch, user needs to click the uiswitch, not just the row
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1190,6 +1189,9 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
// unwrap variables
|
||||
guard let bluetoothPeripheralViewModel = bluetoothPeripheralViewModel else {return nil}
|
||||
|
||||
// unwrap expectedBluetoothPeripheralType
|
||||
guard let expectedBluetoothPeripheralType = expectedBluetoothPeripheralType else {return ""}
|
||||
|
||||
if section == 0 {
|
||||
|
||||
// title for first section
|
||||
|
@ -1200,17 +1202,31 @@ extension BluetoothPeripheralViewController: UITableViewDataSource, UITableViewD
|
|||
// title defined in viewmodel
|
||||
return bluetoothPeripheralViewModel.sectionTitle(forSection: section)
|
||||
|
||||
} else if section == 2 {
|
||||
} else if section == 1 {
|
||||
|
||||
// if the bluetoothperipheral type supports non fixed slope then this is section 1
|
||||
if expectedBluetoothPeripheralType.canUseNonFixedSlope() {
|
||||
|
||||
return Texts_SettingsView.labelNonFixed
|
||||
|
||||
} else if expectedBluetoothPeripheralType.canWebOOP() {
|
||||
|
||||
return Texts_SettingsView.labelWebOOP
|
||||
|
||||
} else {
|
||||
|
||||
return "should not happen 1"
|
||||
|
||||
}
|
||||
|
||||
} else if section == 2 {
|
||||
|
||||
// web oop section
|
||||
return Texts_SettingsView.labelWebOOP
|
||||
|
||||
} else { //if section == 1
|
||||
|
||||
// non fixed section
|
||||
return Texts_SettingsView.labelNonFixed
|
||||
|
||||
}
|
||||
|
||||
return "should not happen 2"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -131,22 +131,7 @@ class DexcomG5BluetoothPeripheralViewModel {
|
|||
|
||||
/// screenTitle, can be overriden for G6
|
||||
public func dexcomScreenTitle() -> String {
|
||||
return BluetoothPeripheralType.DexcomG5Type.rawValue
|
||||
}
|
||||
|
||||
/// just a helper, can be overloaded, eg for firefly
|
||||
public func numberOfSectionsForThisTransmitter() -> Int {
|
||||
|
||||
return DexcomSection.allCases.count
|
||||
|
||||
}
|
||||
|
||||
/// number of rows to show from commondexcomsettings
|
||||
public func numberOfCommonDexcomSettings() -> Int {
|
||||
|
||||
// for non-fireflies, last row not shown
|
||||
return Settings.allCases.count - 2
|
||||
|
||||
return BluetoothPeripheralType.DexcomType.rawValue
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -362,7 +347,7 @@ extension DexcomG5BluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
|
||||
case .commonDexcomSettings:
|
||||
|
||||
return numberOfCommonDexcomSettings()
|
||||
return Settings.allCases.count
|
||||
|
||||
case .batterySettings:
|
||||
return TransmitterBatteryInfoSettings.allCases.count
|
||||
|
@ -376,7 +361,21 @@ extension DexcomG5BluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
|
|||
|
||||
func numberOfSections() -> Int {
|
||||
|
||||
return numberOfSectionsForThisTransmitter()
|
||||
if let bluetoothPeripheral = bluetoothPeripheral, let transmitterId = bluetoothPeripheral.blePeripheral.transmitterId {
|
||||
|
||||
if transmitterId.compare("8G") == .orderedDescending {
|
||||
|
||||
return DexcomSection.allCases.count - 1
|
||||
|
||||
} else {
|
||||
|
||||
return DexcomSection.allCases.count
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return DexcomSection.allCases.count
|
||||
|
||||
}
|
||||
|
||||
|
@ -451,7 +450,7 @@ extension DexcomG5BluetoothPeripheralViewModel: CGMG5TransmitterDelegate {
|
|||
}
|
||||
|
||||
/// received sensorStartDate
|
||||
func received(sensorStartDate: Date, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
func received(sensorStartDate: Date?, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
|
||||
(bluetoothPeripheralManager as? CGMG5TransmitterDelegate)?.received(sensorStartDate: sensorStartDate, cGMG5Transmitter: cGMG5Transmitter)
|
||||
|
||||
|
@ -464,7 +463,7 @@ extension DexcomG5BluetoothPeripheralViewModel: CGMG5TransmitterDelegate {
|
|||
}
|
||||
|
||||
/// received sensorStatus
|
||||
func received(sensorStatus: String, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
func received(sensorStatus: String?, cGMG5Transmitter: CGMG5Transmitter) {
|
||||
|
||||
(bluetoothPeripheralManager as? CGMG5TransmitterDelegate)?.received(sensorStatus: sensorStatus, cGMG5Transmitter: cGMG5Transmitter)
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
import Foundation
|
||||
import UIKit
|
||||
import CoreBluetooth
|
||||
|
||||
class DexcomG6BluetoothPeripheralViewModel: DexcomG5BluetoothPeripheralViewModel {
|
||||
|
||||
// MARK: - overriden functions
|
||||
|
||||
override public func dexcomScreenTitle() -> String {
|
||||
return BluetoothPeripheralType.DexcomG6Type.rawValue
|
||||
}
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
import Foundation
|
||||
import UIKit
|
||||
import CoreBluetooth
|
||||
|
||||
class DexcomG6FireflyBluetoothPeripheralViewModel: DexcomG5BluetoothPeripheralViewModel {
|
||||
|
||||
// MARK: - overriden functions
|
||||
|
||||
override public func dexcomScreenTitle() -> String {
|
||||
return BluetoothPeripheralType.DexcomG6FireflyType.rawValue
|
||||
}
|
||||
|
||||
/// - just a helper, can be overloaded, eg for firefly
|
||||
/// - returns:
|
||||
/// - 1 less than DexcomSection.allCases.count because we don't want to show the reset section for firefly transmitters
|
||||
public override func numberOfSectionsForThisTransmitter() -> Int {
|
||||
|
||||
return DexcomSection.allCases.count - 1
|
||||
|
||||
}
|
||||
|
||||
public override func numberOfCommonDexcomSettings() -> Int {
|
||||
|
||||
return Settings.allCases.count
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1542,13 +1542,32 @@ final class RootViewController: UIViewController {
|
|||
|
||||
switch cgmTransmitterType {
|
||||
|
||||
case .dexcomG4, .dexcomG5, .dexcomG6 :
|
||||
case .dexcomG4:
|
||||
|
||||
calibrator = DexcomCalibrator()
|
||||
|
||||
case .dexcomG6Firefly:
|
||||
case .dexcom:
|
||||
|
||||
calibrator = NoCalibrator()
|
||||
if cgmTransmitter.isWebOOPEnabled() {
|
||||
|
||||
// received values are already calibrated
|
||||
calibrator = NoCalibrator()
|
||||
|
||||
} else if cgmTransmitter.isNonFixedSlopeEnabled() {
|
||||
|
||||
// no oop web, fixed slope
|
||||
// should not occur, because Dexcom should have nonFixedSlopeEnabled false
|
||||
// if true for dexcom, then someone has set this to true but didn't create a non-fixed slope calibrator
|
||||
fatalError("cgmTransmitter.isNonFixedSlopeEnabled returns true for dexcom but there's no NonFixedSlopeCalibrator for Dexcom")
|
||||
|
||||
} else {
|
||||
|
||||
// no oop web, no fixed slope
|
||||
|
||||
calibrator = DexcomCalibrator()
|
||||
|
||||
}
|
||||
|
||||
|
||||
case .miaomiao, .GNSentry, .Blucon, .Bubble, .Droplet1, .blueReader, .watlaa, .Libre2, .Atom:
|
||||
|
||||
|
@ -1896,11 +1915,11 @@ final class RootViewController: UIViewController {
|
|||
startStopAction = UIAlertAction(title: Texts_HomeView.startSensorActionTitle, style: .default) { (UIAlertAction) in
|
||||
|
||||
// either sensor needs a sensor start time, or a sensor code .. or none
|
||||
if cgmTransmitter.cgmTransmitterType().needsSensorStartTime() {
|
||||
if cgmTransmitter.needsSensorStartTime() {
|
||||
|
||||
self.startSensorAskUserForStarttime(cGMTransmitter: cgmTransmitter)
|
||||
|
||||
} else if cgmTransmitter.cgmTransmitterType().needsSensorStartCode() {
|
||||
} else if cgmTransmitter.needsSensorStartCode() {
|
||||
|
||||
self.startSensorAskUserForSensorCode(cGMTransmitter: cgmTransmitter)
|
||||
|
||||
|
|
Loading…
Reference in New Issue