Skip to content

Commit

Permalink
Fix DarwinPeripheral continuations
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Mar 1, 2024
1 parent 26b0a95 commit 77d3bc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/DarwinGATT/DarwinPeripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ internal extension DarwinPeripheral {
log("Did start advertising")
self.peripheral.continuation.startAdvertising?.resume()
}
self.peripheral.continuation.startAdvertising = nil
}

@objc(peripheralManager:didAddService:error:)
Expand All @@ -450,6 +451,7 @@ internal extension DarwinPeripheral {
log("Added service \(service.uuid)")
self.peripheral.continuation.addService?.resume()
}
self.peripheral.continuation.addService = nil
}

@objc(peripheralManager:didReceiveReadRequest:)
Expand Down Expand Up @@ -560,6 +562,7 @@ internal extension DarwinPeripheral {
public func peripheralManagerIsReady(toUpdateSubscribers peripheral: CBPeripheralManager) {
log("Ready to send notifications")
self.peripheral.continuation.canNotify?.resume()
self.peripheral.continuation.canNotify = nil
}
}
}
Expand Down

0 comments on commit 77d3bc6

Please sign in to comment.