Skip to content

Commit bd54d85

Browse files
committed
Add Sendable to other types
1 parent 07773bd commit bd54d85

8 files changed

Lines changed: 12 additions & 11 deletions

File tree

Sources/CombineCoreBluetooth/Models/ATTRequest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
2-
import CoreBluetooth
2+
@preconcurrency import CoreBluetooth
33

4-
public struct ATTRequest {
4+
public struct ATTRequest: Sendable {
55
let rawValue: CBATTRequest?
66

77
public let central: Central

Sources/CombineCoreBluetooth/Models/AdvertisementData.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import CoreBluetooth
22
import Foundation
33

44
/// Various kinds of data that are advertised by peripherals and obtained by the ``CentralManager`` during scanning.
5-
public struct AdvertisementData {
5+
public struct AdvertisementData: @unchecked Sendable {
66
let dictionary: [String: Any]
77

88
/// Initializes the advertisement data with the given dictionary, ideally obtained from `CoreBluetooth` itself.
@@ -60,7 +60,7 @@ public struct AdvertisementData {
6060
}
6161

6262
/// Keys that may reference data in the ``AdvertisementData`` obtained by searching for peripherals.
63-
public struct Key: Equatable, Hashable {
63+
public struct Key: Equatable, Hashable, Sendable {
6464
public let rawValue: String
6565

6666
private init(_ rawValue: String) {

Sources/CombineCoreBluetooth/Models/CentralManagerError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public enum CentralManagerError: Error, Equatable {
3+
public enum CentralManagerError: Error, Equatable, Sendable {
44
/// Thrown if there's a failure during connection to a peripheral, but there's no error information
55
case unknownConnectionFailure
66
}

Sources/CombineCoreBluetooth/Models/L2CAPChannel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
2-
import CoreBluetooth
2+
@preconcurrency import CoreBluetooth
33

4-
public struct L2CAPChannel {
4+
public struct L2CAPChannel: @unchecked Sendable {
55
// Need to keep a reference to this so the system doesn't close the channel
66
let rawValue: CBL2CAPChannel?
77
public let peer: Peer

Sources/CombineCoreBluetooth/Models/ManagerCreationOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import CoreBluetooth
22

33
/// Configuration options used when creating a `CentralManager` or `PeripheralManager`.
4-
public struct ManagerCreationOptions {
4+
public struct ManagerCreationOptions: Sendable {
55
/// If true, display a warning dialog to the user when the manager is instantiated if Bluetooth is powered off
66
public var showPowerAlert: Bool?
77
/// A unique identifier for the manager that's being instantiated. This identifier is used by the system to identify a specific manager instance for restoration and, therefore, must remain the same for subsequent application executions in order for the manager to be restored.

Sources/CombineCoreBluetooth/Models/Peer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import Foundation
2+
@preconcurrency import CoreBluetooth
23

34
/// Protocol that represents either a `Central` or a `Peripheral` when either could be present.
4-
public protocol Peer {
5+
public protocol Peer: Sendable {
56
var identifier: UUID { get }
67
}
78

Sources/CombineCoreBluetooth/Models/PeripheralDiscovery.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public struct PeripheralDiscovery: Identifiable {
3+
public struct PeripheralDiscovery: Identifiable, Sendable {
44
public let peripheral: Peripheral
55
public let advertisementData: AdvertisementData
66
public let rssi: Double?

Sources/CombineCoreBluetooth/Models/PeripheralError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
@preconcurrency import CoreBluetooth
33

4-
public enum PeripheralError: Error, Equatable {
4+
public enum PeripheralError: Error, Equatable, Sendable {
55
case serviceNotFound(CBUUID)
66
case characteristicNotFound(CBUUID)
77
case descriptorNotFound(CBUUID, onCharacteristic: CBUUID)

0 commit comments

Comments
 (0)