Skip to content

Commit

Permalink
Merge pull request #107 from NordicSemiconductor/release
Browse files Browse the repository at this point in the history
Minimum iOS and tvOS version set to 12
  • Loading branch information
philips77 committed Feb 19, 2024
2 parents df76c6a + 71bc15d commit 5d2f4fb
Show file tree
Hide file tree
Showing 877 changed files with 1,582 additions and 3,114 deletions.
13 changes: 8 additions & 5 deletions CoreBluetoothMock.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CoreBluetoothMock'
s.version = '0.17.0'
s.version = '0.18.0'
s.summary = 'Mocking library for CoreBluetooth.'

s.description = <<-DESC
Expand All @@ -13,12 +13,15 @@ device and test the app on simulator.
s.author = { 'Aleksander Nowakowski' => '[email protected]' }
s.source = { :git => 'https://github.com/NordicSemiconductor/IOS-CoreBluetooth-Mock.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/nordictweets'
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']

s.ios.deployment_target = '11.0'
s.osx.deployment_target = '10.13'
s.tvos.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.14'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '4.0'
s.swift_versions = ['4.2', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6']

s.source_files = 'CoreBluetoothMock/**/*'
s.resource_bundles = {
'PrivacyInfo' => ['PrivacyInfo.xcprivacy']
}
end
4 changes: 2 additions & 2 deletions CoreBluetoothMock/CBMAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ open class CBMServiceMock: CBMService {
/// - uuid: The Bluetooth UUID of the service.
/// - isPrimary: The type of the service (primary or secondary).
/// - includedServices: Optional array of included services.
/// - characteristics: Optional aray of characteristics.
/// - characteristics: Optional array of characteristics.
public init(type uuid: CBMUUID, primary isPrimary: Bool,
includedService: [CBMServiceMock]? = nil,
characteristics: [CBMCharacteristicMock]? = nil) {
Expand Down Expand Up @@ -312,7 +312,7 @@ open class CBMCharacteristicMock: CBMCharacteristic {

/// An object that provides further information about a remote peripheral’s characteristic.
///
/// `CBMDescriptor` represents a descriptor of a peripheral’s characteristic. In partcular, `CBMDescriptor` objects
/// `CBMDescriptor` represents a descriptor of a peripheral’s characteristic. In particular, `CBMDescriptor` objects
/// represent the descriptors of a remote peripheral’s characteristic. Descriptors provide further information about a
/// characteristic’s value. For example, they may describe the value in human-readable form and describe how to format
/// the value for presentation purposes. Characteristic descriptors also indicate whether a characteristic’s value indicates
Expand Down
8 changes: 4 additions & 4 deletions CoreBluetoothMock/CBMCentralManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ open class CBMCentralManager: NSObject {
@available(watchOS, introduced: 6.0, deprecated: 6.1)
open var authorization: CBMManagerAuthorization {
if let rawValue = CBMCentralManagerMock.bluetoothAuthorization,
let authotization = CBMManagerAuthorization(rawValue: rawValue) {
return authotization
let authorization = CBMManagerAuthorization(rawValue: rawValue) {
return authorization
} else {
return CBCentralManager().authorization
}
Expand All @@ -128,8 +128,8 @@ open class CBMCentralManager: NSObject {
@available(iOS 13.1, macOS 10.15, tvOS 13.1, watchOS 6.1, *)
open class var authorization: CBMManagerAuthorization {
if let rawValue = CBMCentralManagerMock.bluetoothAuthorization,
let authotization = CBMManagerAuthorization(rawValue: rawValue) {
return authotization
let authorization = CBMManagerAuthorization(rawValue: rawValue) {
return authorization
} else {
return CBCentralManager.authorization
}
Expand Down
14 changes: 7 additions & 7 deletions CoreBluetoothMock/CBMCentralManagerMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
guard mock.proximity != .outOfRange else {
return
}
// If the device is connected and does not advetise in that state, skip.
// If the device is connected and does not advertise in that state, skip.
guard !mock.isConnected || config.isAdvertisingWhenConnected else {
return
}
Expand Down Expand Up @@ -235,7 +235,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
let peripheral = manager.peripherals[mock.identifier]!

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

// MARK: - Central manager simulation methods

/// This method may be used to register a list ot ``CBMPeripheralPreview`` should they be used in Swift UI Previews.
/// This method may be used to register a list of ``CBMPeripheralPreview`` should they be used in Swift UI Previews.
///
/// Registered peripherals can be connected, retrieved, and respond to basic requests
/// - Parameter peripherals: The list of peripherals intended for Swift UI purposes.
Expand All @@ -363,7 +363,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
/// All manager delegates will receive a ``CBMManagerState/unknown`` state update.
public static func tearDownSimulation() {
stopAdvertising()
// Set the state of all currently existing cenral manager instances to
// Set the state of all currently existing central manager instances to
// .unknown, which will make them invalid.
managerState = .unknown
// Remove all central manager instances.
Expand Down Expand Up @@ -656,8 +656,8 @@ open class CBMCentralManagerMock: CBMCentralManager {
@available(watchOS, introduced: 6.0, deprecated: 6.1)
open override var authorization: CBMManagerAuthorization {
if let rawValue = CBMCentralManagerMock.bluetoothAuthorization,
let authotization = CBMManagerAuthorization(rawValue: rawValue) {
return authotization
let authorization = CBMManagerAuthorization(rawValue: rawValue) {
return authorization
} else {
// If `simulateAuthorization(:)` was not called, .allowedAlways is assumed.
return .allowedAlways
Expand Down Expand Up @@ -952,7 +952,7 @@ open class CBMCentralManagerMock: CBMCentralManager {
return
}
// If the device is already connected (using a different central manager),
// report success immediatly. The device already has the connection with central
// report success immediately. The device already has the connection with central
// and will not be notified about another virtual client connection.
if isAlreadyConnected {
queue.async { [weak self] in
Expand Down
2 changes: 1 addition & 1 deletion CoreBluetoothMock/CBMCentralManagerNative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public class CBMPeripheralNative: CBMPeer, CBMPeripheral {
impl.delegate?.peripheral(impl, didOpen: channel, error: error)
}

/// Updates the local list of serivces with received ones.
/// Updates the local list of services with received ones.
/// - Parameter services: New list of services.
private func smartCopy(_ services: [CBService]?) {
guard let services = services else {
Expand Down
16 changes: 8 additions & 8 deletions CoreBluetoothMock/CBMPeripheralSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public enum CBMProximity {
/// Advertisement configuration.
///
/// This config includes the advertisement data, interval, initial delay and a flag
/// indicating thether the advertisement is also broadcasted when the device is in
/// indicating whether the advertisement is also broadcasted when the device is in
/// connected state.
///
/// The advertisement config is set in ``CBMPeripheralSpec/Builder/advertising(advertisementData:withInterval:delay:alsoWhenConnected:)``
Expand All @@ -68,7 +68,7 @@ public struct CBMAdvertisementConfig {
public let data: [String : Any]
/// The advertising interval.
///
/// If the intetval is 0, the advertisement will be fired only once. In that case use the `delay`
/// If the interval is 0, the advertisement will be fired only once. In that case use the `delay`
/// parameter to specify when the advertisement is to be sent.
public let interval: TimeInterval
/// The delay of the first advertising packet of that type.
Expand All @@ -87,7 +87,7 @@ public struct CBMAdvertisementConfig {
/// Creates an advertising configuration.
/// - Parameters:
/// - data: The data that will be advertised. Only the iOS-supported keys are available.
/// - interval: The advertising ingterval in seconds.
/// - interval: The advertising interval in seconds.
/// - delay: The delay to the first packet, in seconds.
/// - isAdvertisingWhenConnected: Whether the device advertises also when in
/// connected state.
Expand Down Expand Up @@ -166,7 +166,7 @@ public class CBMPeripheralSpec {
/// Min value is 23, max 517.
///
/// The maximum value length for Write Without Response is MTU - 3 bytes, as 3 bytes
/// are reserved for the Hndle number and Op Code on the GATT layer.
/// are reserved for the Handle number and Op Code on the GATT layer.
public let mtu: Int?
/// The delegate that will handle connection requests.
public let connectionDelegate: CBMPeripheralSpecDelegate?
Expand Down Expand Up @@ -319,7 +319,7 @@ public class CBMPeripheralSpec {
/// Simulates a change in the advertising packet.
///
/// The delays in the config will be applied from the time this method is called.
/// - Parameter advertisement: The new advertrising configuration.
/// - Parameter advertisement: The new advertising configuration.
/// - Since: 0.15.0
public func simulateAdvertisementChange(_ advertisement: [CBMAdvertisementConfig]?) {
CBMCentralManagerMock.peripheral(self, didChangeAdvertisement: advertisement)
Expand Down Expand Up @@ -379,7 +379,7 @@ public class CBMPeripheralSpec {
private var services: [CBMServiceMock]? = nil
/// The connection interval, in seconds.
private var connectionInterval: TimeInterval? = nil
/// The MTU (Maximul Transfer Unit). Min value is 23, max 517.
/// The MTU (Maximum Transfer Unit). Min value is 23, max 517.
/// The maximum value length for Write Without Response is
/// MTU - 3 bytes.
private var mtu: Int? = nil
Expand All @@ -404,7 +404,7 @@ public class CBMPeripheralSpec {
/// `false`.
/// - Returns: The builder.
/// - Note: Starting from version 0.15.0 this method may be called multiple times
/// if the device advertises with muiltiple different packets.
/// if the device advertises with multiple different packets.
public func advertising(advertisementData: [String : Any],
withInterval interval: TimeInterval = 0.100,
delay: TimeInterval = 0.0,
Expand Down Expand Up @@ -484,7 +484,7 @@ public class CBMPeripheralSpec {
/// without scanning.
///
/// That means, that the manager has perviously scanned and cached the
/// peripheral and can obtain it by the identfier.
/// peripheral and can obtain it by the identifier.
public func allowForRetrieval() -> Builder {
self.isKnown = true
return self
Expand Down
2 changes: 1 addition & 1 deletion CoreBluetoothMock/CBMPeripheralSpecDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import CoreBluetooth

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

/// This method is called when the mock peripheral has been reset.
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use_frameworks!
platform :ios, '11.0'
platform :ios, '12.0'

target 'nRFBlinky' do
pod 'CoreBluetoothMock', :path => '../'
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- CoreBluetoothMock (0.17.0)
- CoreBluetoothMock (0.18.0)

DEPENDENCIES:
- CoreBluetoothMock (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
CoreBluetoothMock: a57a2b19d47cea663e34c3d8e62a5ecba37b0a3e
CoreBluetoothMock: 9de570a29520ea4b1201b8d23a228fb950d12b61

PODFILE CHECKSUM: dbe11fdd34f545de2b6358750fede7261d00aa0a
PODFILE CHECKSUM: 0b65d3eb5c3b8364e0e8c102ccc0cee2258c07fb

COCOAPODS: 1.12.1
COCOAPODS: 1.15.2
28 changes: 18 additions & 10 deletions Example/Pods/Local Podspecs/CoreBluetoothMock.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5d2f4fb

Please sign in to comment.