Skip to content

Commit 26b0a95

Browse files
committed
FixDarwinCentral assertions
1 parent c39a90a commit 26b0a95

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/DarwinGATT/DarwinCentral.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ public final class DarwinCentral: CentralManager, ObservableObject {
438438
}
439439
// get MTU
440440
let rawValue = peripheralObject.maximumWriteValueLength(for: .withoutResponse) + 3
441-
assert(peripheralObject.mtuLength.intValue == rawValue)
441+
assert(peripheralObject.mtuLength.intValue >= rawValue)
442442
guard let mtu = MaximumTransmissionUnit(rawValue: UInt16(rawValue)) else {
443443
assertionFailure("Invalid MTU \(rawValue)")
444444
return .default
@@ -1309,7 +1309,6 @@ internal extension DarwinCentral {
13091309

13101310
let peripheral = Peripheral(corePeripheral)
13111311
guard let context = self.central.continuation.peripherals[peripheral] else {
1312-
assertionFailure("Missing context")
13131312
return
13141313
}
13151314
// user requested disconnection

0 commit comments

Comments
 (0)