Skip to content

Commit 5d2f4fb

Browse files
authored
Merge pull request #107 from NordicSemiconductor/release
Minimum iOS and tvOS version set to 12
2 parents df76c6a + 71bc15d commit 5d2f4fb

File tree

877 files changed

+1582
-3114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

877 files changed

+1582
-3114
lines changed

CoreBluetoothMock.podspec

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'CoreBluetoothMock'
3-
s.version = '0.17.0'
3+
s.version = '0.18.0'
44
s.summary = 'Mocking library for CoreBluetooth.'
55

66
s.description = <<-DESC
@@ -13,12 +13,15 @@ device and test the app on simulator.
1313
s.author = { 'Aleksander Nowakowski' => 'aleksander.nowakowski@nordicsemi.no' }
1414
s.source = { :git => 'https://github.com/NordicSemiconductor/IOS-CoreBluetooth-Mock.git', :tag => s.version.to_s }
1515
s.social_media_url = 'https://twitter.com/nordictweets'
16+
s.swift_versions = ['4.2', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8', '5.9']
1617

17-
s.ios.deployment_target = '11.0'
18-
s.osx.deployment_target = '10.13'
19-
s.tvos.deployment_target = '11.0'
18+
s.ios.deployment_target = '12.0'
19+
s.osx.deployment_target = '10.14'
20+
s.tvos.deployment_target = '12.0'
2021
s.watchos.deployment_target = '4.0'
21-
s.swift_versions = ['4.2', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6']
2222

2323
s.source_files = 'CoreBluetoothMock/**/*'
24+
s.resource_bundles = {
25+
'PrivacyInfo' => ['PrivacyInfo.xcprivacy']
26+
}
2427
end

CoreBluetoothMock/CBMAttributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ open class CBMServiceMock: CBMService {
163163
/// - uuid: The Bluetooth UUID of the service.
164164
/// - isPrimary: The type of the service (primary or secondary).
165165
/// - includedServices: Optional array of included services.
166-
/// - characteristics: Optional aray of characteristics.
166+
/// - characteristics: Optional array of characteristics.
167167
public init(type uuid: CBMUUID, primary isPrimary: Bool,
168168
includedService: [CBMServiceMock]? = nil,
169169
characteristics: [CBMCharacteristicMock]? = nil) {
@@ -312,7 +312,7 @@ open class CBMCharacteristicMock: CBMCharacteristic {
312312

313313
/// An object that provides further information about a remote peripheral’s characteristic.
314314
///
315-
/// `CBMDescriptor` represents a descriptor of a peripheral’s characteristic. In partcular, `CBMDescriptor` objects
315+
/// `CBMDescriptor` represents a descriptor of a peripheral’s characteristic. In particular, `CBMDescriptor` objects
316316
/// represent the descriptors of a remote peripheral’s characteristic. Descriptors provide further information about a
317317
/// characteristic’s value. For example, they may describe the value in human-readable form and describe how to format
318318
/// the value for presentation purposes. Characteristic descriptors also indicate whether a characteristic’s value indicates

CoreBluetoothMock/CBMCentralManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ open class CBMCentralManager: NSObject {
105105
@available(watchOS, introduced: 6.0, deprecated: 6.1)
106106
open var authorization: CBMManagerAuthorization {
107107
if let rawValue = CBMCentralManagerMock.bluetoothAuthorization,
108-
let authotization = CBMManagerAuthorization(rawValue: rawValue) {
109-
return authotization
108+
let authorization = CBMManagerAuthorization(rawValue: rawValue) {
109+
return authorization
110110
} else {
111111
return CBCentralManager().authorization
112112
}
@@ -128,8 +128,8 @@ open class CBMCentralManager: NSObject {
128128
@available(iOS 13.1, macOS 10.15, tvOS 13.1, watchOS 6.1, *)
129129
open class var authorization: CBMManagerAuthorization {
130130
if let rawValue = CBMCentralManagerMock.bluetoothAuthorization,
131-
let authotization = CBMManagerAuthorization(rawValue: rawValue) {
132-
return authotization
131+
let authorization = CBMManagerAuthorization(rawValue: rawValue) {
132+
return authorization
133133
} else {
134134
return CBCentralManager.authorization
135135
}

CoreBluetoothMock/CBMCentralManagerMock.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
207207
guard mock.proximity != .outOfRange else {
208208
return
209209
}
210-
// If the device is connected and does not advetise in that state, skip.
210+
// If the device is connected and does not advertise in that state, skip.
211211
guard !mock.isConnected || config.isAdvertisingWhenConnected else {
212212
return
213213
}
@@ -235,7 +235,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
235235
let peripheral = manager.peripherals[mock.identifier]!
236236

237237
// If the Allow Duplicates flag was not set and the device was already reported,
238-
// don't report it for th second time
238+
// don't report it for the second time
239239
let allowDuplicates = manager.scanOptions?[CBMCentralManagerScanOptionAllowDuplicatesKey] as? NSNumber ?? false as NSNumber
240240
if !peripheral.wasScanned || allowDuplicates.boolValue {
241241
// Remember the scanned name from the last advertising packet.
@@ -348,7 +348,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
348348

349349
// MARK: - Central manager simulation methods
350350

351-
/// This method may be used to register a list ot ``CBMPeripheralPreview`` should they be used in Swift UI Previews.
351+
/// This method may be used to register a list of ``CBMPeripheralPreview`` should they be used in Swift UI Previews.
352352
///
353353
/// Registered peripherals can be connected, retrieved, and respond to basic requests
354354
/// - Parameter peripherals: The list of peripherals intended for Swift UI purposes.
@@ -363,7 +363,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
363363
/// All manager delegates will receive a ``CBMManagerState/unknown`` state update.
364364
public static func tearDownSimulation() {
365365
stopAdvertising()
366-
// Set the state of all currently existing cenral manager instances to
366+
// Set the state of all currently existing central manager instances to
367367
// .unknown, which will make them invalid.
368368
managerState = .unknown
369369
// Remove all central manager instances.
@@ -656,8 +656,8 @@ open class CBMCentralManagerMock: CBMCentralManager {
656656
@available(watchOS, introduced: 6.0, deprecated: 6.1)
657657
open override var authorization: CBMManagerAuthorization {
658658
if let rawValue = CBMCentralManagerMock.bluetoothAuthorization,
659-
let authotization = CBMManagerAuthorization(rawValue: rawValue) {
660-
return authotization
659+
let authorization = CBMManagerAuthorization(rawValue: rawValue) {
660+
return authorization
661661
} else {
662662
// If `simulateAuthorization(:)` was not called, .allowedAlways is assumed.
663663
return .allowedAlways
@@ -952,7 +952,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
952952
return
953953
}
954954
// If the device is already connected (using a different central manager),
955-
// report success immediatly. The device already has the connection with central
955+
// report success immediately. The device already has the connection with central
956956
// and will not be notified about another virtual client connection.
957957
if isAlreadyConnected {
958958
queue.async { [weak self] in

CoreBluetoothMock/CBMCentralManagerNative.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public class CBMPeripheralNative: CBMPeer, CBMPeripheral {
418418
impl.delegate?.peripheral(impl, didOpen: channel, error: error)
419419
}
420420

421-
/// Updates the local list of serivces with received ones.
421+
/// Updates the local list of services with received ones.
422422
/// - Parameter services: New list of services.
423423
private func smartCopy(_ services: [CBService]?) {
424424
guard let services = services else {

CoreBluetoothMock/CBMPeripheralSpec.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public enum CBMProximity {
5454
/// Advertisement configuration.
5555
///
5656
/// This config includes the advertisement data, interval, initial delay and a flag
57-
/// indicating thether the advertisement is also broadcasted when the device is in
57+
/// indicating whether the advertisement is also broadcasted when the device is in
5858
/// connected state.
5959
///
6060
/// The advertisement config is set in ``CBMPeripheralSpec/Builder/advertising(advertisementData:withInterval:delay:alsoWhenConnected:)``
@@ -68,7 +68,7 @@ public struct CBMAdvertisementConfig {
6868
public let data: [String : Any]
6969
/// The advertising interval.
7070
///
71-
/// If the intetval is 0, the advertisement will be fired only once. In that case use the `delay`
71+
/// If the interval is 0, the advertisement will be fired only once. In that case use the `delay`
7272
/// parameter to specify when the advertisement is to be sent.
7373
public let interval: TimeInterval
7474
/// The delay of the first advertising packet of that type.
@@ -87,7 +87,7 @@ public struct CBMAdvertisementConfig {
8787
/// Creates an advertising configuration.
8888
/// - Parameters:
8989
/// - data: The data that will be advertised. Only the iOS-supported keys are available.
90-
/// - interval: The advertising ingterval in seconds.
90+
/// - interval: The advertising interval in seconds.
9191
/// - delay: The delay to the first packet, in seconds.
9292
/// - isAdvertisingWhenConnected: Whether the device advertises also when in
9393
/// connected state.
@@ -166,7 +166,7 @@ public class CBMPeripheralSpec {
166166
/// Min value is 23, max 517.
167167
///
168168
/// The maximum value length for Write Without Response is MTU - 3 bytes, as 3 bytes
169-
/// are reserved for the Hndle number and Op Code on the GATT layer.
169+
/// are reserved for the Handle number and Op Code on the GATT layer.
170170
public let mtu: Int?
171171
/// The delegate that will handle connection requests.
172172
public let connectionDelegate: CBMPeripheralSpecDelegate?
@@ -319,7 +319,7 @@ public class CBMPeripheralSpec {
319319
/// Simulates a change in the advertising packet.
320320
///
321321
/// The delays in the config will be applied from the time this method is called.
322-
/// - Parameter advertisement: The new advertrising configuration.
322+
/// - Parameter advertisement: The new advertising configuration.
323323
/// - Since: 0.15.0
324324
public func simulateAdvertisementChange(_ advertisement: [CBMAdvertisementConfig]?) {
325325
CBMCentralManagerMock.peripheral(self, didChangeAdvertisement: advertisement)
@@ -379,7 +379,7 @@ public class CBMPeripheralSpec {
379379
private var services: [CBMServiceMock]? = nil
380380
/// The connection interval, in seconds.
381381
private var connectionInterval: TimeInterval? = nil
382-
/// The MTU (Maximul Transfer Unit). Min value is 23, max 517.
382+
/// The MTU (Maximum Transfer Unit). Min value is 23, max 517.
383383
/// The maximum value length for Write Without Response is
384384
/// MTU - 3 bytes.
385385
private var mtu: Int? = nil
@@ -404,7 +404,7 @@ public class CBMPeripheralSpec {
404404
/// `false`.
405405
/// - Returns: The builder.
406406
/// - Note: Starting from version 0.15.0 this method may be called multiple times
407-
/// if the device advertises with muiltiple different packets.
407+
/// if the device advertises with multiple different packets.
408408
public func advertising(advertisementData: [String : Any],
409409
withInterval interval: TimeInterval = 0.100,
410410
delay: TimeInterval = 0.0,
@@ -484,7 +484,7 @@ public class CBMPeripheralSpec {
484484
/// without scanning.
485485
///
486486
/// That means, that the manager has perviously scanned and cached the
487-
/// peripheral and can obtain it by the identfier.
487+
/// peripheral and can obtain it by the identifier.
488488
public func allowForRetrieval() -> Builder {
489489
self.isKnown = true
490490
return self

CoreBluetoothMock/CBMPeripheralSpecDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
import CoreBluetooth
3232

33-
/// This delegate should implement the behavior of a real Bluetooth LE device duting a connection.
33+
/// This delegate should implement the behavior of a real Bluetooth LE device during a connection.
3434
public protocol CBMPeripheralSpecDelegate {
3535

3636
/// This method is called when the mock peripheral has been reset.

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use_frameworks!
2-
platform :ios, '11.0'
2+
platform :ios, '12.0'
33

44
target 'nRFBlinky' do
55
pod 'CoreBluetoothMock', :path => '../'

Example/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- CoreBluetoothMock (0.17.0)
2+
- CoreBluetoothMock (0.18.0)
33

44
DEPENDENCIES:
55
- CoreBluetoothMock (from `../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
CoreBluetoothMock: a57a2b19d47cea663e34c3d8e62a5ecba37b0a3e
12+
CoreBluetoothMock: 9de570a29520ea4b1201b8d23a228fb950d12b61
1313

14-
PODFILE CHECKSUM: dbe11fdd34f545de2b6358750fede7261d00aa0a
14+
PODFILE CHECKSUM: 0b65d3eb5c3b8364e0e8c102ccc0cee2258c07fb
1515

16-
COCOAPODS: 1.12.1
16+
COCOAPODS: 1.15.2

Example/Pods/Local Podspecs/CoreBluetoothMock.podspec.json

Lines changed: 18 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)