commented out Libre2 direct connectivity

This commit is contained in:
Johan Degraeve 2020-08-30 22:34:32 +02:00
parent 4514219513
commit d28919a4b3
9 changed files with 44 additions and 40 deletions

View File

@ -3390,7 +3390,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.2.17;
PRODUCT_BUNDLE_IDENTIFIER = net.johandegraeve.xdriptest;
PRODUCT_BUNDLE_IDENTIFIER = net.johandegraeve.xdripswift;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "xdrip/xdrip-Bridging-Header.h";
@ -3419,7 +3419,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.2.17;
PRODUCT_BUNDLE_IDENTIFIER = net.johandegraeve.xdriptest;
PRODUCT_BUNDLE_IDENTIFIER = net.johandegraeve.xdripswift;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "xdrip/xdrip-Bridging-Header.h";

View File

@ -3,7 +3,8 @@ import Foundation
extension Libre2: BluetoothPeripheral {
func bluetoothPeripheralType() -> BluetoothPeripheralType {
return .Libre2Type
return .BluconType
//return .Libre2Type
}
func overrideNeedsOOPWeb() -> Bool {

View File

@ -44,7 +44,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
case WatlaaType = "Watlaa"
/// Libre 2
case Libre2Type = "Libre2"
//case Libre2Type = "Libre2"
/// - returns: the BluetoothPeripheralViewModel. If nil then there's no specific settings for the tpe of bluetoothPeripheral
func viewModel() -> BluetoothPeripheralViewModel? {
@ -87,8 +87,8 @@ enum BluetoothPeripheralType: String, CaseIterable {
case .DexcomG6Type:
return DexcomG6BluetoothPeripheralViewModel()
case .Libre2Type:
return Libre2BluetoothPeripheralViewModel()
/*case .Libre2Type:
return Libre2BluetoothPeripheralViewModel()*/
}
@ -155,9 +155,9 @@ enum BluetoothPeripheralType: String, CaseIterable {
return DexcomG4(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
case .Libre2Type:
/*case .Libre2Type:
return Libre2(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)
return Libre2(address: address, name: name, alias: nil, nsManagedObjectContext: nsManagedObjectContext)*/
}
@ -171,7 +171,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
case .M5StackType, .M5StickCType:
return .M5Stack
case .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type, .WatlaaType, .Libre2Type:
case .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type, .WatlaaType/*, .Libre2Type*/:
return .CGM
}
@ -183,7 +183,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
switch self {
case .M5StackType, .M5StickCType, .WatlaaType, .BubbleType, .MiaoMiaoType, .GNSentryType, .BlueReaderType, .DropletType, .Libre2Type:
case .M5StackType, .M5StickCType, .WatlaaType, .BubbleType, .MiaoMiaoType, .GNSentryType, .BlueReaderType, .DropletType/*, .Libre2Type*/:
return false
case .DexcomG5Type, .BluconType, .DexcomG4Type, .DexcomG6Type:
@ -233,7 +233,7 @@ enum BluetoothPeripheralType: String, CaseIterable {
}
return nil
case .M5StackType, .M5StickCType, .WatlaaType, .BubbleType, .MiaoMiaoType, .GNSentryType, .BlueReaderType, .DropletType, .Libre2Type:
case .M5StackType, .M5StickCType, .WatlaaType, .BubbleType, .MiaoMiaoType, .GNSentryType, .BlueReaderType, .DropletType/*, .Libre2Type*/:
// no transmitter id means no validation to do
return nil
@ -264,9 +264,9 @@ enum BluetoothPeripheralType: String, CaseIterable {
case .BubbleType, .MiaoMiaoType:
return true
case .Libre2Type:
/*case .Libre2Type:
// oop web can still be used for Libre2 because in the end the data received is Libre 1 format, we can use oop web to get slope parameters
return true
return true*/
}
@ -283,8 +283,8 @@ enum BluetoothPeripheralType: String, CaseIterable {
case .BubbleType, .MiaoMiaoType, .WatlaaType, .BluconType, .BlueReaderType, .DropletType , .GNSentryType:
return true
case .Libre2Type:
return true
/*case .Libre2Type:
return true*/
}

View File

@ -74,7 +74,7 @@ enum CGMTransmitterType:String, CaseIterable {
case watlaa = "Watlaa"
/// Libre2
case Libre2 = "Libre2"
//case Libre2 = "Libre2"
/// what sensorType does this CGMTransmitter type support
func sensorType() -> CGMSensorType {
@ -84,7 +84,7 @@ enum CGMTransmitterType:String, CaseIterable {
case .dexcomG4, .dexcomG5, .dexcomG6 :
return .Dexcom
case .miaomiao, .Bubble, .GNSentry, .Droplet1, .blueReader, .watlaa, .Blucon, .Libre2:
case .miaomiao, .Bubble, .GNSentry, .Droplet1, .blueReader, .watlaa, .Blucon/*, .Libre2*/:
return .Libre
}
@ -124,8 +124,8 @@ enum CGMTransmitterType:String, CaseIterable {
case .watlaa:
return false
case .Libre2:
return true
/*case .Libre2:
return true*/
}
}
@ -140,7 +140,7 @@ enum CGMTransmitterType:String, CaseIterable {
case .dexcomG4, .dexcomG5, .dexcomG6, .GNSentry, .Droplet1, .blueReader, .watlaa:
return true
case .miaomiao, .Bubble, .Blucon, .Libre2:
case .miaomiao, .Bubble, .Blucon/*, .Libre2*/:
return true
@ -178,8 +178,8 @@ enum CGMTransmitterType:String, CaseIterable {
case .watlaa:
return ConstantsDefaultAlertLevels.defaultBatteryAlertLevelWatlaa
case .Libre2:
return ConstantsDefaultAlertLevels.defaultBatteryAlertLevelLibre2
/*case .Libre2:
return ConstantsDefaultAlertLevels.defaultBatteryAlertLevelLibre2*/
}
}
@ -212,8 +212,8 @@ enum CGMTransmitterType:String, CaseIterable {
case .watlaa:
return "%"
case .Libre2:
return "%"
/*case .Libre2:
return "%"*/
}
}

View File

@ -94,7 +94,8 @@ class CGMLibre2Transmitter:BluetoothTransmitter, CGMTransmitter {
func setWebOOPToken(oopWebToken: String) {}
func cgmTransmitterType() -> CGMTransmitterType {
return .Libre2
return .Blucon
//return .Libre2
}
func isWebOOPEnabled() -> Bool {

View File

@ -278,7 +278,7 @@ class BluetoothPeripheralManager: NSObject {
}
case .Libre2Type:
/*case .Libre2Type:
if let libre2 = blePeripheral.libre2 {
@ -304,7 +304,7 @@ class BluetoothPeripheralManager: NSObject {
}
}
}*/
case .DropletType:
@ -486,7 +486,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:
case .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type/*, .Libre2Type*/:
// cgm's don't receive reading, they send it
break
@ -682,7 +682,7 @@ class BluetoothPeripheralManager: NSObject {
}
}
case .Libre2Type:
/*case .Libre2Type:
if let libre2 = bluetoothPeripheral as? Libre2 {
@ -696,7 +696,7 @@ class BluetoothPeripheralManager: NSObject {
}
}
}*/
}
@ -777,10 +777,10 @@ class BluetoothPeripheralManager: NSObject {
return .DexcomG4Type
}
case .Libre2Type:
/*case .Libre2Type:
if bluetoothTransmitter is CGMLibre2Transmitter {
return .Libre2Type
}
}*/
}
@ -878,13 +878,13 @@ class BluetoothPeripheralManager: NSObject {
return CGMG4xDripTransmitter(address: nil, name: nil, transmitterID: transmitterId, bluetoothTransmitterDelegate: self, cGMDexcomG4TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate)
case .Libre2Type:
/*case .Libre2Type:
guard let cgmTransmitterDelegate = cgmTransmitterDelegate else {
fatalError("in createNewTransmitter, Libre2Type, cgmTransmitterDelegate is nil")
}
return CGMLibre2Transmitter(address: nil, name: nil, bluetoothTransmitterDelegate: self, cGMLibre2TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, nonFixedSlopeEnabled: nil)
return CGMLibre2Transmitter(address: nil, name: nil, bluetoothTransmitterDelegate: self, cGMLibre2TransmitterDelegate: self, cGMTransmitterDelegate: cgmTransmitterDelegate, nonFixedSlopeEnabled: nil)*/
}
@ -1129,7 +1129,7 @@ class BluetoothPeripheralManager: NSObject {
bluetoothPeripheral.blePeripheral.parameterUpdateNeededAtNextConnect = true
}
case .WatlaaType, .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type, .Libre2Type:
case .WatlaaType, .DexcomG5Type, .BubbleType, .MiaoMiaoType, .BluconType, .GNSentryType, .BlueReaderType, .DropletType, .DexcomG4Type, .DexcomG6Type/*, .Libre2Type*/:
// oop website and oop web token need to be checked
switch keyPathEnum {

View File

@ -442,12 +442,12 @@ class Trace {
}
case .Libre2Type:
/*case .Libre2Type:
if let libre2 = blePeripheral.libre2 {
traceInfo.appendStringAndNewLine(" type = " + bluetoothPeripheralType.rawValue)
}
}*/
}
}

View File

@ -87,11 +87,13 @@ extension Libre2BluetoothPeripheralViewModel: BluetoothPeripheralViewModel {
}
func screenTitle() -> String {
return BluetoothPeripheralType.Libre2Type.rawValue
return "Libre2"
//return BluetoothPeripheralType.Libre2Type.rawValue
}
func sectionTitle(forSection section: Int) -> String {
return BluetoothPeripheralType.Libre2Type.rawValue
return "Libre2"
//return BluetoothPeripheralType.Libre2Type.rawValue
}
func update(cell: UITableViewCell, forRow rawValue: Int, forSection section: Int, for bluetoothPeripheral: BluetoothPeripheral) {

View File

@ -951,7 +951,7 @@ final class RootViewController: UIViewController {
return DexcomCalibrator()
case .miaomiao, .GNSentry, .Blucon, .Bubble, .Droplet1, .blueReader, .watlaa, .Libre2:
case .miaomiao, .GNSentry, .Blucon, .Bubble, .Droplet1, .blueReader, .watlaa/*, .Libre2*/:
if cgmTransmitter.isWebOOPEnabled() && !UserDefaults.standard.overrideWebOOPCalibration {