@@ -195,7 +195,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
195
195
/// Simulates the current authorization state of a Core Bluetooth manager.
196
196
///
197
197
/// When set to `nil` (default), the native value is returned.
198
- @available ( iOS 13 . 0 , * )
198
+ @available ( iOS 13 . 0 , macOS 10 . 15 , tvOS 13 . 0 , watchOS 6 . 0 , * )
199
199
public static func simulateAuthorization( _ authorization: CBMManagerAuthorization ) {
200
200
bluetoothAuthorization = authorization. rawValue
201
201
}
@@ -457,6 +457,9 @@ open class CBMCentralManagerMock: CBMCentralManager {
457
457
}
458
458
459
459
@available ( iOS, introduced: 13.0 , deprecated: 13.1 )
460
+ @available ( macOS, introduced: 10.15 )
461
+ @available ( tvOS, introduced: 13.0 , deprecated: 13.1 )
462
+ @available ( watchOS, introduced: 6.0 , deprecated: 6.1 )
460
463
open override var authorization : CBMManagerAuthorization {
461
464
if let rawValue = CBMCentralManagerMock . bluetoothAuthorization,
462
465
let authotization = CBMManagerAuthorization ( rawValue: rawValue) {
@@ -467,7 +470,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
467
470
}
468
471
}
469
472
470
- @available ( iOS 13 . 1 , * )
473
+ @available ( iOS 13 . 1 , macOS 10 . 15 , tvOS 13 . 1 , watchOS 6 . 1 , * )
471
474
open override class var authorization : CBMManagerAuthorization {
472
475
if let rawValue = CBMCentralManagerMock . bluetoothAuthorization,
473
476
let authotization = CBMManagerAuthorization ( rawValue: rawValue) {
@@ -705,10 +708,12 @@ open class CBMCentralManagerMock: CBMCentralManager {
705
708
+ peripheralsConnectedByOtherApps
706
709
}
707
710
708
- @available ( iOS 13 . 0 , * )
711
+ #if !os(macOS)
712
+ @available ( iOS 13 . 0 , tvOS 13 . 0 , watchOS 6 . 0 , * )
709
713
open override func registerForConnectionEvents( options: [ CBMConnectionEventMatchingOption : Any ] ? = nil ) {
710
714
fatalError ( " Mock connection events are not implemented " )
711
715
}
716
+ #endif
712
717
713
718
fileprivate func ensurePoweredOn( ) -> Bool {
714
719
guard state == . poweredOn else {
@@ -736,7 +741,7 @@ open class CBMPeripheralMock: CBMPeer, CBMPeripheral {
736
741
/// Size of the outgoing buffer. Only this many packets
737
742
/// can be written without response in a loop, without
738
743
/// waiting for `canSendWriteWithoutResponse`.
739
- private let bufferSize = 20
744
+ private let bufferSize = 20
740
745
/// The supervision timeout is a time after which a device realizes
741
746
/// that a connected peer has disconnected, had there been no signal
742
747
/// from it.
@@ -747,7 +752,7 @@ open class CBMPeripheralMock: CBMPeer, CBMPeripheral {
747
752
748
753
/// A flag set to <i>true</i> when the device was scanned
749
754
/// at least once.
750
- fileprivate var wasScanned : Bool = false
755
+ fileprivate var wasScanned : Bool = false
751
756
/// A flag set to <i>true</i> when the device was connected
752
757
/// and iOS had chance to read device name.
753
758
fileprivate var wasConnected : Bool = false
0 commit comments