Skip to content

Commit

Permalink
Bumped dependecy to 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiAAPeres committed Jul 26, 2022
1 parent 52361f3 commit f709b7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
targets: ["VitalCore"]),
],
dependencies: [
.package(name: "CombineCoreBluetooth", url: "https://github.com/StarryInternet/CombineCoreBluetooth.git", from: "0.2.1"),
.package(name: "CombineCoreBluetooth", url: "https://github.com/StarryInternet/CombineCoreBluetooth.git", from: "0.3.1"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class BloodPressureReader1810: BloodPressureReadable {
return .empty
}

return peripheral.setNotifyValue(true, for: characteristics[0]).map { (peripheral, $0) }.eraseToAnyPublisher()
return peripheral.setNotifyValue(true, for: characteristics[0]).map { (peripheral, characteristics[0]) }.eraseToAnyPublisher()
}
}
.eraseToAnyPublisher()
}
}

private func toBloodPressureReading(characteristic: CBCharacteristic) -> BloodPressureSample? {
guard let data = characteristic.value else {
private func toBloodPressureReading(data: Data?) -> BloodPressureSample? {
guard let data = data else {
return nil
}

Expand Down
5 changes: 3 additions & 2 deletions Sources/VitalDevices/DeviceReading/GlucoseMeter1808.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ class GlucoseMeter1808: GlucoseMeterReadable {
}
}

private func toGlucoseReading(characteristic: CBCharacteristic) -> QuantitySample? {
guard let data = characteristic.value else {
private func toGlucoseReading(data: Data?) -> QuantitySample? {
guard let data = data else {
return nil
}

let byteArrayFromData: [UInt8] = [UInt8](data)
let record: UInt16 = [byteArrayFromData[1], byteArrayFromData[2]].withUnsafeBytes { $0.load(as: UInt16.self) }
let year: UInt16 = [byteArrayFromData[3], byteArrayFromData[4]].withUnsafeBytes { $0.load(as: UInt16.self) }
Expand Down

0 comments on commit f709b7c

Please sign in to comment.