Merge pull request #438 from paulplant/develop

New L2 EU patchInfo designation "c5"
This commit is contained in:
Johan Degraeve 2023-05-22 22:40:33 +02:00 committed by GitHub
commit f533e72303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 9 deletions

View File

@ -212,7 +212,7 @@ class CGMBubbleTransmitter:BluetoothTransmitter, CGMTransmitter {
// if firmware < 2.6, libre2 and libreUS will decrypt fram local
// after decryptFRAM, the libre2 and libreUS 344 will be libre1 344 data format
// firmware >= 2.6, then bubble already decrypted the data, no need for decryption we already have the 344 bytes
if libreSensorType == .libre2 || libreSensorType == .libreUS || libreSensorType == .libreUSE6 {
if libreSensorType == .libre2 || libreSensorType == .libre2C5 || libreSensorType == .libreUS || libreSensorType == .libreUSE6 {
if let firmware = firmware?.toDouble(), firmware < 2.6 {

View File

@ -231,7 +231,7 @@ class LibreDataParser {
// should never come here ?
trace("in libreDataProcessor, is libreUS but data is not decrypted - no further processing", log: log, category: ConstantsLog.categoryLibreDataParser, type: .info)
case .libre2:
case .libre2, .libre2C5:
// should never come here ?
trace("in libreDataProcessor, is libre2 but data is not decrypted - no further processing", log: log, category: ConstantsLog.categoryLibreDataParser, type: .info)

View File

@ -104,7 +104,7 @@ public struct LibreSensorSerialNumber: CustomStringConvertible {
first = "1"
case .libre2:
case .libre2, .libre2C5:
first = "3"

View File

@ -6,13 +6,15 @@ import os
public enum LibreSensorType: String {
// Libre 1
case libre1 = "DF"
case libre1 = "DF"
case libre1A2 = "A2"
case libre1A2 = "A2"
case libre2 = "9D"
case libre2 = "9D"
case libreUS = "E5"
case libre2C5 = "C5"
case libreUS = "E5"
case libreUSE6 = "E6"
@ -31,6 +33,9 @@ public enum LibreSensorType: String {
case .libre2:
return "Libre 2"
case .libre2C5:
return "Libre 2 C5"
case .libreUS:
return "Libre US"
@ -56,7 +61,7 @@ public enum LibreSensorType: String {
}
// decrypt if libre2 or libreUS
if self == .libre2 || self == .libreUS || self == .libreUSE6 {
if self == .libre2 || self == .libre2C5 || self == .libreUS || self == .libreUSE6 {
var libreData = rxBuffer.subdata(in: headerLength..<(rxBufferEnd + 1))
@ -123,6 +128,9 @@ public enum LibreSensorType: String {
case "9D":
return .libre2
case "C5":
return .libre2C5 // new Libre 2 EU type (May 2023)
case "E5":
return .libreUS
@ -150,7 +158,7 @@ public enum LibreSensorType: String {
case .libre1A2:
return 14
case .libre2:
case .libre2, .libre2C5:
return 14
case .libreUS, .libreUSE6: