Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/LibDCSwift/DiveLogRetriever.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public class DiveLogRetriever {
model: modelToUse,
diveNumber: context.logCount,
diveData: data,
dataSize: Int(size)
dataSize: Int(size),
fingerprint: fingerprintData
)

DispatchQueue.main.async {
Expand Down
12 changes: 9 additions & 3 deletions Sources/LibDCSwift/Models/DiveData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ public struct DiveData: Identifiable {

// Decompression data
public var decoStop: DecoStop?


// Raw fingerprint bytes identifying the specific dive on the computer,
// returned by dc_device_foreach's per-dive callback.
public var fingerprint: Data?

public struct Tank {
public var volume: Double
public var workingPressure: Double
Expand Down Expand Up @@ -411,7 +415,8 @@ public struct DiveData: Identifiable {
setpoint: Double?,
ppo2Readings: [(sensor: UInt32, value: Double)],
cns: Double?,
decoStop: DecoStop?
decoStop: DecoStop?,
fingerprint: Data? = nil
) {
self.number = number
self.datetime = datetime
Expand Down Expand Up @@ -441,5 +446,6 @@ public struct DiveData: Identifiable {
self.ppo2Readings = ppo2Readings
self.cns = cns
self.decoStop = decoStop
self.fingerprint = fingerprint
}
}
}
6 changes: 4 additions & 2 deletions Sources/LibDCSwift/Parser/GenericParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ public class GenericParser {
diveNumber: Int,
diveData: UnsafePointer<UInt8>,
dataSize: Int,
context: OpaquePointer? = nil
context: OpaquePointer? = nil,
fingerprint: Data? = nil
) throws -> DiveData {
var parser: OpaquePointer?

Expand Down Expand Up @@ -533,7 +534,8 @@ public class GenericParser {
time: TimeInterval(deco.time),
type: Int(deco.type.rawValue)
)
}
},
fingerprint: fingerprint
)
}

Expand Down