Appearance
BTWire
Wire
implementation using Bluetooth
swift
final class BTWire
Overview
To construct a BTWire you need to let a CBPeripheral
be managed by a PeripheralManager. This is due to CoreBluetooth
currently only allowing one CBCentralManager
.
Instance Properties
gotClosedPublisher
swift
var gotClosedPublisher: AnyPublisher<Void, Never>
Publisher used by the Transort
to receive closed events
receivedDataPublisher
swift
var receivedDataPublisher: AnyPublisher<Data, Error>
Publisher to relay received Data
to the Transport
Instance Methods
close()
swift
func close()
Closes the Connection
open()
swift
func open() async throws
Opens the Connection
send(_😃
swift
func send(Data) async throws -> Int
This send the provided Data over the Wire