Skip to content

Commit 9d535ae

Browse files
committed
Enum G7 opcodes
1 parent d95ebd6 commit 9d535ae

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

DiaBLE Playground.swiftpm/Dexcom.swift

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ import CoreBluetooth
105105
case calibrateGlucoseTx = 0x34 // G7 Tx/Rx
106106
case calibrateGlucoseRx = 0x35
107107

108+
case encryptionInfo = 0x38 // G7 Tx/Rx
109+
108110
case glucoseHistoryTx = 0x3e
109111

110112
case resetTx = 0x42
@@ -117,13 +119,14 @@ import CoreBluetooth
117119
case glucoseG6Rx = 0x4f
118120

119121
case glucoseBackfillTx = 0x50 // DataStream
120-
case glucoseBackfillRx = 0x51 // Tx/Rx start/end of stream
122+
case glucoseBackfillRx = 0x51 // G7 Tx/Rx start/end of diagnostic data stream
121123

122124
case transmitterVersionExtended = 0x52 // G7 Tx/Rx
123125
case transmitterVersionExtendedRx = 0x53
124126

125127
case backfillFinished = 0x59 // G7 Tx/Rx
126-
case unknown1_G7 = 0xEA // TODO: Tx/Rx EA00
128+
129+
case bleControl = 0xea // TODO: G7 Tx/Rx EA00
127130

128131
case keepAliveRx = 0xFF
129132

@@ -141,7 +144,22 @@ import CoreBluetooth
141144
var opCode: Opcode = .unknown
142145

143146

144-
// TODO:
147+
// TODO: com.dexcom.coresdk.transmitterG7.command CmdRequest$Opcode class
148+
// enum G7Opcode {
149+
// stopSession = 0x28
150+
// egv = 0x4e
151+
// calibrationBounds = 0x32
152+
// calibrate = 0x34
153+
// transmitterVersion = 0x4a
154+
// transmitterVersionExtended = 0x52
155+
// encryptionInfo = 0x38
156+
// backfill = 0x59
157+
// diagnosticData = 0x51
158+
// bleControl = 0xea
159+
// disconnect = 0x09
160+
// }
161+
162+
145163
// enum G7TxController.TransmitterResponseCode {
146164
// case success = 0
147165
// case notPermitted = 1
@@ -589,7 +607,7 @@ import CoreBluetooth
589607
log("\(name): extended version response: status: \(status), session length: \(sessionLength) days, CRC: \(crc.hex), valid CRC: \(crc == data.dropLast(2).crc)")
590608

591609

592-
case .unknown1_G7:
610+
case .bleControl:
593611
// TODO: i.e. ea00030100000000000200000045ffffff
594612
break
595613

DiaBLE/Dexcom.swift

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ import CoreBluetooth
105105
case calibrateGlucoseTx = 0x34 // G7 Tx/Rx
106106
case calibrateGlucoseRx = 0x35
107107

108+
case encryptionInfo = 0x38 // G7 Tx/Rx
109+
108110
case glucoseHistoryTx = 0x3e
109111

110112
case resetTx = 0x42
@@ -117,13 +119,14 @@ import CoreBluetooth
117119
case glucoseG6Rx = 0x4f
118120

119121
case glucoseBackfillTx = 0x50 // DataStream
120-
case glucoseBackfillRx = 0x51 // Tx/Rx start/end of stream
122+
case glucoseBackfillRx = 0x51 // G7 Tx/Rx start/end of diagnostic data stream
121123

122124
case transmitterVersionExtended = 0x52 // G7 Tx/Rx
123125
case transmitterVersionExtendedRx = 0x53
124126

125127
case backfillFinished = 0x59 // G7 Tx/Rx
126-
case unknown1_G7 = 0xEA // TODO: Tx/Rx EA00
128+
129+
case bleControl = 0xea // TODO: G7 Tx/Rx EA00
127130

128131
case keepAliveRx = 0xFF
129132

@@ -141,7 +144,22 @@ import CoreBluetooth
141144
var opCode: Opcode = .unknown
142145

143146

144-
// TODO:
147+
// TODO: com.dexcom.coresdk.transmitterG7.command CmdRequest$Opcode class
148+
// enum G7Opcode {
149+
// stopSession = 0x28
150+
// egv = 0x4e
151+
// calibrationBounds = 0x32
152+
// calibrate = 0x34
153+
// transmitterVersion = 0x4a
154+
// transmitterVersionExtended = 0x52
155+
// encryptionInfo = 0x38
156+
// backfill = 0x59
157+
// diagnosticData = 0x51
158+
// bleControl = 0xea
159+
// disconnect = 0x09
160+
// }
161+
162+
145163
// enum G7TxController.TransmitterResponseCode {
146164
// case success = 0
147165
// case notPermitted = 1
@@ -589,7 +607,7 @@ import CoreBluetooth
589607
log("\(name): extended version response: status: \(status), session length: \(sessionLength) days, CRC: \(crc.hex), valid CRC: \(crc == data.dropLast(2).crc)")
590608

591609

592-
case .unknown1_G7:
610+
case .bleControl:
593611
// TODO: i.e. ea00030100000000000200000045ffffff
594612
break
595613

0 commit comments

Comments
 (0)