Skip to content

Commit

Permalink
FixDarwinCentral assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Mar 1, 2024
1 parent c39a90a commit 26b0a95
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/DarwinGATT/DarwinCentral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public final class DarwinCentral: CentralManager, ObservableObject {
}
// get MTU
let rawValue = peripheralObject.maximumWriteValueLength(for: .withoutResponse) + 3
assert(peripheralObject.mtuLength.intValue == rawValue)
assert(peripheralObject.mtuLength.intValue >= rawValue)
guard let mtu = MaximumTransmissionUnit(rawValue: UInt16(rawValue)) else {
assertionFailure("Invalid MTU \(rawValue)")
return .default
Expand Down Expand Up @@ -1309,7 +1309,6 @@ internal extension DarwinCentral {

let peripheral = Peripheral(corePeripheral)
guard let context = self.central.continuation.peripherals[peripheral] else {
assertionFailure("Missing context")
return
}
// user requested disconnection
Expand Down

0 comments on commit 26b0a95

Please sign in to comment.