Skip to content

Commit 354f009

Browse files
authored
Merge pull request #16 from AudigoLabs/bugfix/open-l2cap
bugfix: Keep reference to CBL2CAPChannel so the system doesn't close it
2 parents 26272e0 + 3c8446e commit 354f009

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: Sources/CombineCoreBluetooth/Models/L2CAPChannel.swift

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Foundation
2+
import CoreBluetooth
23

34
public struct L2CAPChannel {
5+
// Need to keep a reference to this so the system doesn't close the channel
6+
let rawValue: CBL2CAPChannel?
47
public let peer: Peer
58
public let inputStream: InputStream
69
public let outputStream: OutputStream
@@ -19,6 +22,7 @@ extension L2CAPChannel {
1922
}
2023

2124
self.init(
25+
rawValue: channel,
2226
peer: peer,
2327
inputStream: channel.inputStream,
2428
outputStream: channel.outputStream,

0 commit comments

Comments
 (0)