Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Easily interface with Bluetooth peripherals in new or existing projects through
- [x] Alternate callback-based API for codebases not using Swift Concurrency
- [x] Subscribe to peripheral discoveries, value updates, and more through `AsyncStream`
- [x] Easy await-ing of `CentralManager` state
- [x] Staticly typed characteristics
- [x] Statically typed characteristics
- [x] Thread safe
- [x] Zero inherited dependencies
- [x] Tested with included `SwiftBluetoothMock` library
Expand Down Expand Up @@ -60,7 +60,7 @@ central.connect(peripheral) { result in
// Connected!
}
```
> Methods often now have 3 overloads. One marked `async`, one with a `completionHandler`, and the original CoreBluetooth verision. Meaning you can choose whichever is most convienient at the time.
> Methods often now have 3 overloads. One marked `async`, one with a `completionHandler`, and the original CoreBluetooth version. Meaning you can choose whichever is most convenient at the time.

#### Stream discovered peripherals

Expand All @@ -74,7 +74,7 @@ for await peripheral in await central.scanForPeripherals() {

#### Defining characteristics

Characteristics can be staticly defined on the stock `Characteristic` type, which removes the burden of keeping track of `CBCharacteristic` instances around your app.
Characteristics can be statically defined on the stock `Characteristic` type, which removes the burden of keeping track of `CBCharacteristic` instances around your app.

```swift
extension Characteristic {
Expand All @@ -88,7 +88,7 @@ try await myPeripheral.readValue(for: .someCharacteristic)

#### Watching with callbacks

Peristent tasks return a `CancellableTask` that needs to be cancelled when you're done.
Persistent tasks return a `CancellableTask` that needs to be cancelled when you're done.

```swift
let task = central.scanForPeripherals { peripheral in
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftBluetooth/Extensions/AsyncStream+first.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

// Convienence API for people interfacing with AsyncStream. Not sure why this isn't in Foundation by default...
// Convenience API for people interfacing with AsyncStream. Not sure why this isn't in Foundation by default...
public extension AsyncStream {
var first: Element? {
get async {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftBluetoothMock/CoreBluetoothMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import CoreBluetoothMock
// Copy this file to your project to start using CoreBluetoothMock classes
// without having to refactor any of your code. You will just have to remove
// the imports to CoreBluetooth to fix conflicts and initiate the manager
// using CBCentralManagerFactory, instad of just creating a CBCentralManager.
// using CBCentralManagerFactory, instead of just creating a CBCentralManager.

// disabled for Xcode 12.5 beta
// typealias CBPeer = CBMPeer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ final class LostConnectionPeripheralTests: CentralPeripheralTestCase {

XCTAssertNil(characteristic.value)

// TODO: Break this out into a seperate AsyncSubscriptionQueue test?
// TODO: Break this out into a separate AsyncSubscriptionQueue test?
// Will also need to test that SwiftBluetooth.Peripheral implements a shared DispatchQueue (like this test is doing)
var ran = 0
let exp = XCTestExpectation()
Expand Down