diff --git a/Bluejay.podspec b/Bluejay.podspec index 19331ac..5155882 100644 --- a/Bluejay.podspec +++ b/Bluejay.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |spec| spec.name = 'Bluejay' - spec.version = '0.8.1' + spec.version = '0.9.0' spec.license = { type: 'MIT', file: 'LICENSE' } spec.homepage = 'https://github.com/steamclock/bluejay' spec.authors = { 'Jeremy Chiang' => 'jeremy@steamclock.com' } spec.summary = 'Bluejay is a simple Swift framework for building reliable Bluetooth apps.' spec.homepage = 'https://github.com/steamclock/bluejay' - spec.source = { git: 'https://github.com/steamclock/bluejay.git', tag: 'v0.8.1' } + spec.source = { git: 'https://github.com/steamclock/bluejay.git', tag: 'v0.9.0' } spec.source_files = 'Bluejay/Bluejay/*.{h,swift}' spec.framework = 'SystemConfiguration' spec.platform = :ios, '10.0' diff --git a/Bluejay/.jazzy.yaml b/Bluejay/.jazzy.yaml index e2c0f62..b0d031e 100644 --- a/Bluejay/.jazzy.yaml +++ b/Bluejay/.jazzy.yaml @@ -2,7 +2,7 @@ output: ../docs author: Steamclock Software author_url: http://steamclock.com module: Bluejay -module_version: 0.8.1 +module_version: 0.9.0 readme: ../README.md sdk: iphone copyright: Copyright © 2017 Steamclock Software. All rights reserved. diff --git a/Bluejay/Bluejay.xcodeproj/project.pbxproj b/Bluejay/Bluejay.xcodeproj/project.pbxproj index 338afe6..878d668 100644 --- a/Bluejay/Bluejay.xcodeproj/project.pbxproj +++ b/Bluejay/Bluejay.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ B8022D9A1E1F041D00EA360B /* SynchronizedPeripheral.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8022D991E1F041D00EA360B /* SynchronizedPeripheral.swift */; }; B8022D9C1E1F052F00EA360B /* ListenAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8022D9B1E1F052F00EA360B /* ListenAction.swift */; }; B80D299B2170062D001C3C9B /* DisconnectHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B80D299A2170062D001C3C9B /* DisconnectHandler.swift */; }; + B8127C732236F63300218B97 /* FixedWidth.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8127C722236F63300218B97 /* FixedWidth.swift */; }; B81E37731EDE238900E0655F /* DisconnectionResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B81E37721EDE238900E0655F /* DisconnectionResult.swift */; }; B83271A91E313CA300D68581 /* Queueable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B83271A81E313CA300D68581 /* Queueable.swift */; }; B8330D5121B9E03B006F29C7 /* ListenCallback.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8330D5021B9E03B006F29C7 /* ListenCallback.swift */; }; @@ -24,7 +25,7 @@ B8383B7021C31B2D00F07306 /* ListenRestorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8383B6F21C31B2D00F07306 /* ListenRestorer.swift */; }; B8383B7221C3239B00F07306 /* PeripheralDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8383B7121C3239B00F07306 /* PeripheralDelegate.swift */; }; B83A67CE219F45C300076B9F /* BackgroundRestorer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B83A67CD219F45C300076B9F /* BackgroundRestorer.swift */; }; - B842AAF81E4CF74300BB32EE /* String+Transferable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B842AAF71E4CF74300BB32EE /* String+Transferable.swift */; }; + B843657E221F73FC00990C83 /* ServiceObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B843657D221F73FC00990C83 /* ServiceObserver.swift */; }; B86586A9216D1105002E8E2D /* StartOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B86586A8216D1105002E8E2D /* StartOptions.swift */; }; B869A2971E721D50003C1278 /* Data+Sendable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B869A2961E721D50003C1278 /* Data+Sendable.swift */; }; B87CBB4D21C05F8400B67B5B /* BackgroundRestoreConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = B87CBB4C21C05F8400B67B5B /* BackgroundRestoreConfig.swift */; }; @@ -138,6 +139,7 @@ B8022D991E1F041D00EA360B /* SynchronizedPeripheral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronizedPeripheral.swift; sourceTree = ""; }; B8022D9B1E1F052F00EA360B /* ListenAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListenAction.swift; sourceTree = ""; }; B80D299A2170062D001C3C9B /* DisconnectHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisconnectHandler.swift; sourceTree = ""; }; + B8127C722236F63300218B97 /* FixedWidth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixedWidth.swift; sourceTree = ""; }; B81E37721EDE238900E0655F /* DisconnectionResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisconnectionResult.swift; sourceTree = ""; }; B82FE820DEBA78205D73DB03 /* Pods_BluejayHeartSensorDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BluejayHeartSensorDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B83271A81E313CA300D68581 /* Queueable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Queueable.swift; sourceTree = ""; }; @@ -151,7 +153,7 @@ B8383B6F21C31B2D00F07306 /* ListenRestorer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListenRestorer.swift; sourceTree = ""; }; B8383B7121C3239B00F07306 /* PeripheralDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PeripheralDelegate.swift; sourceTree = ""; }; B83A67CD219F45C300076B9F /* BackgroundRestorer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundRestorer.swift; sourceTree = ""; }; - B842AAF71E4CF74300BB32EE /* String+Transferable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Transferable.swift"; sourceTree = ""; }; + B843657D221F73FC00990C83 /* ServiceObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceObserver.swift; sourceTree = ""; }; B86586A8216D1105002E8E2D /* StartOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartOptions.swift; sourceTree = ""; }; B869A2961E721D50003C1278 /* Data+Sendable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Data+Sendable.swift"; sourceTree = ""; }; B87CBB4C21C05F8400B67B5B /* BackgroundRestoreConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundRestoreConfig.swift; sourceTree = ""; }; @@ -261,8 +263,8 @@ children = ( B8C70FAA1E1C69C50006CF58 /* Sendable.swift */, B8C70FA81E1C69B60006CF58 /* Receivable.swift */, + B8127C722236F63300218B97 /* FixedWidth.swift */, B8C70FAE1E1C6C780006CF58 /* Integer+Transferable.swift */, - B842AAF71E4CF74300BB32EE /* String+Transferable.swift */, B869A2961E721D50003C1278 /* Data+Sendable.swift */, B8B5708E1ED8AEAA00603C0B /* Data+Extractable.swift */, ); @@ -460,6 +462,7 @@ children = ( B8C70FB81E1C725C0006CF58 /* ConnectionObserver.swift */, B8FE9DF41E73597A00D361CE /* RSSIObserver.swift */, + B843657D221F73FC00990C83 /* ServiceObserver.swift */, B8DC6C6D21DD7917004A8EA6 /* LogObserver.swift */, B80D299A2170062D001C3C9B /* DisconnectHandler.swift */, ); @@ -794,7 +797,7 @@ B8C70FA31E1C65000006CF58 /* ConnectionResult.swift in Sources */, B88A0DA11E1DD15600A00FF8 /* DiscoverCharacteristic.swift in Sources */, B80D299B2170062D001C3C9B /* DisconnectHandler.swift in Sources */, - B842AAF81E4CF74300BB32EE /* String+Transferable.swift in Sources */, + B8127C732236F63300218B97 /* FixedWidth.swift in Sources */, B8DC6C6E21DD7917004A8EA6 /* LogObserver.swift in Sources */, B83A67CE219F45C300076B9F /* BackgroundRestorer.swift in Sources */, B83271A91E313CA300D68581 /* Queueable.swift in Sources */, @@ -819,6 +822,7 @@ B8383B7021C31B2D00F07306 /* ListenRestorer.swift in Sources */, B8022D9C1E1F052F00EA360B /* ListenAction.swift in Sources */, B8C70F9B1E1C5A910006CF58 /* CharacteristicIdentifier.swift in Sources */, + B843657E221F73FC00990C83 /* ServiceObserver.swift in Sources */, B869A2971E721D50003C1278 /* Data+Sendable.swift in Sources */, B8D2078C1E26D446007E670A /* CBPeripheralState+ReturnString.swift in Sources */, B88F79951EB7DB420094D8D1 /* Operation.swift in Sources */, diff --git a/Bluejay/Bluejay/Bluejay.swift b/Bluejay/Bluejay/Bluejay.swift index 29b8099..7607077 100644 --- a/Bluejay/Bluejay/Bluejay.swift +++ b/Bluejay/Bluejay/Bluejay.swift @@ -31,6 +31,9 @@ public class Bluejay: NSObject { //swiftlint:disable:this type_body_length /// List of weak references to objects interested in receiving notifications on RSSI reads. private var rssiObservers: [WeakRSSIObserver] = [] + /// List of weak references to objects interested in receiving notifications on services changes. + private var serviceObservers: [WeakServiceObserver] = [] + /// List of weak references to objects interested in receiving notifications on log file changes. private var logObservers: [WeakLogObserver] = [] @@ -496,6 +499,25 @@ public class Bluejay: NSObject { //swiftlint:disable:this type_body_length rssiObservers = rssiObservers.filter { $0.weakReference != nil && $0.weakReference !== rssiObserver } } + /** + Register for notifications when a connected peripheral's services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory. + + - Parameter serviceObserver: object interested in receiving the connected peripheral's did modify services event. + */ + public func register(serviceObserver: ServiceObserver) { + serviceObservers = serviceObservers.filter { $0.weakReference != nil && $0.weakReference !== serviceObserver } + serviceObservers.append(WeakServiceObserver(weakReference: serviceObserver)) + } + + /** + Unregister for notifications when a connected peripheral's services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory. + + - Parameter serviceObserver: object no longer interested in receiving the connected peripheral's did modify services event. + */ + public func unregister(serviceObserver: ServiceObserver) { + serviceObservers = serviceObservers.filter { $0.weakReference != nil && $0.weakReference !== serviceObserver } + } + /** Register for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory. @@ -1535,6 +1557,15 @@ extension Bluejay: PeripheralDelegate { observer.weakReference?.didReadRSSI(from: peripheral.identifier, RSSI: RSSI, error: error) } } + + func didModifyServices(from peripheral: Peripheral, invalidatedServices: [ServiceIdentifier]) { + for observer in serviceObservers { + observer.weakReference?.didModifyServices( + from: peripheral.identifier, + invalidatedServices: invalidatedServices + ) + } + } } let logger = XCGLogger(identifier: "Bluejay", includeDefaultDestinations: true) diff --git a/Bluejay/Bluejay/Data+Extractable.swift b/Bluejay/Bluejay/Data+Extractable.swift index f5bfa35..eb77a00 100644 --- a/Bluejay/Bluejay/Data+Extractable.swift +++ b/Bluejay/Bluejay/Data+Extractable.swift @@ -11,13 +11,13 @@ import Foundation extension Data { /** - Convenience function to read a range of Data and deserialize it into the specified type. + Convenience function to read a range of Data and deserialize it into a fixed width type. - Parameters: - start: The starting position of the range to read. - length: The number of bytes to read from `start`. */ - public func extract(start: Int, length: Int) throws -> T { + public func extract(start: Int, length: Int) throws -> T { if start + length > self.count { throw BluejayError.dataOutOfBounds(start: start, length: length, count: self.count) } @@ -25,4 +25,28 @@ extension Data { return self.subdata(in: start.. Data { + return self.subdata(in: start.. String? { + return String(data: self.subdata(in: start..CFBundlePackageType FMWK CFBundleShortVersionString - 0.8.0 + 0.9.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Bluejay/Bluejay/Integer+Transferable.swift b/Bluejay/Bluejay/Integer+Transferable.swift index d69dbf5..7a97bbd 100644 --- a/Bluejay/Bluejay/Integer+Transferable.swift +++ b/Bluejay/Bluejay/Integer+Transferable.swift @@ -29,12 +29,12 @@ extension BinaryInteger { } /// Extensions to existing primitive types to make them Sendable and Receivable. -extension Int64: Sendable, Receivable {} -extension Int32: Sendable, Receivable {} -extension Int16: Sendable, Receivable {} -extension Int8: Sendable, Receivable {} +extension Int64: Sendable, Receivable, FixedWidth {} +extension Int32: Sendable, Receivable, FixedWidth {} +extension Int16: Sendable, Receivable, FixedWidth {} +extension Int8: Sendable, Receivable, FixedWidth {} -extension UInt64: Sendable, Receivable {} -extension UInt32: Sendable, Receivable {} -extension UInt16: Sendable, Receivable {} -extension UInt8: Sendable, Receivable {} +extension UInt64: Sendable, FixedWidth {} +extension UInt32: Sendable, FixedWidth {} +extension UInt16: Sendable, FixedWidth {} +extension UInt8: Sendable, FixedWidth {} diff --git a/Bluejay/Bluejay/Peripheral.swift b/Bluejay/Bluejay/Peripheral.swift index 6cc9e6c..a617bae 100644 --- a/Bluejay/Bluejay/Peripheral.swift +++ b/Bluejay/Bluejay/Peripheral.swift @@ -333,4 +333,14 @@ extension Peripheral: CBPeripheralDelegate { delegate.didReadRSSI(from: self, RSSI: RSSI, error: error) } + /// Called when the peripheral removed or added services. + public func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) { + delegate.didModifyServices( + from: self, + invalidatedServices: invalidatedServices.map { + ServiceIdentifier(uuid: $0.uuid) + } + ) + } + } diff --git a/Bluejay/Bluejay/PeripheralDelegate.swift b/Bluejay/Bluejay/PeripheralDelegate.swift index 04fc569..86d988e 100644 --- a/Bluejay/Bluejay/PeripheralDelegate.swift +++ b/Bluejay/Bluejay/PeripheralDelegate.swift @@ -30,4 +30,7 @@ protocol PeripheralDelegate: class { /// The peripheral has received a RSSI value and notifies Bluejay. func didReadRSSI(from peripheral: Peripheral, RSSI: NSNumber, error: Error?) + + /// The peripheral's list of available services has changed. + func didModifyServices(from peripheral: Peripheral, invalidatedServices: [ServiceIdentifier]) } diff --git a/Bluejay/Bluejay/ServiceObserver.swift b/Bluejay/Bluejay/ServiceObserver.swift new file mode 100644 index 0000000..1541e76 --- /dev/null +++ b/Bluejay/Bluejay/ServiceObserver.swift @@ -0,0 +1,28 @@ +// +// ServiceObserver.swift +// Bluejay +// +// Created by Jeremy Chiang on 2019-02-21. +// Copyright © 2019 Steamclock Software. All rights reserved. +// + +import Foundation + +/** + A protocol allowing conforming objects to monitor the services changes of a connected peripheral. + */ +public protocol ServiceObserver: class { + /** + * Called whenever a peripheral's services change. + * + * - Parameters: + * - from: the peripheral that changed services. + * - invalidatedServices: the services invalidated. + */ + func didModifyServices(from peripheral: PeripheralIdentifier, invalidatedServices: [ServiceIdentifier]) +} + +/// Allows creating weak references to ServiceObserver objects, so that Bluejay does not keep strong references to observers and prevent them from being released in memory. +struct WeakServiceObserver { + weak var weakReference: ServiceObserver? +} diff --git a/Bluejay/Bluejay/String+Transferable.swift b/Bluejay/Bluejay/String+Transferable.swift deleted file mode 100644 index 310c4c7..0000000 --- a/Bluejay/Bluejay/String+Transferable.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// String+Transferable.swift -// Bluejay -// -// Created by Jeremy Chiang on 2017-02-09. -// Copyright © 2017 Steamclock Software. All rights reserved. -// - -import Foundation - -/// Make String Sendable and Receivable. -extension String { - - public init(bluetoothData: Data) { - self = String(data: bluetoothData, encoding: .utf8)! - } - - public func toBluetoothData() -> Data { - return self.data(using: .utf8)! - } - -} - -extension String: Sendable, Receivable {} diff --git a/Bluejay/BluejayHeartSensorDemo/SensorViewController.swift b/Bluejay/BluejayHeartSensorDemo/SensorViewController.swift index ffdf2f6..e0c16c8 100644 --- a/Bluejay/BluejayHeartSensorDemo/SensorViewController.swift +++ b/Bluejay/BluejayHeartSensorDemo/SensorViewController.swift @@ -27,6 +27,7 @@ class SensorViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() bluejay.register(connectionObserver: self) + bluejay.register(serviceObserver: self) } override func willMove(toParent parent: UIViewController?) { @@ -228,3 +229,17 @@ extension SensorViewController: ConnectionObserver { UNUserNotificationCenter.current().add(request, withCompletionHandler: nil) } } + +extension SensorViewController: ServiceObserver { + func didModifyServices(from peripheral: PeripheralIdentifier, invalidatedServices: [ServiceIdentifier]) { + bluejay.log("SensorViewController - Invalidated services: \(invalidatedServices.debugDescription)") + + if invalidatedServices.contains(where: { invalidatedServiceIdentifier -> Bool in + invalidatedServiceIdentifier == chirpCharacteristic.service + }) { + endListen(to: chirpCharacteristic) + } else if invalidatedServices.isEmpty { + listen(to: chirpCharacteristic) + } + } +} diff --git a/Bluejay/DittojayHeartSensorDemo/DittojayViewController.swift b/Bluejay/DittojayHeartSensorDemo/DittojayViewController.swift index d08f118..9838715 100644 --- a/Bluejay/DittojayHeartSensorDemo/DittojayViewController.swift +++ b/Bluejay/DittojayHeartSensorDemo/DittojayViewController.swift @@ -22,6 +22,7 @@ class DittojayViewController: UITableViewController { var addedServices: [CBService] = [] var heartRate: UInt8 = 0 + var timer: Timer? override func viewDidLoad() { super.viewDidLoad() @@ -48,6 +49,12 @@ class DittojayViewController: UITableViewController { let wakeAppServiceUUID = CBUUID(string: "CED261B7-F120-41C8-9A92-A41DE69CF2A8") let wakeAppCharacteristicUUID = CBUUID(string: "83B4A431-A6F1-4540-B3EE-3C14AEF71A04") + if addedServices.contains(where: { addedService -> Bool in + addedService.uuid == wakeAppServiceUUID + }) { + return + } + wakeAppCharacteristic = CBMutableCharacteristic( type: wakeAppCharacteristicUUID, properties: .notify, @@ -57,15 +64,35 @@ class DittojayViewController: UITableViewController { wakeAppService = CBMutableService(type: wakeAppServiceUUID, primary: true) wakeAppService.characteristics = [wakeAppCharacteristic] + debugPrint("Will add wake app service...") + manager.add(wakeAppService) } + private func removeWakeAppService() { + addedServices.removeAll { addedService -> Bool in + addedService.uuid == wakeAppService.uuid + } + + debugPrint("Will remove wake app service...") + + manager.remove(wakeAppService) + + if manager.isAdvertising { + debugPrint("Will stop advertising...") + manager.stopAdvertising() + } + + debugPrint("Will start advertising...") + advertiseServices([heartRateService.uuid]) + } + private func advertiseServices(_ services: [CBUUID]) { manager.startAdvertising([CBAdvertisementDataServiceUUIDsKey: services]) } private func startHeartRateSensor() { - _ = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [weak self] _ in + timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [weak self] _ in guard let weakSelf = self else { return } @@ -93,7 +120,7 @@ class DittojayViewController: UITableViewController { } override func numberOfSections(in tableView: UITableView) -> Int { - return 1 + return 2 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { @@ -103,24 +130,35 @@ class DittojayViewController: UITableViewController { override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "actionCell", for: indexPath) - if indexPath.row == 0 { - cell.textLabel?.text = "Generated Heart Rate" - cell.detailTextLabel?.text = "\(heartRate)" - - DispatchQueue.main.async { - UIView.animate(withDuration: 0.25, animations: { - cell.detailTextLabel?.transform = cell.detailTextLabel!.transform.scaledBy(x: 1.5, y: 1.5) - }, completion: { completed in - if completed { - UIView.animate(withDuration: 0.25) { - cell.detailTextLabel?.transform = CGAffineTransform.identity + if indexPath.section == 0 { + if indexPath.row == 0 { + cell.textLabel?.text = "Generated Heart Rate" + cell.detailTextLabel?.text = "\(heartRate)" + cell.selectionStyle = .none + + DispatchQueue.main.async { + UIView.animate(withDuration: 0.25, animations: { + cell.detailTextLabel?.transform = cell.detailTextLabel!.transform.scaledBy(x: 1.5, y: 1.5) + }, completion: { completed in + if completed { + UIView.animate(withDuration: 0.25) { + cell.detailTextLabel?.transform = CGAffineTransform.identity + } } - } - }) + }) + } + } else { + cell.textLabel?.text = "Chirp" + cell.detailTextLabel?.text = "" } } else { - cell.textLabel?.text = "Chirp" - cell.detailTextLabel?.text = "" + if indexPath.row == 0 { + cell.textLabel?.text = "Add Chirp Service" + cell.detailTextLabel?.text = "" + } else { + cell.textLabel?.text = "Remove Chirp Service" + cell.detailTextLabel?.text = "" + } } return cell @@ -128,7 +166,18 @@ class DittojayViewController: UITableViewController { override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) - chirp() + + if indexPath.section == 0 { + if indexPath.row == 1 { + chirp() + } + } else { + if indexPath.row == 0 { + addWakeAppService() + } else { + removeWakeAppService() + } + } } } @@ -146,13 +195,26 @@ extension DittojayViewController: CBPeripheralManagerDelegate { if let error = error { debugPrint("Failed to add service \(service.uuid.uuidString) with error: \(error.localizedDescription)") } else { - debugPrint("Added service \(service.uuid.uuidString)") - - addedServices.append(service) + if !addedServices.contains { addedService -> Bool in + addedService.uuid == service.uuid + } { + debugPrint("Added service \(service.uuid.uuidString)") + addedServices.append(service) + } if addedServices.contains(heartRateService) && addedServices.contains(wakeAppService) { + if manager.isAdvertising { + debugPrint("Will stop advertising...") + manager.stopAdvertising() + } + + debugPrint("Will start advertising...") advertiseServices([heartRateService.uuid, wakeAppService.uuid]) - startHeartRateSensor() + + if timer == nil { + debugPrint("Will start heart rate sensor...") + startHeartRateSensor() + } } } } diff --git a/CHANGELOG.md b/CHANGELOG.md index f3291c9..f7334ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Changed +## [0.9.0] - 2019-03-11 +- Fixed the extraction helper so that it can only extract supported primitives, but also data and string now without crashing +- Added documentation on how to work with strings better + +## [0.8.2] - 2019-02-25 +### Added +- Added initial support for did modify services delegation ## [0.8.1] - 2019-01-14 ### Fixed diff --git a/README.md b/README.md index 2326aa1..26df56f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ Bluejay's primary goals are: - [Deserialization and Serialization](#deserialization-and-serialization) - [Receivable](#receivable) - [Sendable](#sendable) + - [Sending and Receiving Primitives](#sending-and-receiving-primitives) + - [Strings](#strings) - [Interactions](#interactions) - [Reading](#reading) - [Writing](#writing) @@ -46,6 +48,7 @@ Bluejay's primary goals are: - [Write and Assemble](#write-and-assemble) - [Flush Listen](#flush-listen) - [CoreBluetooth Migration](#corebluetooth-migration) + - [Monitor Peripheral Services](#monitor-peripheral-services) ## Features @@ -499,6 +502,45 @@ In some cases, you may want to send or receive data simple enough that creating `Int` and `UInt` are intentionally not conformed. Bluetooth values are always sent and/or received at a specific bit width. The intended bit width for an `Int` is ambiguous, and trying to use one often indicates a programmer error, in the form of not considering the bit width the Bluetooth device is expecting on a characteristic. +#### Strings + +`String` is special because encoding can vary and it is not a fixed width type, so you cannot use a `String` on its own as a `Sendable` nor `Receivable`. To work around this, wrap the string data inside a `Sendable` and/or `Receivable` struct, then use iOS' `Foundation` framework to serialize and/or to deserialize. But when deserializing, one of Bluejay's `extract` helpers does provide a slightly more convenient interface. For examples: + +**Serializing a packet containing a string** + +```swift +struct MyBluetoothPacket: Sendable { + + private let deviceName: String + + init(deviceName: String) { + self.deviceName = deviceName + } + + func toBluetoothData() -> Data { + // Should probably validate the length here before sending it to your peripheral. + return deviceName.data(using: .utf8) ?? Data() + } + +} +``` + +**Deserializing a packet containing a string** + +```swift +struct MyBluetoothPacket: Receivable { + + private var deviceName: String? + + init(bluetoothData: Data) throws { + deviceName = try bluetoothData.extract(start: 0, length: 10, encoding: .utf8) + } + +} +``` + +**Note:** As with the majority of Bluetooth data you work with, you should know the length beforehand, and especially so for both incoming and outgoing strings. + ## Interactions Once you have your data modelled using either the `Receivable` or `Sendable` protocol, the read, write, and listen APIs in Bluejay should handle the deserialization and serialization seamlessly for you. All you need to do is to specify the type for the generic result wrappers: `ReadResult` or `WriteResult`. @@ -867,6 +909,32 @@ public func stopAndExtractBluetoothState() -> Finally, you can check whether Bluejay has been started or stopped using the `hasStarted` property. +### Monitor Peripheral Services + +Some peripherals can add or remove services while it's being used, and Bluejay provides a basic way to react to this. See **BluejayHeartSensorDemo** and **DittojayHeartSensorDemo** in the project for more examples. + +```swift +bluejay.register(serviceObserver: self) +``` + +```swift +func didModifyServices( + from peripheral: PeripheralIdentifier, + invalidatedServices: [ServiceIdentifier]) { + if invalidatedServices.contains(where: { invalidatedServiceIdentifier -> Bool in + invalidatedServiceIdentifier == chirpCharacteristic.service + }) { + endListen(to: chirpCharacteristic) + } else if invalidatedServices.isEmpty { + listen(to: chirpCharacteristic) + } +} +``` + +**Notes from Apple:** + +> If you previously discovered any of the services that have changed, they are provided in the invalidatedServices parameter and can no longer be used. You can use the discoverServices: method to discover any new services that have been added to the peripheral’s database or to find out whether any of the invalidated services that you were using (and want to continue using) have been added back to a different location in the peripheral’s database. + ## API Documentation We have more [in-depth API documentation for Bluejay](https://steamclock.github.io/bluejay/index.html) using inline documentation and Jazzy. diff --git a/docs/Classes.html b/docs/Classes.html index 9a9ce7f..1cff232 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + +
  • + +
    +
    +
    +
    +
    +

    Register for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func register(serviceObserver: ServiceObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + serviceObserver + + +
    +

    object interested in receiving the connected peripheral’s did modify services event.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unregister for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unregister(serviceObserver: ServiceObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + serviceObserver + + +
    +

    object no longer interested in receiving the connected peripheral’s did modify services event.

    +
    +
    +
    +
    +
    +
  • @@ -2314,7 +2409,7 @@

    Declaration

    diff --git a/docs/Classes/SynchronizedPeripheral.html b/docs/Classes/SynchronizedPeripheral.html index bf1bd9d..2778910 100644 --- a/docs/Classes/SynchronizedPeripheral.html +++ b/docs/Classes/SynchronizedPeripheral.html @@ -113,9 +113,6 @@
  • - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + -
    -
      -
    • -
      - - - - String - -
      -
      -
      -
      -
      -
      -

      Make String Sendable and Receivable.

      - - See more -
      -
      -

      Declaration

      -
      -

      Swift

      -
      struct String
      - -
      -
      -
      -
      -
    • -
    -
    diff --git a/docs/Extensions/BinaryInteger.html b/docs/Extensions/BinaryInteger.html index fdfde58..c23b8d6 100644 --- a/docs/Extensions/BinaryInteger.html +++ b/docs/Extensions/BinaryInteger.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ +
  • @@ -220,14 +223,14 @@

    Data

    -

    Convenience function to read a range of Data and deserialize it into the specified type.

    +

    Convenience function to read a range of Data and deserialize it into a fixed width type.

    Declaration

    Swift

    -
    public func extract<T>(start: Int, length: Int) throws -> T
    +
    public func extract<T>(start: Int, length: Int) throws -> T where T : FixedWidth
    @@ -265,6 +268,139 @@

    Parameters

  • +
  • + +
    +
    +
    +
    +
    +

    Convenience function to extract a range of Data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func extract(start: Int, length: Int) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + start + + +
    +

    The starting position of the range to read.

    +
    +
    + + length + + +
    +

    The number of bytes to read from start.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience function to read a range of Data and deserialize it into a String.

    +
    +

    Note

    +

    Defaults to using utf8 encoding.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func extract(start: Int, length: Int, encoding: String.Encoding = .utf8) throws -> String?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + start + + +
    +

    The starting position of the range to read.

    +
    +
    + + length + + +
    +

    The number of bytes to read from start.

    +
    +
    + + encoding + + +
    +

    The string encoding to use, defaults to utf8.

    +
    +
    +
    +
    +
    +
  • @@ -333,7 +469,7 @@

    Declaration

    diff --git a/docs/Extensions/Peripheral.html b/docs/Extensions/Peripheral.html index 157ab3e..4ee258e 100644 --- a/docs/Extensions/Peripheral.html +++ b/docs/Extensions/Peripheral.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + +
  • + +
    +
    +
    +
    +
    +

    Called when the peripheral removed or added services.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService])
    + +
    +
    +
    +
    +
  • diff --git a/docs/Extensions/String.html b/docs/Extensions/String.html index c5ec75a..8d56e69 100644 --- a/docs/Extensions/String.html +++ b/docs/Extensions/String.html @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + +
    +
      +
    • +
      + + + + FixedWidth + +
      +
      +
      +
      +
      +
      +

      Marker protocol to help enforce extraction only on primitives or fixed width types.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public protocol FixedWidth
      + +
      +
      +
      +
      +
    • +
    +
    • @@ -481,11 +515,43 @@

      Declaration

    +
    +
      +
    • +
      + + + + ServiceObserver + +
      +
      +
      +
      +
      +
      +

      A protocol allowing conforming objects to monitor the services changes of a connected peripheral.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public protocol ServiceObserver : AnyObject
      + +
      +
      +
      +
      +
    • +
    +
    diff --git a/docs/Protocols/BackgroundRestorer.html b/docs/Protocols/BackgroundRestorer.html index f5d1184..c11e9cb 100644 --- a/docs/Protocols/BackgroundRestorer.html +++ b/docs/Protocols/BackgroundRestorer.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + +
  • + +
    +
    +
    +
    +
    +

    Register for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func register(serviceObserver: ServiceObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + serviceObserver + + +
    +

    object interested in receiving the connected peripheral’s did modify services event.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Unregister for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unregister(serviceObserver: ServiceObserver)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + serviceObserver + + +
    +

    object no longer interested in receiving the connected peripheral’s did modify services event.

    +
    +
    +
    +
    +
    +
  • @@ -2314,7 +2409,7 @@

    Declaration

    diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Classes/SynchronizedPeripheral.html b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Classes/SynchronizedPeripheral.html index bf1bd9d..2778910 100644 --- a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Classes/SynchronizedPeripheral.html +++ b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Classes/SynchronizedPeripheral.html @@ -113,9 +113,6 @@
  • - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + -
    -
      -
    • -
      - - - - String - -
      -
      -
      -
      -
      -
      -

      Make String Sendable and Receivable.

      - - See more -
      -
      -

      Declaration

      -
      -

      Swift

      -
      struct String
      - -
      -
      -
      -
      -
    • -
    -
    diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/BinaryInteger.html b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/BinaryInteger.html index fdfde58..c23b8d6 100644 --- a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/BinaryInteger.html +++ b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/BinaryInteger.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ +
  • @@ -220,14 +223,14 @@

    Data

    -

    Convenience function to read a range of Data and deserialize it into the specified type.

    +

    Convenience function to read a range of Data and deserialize it into a fixed width type.

    Declaration

    Swift

    -
    public func extract<T>(start: Int, length: Int) throws -> T
    +
    public func extract<T>(start: Int, length: Int) throws -> T where T : FixedWidth
    @@ -265,6 +268,139 @@

    Parameters

  • +
  • + +
    +
    +
    +
    +
    +

    Convenience function to extract a range of Data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func extract(start: Int, length: Int) throws -> Data
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + start + + +
    +

    The starting position of the range to read.

    +
    +
    + + length + + +
    +

    The number of bytes to read from start.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Convenience function to read a range of Data and deserialize it into a String.

    +
    +

    Note

    +

    Defaults to using utf8 encoding.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func extract(start: Int, length: Int, encoding: String.Encoding = .utf8) throws -> String?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + start + + +
    +

    The starting position of the range to read.

    +
    +
    + + length + + +
    +

    The number of bytes to read from start.

    +
    +
    + + encoding + + +
    +

    The string encoding to use, defaults to utf8.

    +
    +
    +
    +
    +
    +
  • @@ -333,7 +469,7 @@

    Declaration

    diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/Peripheral.html b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/Peripheral.html index 157ab3e..4ee258e 100644 --- a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/Peripheral.html +++ b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/Peripheral.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + +
  • + +
    +
    +
    +
    +
    +

    Called when the peripheral removed or added services.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService])
    + +
    +
    +
    +
    +
  • diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/String.html b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/String.html index c5ec75a..8d56e69 100644 --- a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/String.html +++ b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Extensions/String.html @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + +
    +
      +
    • +
      + + + + FixedWidth + +
      +
      +
      +
      +
      +
      +

      Marker protocol to help enforce extraction only on primitives or fixed width types.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public protocol FixedWidth
      + +
      +
      +
      +
      +
    • +
    +
    • @@ -481,11 +515,43 @@

      Declaration

    +
    +
      +
    • +
      + + + + ServiceObserver + +
      +
      +
      +
      +
      +
      +

      A protocol allowing conforming objects to monitor the services changes of a connected peripheral.

      + + See more +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public protocol ServiceObserver : AnyObject
      + +
      +
      +
      +
      +
    • +
    +
    diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Protocols/BackgroundRestorer.html b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Protocols/BackgroundRestorer.html index f5d1184..c11e9cb 100644 --- a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Protocols/BackgroundRestorer.html +++ b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/Protocols/BackgroundRestorer.html @@ -113,9 +113,6 @@ - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -145,6 +145,9 @@ + - + @@ -144,6 +144,9 @@ +
  • Interactions @@ -259,6 +264,7 @@

    Index

  • Write and Assemble
  • Flush Listen
  • CoreBluetooth Migration
  • +
  • Monitor Peripheral Services
  • Features

    @@ -655,6 +661,40 @@

    Sending and Receiving

    In some cases, you may want to send or receive data simple enough that creating a custom struct which implements Sendable or Receivable to hold it is unnecessarily complicated. For those cases, Bluejay also retroactively conforms several built-in Swift types to Sendable and Receivable. Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Data are all conformed to both protocols and so they can all be sent or received directly.

    Int and UInt are intentionally not conformed. Bluetooth values are always sent and/or received at a specific bit width. The intended bit width for an Int is ambiguous, and trying to use one often indicates a programmer error, in the form of not considering the bit width the Bluetooth device is expecting on a characteristic.

    +

    Strings

    + +

    String is special because encoding can vary and it is not a fixed width type, so you cannot use a String on its own as a Sendable nor Receivable. To work around this, wrap the string data inside a Sendable and/or Receivable struct, then use iOS’ Foundation framework to serialize and/or to deserialize. But when deserializing, one of Bluejay’s extract helpers does provide a slightly more convenient interface. For examples:

    + +

    Serializing a packet containing a string

    +
    struct MyBluetoothPacket: Sendable {
    +
    +    private let deviceName: String
    +
    +    init(deviceName: String) {
    +        self.deviceName = deviceName
    +    }
    +
    +    func toBluetoothData() -> Data {
    +        // Should probably validate the length here before sending it to your peripheral.
    +        return deviceName.data(using: .utf8) ?? Data()
    +    }
    +
    +}
    +
    + +

    Deserializing a packet containing a string

    +
    struct MyBluetoothPacket: Receivable {
    +
    +    private var deviceName: String?
    +
    +    init(bluetoothData: Data) throws {
    +        deviceName = try bluetoothData.extract(start: 0, length: 10, encoding: .utf8)
    +    }
    +
    +}
    +
    + +

    Note: As with the majority of Bluetooth data you work with, you should know the length beforehand, and especially so for both incoming and outgoing strings.

    Interactions

    Once you have your data modelled using either the Receivable or Sendable protocol, the read, write, and listen APIs in Bluejay should handle the deserialization and serialization seamlessly for you. All you need to do is to specify the type for the generic result wrappers: ReadResult<T> or WriteResult<T>.

    @@ -992,6 +1032,29 @@

    CoreBluetooth Migration

    Finally, you can check whether Bluejay has been started or stopped using the hasStarted property.

    +

    Monitor Peripheral Services

    + +

    Some peripherals can add or remove services while it’s being used, and Bluejay provides a basic way to react to this. See BluejayHeartSensorDemo and DittojayHeartSensorDemo in the project for more examples.

    +
    bluejay.register(serviceObserver: self)
    +
    +
    func didModifyServices(
    +  from peripheral: PeripheralIdentifier,
    +  invalidatedServices: [ServiceIdentifier]) {
    +    if invalidatedServices.contains(where: { invalidatedServiceIdentifier -> Bool in
    +        invalidatedServiceIdentifier == chirpCharacteristic.service
    +    }) {
    +        endListen(to: chirpCharacteristic)
    +    } else if invalidatedServices.isEmpty {
    +        listen(to: chirpCharacteristic)
    +    }
    +}
    +
    + +

    Notes from Apple:

    + +
    +

    If you previously discovered any of the services that have changed, they are provided in the invalidatedServices parameter and can no longer be used. You can use the discoverServices: method to discover any new services that have been added to the peripheral’s database or to find out whether any of the invalidated services that you were using (and want to continue using) have been added back to a different location in the peripheral’s database.

    +

    API Documentation

    We have more in-depth API documentation for Bluejay using inline documentation and Jazzy.

    @@ -1000,7 +1063,7 @@

    API Documentation

    diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/search.json b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/search.json index 0eb592c..b074416 100644 --- a/docs/docsets/Bluejay.docset/Contents/Resources/Documents/search.json +++ b/docs/docsets/Bluejay.docset/Contents/Resources/Documents/search.json @@ -1 +1 @@ -{"Typealiases.html#/s:7Bluejay17RestoreIdentifiera":{"name":"RestoreIdentifier","abstract":"

    An alias to make it clearer that the string should be some kind of identifier for restoration, and not just any arbitrary string.

    "},"Typealiases.html#/s:7Bluejay13LaunchOptionsa":{"name":"LaunchOptions","abstract":"

    An alias to make it clearer that the dictionary should be the launch options from UIApplicationDelegate.

    "},"Typealiases.html#/s:7Bluejay14ListenCallbacka":{"name":"ListenCallback","abstract":"

    Gives name to a specific callback type used for listens.

    "},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Sensible default warning options: all off in favour of not aggressively notifying the user of changes when the app is backgrounded.

    ","parent_name":"WarningOptions"},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV18notifyOnConnection0dE13Disconnection0dE12NotificationACSb_S2btcfc":{"name":"init(notifyOnConnection:notifyOnDisconnection:notifyOnNotification:)","abstract":"

    Creates a connection options that can specify whether iOS can display a system alert when certain conditions are met while your app is suspended, usually an alert dialog outside of your app in the Home screen for example.

    ","parent_name":"WarningOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV20enableBluetoothAlert17backgroundRestoreACSb_AA010BackgroundH4ModeOtcfc":{"name":"init(enableBluetoothAlert:backgroundRestore:)","abstract":"

    Configurations for starting Bluejay.

    ","parent_name":"StartOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Convenience factory method to avoid having to use the public initializer.

    ","parent_name":"StartOptions"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this service.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSS_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a string. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSo6CBUUIDC_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two ServiceIdentifier.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV20peripheralIdentifierAA010PeripheralE0Vvp":{"name":"peripheralIdentifier","abstract":"

    The unique, persistent identifier associated with the peer.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV19advertisementPacketSDySSypGvp":{"name":"advertisementPacket","abstract":"

    The advertisement packet the discovered peripheral is sending.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV4rssiSivp":{"name":"rssi","abstract":"

    The signal strength of the peripheral discovered.

    ","parent_name":"ScanDiscovery"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    The UUID of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4nameSSvp":{"name":"name","abstract":"

    The name of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns both the name and uuid of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid4nameAC10Foundation4UUIDV_SSSgtcfc":{"name":"init(uuid:name:)","abstract":"

    Create a PeripheralIdentifier using a UUID.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SH9hashValueSivp":{"name":"hashValue","parent_name":"PeripheralIdentifier"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingVyACSicfc":{"name":"init(_:)","abstract":"

    Create empty data.

    ","parent_name":"DataPadding"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingV011toBluetoothB010Foundation0B0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to the Sendable protocol, which allows Bluejay to serialize DataPadding when performing write-related operations.

    ","parent_name":"DataPadding"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV7serviceAA07ServiceC0Vvp":{"name":"service","abstract":"

    The service this characteristic belongs to.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierVyACSo16CBCharacteristicCcfc":{"name":"init(_:)","abstract":"

    Create a CharacteristicIdentifier using a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns the essential description of a characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSS_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a string and a ServiceIdentifier. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSo6CBUUIDC_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a CBUUID and a ServiceIdentifier.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_So16CBCharacteristicCtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between a CharacteristicIdentifier and a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two CharacteristicIdentifiers.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifierSSvp":{"name":"restoreIdentifier","abstract":"

    A restore identifier helps uniquely identify which device is triggering background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV18backgroundRestorerAA0bF0_pvp":{"name":"backgroundRestorer","abstract":"

    A background restorer is required to handle the results of a background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV14listenRestorerAA06ListenF0_pvp":{"name":"listenRestorer","abstract":"

    A listen restorer is required for any potential unhandled listens when restoring to a connected peripheral.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV13launchOptionsSDySo019UIApplicationLaunchF3KeyaypGSgvp":{"name":"launchOptions","abstract":"

    The launch options from application(_:didFinishLaunchingWithOptions:) is required to parse the restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV11centralKeysSaySSGSgvp":{"name":"centralKeys","abstract":"

    Convenience return of bluetooth central keys from the launch options.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV015isRestoringFromB0Sbvp":{"name":"isRestoringFromBackground","abstract":"

    If CoreBluetooth is restoring from background, the bluetooth central keys from launch options will contain the designated restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifier18backgroundRestorer06listenH013launchOptionsACSS_AA0bH0_pAA06ListenH0_pSDySo019UIApplicationLaunchK3KeyaypGSgtcfc":{"name":"init(restoreIdentifier:backgroundRestorer:listenRestorer:launchOptions:)","abstract":"

    Initializes a container for all required configurations necessary to support background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html":{"name":"BackgroundRestoreConfig","abstract":"

    Contains all required configurations for background restoration.

    "},"Structs/CharacteristicIdentifier.html":{"name":"CharacteristicIdentifier","abstract":"

    A wrapper for CBUUID specific to a characteristic to help distinguish it from a CBUUID of a service.

    "},"Structs/DataPadding.html":{"name":"DataPadding","abstract":"

    Helper object that can create empty data to be used as padding in packet construction.

    "},"Structs/PeripheralIdentifier.html":{"name":"PeripheralIdentifier","abstract":"

    Uniquely identifies a peripheral to the current iOS device. The UUID changes and is different on different iOS devices.

    "},"Structs/ScanDiscovery.html":{"name":"ScanDiscovery","abstract":"

    A model capturing what is found from a scan callback.

    "},"Structs/ServiceIdentifier.html":{"name":"ServiceIdentifier","abstract":"

    A wrapper for CBUUID specific to a service to help distinguish it from a CBUUID of a characteristic.

    "},"Structs/StartOptions.html":{"name":"StartOptions","abstract":"

    Wrapper for CBCentralManager initialization configurations when starting a new Bluejay instance.

    "},"Structs/WarningOptions.html":{"name":"WarningOptions","abstract":"

    A connection’s configurations for system alerts.

    "},"Protocols/Sendable.html#/s:7Bluejay8SendableP15toBluetoothData10Foundation0E0VyF":{"name":"toBluetoothData()","abstract":"

    A place to implement your serialization logic.

    ","parent_name":"Sendable"},"Protocols/Receivable.html#/s:7Bluejay10ReceivableP13bluetoothDatax10Foundation0D0V_tKcfc":{"name":"init(bluetoothData:)","abstract":"

    A place to implement your deserialization logic.

    ","parent_name":"Receivable"},"Protocols/RSSIObserver.html#/s:7Bluejay12RSSIObserverP11didReadRSSI4from0E05erroryAA20PeripheralIdentifierV_So8NSNumberCs5Error_pSgtF":{"name":"didReadRSSI(from:RSSI:error:)","abstract":"

    Called whenever a peripheral’s RSSI value changes.

    ","parent_name":"RSSIObserver"},"Protocols/LogObserver.html#/s:7Bluejay11LogObserverP14logFileUpdated4logsySS_tF":{"name":"logFileUpdated(logs:)","abstract":"

    Called whenever the log file is updated.

    ","parent_name":"LogObserver"},"Protocols/ListenRestorer.html#/s:7Bluejay14ListenRestorerP019didReceiveUnhandledB04from2on4withAA0B13RestoreActionOAA20PeripheralIdentifierV_AA014CharacteristicM0V10Foundation4DataVSgtF":{"name":"didReceiveUnhandledListen(from:on:with:)","abstract":"

    Called whenever there is an unhandled listen.

    ","parent_name":"ListenRestorer"},"Protocols/DisconnectHandler.html#/s:7Bluejay17DisconnectHandlerP03didB04from4with13willReconnectAA04AutoH4ModeOAA20PeripheralIdentifierV_s5Error_pSgSbtF":{"name":"didDisconnect(from:with:willReconnect:)","abstract":"

    Notifies the delegate that the peripheral is fully disconnected.

    ","parent_name":"DisconnectHandler"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","abstract":"

    Called whenever Bluetooth availability changes, as well as when an object first subscribes to become a ConnectionObserver.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP9connected2toyAA20PeripheralIdentifierV_tF":{"name":"connected(to:)","abstract":"

    Called whenever a peripheral is connected, as well as when an object first subscribes to become a ConnectionObserver and the peripheral is already connected.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","abstract":"

    Called whenever a peripheral is disconnected.

    ","parent_name":"ConnectionObserver"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP20didRestoreConnection2toAA0bE10CompletionOAA20PeripheralIdentifierV_tF":{"name":"didRestoreConnection(to:)","abstract":"

    Bluejay was able to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP26didFailToRestoreConnection2to5errorAA0bG10CompletionOAA20PeripheralIdentifierV_s5Error_ptF":{"name":"didFailToRestoreConnection(to:error:)","abstract":"

    Bluejay failed to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html":{"name":"BackgroundRestorer","abstract":"

    Protocols for handling the results of a background restoration.

    "},"Protocols/ConnectionObserver.html":{"name":"ConnectionObserver","abstract":"

    A protocol allowing conforming objects registered to Bluejay to optionally respond to Bluetooth connection events.

    "},"Protocols/DisconnectHandler.html":{"name":"DisconnectHandler","abstract":"

    A protocol allowing a single delegate registered to Bluejay to have a final say at the end of a disconnection, as well as evaluate and control the auto-reconnect behaviour.

    "},"Protocols/ListenRestorer.html":{"name":"ListenRestorer","abstract":"

    Protocol for handling a listen event that does not have a callback due to background restoration.

    "},"Protocols/LogObserver.html":{"name":"LogObserver","abstract":"

    A protocol allowing conforming objects to monitor log file changes.

    "},"Protocols/RSSIObserver.html":{"name":"RSSIObserver","abstract":"

    A protocol allowing conforming objects to monitor the RSSI changes of a connected peripheral.

    "},"Protocols/Receivable.html":{"name":"Receivable","abstract":"

    Protocol to indicate that a type can be received from the Bluetooth connection.

    "},"Protocols/Sendable.html":{"name":"Sendable","abstract":"

    Protocol to indicate that a type can be sent via the Bluetooth connection.

    "},"Extensions/String.html#/s:7Bluejay10ReceivableP13bluetoothDatax10Foundation0D0V_tKcfc":{"name":"init(bluetoothData:)","parent_name":"String"},"Extensions/String.html#/s:7Bluejay8SendableP15toBluetoothData10Foundation0E0VyF":{"name":"toBluetoothData()","parent_name":"String"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverServices:":{"name":"peripheral(_:didDiscoverServices:)","abstract":"

    Captures CoreBluetooth’s did discover services event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverCharacteristicsForService:error:":{"name":"peripheral(_:didDiscoverCharacteristicsFor:error:)","abstract":"

    Captures CoreBluetooth’s did discover characteristics event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didWriteValueForCharacteristic:error:":{"name":"peripheral(_:didWriteValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did write to charactersitic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateValueForCharacteristic:error:":{"name":"peripheral(_:didUpdateValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did receive a notification/value from a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateNotificationStateForCharacteristic:error:":{"name":"peripheral(_:didUpdateNotificationStateFor:error:)","abstract":"

    Captures CoreBluetooth’s did turn on or off notification/listening on a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didReadRSSI:error:":{"name":"peripheral(_:didReadRSSI:error:)","abstract":"

    Captures CoreBluetooth’s did read RSSI event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE15toBluetoothData10Foundation0D0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to Sendable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE13bluetoothDatax10Foundation0C0V_tcfc":{"name":"init(bluetoothData:)","abstract":"

    This function is required to conform to Receivable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6lengthxSi_SitKlF":{"name":"extract(start:length:)","abstract":"

    Convenience function to read a range of Data and deserialize it into the specified type.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE011toBluetoothB0ACyF":{"name":"toBluetoothData()","abstract":"

    Allows using Data as is when using Bluejay and working with write-related operations.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE09bluetoothB0A2C_tcfc":{"name":"init(bluetoothData:)","abstract":"

    Allows using Data as is when using Bluejay and working with read-related operations.

    ","parent_name":"Data"},"Extensions/CBService.html#/s:So9CBServiceC7BluejayE14characteristic4withSo16CBCharacteristicCSgSo6CBUUIDC_tF":{"name":"characteristic(with:)","abstract":"

    Find a characteristic on a service by CBUUID.

    ","parent_name":"CBService"},"Extensions/CBPeripheralState.html#/s:So17CBPeripheralStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBPeripheralState as a string.

    ","parent_name":"CBPeripheralState"},"Extensions/CBPeripheral.html#/s:So12CBPeripheralC7BluejayE7service4withSo9CBServiceCSgSo6CBUUIDC_tF":{"name":"service(with:)","abstract":"

    Find a service on a peripheral by CBUUID.

    ","parent_name":"CBPeripheral"},"Extensions/CBManagerState.html#/s:So14CBManagerStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBManagerState as a string.

    ","parent_name":"CBManagerState"},"Extensions/CBManagerState.html":{"name":"CBManagerState"},"Extensions/CBPeripheral.html":{"name":"CBPeripheral"},"Extensions/CBPeripheralState.html":{"name":"CBPeripheralState"},"Extensions/CBService.html":{"name":"CBService"},"Extensions/Data.html":{"name":"Data"},"Extensions/BinaryInteger.html":{"name":"BinaryInteger","abstract":"

    Extension to Int to make it Sendable and Receivable.

    "},"Extensions/Peripheral.html":{"name":"Peripheral"},"Extensions/String.html":{"name":"String","abstract":"

    Make String Sendable and Receivable.

    "},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7successyA2CmF":{"name":"success","abstract":"

    The write is successful.

    ","parent_name":"WriteResult"},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The write has failed unexpectedly with an error.

    ","parent_name":"WriteResult"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3newyAcA0B7OptionsVcACmF":{"name":"new(_:)","abstract":"

    Start Bluejay using a new CBCentralManager.

    ","parent_name":"StartMode"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3useyACSo16CBCentralManagerC_So12CBPeripheralCSgtcACmF":{"name":"use(manager:peripheral:)","abstract":"

    Start Bluejay using an existing CBCentralManager.

    ","parent_name":"StartMode"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO8continueyA2CmF":{"name":"continue","abstract":"

    Continue scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO9blacklistyA2CmF":{"name":"blacklist","abstract":"

    Continue scanning, but don’t discover the same peripheral in the current callback again within the same scan session.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO4stopyA2CmF":{"name":"stop","abstract":"

    Stop scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO7connectyAcA0B9DiscoveryV_AA7TimeoutOAA14WarningOptionsVyAA16ConnectionResultOctcACmF":{"name":"connect(_:_:_:_:)","abstract":"

    Stop scanning, and connect to a discovery.

    ","parent_name":"ScanAction"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The background task is successful, and the returned value is captured in the associated value.

    ","parent_name":"RunResult"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The background task has failed unexpectedly with an error.

    ","parent_name":"RunResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The read is successful and the value read is captured in the associated value.

    ","parent_name":"ReadResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The read has failed unexpectedly with an error.

    ","parent_name":"ReadResult"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO4trapyA2CmF":{"name":"trap","abstract":"

    New listen and its new callback on the same characteristic will not overwrite an existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO11replaceableyA2CmF":{"name":"replaceable","abstract":"

    New listens and its new callback on the same characteristic will replace the existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO18promiseRestorationyA2CmF":{"name":"promiseRestoration","abstract":"

    Bluejay will continue to receive but do nothing with the incoming listen events until a new listener is installed.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO04stopB0yA2CmF":{"name":"stopListen","abstract":"

    Bluejay will attempt to turn off notifications on the peripheral.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO13keepListeningyA2CmF":{"name":"keepListening","abstract":"

    Keep listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO4doneyA2CmF":{"name":"done","abstract":"

    Stop listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20bluetoothUnavailableyA2CmF":{"name":"bluetoothUnavailable","abstract":"

    Bluetooth is either turned off or unavailable.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO24multipleScanNotSupportedyA2CmF":{"name":"multipleScanNotSupported","abstract":"

    Bluejay does not support another scanning request if Bluejay is still scanning.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO27multipleConnectNotSupportedyA2CmF":{"name":"multipleConnectNotSupported","abstract":"

    Bluejay does not support another connection request if Bluejay is already connected or still connecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO30multipleDisconnectNotSupportedyA2CmF":{"name":"multipleDisconnectNotSupported","abstract":"

    Bluejay does not support another disconnection request if Bluejay is still disconnecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18connectionTimedOutyA2CmF":{"name":"connectionTimedOut","abstract":"

    A connection request in Bluejay has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO12notConnectedyA2CmF":{"name":"notConnected","abstract":"

    Bluejay is not connected to a peripheral.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14missingServiceyAcA0D10IdentifierVcACmF":{"name":"missingService(_:)","abstract":"

    A Bluetooth service is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21missingCharacteristicyAcA0D10IdentifierVcACmF":{"name":"missingCharacteristic(_:)","abstract":"

    A Bluetooth characteristic is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO9cancelledyA2CmF":{"name":"cancelled","abstract":"

    A Bluetooth operation is cancelled.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18explicitDisconnectyA2CmF":{"name":"explicitDisconnect","abstract":"

    Bluejay disconnect is called.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedDisconnectyA2CmF":{"name":"unexpectedDisconnect","abstract":"

    Bluejay disconnected unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO16disconnectQueuedyA2CmF":{"name":"disconnectQueued","abstract":"

    A disconnection operation is queued.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14listenTimedOutyA2CmF":{"name":"listenTimedOut","abstract":"

    An attempt to listen on a characteristic has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO10readFailedyA2CmF":{"name":"readFailed","abstract":"

    An attempt to read a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11writeFailedyA2CmF":{"name":"writeFailed","abstract":"

    An attempt to write a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11missingDatayA2CmF":{"name":"missingData","abstract":"

    An attempt to read a value from a characteristic has returned no data unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15dataOutOfBoundsyACSi_S2itcACmF":{"name":"dataOutOfBounds(start:length:count:)","abstract":"

    An attempt to read a range of data has failed due to incorrect bounds or an unexpected length.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedPeripheralyAcA0D10IdentifierVcACmF":{"name":"unexpectedPeripheral(_:)","abstract":"

    An unexpected peripheral is cached and retrieved from CoreBluetooth.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO39allowDuplicatesInBackgroundNotSupportedyA2CmF":{"name":"allowDuplicatesInBackgroundNotSupported","abstract":"

    iOS will not continue scanning in the background if allow duplicates is turned on.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO37missingServiceIdentifiersInBackgroundyA2CmF":{"name":"missingServiceIdentifiersInBackground","abstract":"

    iOS will not continue scanning in the background if no service identifiers are specified.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21backgroundTaskRunningyA2CmF":{"name":"backgroundTaskRunning","abstract":"

    Bluejay does not support further Bluetooth operations while a Bluejay background task is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO34multipleBackgroundTaskNotSupportedyA2CmF":{"name":"multipleBackgroundTaskNotSupported","abstract":"

    Bluejay does not support another Bluejay background task when there is already one that is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15indefiniteFlushyA2CmF":{"name":"indefiniteFlush","abstract":"

    Indefinite flush will not exit.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO7stoppedyA2CmF":{"name":"stopped","abstract":"

    Bluejay has stopped.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO31backgroundRestorationInProgressyA2CmF":{"name":"backgroundRestorationInProgress","abstract":"

    Bluejay cannot perform certain actions when background restoration is still in progress.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO28startupBackgroundTaskExpiredyA2CmF":{"name":"startupBackgroundTaskExpired","abstract":"

    Startup background task has expired during state restoration.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21multipleListenTrappedyA2CmF":{"name":"multipleListenTrapped","abstract":"

    The original listen declared that duplicated listens are not allowed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO22multipleListenReplacedyA2CmF":{"name":"multipleListenReplaced","abstract":"

    The original listen declared that it can be replaced by a new listen.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation14LocalizedErrorP16errorDescriptionSSSgvp":{"name":"errorDescription","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP11errorDomainSSvpZ":{"name":"errorDomain","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP9errorCodeSivp":{"name":"errorCode","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"BluejayError"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO12disconnectedyAcA20PeripheralIdentifierVcACmF":{"name":"disconnected(_:)","abstract":"

    The disconnection is successful, and the disconnected peripheral is captured in the associated value.

    ","parent_name":"DisconnectionResult"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The disconnection has failed unexpectedly with an error.

    ","parent_name":"DisconnectionResult"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO8noChangeyA2CmF":{"name":"noChange","abstract":"

    Bluejay will maintain its current auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO6changeyACSb_tcACmF":{"name":"change(shouldAutoReconnect:)","abstract":"

    Override Bluejay’s auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7successyAcA20PeripheralIdentifierVcACmF":{"name":"success(_:)","abstract":"

    The connection is successful, and the peripheral connected is captured in the associated value.

    ","parent_name":"ConnectionResult"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The connection has failed unexpectedly with an error.

    ","parent_name":"ConnectionResult"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO7secondsyACSdcACmF":{"name":"seconds(_:)","abstract":"

    Specify a timeout with a duration in seconds.

    ","parent_name":"Timeout"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO4noneyA2CmF":{"name":"none","abstract":"

    Specify there is no timeout.

    ","parent_name":"Timeout"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8callbackyACyyccACmF":{"name":"callback(_:)","abstract":"

    Put required Bluejay API or application calls that are needed after a background restoration inside this callback.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8continueyA2CmF":{"name":"continue","abstract":"

    Return this if no callback is needed after a background restoration.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO7disableyA2CmF":{"name":"disable","abstract":"

    Bluejay will not start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO6enableyAcA0bC6ConfigVcACmF":{"name":"enable(_:)","abstract":"

    Bluejay will start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html":{"name":"BackgroundRestoreMode","abstract":"

    Determines how Bluejay should opt-in to CoreBluetooth state restoration.

    "},"Enums/BackgroundRestoreCompletion.html":{"name":"BackgroundRestoreCompletion","abstract":"

    Allows capturing further Bluejay operations to be queued and executed after background restoration is completed.

    "},"Enums/Timeout.html":{"name":"Timeout","abstract":"

    Types of connection time outs. Can specify a time out in seconds, or no time out.

    "},"Enums/ConnectionResult.html":{"name":"ConnectionResult","abstract":"

    Indicates a successful, cancelled, or failed connection attempt, where the success case contains the peripheral connected to.

    "},"Enums/AutoReconnectMode.html":{"name":"AutoReconnectMode","abstract":"

    Tells Bluejay whether it should auto-reconnect.

    "},"Enums/DisconnectionResult.html":{"name":"DisconnectionResult","abstract":"

    Indicates a successful, cancelled, or failed disconnection attempt, where the success case contains the peripheral disconnected from.

    "},"Enums/BluejayError.html":{"name":"BluejayError","abstract":"

    Errors specific to Bluejay.

    "},"Enums/ListenAction.html":{"name":"ListenAction","abstract":"

    Indicates whether the current listen on a characteristic should continue or end.

    "},"Enums/ListenRestoreAction.html":{"name":"ListenRestoreAction","abstract":"

    Available actions to take on an unhandled listen event from background restoration.

    "},"Enums/MultipleListenOption.html":{"name":"MultipleListenOption","abstract":"

    Ways to handle calling listen on the same characteristic multiple times.

    "},"Enums/ReadResult.html":{"name":"ReadResult","abstract":"

    Indicates a successful, cancelled, or failed read attempt, where the success case contains the value read.

    "},"Enums/RunResult.html":{"name":"RunResult","abstract":"

    Indicates a successful, cancelled, or failed run(backgroundTask:completionOnMainThread:) attempt, where the success case contains the value returned at the end of the background task.

    "},"Enums/ScanAction.html":{"name":"ScanAction","abstract":"

    Indicates whether a scan should continue, continue but blacklist the current discovery, stop, or stop and connect.

    "},"Enums/StartMode.html":{"name":"StartMode","abstract":"

    Specifies whether to start a new Bluejay instance from scratch, or from an existing CoreBluetooth session.

    "},"Enums/WriteResult.html":{"name":"WriteResult","abstract":"

    Indicates a successful, cancelled, or failed write attempt.

    "},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC4read4fromxAA24CharacteristicIdentifierV_tKAA10ReceivableRzlF":{"name":"read(from:)","abstract":"

    Read a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC5write2to5value4typeyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVtKAA8SendableRzlF":{"name":"write(to:value:type:)","abstract":"

    Write a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC12writeAndRead0D2To5value4type8readFromxAA24CharacteristicIdentifierV_q_So25CBCharacteristicWriteTypeVAJtKAA10ReceivableRzAA8SendableR_r0_lF":{"name":"writeAndRead(writeTo:value:type:readFrom:)","abstract":"

    Write to one characterestic then reading a value from another.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC6listen2to7timeout10completionyAA24CharacteristicIdentifierV_AA7TimeoutOAA12ListenActionOxctKAA10ReceivableRzlF":{"name":"listen(to:timeout:completion:)","abstract":"

    Listen for changes on a specified characterstic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtKF":{"name":"endListen(to:error:completion:)","abstract":"

    Stop listening to a characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC11flushListen2to14nonZeroTimeout10completionyAA24CharacteristicIdentifierV_AA0I0OyyctKF":{"name":"flushListen(to:nonZeroTimeout:completion:)","abstract":"

    Flush a listen to a characteristic by receiving and discarding values for the specified duration.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC14writeAndListen0D2To5value4type06listenG016timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVALSiAA0F6ActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndListen(writeTo:value:type:listenTo:timeoutInSeconds:completion:)","abstract":"

    Handle a compound operation consisting of writing on one characterstic followed by listening on another for some streamed data.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC16writeAndAssemble0D2To5value06listenG014expectedLength16timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xALS2iAA12ListenActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndAssemble(writeTo:value:listenTo:expectedLength:timeoutInSeconds:completion:)","abstract":"

    Similar to writeAndListen, but use this if you don’t know or don’t have control over how many packets will be sent to you. You still need to know the total size of the data you’re receiving.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicE4TypeV_tF":{"name":"maximumWriteValueLength(for:)","abstract":"

    Ask for the peripheral’s maximum payload length in bytes for a single write request.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","parent_name":"SynchronizedPeripheral"},"Classes/Bluejay.html#/s:7BluejayAAC4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    Helps distinguish one Bluejay instance from another.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC20isBluetoothAvailableSbvp":{"name":"isBluetoothAvailable","abstract":"

    Allows checking whether Bluetooth is powered on. Also returns false if Bluejay is not started yet.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBluetoothStateUpdateImminentSbvp":{"name":"isBluetoothStateUpdateImminent","abstract":"

    Allows checking for if CoreBluetooth state is transitional (update is imminent)","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12isConnectingSbvp":{"name":"isConnecting","abstract":"

    Allows checking whether Bluejay is currently connecting to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isConnectedSbvp":{"name":"isConnected","abstract":"

    Allows checking whether Bluejay is currently connected to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC15isDisconnectingSbvp":{"name":"isDisconnecting","abstract":"

    Allows checking whether Bluejay is currently disconnecting from a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC19shouldAutoReconnectSbvp":{"name":"shouldAutoReconnect","abstract":"

    Allowing checking whether Bluejay will automatic reconnect after an unexpected disconnection. Default is true, and Bluejay will also always set this to true on a successful connection to a peripheral. Conversely, Bluejay will always set this to false after an explicit disconnection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10isScanningSbvp":{"name":"isScanning","abstract":"

    Allows checking whether Bluejay is currently scanning.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10hasStartedSbvp":{"name":"hasStarted","abstract":"

    Allows checking whether Bluejay has started and is available for use.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC21defaultWarningOptionsAA0cD0Vvp":{"name":"defaultWarningOptions","abstract":"

    Warning options to use for each new connection if the options are not specified at the creation of those connections.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBackgroundRestorationEnabledSbvp":{"name":"isBackgroundRestorationEnabled","abstract":"

    Allows checking whether Bluejay has background restoration enabled.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3logyySSF":{"name":"log(_:)","abstract":"

    Allow apps that use Bluejay to log alongside of Bluejay’s internal logs.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7getLogsSSSgyF":{"name":"getLogs()","abstract":"

    Get the current content of the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9clearLogsyyF":{"name":"clearLogs()","abstract":"

    Clears the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@M@Bluejay@objc(cs)Bluejay(im)init":{"name":"init()","abstract":"

    Initializing a Bluejay instance will not yet initialize the CoreBluetooth stack. An explicit start call after Bluejay is intialized will then initialize the CoreBluetooth stack and is required because in cases where a state resotration is trying to restore a listen on a characteristic, a listen restorer must be available before the CoreBluetooth stack is re-initialized. This two-step startup allows you to prepare and gaurantee the setup of your listen restorer in between the initialization of Bluejay and the initialization of the CoreBluetooth stack.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5start4modeyAA9StartModeO_tF":{"name":"start(mode:)","abstract":"

    Starting Bluejay will initialize the CoreBluetooth stack. Simply initializing a Bluejay instance without calling this function will not initialize the CoreBluetooth stack. An explicit start call is required so that we can also support proper background restoration, where CoreBluetooth must be initialized in the AppDelegate’s application(_:didFinishLaunchingWithOptions:) for both starting an iOS background task and for parsing the restore identifier.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC28stopAndExtractBluetoothStateSo16CBCentralManagerC7manager_So12CBPeripheralCSg10peripheraltyF":{"name":"stopAndExtractBluetoothState()","abstract":"

    Stops all operations and clears all states in Bluejay before returning a Core Bluetooth state that can then be used by another library or code outside of Bluejay.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC16cancelEverything5error16shouldDisconnectys5Error_p_SbtF":{"name":"cancelEverything(error:shouldDisconnect:)","abstract":"

    This will cancel the current and all pending operations in the Bluejay queue. It will also disconnect by default after the queue is emptied, but you can cancel everything without disconnecting.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register18connectionObserveryAA010ConnectionD0_p_tF":{"name":"register(connectionObserver:)","abstract":"

    Register for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister18connectionObserveryAA010ConnectionD0_p_tF":{"name":"unregister(connectionObserver:)","abstract":"

    Unregister for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register12rssiObserveryAA12RSSIObserver_p_tF":{"name":"register(rssiObserver:)","abstract":"

    Register for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister12rssiObserveryAA12RSSIObserver_p_tF":{"name":"unregister(rssiObserver:)","abstract":"

    Unregister for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register11logObserveryAA03LogD0_p_tF":{"name":"register(logObserver:)","abstract":"

    Register for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister11logObserveryAA03LogD0_p_tF":{"name":"unregister(logObserver:)","abstract":"

    Unregister for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC25registerDisconnectHandler7handleryAA0cD0_p_tF":{"name":"registerDisconnectHandler(handler:)","abstract":"

    Register a single disconnection handler for giving it a final say on what to do at the end of a disconnection, as well as evaluate and control Bluejay’s auto-reconnect behaviour.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC27unregisterDisconnectHandleryyF":{"name":"unregisterDisconnectHandler()","abstract":"

    Remove any registered disconnection handler.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4scan8duration15allowDuplicates17throttleRSSIDelta18serviceIdentifiers9discovery7expired7stoppedySd_SbSiSayAA17ServiceIdentifierVGSgAA10ScanActionOAA0O9DiscoveryV_SayARGtcApR_AStcSgyAS_s5Error_pSgtctF":{"name":"scan(duration:allowDuplicates:throttleRSSIDelta:serviceIdentifiers:discovery:expired:stopped:)","abstract":"

    Scan for the peripheral(s) specified.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12stopScanningyyF":{"name":"stopScanning()","abstract":"

    Stops current or queued scan.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7connect_7timeout14warningOptions10completionyAA20PeripheralIdentifierV_AA7TimeoutOAA07WarningE0VSgyAA16ConnectionResultOctF":{"name":"connect(_:timeout:warningOptions:completion:)","abstract":"

    Attempt to connect directly to a known peripheral. The call will fail if Bluetooth is not available, or if Bluejay is already connected. Making a connection request while Bluejay is scanning will also cause Bluejay to stop the current scan for you behind the scene prior to fulfilling your connection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10disconnect9immediate10completionySb_yAA19DisconnectionResultOcSgtF":{"name":"disconnect(immediate:completion:)","abstract":"

    Disconnect a connected peripheral or cancel a connecting peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"read(from:completion:)","abstract":"

    Read from the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0J6ResultOctAA8SendableRzlF":{"name":"write(to:value:type:completion:)","abstract":"

    Write to the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC6listen2to20multipleListenOption10completionyAA24CharacteristicIdentifierV_AA08MultipleeF0OyAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"listen(to:multipleListenOption:completion:)","abstract":"

    Listen for notifications on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9endListen2to10completionyAA24CharacteristicIdentifierV_yAA11WriteResultOcSgtF":{"name":"endListen(to:completion:)","abstract":"

    End listening on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isListening2toSbAA24CharacteristicIdentifierV_tKF":{"name":"isListening(to:)","abstract":"

    Check if a peripheral is listening to a specific characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8readRSSIyyKF":{"name":"readRSSI()","abstract":"

    Attempts to read the RSSI (signal strength) of the currently connected peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyyAA22SynchronizedPeripheralCKc_yAA9RunResultOyytGctF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This is the simplest one as the background task will not return any typed values back to the completion block on finishing the background task, except for thrown errors, and it also doesn’t provide an input for an object that might need thread safe access.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyxAA22SynchronizedPeripheralCKc_yAA9RunResultOyxGctlF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run8userData14backgroundTask22completionOnMainThreadyx_q_AA22SynchronizedPeripheralC_xtKcyAA9RunResultOyq_Gctr0_lF":{"name":"run(userData:backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully, as well as supplying an object for thread safe access inside the background task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7combine9sendables10Foundation4DataVSayAA8Sendable_pG_tFZ":{"name":"combine(sendables:)","abstract":"

    A helper function to take an array of Sendables and combine their data together.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManagerDidUpdateState:":{"name":"centralManagerDidUpdateState(_:)","abstract":"

    Bluejay uses this to figure out whether Bluetooth is available or not.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:willRestoreState:":{"name":"centralManager(_:willRestoreState:)","abstract":"

    If Core Bluetooth will restore state, update Bluejay’s internal states to match the states of the Core Bluetooth stack by assigning the peripheral to connectingPeripheral or connectedPeripheral, or niling them out, depending on what the restored CBPeripheral state is.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didConnectPeripheral:":{"name":"centralManager(_:didConnect:)","abstract":"

    When connected, update Bluejay’s states by updating the values for connectingPeripheral, connectedPeripheral, and shouldAutoReconnect. Also, make sure to broadcast the event to observers, and notify the queue so that the current operation in-flight can process this event and get a chance to finish.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDisconnectPeripheral:error:":{"name":"centralManager(_:didDisconnectPeripheral:error:)","abstract":"

    Handle a disconnection event from Core Bluetooth by figuring out what kind of disconnection it is (planned or unplanned), and updating Bluejay’s internal state and sending notifications as appropriate.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didFailToConnectPeripheral:error:":{"name":"centralManager(_:didFailToConnect:error:)","abstract":"

    This mostly happens when either the Bluetooth device or the Core Bluetooth stack somehow only partially completes the negotiation of a connection. For simplicity, Bluejay is currently treating this as a disconnection event, so it can perform all the same clean up logic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDiscoverPeripheral:advertisementData:RSSI:":{"name":"centralManager(_:didDiscover:advertisementData:rssi:)","abstract":"

    This should only be called when the current operation in the queue is a Scan task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html":{"name":"Bluejay","abstract":"

    Bluejay is a simple wrapper around CoreBluetooth that focuses on making a common usage case as straight forward as possible: a single connected peripheral that the user is interacting with regularly (think most personal electronics devices that have an associated iOS app: fitness trackers, guitar amps, etc).

    "},"Classes/SynchronizedPeripheral.html":{"name":"SynchronizedPeripheral","abstract":"

    A synchronous interface to the Bluetooth peripheral, intended to be used inside the backgroundTask block of run(backgroundTask:completionOnMainThread:) to perform multi-part operations without the need for a complicated callback or promise setup.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "},"Typealiases.html":{"name":"Type Aliases","abstract":"

    The following type aliases are available globally.

    "}} \ No newline at end of file +{"Typealiases.html#/s:7Bluejay17RestoreIdentifiera":{"name":"RestoreIdentifier","abstract":"

    An alias to make it clearer that the string should be some kind of identifier for restoration, and not just any arbitrary string.

    "},"Typealiases.html#/s:7Bluejay13LaunchOptionsa":{"name":"LaunchOptions","abstract":"

    An alias to make it clearer that the dictionary should be the launch options from UIApplicationDelegate.

    "},"Typealiases.html#/s:7Bluejay14ListenCallbacka":{"name":"ListenCallback","abstract":"

    Gives name to a specific callback type used for listens.

    "},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Sensible default warning options: all off in favour of not aggressively notifying the user of changes when the app is backgrounded.

    ","parent_name":"WarningOptions"},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV18notifyOnConnection0dE13Disconnection0dE12NotificationACSb_S2btcfc":{"name":"init(notifyOnConnection:notifyOnDisconnection:notifyOnNotification:)","abstract":"

    Creates a connection options that can specify whether iOS can display a system alert when certain conditions are met while your app is suspended, usually an alert dialog outside of your app in the Home screen for example.

    ","parent_name":"WarningOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV20enableBluetoothAlert17backgroundRestoreACSb_AA010BackgroundH4ModeOtcfc":{"name":"init(enableBluetoothAlert:backgroundRestore:)","abstract":"

    Configurations for starting Bluejay.

    ","parent_name":"StartOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Convenience factory method to avoid having to use the public initializer.

    ","parent_name":"StartOptions"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this service.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSS_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a string. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSo6CBUUIDC_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two ServiceIdentifier.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV20peripheralIdentifierAA010PeripheralE0Vvp":{"name":"peripheralIdentifier","abstract":"

    The unique, persistent identifier associated with the peer.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV19advertisementPacketSDySSypGvp":{"name":"advertisementPacket","abstract":"

    The advertisement packet the discovered peripheral is sending.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV4rssiSivp":{"name":"rssi","abstract":"

    The signal strength of the peripheral discovered.

    ","parent_name":"ScanDiscovery"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    The UUID of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4nameSSvp":{"name":"name","abstract":"

    The name of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns both the name and uuid of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid4nameAC10Foundation4UUIDV_SSSgtcfc":{"name":"init(uuid:name:)","abstract":"

    Create a PeripheralIdentifier using a UUID.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SH9hashValueSivp":{"name":"hashValue","parent_name":"PeripheralIdentifier"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingVyACSicfc":{"name":"init(_:)","abstract":"

    Create empty data.

    ","parent_name":"DataPadding"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingV011toBluetoothB010Foundation0B0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to the Sendable protocol, which allows Bluejay to serialize DataPadding when performing write-related operations.

    ","parent_name":"DataPadding"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV7serviceAA07ServiceC0Vvp":{"name":"service","abstract":"

    The service this characteristic belongs to.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierVyACSo16CBCharacteristicCcfc":{"name":"init(_:)","abstract":"

    Create a CharacteristicIdentifier using a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns the essential description of a characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSS_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a string and a ServiceIdentifier. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSo6CBUUIDC_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a CBUUID and a ServiceIdentifier.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_So16CBCharacteristicCtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between a CharacteristicIdentifier and a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two CharacteristicIdentifiers.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifierSSvp":{"name":"restoreIdentifier","abstract":"

    A restore identifier helps uniquely identify which device is triggering background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV18backgroundRestorerAA0bF0_pvp":{"name":"backgroundRestorer","abstract":"

    A background restorer is required to handle the results of a background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV14listenRestorerAA06ListenF0_pvp":{"name":"listenRestorer","abstract":"

    A listen restorer is required for any potential unhandled listens when restoring to a connected peripheral.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV13launchOptionsSDySo019UIApplicationLaunchF3KeyaypGSgvp":{"name":"launchOptions","abstract":"

    The launch options from application(_:didFinishLaunchingWithOptions:) is required to parse the restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV11centralKeysSaySSGSgvp":{"name":"centralKeys","abstract":"

    Convenience return of bluetooth central keys from the launch options.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV015isRestoringFromB0Sbvp":{"name":"isRestoringFromBackground","abstract":"

    If CoreBluetooth is restoring from background, the bluetooth central keys from launch options will contain the designated restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifier18backgroundRestorer06listenH013launchOptionsACSS_AA0bH0_pAA06ListenH0_pSDySo019UIApplicationLaunchK3KeyaypGSgtcfc":{"name":"init(restoreIdentifier:backgroundRestorer:listenRestorer:launchOptions:)","abstract":"

    Initializes a container for all required configurations necessary to support background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html":{"name":"BackgroundRestoreConfig","abstract":"

    Contains all required configurations for background restoration.

    "},"Structs/CharacteristicIdentifier.html":{"name":"CharacteristicIdentifier","abstract":"

    A wrapper for CBUUID specific to a characteristic to help distinguish it from a CBUUID of a service.

    "},"Structs/DataPadding.html":{"name":"DataPadding","abstract":"

    Helper object that can create empty data to be used as padding in packet construction.

    "},"Structs/PeripheralIdentifier.html":{"name":"PeripheralIdentifier","abstract":"

    Uniquely identifies a peripheral to the current iOS device. The UUID changes and is different on different iOS devices.

    "},"Structs/ScanDiscovery.html":{"name":"ScanDiscovery","abstract":"

    A model capturing what is found from a scan callback.

    "},"Structs/ServiceIdentifier.html":{"name":"ServiceIdentifier","abstract":"

    A wrapper for CBUUID specific to a service to help distinguish it from a CBUUID of a characteristic.

    "},"Structs/StartOptions.html":{"name":"StartOptions","abstract":"

    Wrapper for CBCentralManager initialization configurations when starting a new Bluejay instance.

    "},"Structs/WarningOptions.html":{"name":"WarningOptions","abstract":"

    A connection’s configurations for system alerts.

    "},"Protocols/ServiceObserver.html#/s:7Bluejay15ServiceObserverP17didModifyServices4from011invalidatedF0yAA20PeripheralIdentifierV_SayAA0bJ0VGtF":{"name":"didModifyServices(from:invalidatedServices:)","abstract":"

    Called whenever a peripheral’s services change.

    ","parent_name":"ServiceObserver"},"Protocols/Sendable.html#/s:7Bluejay8SendableP15toBluetoothData10Foundation0E0VyF":{"name":"toBluetoothData()","abstract":"

    A place to implement your serialization logic.

    ","parent_name":"Sendable"},"Protocols/Receivable.html#/s:7Bluejay10ReceivableP13bluetoothDatax10Foundation0D0V_tKcfc":{"name":"init(bluetoothData:)","abstract":"

    A place to implement your deserialization logic.

    ","parent_name":"Receivable"},"Protocols/RSSIObserver.html#/s:7Bluejay12RSSIObserverP11didReadRSSI4from0E05erroryAA20PeripheralIdentifierV_So8NSNumberCs5Error_pSgtF":{"name":"didReadRSSI(from:RSSI:error:)","abstract":"

    Called whenever a peripheral’s RSSI value changes.

    ","parent_name":"RSSIObserver"},"Protocols/LogObserver.html#/s:7Bluejay11LogObserverP14logFileUpdated4logsySS_tF":{"name":"logFileUpdated(logs:)","abstract":"

    Called whenever the log file is updated.

    ","parent_name":"LogObserver"},"Protocols/ListenRestorer.html#/s:7Bluejay14ListenRestorerP019didReceiveUnhandledB04from2on4withAA0B13RestoreActionOAA20PeripheralIdentifierV_AA014CharacteristicM0V10Foundation4DataVSgtF":{"name":"didReceiveUnhandledListen(from:on:with:)","abstract":"

    Called whenever there is an unhandled listen.

    ","parent_name":"ListenRestorer"},"Protocols/DisconnectHandler.html#/s:7Bluejay17DisconnectHandlerP03didB04from4with13willReconnectAA04AutoH4ModeOAA20PeripheralIdentifierV_s5Error_pSgSbtF":{"name":"didDisconnect(from:with:willReconnect:)","abstract":"

    Notifies the delegate that the peripheral is fully disconnected.

    ","parent_name":"DisconnectHandler"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","abstract":"

    Called whenever Bluetooth availability changes, as well as when an object first subscribes to become a ConnectionObserver.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP9connected2toyAA20PeripheralIdentifierV_tF":{"name":"connected(to:)","abstract":"

    Called whenever a peripheral is connected, as well as when an object first subscribes to become a ConnectionObserver and the peripheral is already connected.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","abstract":"

    Called whenever a peripheral is disconnected.

    ","parent_name":"ConnectionObserver"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP20didRestoreConnection2toAA0bE10CompletionOAA20PeripheralIdentifierV_tF":{"name":"didRestoreConnection(to:)","abstract":"

    Bluejay was able to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP26didFailToRestoreConnection2to5errorAA0bG10CompletionOAA20PeripheralIdentifierV_s5Error_ptF":{"name":"didFailToRestoreConnection(to:error:)","abstract":"

    Bluejay failed to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html":{"name":"BackgroundRestorer","abstract":"

    Protocols for handling the results of a background restoration.

    "},"Protocols/ConnectionObserver.html":{"name":"ConnectionObserver","abstract":"

    A protocol allowing conforming objects registered to Bluejay to optionally respond to Bluetooth connection events.

    "},"Protocols/DisconnectHandler.html":{"name":"DisconnectHandler","abstract":"

    A protocol allowing a single delegate registered to Bluejay to have a final say at the end of a disconnection, as well as evaluate and control the auto-reconnect behaviour.

    "},"Protocols.html#/s:7Bluejay10FixedWidthP":{"name":"FixedWidth","abstract":"

    Marker protocol to help enforce extraction only on primitives or fixed width types.

    "},"Protocols/ListenRestorer.html":{"name":"ListenRestorer","abstract":"

    Protocol for handling a listen event that does not have a callback due to background restoration.

    "},"Protocols/LogObserver.html":{"name":"LogObserver","abstract":"

    A protocol allowing conforming objects to monitor log file changes.

    "},"Protocols/RSSIObserver.html":{"name":"RSSIObserver","abstract":"

    A protocol allowing conforming objects to monitor the RSSI changes of a connected peripheral.

    "},"Protocols/Receivable.html":{"name":"Receivable","abstract":"

    Protocol to indicate that a type can be received from the Bluetooth connection.

    "},"Protocols/Sendable.html":{"name":"Sendable","abstract":"

    Protocol to indicate that a type can be sent via the Bluetooth connection.

    "},"Protocols/ServiceObserver.html":{"name":"ServiceObserver","abstract":"

    A protocol allowing conforming objects to monitor the services changes of a connected peripheral.

    "},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverServices:":{"name":"peripheral(_:didDiscoverServices:)","abstract":"

    Captures CoreBluetooth’s did discover services event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverCharacteristicsForService:error:":{"name":"peripheral(_:didDiscoverCharacteristicsFor:error:)","abstract":"

    Captures CoreBluetooth’s did discover characteristics event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didWriteValueForCharacteristic:error:":{"name":"peripheral(_:didWriteValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did write to charactersitic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateValueForCharacteristic:error:":{"name":"peripheral(_:didUpdateValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did receive a notification/value from a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateNotificationStateForCharacteristic:error:":{"name":"peripheral(_:didUpdateNotificationStateFor:error:)","abstract":"

    Captures CoreBluetooth’s did turn on or off notification/listening on a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didReadRSSI:error:":{"name":"peripheral(_:didReadRSSI:error:)","abstract":"

    Captures CoreBluetooth’s did read RSSI event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didModifyServices:":{"name":"peripheral(_:didModifyServices:)","abstract":"

    Called when the peripheral removed or added services.

    ","parent_name":"Peripheral"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE15toBluetoothData10Foundation0D0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to Sendable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE13bluetoothDatax10Foundation0C0V_tcfc":{"name":"init(bluetoothData:)","abstract":"

    This function is required to conform to Receivable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6lengthxSi_SitKAD10FixedWidthRzlF":{"name":"extract(start:length:)","abstract":"

    Convenience function to read a range of Data and deserialize it into a fixed width type.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6lengthACSi_SitKF":{"name":"extract(start:length:)","abstract":"

    Convenience function to extract a range of Data.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6length8encodingSSSgSi_SiSSAAE8EncodingVtKF":{"name":"extract(start:length:encoding:)","abstract":"

    Convenience function to read a range of Data and deserialize it into a String.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE011toBluetoothB0ACyF":{"name":"toBluetoothData()","abstract":"

    Allows using Data as is when using Bluejay and working with write-related operations.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE09bluetoothB0A2C_tcfc":{"name":"init(bluetoothData:)","abstract":"

    Allows using Data as is when using Bluejay and working with read-related operations.

    ","parent_name":"Data"},"Extensions/CBService.html#/s:So9CBServiceC7BluejayE14characteristic4withSo16CBCharacteristicCSgSo6CBUUIDC_tF":{"name":"characteristic(with:)","abstract":"

    Find a characteristic on a service by CBUUID.

    ","parent_name":"CBService"},"Extensions/CBPeripheralState.html#/s:So17CBPeripheralStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBPeripheralState as a string.

    ","parent_name":"CBPeripheralState"},"Extensions/CBPeripheral.html#/s:So12CBPeripheralC7BluejayE7service4withSo9CBServiceCSgSo6CBUUIDC_tF":{"name":"service(with:)","abstract":"

    Find a service on a peripheral by CBUUID.

    ","parent_name":"CBPeripheral"},"Extensions/CBManagerState.html#/s:So14CBManagerStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBManagerState as a string.

    ","parent_name":"CBManagerState"},"Extensions/CBManagerState.html":{"name":"CBManagerState"},"Extensions/CBPeripheral.html":{"name":"CBPeripheral"},"Extensions/CBPeripheralState.html":{"name":"CBPeripheralState"},"Extensions/CBService.html":{"name":"CBService"},"Extensions/Data.html":{"name":"Data"},"Extensions/BinaryInteger.html":{"name":"BinaryInteger","abstract":"

    Extension to Int to make it Sendable and Receivable.

    "},"Extensions/Peripheral.html":{"name":"Peripheral"},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7successyA2CmF":{"name":"success","abstract":"

    The write is successful.

    ","parent_name":"WriteResult"},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The write has failed unexpectedly with an error.

    ","parent_name":"WriteResult"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3newyAcA0B7OptionsVcACmF":{"name":"new(_:)","abstract":"

    Start Bluejay using a new CBCentralManager.

    ","parent_name":"StartMode"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3useyACSo16CBCentralManagerC_So12CBPeripheralCSgtcACmF":{"name":"use(manager:peripheral:)","abstract":"

    Start Bluejay using an existing CBCentralManager.

    ","parent_name":"StartMode"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO8continueyA2CmF":{"name":"continue","abstract":"

    Continue scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO9blacklistyA2CmF":{"name":"blacklist","abstract":"

    Continue scanning, but don’t discover the same peripheral in the current callback again within the same scan session.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO4stopyA2CmF":{"name":"stop","abstract":"

    Stop scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO7connectyAcA0B9DiscoveryV_AA7TimeoutOAA14WarningOptionsVyAA16ConnectionResultOctcACmF":{"name":"connect(_:_:_:_:)","abstract":"

    Stop scanning, and connect to a discovery.

    ","parent_name":"ScanAction"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The background task is successful, and the returned value is captured in the associated value.

    ","parent_name":"RunResult"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The background task has failed unexpectedly with an error.

    ","parent_name":"RunResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The read is successful and the value read is captured in the associated value.

    ","parent_name":"ReadResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The read has failed unexpectedly with an error.

    ","parent_name":"ReadResult"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO4trapyA2CmF":{"name":"trap","abstract":"

    New listen and its new callback on the same characteristic will not overwrite an existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO11replaceableyA2CmF":{"name":"replaceable","abstract":"

    New listens and its new callback on the same characteristic will replace the existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO18promiseRestorationyA2CmF":{"name":"promiseRestoration","abstract":"

    Bluejay will continue to receive but do nothing with the incoming listen events until a new listener is installed.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO04stopB0yA2CmF":{"name":"stopListen","abstract":"

    Bluejay will attempt to turn off notifications on the peripheral.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO13keepListeningyA2CmF":{"name":"keepListening","abstract":"

    Keep listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO4doneyA2CmF":{"name":"done","abstract":"

    Stop listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20bluetoothUnavailableyA2CmF":{"name":"bluetoothUnavailable","abstract":"

    Bluetooth is either turned off or unavailable.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO24multipleScanNotSupportedyA2CmF":{"name":"multipleScanNotSupported","abstract":"

    Bluejay does not support another scanning request if Bluejay is still scanning.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO27multipleConnectNotSupportedyA2CmF":{"name":"multipleConnectNotSupported","abstract":"

    Bluejay does not support another connection request if Bluejay is already connected or still connecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO30multipleDisconnectNotSupportedyA2CmF":{"name":"multipleDisconnectNotSupported","abstract":"

    Bluejay does not support another disconnection request if Bluejay is still disconnecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18connectionTimedOutyA2CmF":{"name":"connectionTimedOut","abstract":"

    A connection request in Bluejay has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO12notConnectedyA2CmF":{"name":"notConnected","abstract":"

    Bluejay is not connected to a peripheral.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14missingServiceyAcA0D10IdentifierVcACmF":{"name":"missingService(_:)","abstract":"

    A Bluetooth service is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21missingCharacteristicyAcA0D10IdentifierVcACmF":{"name":"missingCharacteristic(_:)","abstract":"

    A Bluetooth characteristic is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO9cancelledyA2CmF":{"name":"cancelled","abstract":"

    A Bluetooth operation is cancelled.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18explicitDisconnectyA2CmF":{"name":"explicitDisconnect","abstract":"

    Bluejay disconnect is called.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedDisconnectyA2CmF":{"name":"unexpectedDisconnect","abstract":"

    Bluejay disconnected unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO16disconnectQueuedyA2CmF":{"name":"disconnectQueued","abstract":"

    A disconnection operation is queued.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14listenTimedOutyA2CmF":{"name":"listenTimedOut","abstract":"

    An attempt to listen on a characteristic has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO10readFailedyA2CmF":{"name":"readFailed","abstract":"

    An attempt to read a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11writeFailedyA2CmF":{"name":"writeFailed","abstract":"

    An attempt to write a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11missingDatayA2CmF":{"name":"missingData","abstract":"

    An attempt to read a value from a characteristic has returned no data unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15dataOutOfBoundsyACSi_S2itcACmF":{"name":"dataOutOfBounds(start:length:count:)","abstract":"

    An attempt to read a range of data has failed due to incorrect bounds or an unexpected length.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedPeripheralyAcA0D10IdentifierVcACmF":{"name":"unexpectedPeripheral(_:)","abstract":"

    An unexpected peripheral is cached and retrieved from CoreBluetooth.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO39allowDuplicatesInBackgroundNotSupportedyA2CmF":{"name":"allowDuplicatesInBackgroundNotSupported","abstract":"

    iOS will not continue scanning in the background if allow duplicates is turned on.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO37missingServiceIdentifiersInBackgroundyA2CmF":{"name":"missingServiceIdentifiersInBackground","abstract":"

    iOS will not continue scanning in the background if no service identifiers are specified.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21backgroundTaskRunningyA2CmF":{"name":"backgroundTaskRunning","abstract":"

    Bluejay does not support further Bluetooth operations while a Bluejay background task is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO34multipleBackgroundTaskNotSupportedyA2CmF":{"name":"multipleBackgroundTaskNotSupported","abstract":"

    Bluejay does not support another Bluejay background task when there is already one that is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15indefiniteFlushyA2CmF":{"name":"indefiniteFlush","abstract":"

    Indefinite flush will not exit.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO7stoppedyA2CmF":{"name":"stopped","abstract":"

    Bluejay has stopped.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO31backgroundRestorationInProgressyA2CmF":{"name":"backgroundRestorationInProgress","abstract":"

    Bluejay cannot perform certain actions when background restoration is still in progress.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO28startupBackgroundTaskExpiredyA2CmF":{"name":"startupBackgroundTaskExpired","abstract":"

    Startup background task has expired during state restoration.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21multipleListenTrappedyA2CmF":{"name":"multipleListenTrapped","abstract":"

    The original listen declared that duplicated listens are not allowed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO22multipleListenReplacedyA2CmF":{"name":"multipleListenReplaced","abstract":"

    The original listen declared that it can be replaced by a new listen.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation14LocalizedErrorP16errorDescriptionSSSgvp":{"name":"errorDescription","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP11errorDomainSSvpZ":{"name":"errorDomain","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP9errorCodeSivp":{"name":"errorCode","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"BluejayError"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO12disconnectedyAcA20PeripheralIdentifierVcACmF":{"name":"disconnected(_:)","abstract":"

    The disconnection is successful, and the disconnected peripheral is captured in the associated value.

    ","parent_name":"DisconnectionResult"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The disconnection has failed unexpectedly with an error.

    ","parent_name":"DisconnectionResult"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO8noChangeyA2CmF":{"name":"noChange","abstract":"

    Bluejay will maintain its current auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO6changeyACSb_tcACmF":{"name":"change(shouldAutoReconnect:)","abstract":"

    Override Bluejay’s auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7successyAcA20PeripheralIdentifierVcACmF":{"name":"success(_:)","abstract":"

    The connection is successful, and the peripheral connected is captured in the associated value.

    ","parent_name":"ConnectionResult"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The connection has failed unexpectedly with an error.

    ","parent_name":"ConnectionResult"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO7secondsyACSdcACmF":{"name":"seconds(_:)","abstract":"

    Specify a timeout with a duration in seconds.

    ","parent_name":"Timeout"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO4noneyA2CmF":{"name":"none","abstract":"

    Specify there is no timeout.

    ","parent_name":"Timeout"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8callbackyACyyccACmF":{"name":"callback(_:)","abstract":"

    Put required Bluejay API or application calls that are needed after a background restoration inside this callback.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8continueyA2CmF":{"name":"continue","abstract":"

    Return this if no callback is needed after a background restoration.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO7disableyA2CmF":{"name":"disable","abstract":"

    Bluejay will not start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO6enableyAcA0bC6ConfigVcACmF":{"name":"enable(_:)","abstract":"

    Bluejay will start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html":{"name":"BackgroundRestoreMode","abstract":"

    Determines how Bluejay should opt-in to CoreBluetooth state restoration.

    "},"Enums/BackgroundRestoreCompletion.html":{"name":"BackgroundRestoreCompletion","abstract":"

    Allows capturing further Bluejay operations to be queued and executed after background restoration is completed.

    "},"Enums/Timeout.html":{"name":"Timeout","abstract":"

    Types of connection time outs. Can specify a time out in seconds, or no time out.

    "},"Enums/ConnectionResult.html":{"name":"ConnectionResult","abstract":"

    Indicates a successful, cancelled, or failed connection attempt, where the success case contains the peripheral connected to.

    "},"Enums/AutoReconnectMode.html":{"name":"AutoReconnectMode","abstract":"

    Tells Bluejay whether it should auto-reconnect.

    "},"Enums/DisconnectionResult.html":{"name":"DisconnectionResult","abstract":"

    Indicates a successful, cancelled, or failed disconnection attempt, where the success case contains the peripheral disconnected from.

    "},"Enums/BluejayError.html":{"name":"BluejayError","abstract":"

    Errors specific to Bluejay.

    "},"Enums/ListenAction.html":{"name":"ListenAction","abstract":"

    Indicates whether the current listen on a characteristic should continue or end.

    "},"Enums/ListenRestoreAction.html":{"name":"ListenRestoreAction","abstract":"

    Available actions to take on an unhandled listen event from background restoration.

    "},"Enums/MultipleListenOption.html":{"name":"MultipleListenOption","abstract":"

    Ways to handle calling listen on the same characteristic multiple times.

    "},"Enums/ReadResult.html":{"name":"ReadResult","abstract":"

    Indicates a successful, cancelled, or failed read attempt, where the success case contains the value read.

    "},"Enums/RunResult.html":{"name":"RunResult","abstract":"

    Indicates a successful, cancelled, or failed run(backgroundTask:completionOnMainThread:) attempt, where the success case contains the value returned at the end of the background task.

    "},"Enums/ScanAction.html":{"name":"ScanAction","abstract":"

    Indicates whether a scan should continue, continue but blacklist the current discovery, stop, or stop and connect.

    "},"Enums/StartMode.html":{"name":"StartMode","abstract":"

    Specifies whether to start a new Bluejay instance from scratch, or from an existing CoreBluetooth session.

    "},"Enums/WriteResult.html":{"name":"WriteResult","abstract":"

    Indicates a successful, cancelled, or failed write attempt.

    "},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC4read4fromxAA24CharacteristicIdentifierV_tKAA10ReceivableRzlF":{"name":"read(from:)","abstract":"

    Read a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC5write2to5value4typeyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVtKAA8SendableRzlF":{"name":"write(to:value:type:)","abstract":"

    Write a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC12writeAndRead0D2To5value4type8readFromxAA24CharacteristicIdentifierV_q_So25CBCharacteristicWriteTypeVAJtKAA10ReceivableRzAA8SendableR_r0_lF":{"name":"writeAndRead(writeTo:value:type:readFrom:)","abstract":"

    Write to one characterestic then reading a value from another.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC6listen2to7timeout10completionyAA24CharacteristicIdentifierV_AA7TimeoutOAA12ListenActionOxctKAA10ReceivableRzlF":{"name":"listen(to:timeout:completion:)","abstract":"

    Listen for changes on a specified characterstic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtKF":{"name":"endListen(to:error:completion:)","abstract":"

    Stop listening to a characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC11flushListen2to14nonZeroTimeout10completionyAA24CharacteristicIdentifierV_AA0I0OyyctKF":{"name":"flushListen(to:nonZeroTimeout:completion:)","abstract":"

    Flush a listen to a characteristic by receiving and discarding values for the specified duration.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC14writeAndListen0D2To5value4type06listenG016timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVALSiAA0F6ActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndListen(writeTo:value:type:listenTo:timeoutInSeconds:completion:)","abstract":"

    Handle a compound operation consisting of writing on one characterstic followed by listening on another for some streamed data.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC16writeAndAssemble0D2To5value06listenG014expectedLength16timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xALS2iAA12ListenActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndAssemble(writeTo:value:listenTo:expectedLength:timeoutInSeconds:completion:)","abstract":"

    Similar to writeAndListen, but use this if you don’t know or don’t have control over how many packets will be sent to you. You still need to know the total size of the data you’re receiving.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicE4TypeV_tF":{"name":"maximumWriteValueLength(for:)","abstract":"

    Ask for the peripheral’s maximum payload length in bytes for a single write request.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","parent_name":"SynchronizedPeripheral"},"Classes/Bluejay.html#/s:7BluejayAAC4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    Helps distinguish one Bluejay instance from another.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC20isBluetoothAvailableSbvp":{"name":"isBluetoothAvailable","abstract":"

    Allows checking whether Bluetooth is powered on. Also returns false if Bluejay is not started yet.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBluetoothStateUpdateImminentSbvp":{"name":"isBluetoothStateUpdateImminent","abstract":"

    Allows checking for if CoreBluetooth state is transitional (update is imminent)","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12isConnectingSbvp":{"name":"isConnecting","abstract":"

    Allows checking whether Bluejay is currently connecting to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isConnectedSbvp":{"name":"isConnected","abstract":"

    Allows checking whether Bluejay is currently connected to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC15isDisconnectingSbvp":{"name":"isDisconnecting","abstract":"

    Allows checking whether Bluejay is currently disconnecting from a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC19shouldAutoReconnectSbvp":{"name":"shouldAutoReconnect","abstract":"

    Allowing checking whether Bluejay will automatic reconnect after an unexpected disconnection. Default is true, and Bluejay will also always set this to true on a successful connection to a peripheral. Conversely, Bluejay will always set this to false after an explicit disconnection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10isScanningSbvp":{"name":"isScanning","abstract":"

    Allows checking whether Bluejay is currently scanning.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10hasStartedSbvp":{"name":"hasStarted","abstract":"

    Allows checking whether Bluejay has started and is available for use.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC21defaultWarningOptionsAA0cD0Vvp":{"name":"defaultWarningOptions","abstract":"

    Warning options to use for each new connection if the options are not specified at the creation of those connections.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBackgroundRestorationEnabledSbvp":{"name":"isBackgroundRestorationEnabled","abstract":"

    Allows checking whether Bluejay has background restoration enabled.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3logyySSF":{"name":"log(_:)","abstract":"

    Allow apps that use Bluejay to log alongside of Bluejay’s internal logs.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7getLogsSSSgyF":{"name":"getLogs()","abstract":"

    Get the current content of the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9clearLogsyyF":{"name":"clearLogs()","abstract":"

    Clears the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@M@Bluejay@objc(cs)Bluejay(im)init":{"name":"init()","abstract":"

    Initializing a Bluejay instance will not yet initialize the CoreBluetooth stack. An explicit start call after Bluejay is intialized will then initialize the CoreBluetooth stack and is required because in cases where a state resotration is trying to restore a listen on a characteristic, a listen restorer must be available before the CoreBluetooth stack is re-initialized. This two-step startup allows you to prepare and gaurantee the setup of your listen restorer in between the initialization of Bluejay and the initialization of the CoreBluetooth stack.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5start4modeyAA9StartModeO_tF":{"name":"start(mode:)","abstract":"

    Starting Bluejay will initialize the CoreBluetooth stack. Simply initializing a Bluejay instance without calling this function will not initialize the CoreBluetooth stack. An explicit start call is required so that we can also support proper background restoration, where CoreBluetooth must be initialized in the AppDelegate’s application(_:didFinishLaunchingWithOptions:) for both starting an iOS background task and for parsing the restore identifier.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC28stopAndExtractBluetoothStateSo16CBCentralManagerC7manager_So12CBPeripheralCSg10peripheraltyF":{"name":"stopAndExtractBluetoothState()","abstract":"

    Stops all operations and clears all states in Bluejay before returning a Core Bluetooth state that can then be used by another library or code outside of Bluejay.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC16cancelEverything5error16shouldDisconnectys5Error_p_SbtF":{"name":"cancelEverything(error:shouldDisconnect:)","abstract":"

    This will cancel the current and all pending operations in the Bluejay queue. It will also disconnect by default after the queue is emptied, but you can cancel everything without disconnecting.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register18connectionObserveryAA010ConnectionD0_p_tF":{"name":"register(connectionObserver:)","abstract":"

    Register for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister18connectionObserveryAA010ConnectionD0_p_tF":{"name":"unregister(connectionObserver:)","abstract":"

    Unregister for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register12rssiObserveryAA12RSSIObserver_p_tF":{"name":"register(rssiObserver:)","abstract":"

    Register for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister12rssiObserveryAA12RSSIObserver_p_tF":{"name":"unregister(rssiObserver:)","abstract":"

    Unregister for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register15serviceObserveryAA07ServiceD0_p_tF":{"name":"register(serviceObserver:)","abstract":"

    Register for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister15serviceObserveryAA07ServiceD0_p_tF":{"name":"unregister(serviceObserver:)","abstract":"

    Unregister for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register11logObserveryAA03LogD0_p_tF":{"name":"register(logObserver:)","abstract":"

    Register for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister11logObserveryAA03LogD0_p_tF":{"name":"unregister(logObserver:)","abstract":"

    Unregister for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC25registerDisconnectHandler7handleryAA0cD0_p_tF":{"name":"registerDisconnectHandler(handler:)","abstract":"

    Register a single disconnection handler for giving it a final say on what to do at the end of a disconnection, as well as evaluate and control Bluejay’s auto-reconnect behaviour.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC27unregisterDisconnectHandleryyF":{"name":"unregisterDisconnectHandler()","abstract":"

    Remove any registered disconnection handler.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4scan8duration15allowDuplicates17throttleRSSIDelta18serviceIdentifiers9discovery7expired7stoppedySd_SbSiSayAA17ServiceIdentifierVGSgAA10ScanActionOAA0O9DiscoveryV_SayARGtcApR_AStcSgyAS_s5Error_pSgtctF":{"name":"scan(duration:allowDuplicates:throttleRSSIDelta:serviceIdentifiers:discovery:expired:stopped:)","abstract":"

    Scan for the peripheral(s) specified.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12stopScanningyyF":{"name":"stopScanning()","abstract":"

    Stops current or queued scan.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7connect_7timeout14warningOptions10completionyAA20PeripheralIdentifierV_AA7TimeoutOAA07WarningE0VSgyAA16ConnectionResultOctF":{"name":"connect(_:timeout:warningOptions:completion:)","abstract":"

    Attempt to connect directly to a known peripheral. The call will fail if Bluetooth is not available, or if Bluejay is already connected. Making a connection request while Bluejay is scanning will also cause Bluejay to stop the current scan for you behind the scene prior to fulfilling your connection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10disconnect9immediate10completionySb_yAA19DisconnectionResultOcSgtF":{"name":"disconnect(immediate:completion:)","abstract":"

    Disconnect a connected peripheral or cancel a connecting peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"read(from:completion:)","abstract":"

    Read from the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0J6ResultOctAA8SendableRzlF":{"name":"write(to:value:type:completion:)","abstract":"

    Write to the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC6listen2to20multipleListenOption10completionyAA24CharacteristicIdentifierV_AA08MultipleeF0OyAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"listen(to:multipleListenOption:completion:)","abstract":"

    Listen for notifications on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9endListen2to10completionyAA24CharacteristicIdentifierV_yAA11WriteResultOcSgtF":{"name":"endListen(to:completion:)","abstract":"

    End listening on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isListening2toSbAA24CharacteristicIdentifierV_tKF":{"name":"isListening(to:)","abstract":"

    Check if a peripheral is listening to a specific characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8readRSSIyyKF":{"name":"readRSSI()","abstract":"

    Attempts to read the RSSI (signal strength) of the currently connected peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyyAA22SynchronizedPeripheralCKc_yAA9RunResultOyytGctF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This is the simplest one as the background task will not return any typed values back to the completion block on finishing the background task, except for thrown errors, and it also doesn’t provide an input for an object that might need thread safe access.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyxAA22SynchronizedPeripheralCKc_yAA9RunResultOyxGctlF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run8userData14backgroundTask22completionOnMainThreadyx_q_AA22SynchronizedPeripheralC_xtKcyAA9RunResultOyq_Gctr0_lF":{"name":"run(userData:backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully, as well as supplying an object for thread safe access inside the background task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7combine9sendables10Foundation4DataVSayAA8Sendable_pG_tFZ":{"name":"combine(sendables:)","abstract":"

    A helper function to take an array of Sendables and combine their data together.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManagerDidUpdateState:":{"name":"centralManagerDidUpdateState(_:)","abstract":"

    Bluejay uses this to figure out whether Bluetooth is available or not.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:willRestoreState:":{"name":"centralManager(_:willRestoreState:)","abstract":"

    If Core Bluetooth will restore state, update Bluejay’s internal states to match the states of the Core Bluetooth stack by assigning the peripheral to connectingPeripheral or connectedPeripheral, or niling them out, depending on what the restored CBPeripheral state is.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didConnectPeripheral:":{"name":"centralManager(_:didConnect:)","abstract":"

    When connected, update Bluejay’s states by updating the values for connectingPeripheral, connectedPeripheral, and shouldAutoReconnect. Also, make sure to broadcast the event to observers, and notify the queue so that the current operation in-flight can process this event and get a chance to finish.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDisconnectPeripheral:error:":{"name":"centralManager(_:didDisconnectPeripheral:error:)","abstract":"

    Handle a disconnection event from Core Bluetooth by figuring out what kind of disconnection it is (planned or unplanned), and updating Bluejay’s internal state and sending notifications as appropriate.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didFailToConnectPeripheral:error:":{"name":"centralManager(_:didFailToConnect:error:)","abstract":"

    This mostly happens when either the Bluetooth device or the Core Bluetooth stack somehow only partially completes the negotiation of a connection. For simplicity, Bluejay is currently treating this as a disconnection event, so it can perform all the same clean up logic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDiscoverPeripheral:advertisementData:RSSI:":{"name":"centralManager(_:didDiscover:advertisementData:rssi:)","abstract":"

    This should only be called when the current operation in the queue is a Scan task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html":{"name":"Bluejay","abstract":"

    Bluejay is a simple wrapper around CoreBluetooth that focuses on making a common usage case as straight forward as possible: a single connected peripheral that the user is interacting with regularly (think most personal electronics devices that have an associated iOS app: fitness trackers, guitar amps, etc).

    "},"Classes/SynchronizedPeripheral.html":{"name":"SynchronizedPeripheral","abstract":"

    A synchronous interface to the Bluetooth peripheral, intended to be used inside the backgroundTask block of run(backgroundTask:completionOnMainThread:) to perform multi-part operations without the need for a complicated callback or promise setup.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "},"Typealiases.html":{"name":"Type Aliases","abstract":"

    The following type aliases are available globally.

    "}} \ No newline at end of file diff --git a/docs/docsets/Bluejay.docset/Contents/Resources/docSet.dsidx b/docs/docsets/Bluejay.docset/Contents/Resources/docSet.dsidx index 09deeff..46daa69 100644 Binary files a/docs/docsets/Bluejay.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/Bluejay.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/Bluejay.tgz b/docs/docsets/Bluejay.tgz index 2a07ab6..dd93799 100644 Binary files a/docs/docsets/Bluejay.tgz and b/docs/docsets/Bluejay.tgz differ diff --git a/docs/index.html b/docs/index.html index 673b0ef..1361ea3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -112,9 +112,6 @@ - + @@ -144,6 +144,9 @@ +
  • Interactions @@ -259,6 +264,7 @@

    Index

  • Write and Assemble
  • Flush Listen
  • CoreBluetooth Migration
  • +
  • Monitor Peripheral Services
  • Features

    @@ -655,6 +661,40 @@

    Sending and Receiving

    In some cases, you may want to send or receive data simple enough that creating a custom struct which implements Sendable or Receivable to hold it is unnecessarily complicated. For those cases, Bluejay also retroactively conforms several built-in Swift types to Sendable and Receivable. Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Data are all conformed to both protocols and so they can all be sent or received directly.

    Int and UInt are intentionally not conformed. Bluetooth values are always sent and/or received at a specific bit width. The intended bit width for an Int is ambiguous, and trying to use one often indicates a programmer error, in the form of not considering the bit width the Bluetooth device is expecting on a characteristic.

    +

    Strings

    + +

    String is special because encoding can vary and it is not a fixed width type, so you cannot use a String on its own as a Sendable nor Receivable. To work around this, wrap the string data inside a Sendable and/or Receivable struct, then use iOS’ Foundation framework to serialize and/or to deserialize. But when deserializing, one of Bluejay’s extract helpers does provide a slightly more convenient interface. For examples:

    + +

    Serializing a packet containing a string

    +
    struct MyBluetoothPacket: Sendable {
    +
    +    private let deviceName: String
    +
    +    init(deviceName: String) {
    +        self.deviceName = deviceName
    +    }
    +
    +    func toBluetoothData() -> Data {
    +        // Should probably validate the length here before sending it to your peripheral.
    +        return deviceName.data(using: .utf8) ?? Data()
    +    }
    +
    +}
    +
    + +

    Deserializing a packet containing a string

    +
    struct MyBluetoothPacket: Receivable {
    +
    +    private var deviceName: String?
    +
    +    init(bluetoothData: Data) throws {
    +        deviceName = try bluetoothData.extract(start: 0, length: 10, encoding: .utf8)
    +    }
    +
    +}
    +
    + +

    Note: As with the majority of Bluetooth data you work with, you should know the length beforehand, and especially so for both incoming and outgoing strings.

    Interactions

    Once you have your data modelled using either the Receivable or Sendable protocol, the read, write, and listen APIs in Bluejay should handle the deserialization and serialization seamlessly for you. All you need to do is to specify the type for the generic result wrappers: ReadResult<T> or WriteResult<T>.

    @@ -992,6 +1032,29 @@

    CoreBluetooth Migration

    Finally, you can check whether Bluejay has been started or stopped using the hasStarted property.

    +

    Monitor Peripheral Services

    + +

    Some peripherals can add or remove services while it’s being used, and Bluejay provides a basic way to react to this. See BluejayHeartSensorDemo and DittojayHeartSensorDemo in the project for more examples.

    +
    bluejay.register(serviceObserver: self)
    +
    +
    func didModifyServices(
    +  from peripheral: PeripheralIdentifier,
    +  invalidatedServices: [ServiceIdentifier]) {
    +    if invalidatedServices.contains(where: { invalidatedServiceIdentifier -> Bool in
    +        invalidatedServiceIdentifier == chirpCharacteristic.service
    +    }) {
    +        endListen(to: chirpCharacteristic)
    +    } else if invalidatedServices.isEmpty {
    +        listen(to: chirpCharacteristic)
    +    }
    +}
    +
    + +

    Notes from Apple:

    + +
    +

    If you previously discovered any of the services that have changed, they are provided in the invalidatedServices parameter and can no longer be used. You can use the discoverServices: method to discover any new services that have been added to the peripheral’s database or to find out whether any of the invalidated services that you were using (and want to continue using) have been added back to a different location in the peripheral’s database.

    +

    API Documentation

    We have more in-depth API documentation for Bluejay using inline documentation and Jazzy.

    @@ -1000,7 +1063,7 @@

    API Documentation

    diff --git a/docs/search.json b/docs/search.json index 0eb592c..b074416 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -{"Typealiases.html#/s:7Bluejay17RestoreIdentifiera":{"name":"RestoreIdentifier","abstract":"

    An alias to make it clearer that the string should be some kind of identifier for restoration, and not just any arbitrary string.

    "},"Typealiases.html#/s:7Bluejay13LaunchOptionsa":{"name":"LaunchOptions","abstract":"

    An alias to make it clearer that the dictionary should be the launch options from UIApplicationDelegate.

    "},"Typealiases.html#/s:7Bluejay14ListenCallbacka":{"name":"ListenCallback","abstract":"

    Gives name to a specific callback type used for listens.

    "},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Sensible default warning options: all off in favour of not aggressively notifying the user of changes when the app is backgrounded.

    ","parent_name":"WarningOptions"},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV18notifyOnConnection0dE13Disconnection0dE12NotificationACSb_S2btcfc":{"name":"init(notifyOnConnection:notifyOnDisconnection:notifyOnNotification:)","abstract":"

    Creates a connection options that can specify whether iOS can display a system alert when certain conditions are met while your app is suspended, usually an alert dialog outside of your app in the Home screen for example.

    ","parent_name":"WarningOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV20enableBluetoothAlert17backgroundRestoreACSb_AA010BackgroundH4ModeOtcfc":{"name":"init(enableBluetoothAlert:backgroundRestore:)","abstract":"

    Configurations for starting Bluejay.

    ","parent_name":"StartOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Convenience factory method to avoid having to use the public initializer.

    ","parent_name":"StartOptions"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this service.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSS_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a string. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSo6CBUUIDC_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two ServiceIdentifier.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV20peripheralIdentifierAA010PeripheralE0Vvp":{"name":"peripheralIdentifier","abstract":"

    The unique, persistent identifier associated with the peer.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV19advertisementPacketSDySSypGvp":{"name":"advertisementPacket","abstract":"

    The advertisement packet the discovered peripheral is sending.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV4rssiSivp":{"name":"rssi","abstract":"

    The signal strength of the peripheral discovered.

    ","parent_name":"ScanDiscovery"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    The UUID of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4nameSSvp":{"name":"name","abstract":"

    The name of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns both the name and uuid of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid4nameAC10Foundation4UUIDV_SSSgtcfc":{"name":"init(uuid:name:)","abstract":"

    Create a PeripheralIdentifier using a UUID.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SH9hashValueSivp":{"name":"hashValue","parent_name":"PeripheralIdentifier"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingVyACSicfc":{"name":"init(_:)","abstract":"

    Create empty data.

    ","parent_name":"DataPadding"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingV011toBluetoothB010Foundation0B0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to the Sendable protocol, which allows Bluejay to serialize DataPadding when performing write-related operations.

    ","parent_name":"DataPadding"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV7serviceAA07ServiceC0Vvp":{"name":"service","abstract":"

    The service this characteristic belongs to.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierVyACSo16CBCharacteristicCcfc":{"name":"init(_:)","abstract":"

    Create a CharacteristicIdentifier using a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns the essential description of a characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSS_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a string and a ServiceIdentifier. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSo6CBUUIDC_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a CBUUID and a ServiceIdentifier.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_So16CBCharacteristicCtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between a CharacteristicIdentifier and a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two CharacteristicIdentifiers.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifierSSvp":{"name":"restoreIdentifier","abstract":"

    A restore identifier helps uniquely identify which device is triggering background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV18backgroundRestorerAA0bF0_pvp":{"name":"backgroundRestorer","abstract":"

    A background restorer is required to handle the results of a background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV14listenRestorerAA06ListenF0_pvp":{"name":"listenRestorer","abstract":"

    A listen restorer is required for any potential unhandled listens when restoring to a connected peripheral.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV13launchOptionsSDySo019UIApplicationLaunchF3KeyaypGSgvp":{"name":"launchOptions","abstract":"

    The launch options from application(_:didFinishLaunchingWithOptions:) is required to parse the restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV11centralKeysSaySSGSgvp":{"name":"centralKeys","abstract":"

    Convenience return of bluetooth central keys from the launch options.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV015isRestoringFromB0Sbvp":{"name":"isRestoringFromBackground","abstract":"

    If CoreBluetooth is restoring from background, the bluetooth central keys from launch options will contain the designated restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifier18backgroundRestorer06listenH013launchOptionsACSS_AA0bH0_pAA06ListenH0_pSDySo019UIApplicationLaunchK3KeyaypGSgtcfc":{"name":"init(restoreIdentifier:backgroundRestorer:listenRestorer:launchOptions:)","abstract":"

    Initializes a container for all required configurations necessary to support background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html":{"name":"BackgroundRestoreConfig","abstract":"

    Contains all required configurations for background restoration.

    "},"Structs/CharacteristicIdentifier.html":{"name":"CharacteristicIdentifier","abstract":"

    A wrapper for CBUUID specific to a characteristic to help distinguish it from a CBUUID of a service.

    "},"Structs/DataPadding.html":{"name":"DataPadding","abstract":"

    Helper object that can create empty data to be used as padding in packet construction.

    "},"Structs/PeripheralIdentifier.html":{"name":"PeripheralIdentifier","abstract":"

    Uniquely identifies a peripheral to the current iOS device. The UUID changes and is different on different iOS devices.

    "},"Structs/ScanDiscovery.html":{"name":"ScanDiscovery","abstract":"

    A model capturing what is found from a scan callback.

    "},"Structs/ServiceIdentifier.html":{"name":"ServiceIdentifier","abstract":"

    A wrapper for CBUUID specific to a service to help distinguish it from a CBUUID of a characteristic.

    "},"Structs/StartOptions.html":{"name":"StartOptions","abstract":"

    Wrapper for CBCentralManager initialization configurations when starting a new Bluejay instance.

    "},"Structs/WarningOptions.html":{"name":"WarningOptions","abstract":"

    A connection’s configurations for system alerts.

    "},"Protocols/Sendable.html#/s:7Bluejay8SendableP15toBluetoothData10Foundation0E0VyF":{"name":"toBluetoothData()","abstract":"

    A place to implement your serialization logic.

    ","parent_name":"Sendable"},"Protocols/Receivable.html#/s:7Bluejay10ReceivableP13bluetoothDatax10Foundation0D0V_tKcfc":{"name":"init(bluetoothData:)","abstract":"

    A place to implement your deserialization logic.

    ","parent_name":"Receivable"},"Protocols/RSSIObserver.html#/s:7Bluejay12RSSIObserverP11didReadRSSI4from0E05erroryAA20PeripheralIdentifierV_So8NSNumberCs5Error_pSgtF":{"name":"didReadRSSI(from:RSSI:error:)","abstract":"

    Called whenever a peripheral’s RSSI value changes.

    ","parent_name":"RSSIObserver"},"Protocols/LogObserver.html#/s:7Bluejay11LogObserverP14logFileUpdated4logsySS_tF":{"name":"logFileUpdated(logs:)","abstract":"

    Called whenever the log file is updated.

    ","parent_name":"LogObserver"},"Protocols/ListenRestorer.html#/s:7Bluejay14ListenRestorerP019didReceiveUnhandledB04from2on4withAA0B13RestoreActionOAA20PeripheralIdentifierV_AA014CharacteristicM0V10Foundation4DataVSgtF":{"name":"didReceiveUnhandledListen(from:on:with:)","abstract":"

    Called whenever there is an unhandled listen.

    ","parent_name":"ListenRestorer"},"Protocols/DisconnectHandler.html#/s:7Bluejay17DisconnectHandlerP03didB04from4with13willReconnectAA04AutoH4ModeOAA20PeripheralIdentifierV_s5Error_pSgSbtF":{"name":"didDisconnect(from:with:willReconnect:)","abstract":"

    Notifies the delegate that the peripheral is fully disconnected.

    ","parent_name":"DisconnectHandler"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","abstract":"

    Called whenever Bluetooth availability changes, as well as when an object first subscribes to become a ConnectionObserver.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP9connected2toyAA20PeripheralIdentifierV_tF":{"name":"connected(to:)","abstract":"

    Called whenever a peripheral is connected, as well as when an object first subscribes to become a ConnectionObserver and the peripheral is already connected.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","abstract":"

    Called whenever a peripheral is disconnected.

    ","parent_name":"ConnectionObserver"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP20didRestoreConnection2toAA0bE10CompletionOAA20PeripheralIdentifierV_tF":{"name":"didRestoreConnection(to:)","abstract":"

    Bluejay was able to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP26didFailToRestoreConnection2to5errorAA0bG10CompletionOAA20PeripheralIdentifierV_s5Error_ptF":{"name":"didFailToRestoreConnection(to:error:)","abstract":"

    Bluejay failed to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html":{"name":"BackgroundRestorer","abstract":"

    Protocols for handling the results of a background restoration.

    "},"Protocols/ConnectionObserver.html":{"name":"ConnectionObserver","abstract":"

    A protocol allowing conforming objects registered to Bluejay to optionally respond to Bluetooth connection events.

    "},"Protocols/DisconnectHandler.html":{"name":"DisconnectHandler","abstract":"

    A protocol allowing a single delegate registered to Bluejay to have a final say at the end of a disconnection, as well as evaluate and control the auto-reconnect behaviour.

    "},"Protocols/ListenRestorer.html":{"name":"ListenRestorer","abstract":"

    Protocol for handling a listen event that does not have a callback due to background restoration.

    "},"Protocols/LogObserver.html":{"name":"LogObserver","abstract":"

    A protocol allowing conforming objects to monitor log file changes.

    "},"Protocols/RSSIObserver.html":{"name":"RSSIObserver","abstract":"

    A protocol allowing conforming objects to monitor the RSSI changes of a connected peripheral.

    "},"Protocols/Receivable.html":{"name":"Receivable","abstract":"

    Protocol to indicate that a type can be received from the Bluetooth connection.

    "},"Protocols/Sendable.html":{"name":"Sendable","abstract":"

    Protocol to indicate that a type can be sent via the Bluetooth connection.

    "},"Extensions/String.html#/s:7Bluejay10ReceivableP13bluetoothDatax10Foundation0D0V_tKcfc":{"name":"init(bluetoothData:)","parent_name":"String"},"Extensions/String.html#/s:7Bluejay8SendableP15toBluetoothData10Foundation0E0VyF":{"name":"toBluetoothData()","parent_name":"String"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverServices:":{"name":"peripheral(_:didDiscoverServices:)","abstract":"

    Captures CoreBluetooth’s did discover services event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverCharacteristicsForService:error:":{"name":"peripheral(_:didDiscoverCharacteristicsFor:error:)","abstract":"

    Captures CoreBluetooth’s did discover characteristics event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didWriteValueForCharacteristic:error:":{"name":"peripheral(_:didWriteValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did write to charactersitic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateValueForCharacteristic:error:":{"name":"peripheral(_:didUpdateValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did receive a notification/value from a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateNotificationStateForCharacteristic:error:":{"name":"peripheral(_:didUpdateNotificationStateFor:error:)","abstract":"

    Captures CoreBluetooth’s did turn on or off notification/listening on a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didReadRSSI:error:":{"name":"peripheral(_:didReadRSSI:error:)","abstract":"

    Captures CoreBluetooth’s did read RSSI event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE15toBluetoothData10Foundation0D0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to Sendable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE13bluetoothDatax10Foundation0C0V_tcfc":{"name":"init(bluetoothData:)","abstract":"

    This function is required to conform to Receivable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6lengthxSi_SitKlF":{"name":"extract(start:length:)","abstract":"

    Convenience function to read a range of Data and deserialize it into the specified type.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE011toBluetoothB0ACyF":{"name":"toBluetoothData()","abstract":"

    Allows using Data as is when using Bluejay and working with write-related operations.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE09bluetoothB0A2C_tcfc":{"name":"init(bluetoothData:)","abstract":"

    Allows using Data as is when using Bluejay and working with read-related operations.

    ","parent_name":"Data"},"Extensions/CBService.html#/s:So9CBServiceC7BluejayE14characteristic4withSo16CBCharacteristicCSgSo6CBUUIDC_tF":{"name":"characteristic(with:)","abstract":"

    Find a characteristic on a service by CBUUID.

    ","parent_name":"CBService"},"Extensions/CBPeripheralState.html#/s:So17CBPeripheralStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBPeripheralState as a string.

    ","parent_name":"CBPeripheralState"},"Extensions/CBPeripheral.html#/s:So12CBPeripheralC7BluejayE7service4withSo9CBServiceCSgSo6CBUUIDC_tF":{"name":"service(with:)","abstract":"

    Find a service on a peripheral by CBUUID.

    ","parent_name":"CBPeripheral"},"Extensions/CBManagerState.html#/s:So14CBManagerStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBManagerState as a string.

    ","parent_name":"CBManagerState"},"Extensions/CBManagerState.html":{"name":"CBManagerState"},"Extensions/CBPeripheral.html":{"name":"CBPeripheral"},"Extensions/CBPeripheralState.html":{"name":"CBPeripheralState"},"Extensions/CBService.html":{"name":"CBService"},"Extensions/Data.html":{"name":"Data"},"Extensions/BinaryInteger.html":{"name":"BinaryInteger","abstract":"

    Extension to Int to make it Sendable and Receivable.

    "},"Extensions/Peripheral.html":{"name":"Peripheral"},"Extensions/String.html":{"name":"String","abstract":"

    Make String Sendable and Receivable.

    "},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7successyA2CmF":{"name":"success","abstract":"

    The write is successful.

    ","parent_name":"WriteResult"},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The write has failed unexpectedly with an error.

    ","parent_name":"WriteResult"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3newyAcA0B7OptionsVcACmF":{"name":"new(_:)","abstract":"

    Start Bluejay using a new CBCentralManager.

    ","parent_name":"StartMode"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3useyACSo16CBCentralManagerC_So12CBPeripheralCSgtcACmF":{"name":"use(manager:peripheral:)","abstract":"

    Start Bluejay using an existing CBCentralManager.

    ","parent_name":"StartMode"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO8continueyA2CmF":{"name":"continue","abstract":"

    Continue scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO9blacklistyA2CmF":{"name":"blacklist","abstract":"

    Continue scanning, but don’t discover the same peripheral in the current callback again within the same scan session.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO4stopyA2CmF":{"name":"stop","abstract":"

    Stop scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO7connectyAcA0B9DiscoveryV_AA7TimeoutOAA14WarningOptionsVyAA16ConnectionResultOctcACmF":{"name":"connect(_:_:_:_:)","abstract":"

    Stop scanning, and connect to a discovery.

    ","parent_name":"ScanAction"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The background task is successful, and the returned value is captured in the associated value.

    ","parent_name":"RunResult"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The background task has failed unexpectedly with an error.

    ","parent_name":"RunResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The read is successful and the value read is captured in the associated value.

    ","parent_name":"ReadResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The read has failed unexpectedly with an error.

    ","parent_name":"ReadResult"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO4trapyA2CmF":{"name":"trap","abstract":"

    New listen and its new callback on the same characteristic will not overwrite an existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO11replaceableyA2CmF":{"name":"replaceable","abstract":"

    New listens and its new callback on the same characteristic will replace the existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO18promiseRestorationyA2CmF":{"name":"promiseRestoration","abstract":"

    Bluejay will continue to receive but do nothing with the incoming listen events until a new listener is installed.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO04stopB0yA2CmF":{"name":"stopListen","abstract":"

    Bluejay will attempt to turn off notifications on the peripheral.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO13keepListeningyA2CmF":{"name":"keepListening","abstract":"

    Keep listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO4doneyA2CmF":{"name":"done","abstract":"

    Stop listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20bluetoothUnavailableyA2CmF":{"name":"bluetoothUnavailable","abstract":"

    Bluetooth is either turned off or unavailable.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO24multipleScanNotSupportedyA2CmF":{"name":"multipleScanNotSupported","abstract":"

    Bluejay does not support another scanning request if Bluejay is still scanning.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO27multipleConnectNotSupportedyA2CmF":{"name":"multipleConnectNotSupported","abstract":"

    Bluejay does not support another connection request if Bluejay is already connected or still connecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO30multipleDisconnectNotSupportedyA2CmF":{"name":"multipleDisconnectNotSupported","abstract":"

    Bluejay does not support another disconnection request if Bluejay is still disconnecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18connectionTimedOutyA2CmF":{"name":"connectionTimedOut","abstract":"

    A connection request in Bluejay has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO12notConnectedyA2CmF":{"name":"notConnected","abstract":"

    Bluejay is not connected to a peripheral.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14missingServiceyAcA0D10IdentifierVcACmF":{"name":"missingService(_:)","abstract":"

    A Bluetooth service is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21missingCharacteristicyAcA0D10IdentifierVcACmF":{"name":"missingCharacteristic(_:)","abstract":"

    A Bluetooth characteristic is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO9cancelledyA2CmF":{"name":"cancelled","abstract":"

    A Bluetooth operation is cancelled.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18explicitDisconnectyA2CmF":{"name":"explicitDisconnect","abstract":"

    Bluejay disconnect is called.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedDisconnectyA2CmF":{"name":"unexpectedDisconnect","abstract":"

    Bluejay disconnected unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO16disconnectQueuedyA2CmF":{"name":"disconnectQueued","abstract":"

    A disconnection operation is queued.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14listenTimedOutyA2CmF":{"name":"listenTimedOut","abstract":"

    An attempt to listen on a characteristic has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO10readFailedyA2CmF":{"name":"readFailed","abstract":"

    An attempt to read a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11writeFailedyA2CmF":{"name":"writeFailed","abstract":"

    An attempt to write a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11missingDatayA2CmF":{"name":"missingData","abstract":"

    An attempt to read a value from a characteristic has returned no data unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15dataOutOfBoundsyACSi_S2itcACmF":{"name":"dataOutOfBounds(start:length:count:)","abstract":"

    An attempt to read a range of data has failed due to incorrect bounds or an unexpected length.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedPeripheralyAcA0D10IdentifierVcACmF":{"name":"unexpectedPeripheral(_:)","abstract":"

    An unexpected peripheral is cached and retrieved from CoreBluetooth.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO39allowDuplicatesInBackgroundNotSupportedyA2CmF":{"name":"allowDuplicatesInBackgroundNotSupported","abstract":"

    iOS will not continue scanning in the background if allow duplicates is turned on.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO37missingServiceIdentifiersInBackgroundyA2CmF":{"name":"missingServiceIdentifiersInBackground","abstract":"

    iOS will not continue scanning in the background if no service identifiers are specified.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21backgroundTaskRunningyA2CmF":{"name":"backgroundTaskRunning","abstract":"

    Bluejay does not support further Bluetooth operations while a Bluejay background task is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO34multipleBackgroundTaskNotSupportedyA2CmF":{"name":"multipleBackgroundTaskNotSupported","abstract":"

    Bluejay does not support another Bluejay background task when there is already one that is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15indefiniteFlushyA2CmF":{"name":"indefiniteFlush","abstract":"

    Indefinite flush will not exit.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO7stoppedyA2CmF":{"name":"stopped","abstract":"

    Bluejay has stopped.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO31backgroundRestorationInProgressyA2CmF":{"name":"backgroundRestorationInProgress","abstract":"

    Bluejay cannot perform certain actions when background restoration is still in progress.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO28startupBackgroundTaskExpiredyA2CmF":{"name":"startupBackgroundTaskExpired","abstract":"

    Startup background task has expired during state restoration.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21multipleListenTrappedyA2CmF":{"name":"multipleListenTrapped","abstract":"

    The original listen declared that duplicated listens are not allowed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO22multipleListenReplacedyA2CmF":{"name":"multipleListenReplaced","abstract":"

    The original listen declared that it can be replaced by a new listen.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation14LocalizedErrorP16errorDescriptionSSSgvp":{"name":"errorDescription","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP11errorDomainSSvpZ":{"name":"errorDomain","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP9errorCodeSivp":{"name":"errorCode","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"BluejayError"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO12disconnectedyAcA20PeripheralIdentifierVcACmF":{"name":"disconnected(_:)","abstract":"

    The disconnection is successful, and the disconnected peripheral is captured in the associated value.

    ","parent_name":"DisconnectionResult"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The disconnection has failed unexpectedly with an error.

    ","parent_name":"DisconnectionResult"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO8noChangeyA2CmF":{"name":"noChange","abstract":"

    Bluejay will maintain its current auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO6changeyACSb_tcACmF":{"name":"change(shouldAutoReconnect:)","abstract":"

    Override Bluejay’s auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7successyAcA20PeripheralIdentifierVcACmF":{"name":"success(_:)","abstract":"

    The connection is successful, and the peripheral connected is captured in the associated value.

    ","parent_name":"ConnectionResult"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The connection has failed unexpectedly with an error.

    ","parent_name":"ConnectionResult"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO7secondsyACSdcACmF":{"name":"seconds(_:)","abstract":"

    Specify a timeout with a duration in seconds.

    ","parent_name":"Timeout"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO4noneyA2CmF":{"name":"none","abstract":"

    Specify there is no timeout.

    ","parent_name":"Timeout"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8callbackyACyyccACmF":{"name":"callback(_:)","abstract":"

    Put required Bluejay API or application calls that are needed after a background restoration inside this callback.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8continueyA2CmF":{"name":"continue","abstract":"

    Return this if no callback is needed after a background restoration.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO7disableyA2CmF":{"name":"disable","abstract":"

    Bluejay will not start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO6enableyAcA0bC6ConfigVcACmF":{"name":"enable(_:)","abstract":"

    Bluejay will start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html":{"name":"BackgroundRestoreMode","abstract":"

    Determines how Bluejay should opt-in to CoreBluetooth state restoration.

    "},"Enums/BackgroundRestoreCompletion.html":{"name":"BackgroundRestoreCompletion","abstract":"

    Allows capturing further Bluejay operations to be queued and executed after background restoration is completed.

    "},"Enums/Timeout.html":{"name":"Timeout","abstract":"

    Types of connection time outs. Can specify a time out in seconds, or no time out.

    "},"Enums/ConnectionResult.html":{"name":"ConnectionResult","abstract":"

    Indicates a successful, cancelled, or failed connection attempt, where the success case contains the peripheral connected to.

    "},"Enums/AutoReconnectMode.html":{"name":"AutoReconnectMode","abstract":"

    Tells Bluejay whether it should auto-reconnect.

    "},"Enums/DisconnectionResult.html":{"name":"DisconnectionResult","abstract":"

    Indicates a successful, cancelled, or failed disconnection attempt, where the success case contains the peripheral disconnected from.

    "},"Enums/BluejayError.html":{"name":"BluejayError","abstract":"

    Errors specific to Bluejay.

    "},"Enums/ListenAction.html":{"name":"ListenAction","abstract":"

    Indicates whether the current listen on a characteristic should continue or end.

    "},"Enums/ListenRestoreAction.html":{"name":"ListenRestoreAction","abstract":"

    Available actions to take on an unhandled listen event from background restoration.

    "},"Enums/MultipleListenOption.html":{"name":"MultipleListenOption","abstract":"

    Ways to handle calling listen on the same characteristic multiple times.

    "},"Enums/ReadResult.html":{"name":"ReadResult","abstract":"

    Indicates a successful, cancelled, or failed read attempt, where the success case contains the value read.

    "},"Enums/RunResult.html":{"name":"RunResult","abstract":"

    Indicates a successful, cancelled, or failed run(backgroundTask:completionOnMainThread:) attempt, where the success case contains the value returned at the end of the background task.

    "},"Enums/ScanAction.html":{"name":"ScanAction","abstract":"

    Indicates whether a scan should continue, continue but blacklist the current discovery, stop, or stop and connect.

    "},"Enums/StartMode.html":{"name":"StartMode","abstract":"

    Specifies whether to start a new Bluejay instance from scratch, or from an existing CoreBluetooth session.

    "},"Enums/WriteResult.html":{"name":"WriteResult","abstract":"

    Indicates a successful, cancelled, or failed write attempt.

    "},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC4read4fromxAA24CharacteristicIdentifierV_tKAA10ReceivableRzlF":{"name":"read(from:)","abstract":"

    Read a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC5write2to5value4typeyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVtKAA8SendableRzlF":{"name":"write(to:value:type:)","abstract":"

    Write a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC12writeAndRead0D2To5value4type8readFromxAA24CharacteristicIdentifierV_q_So25CBCharacteristicWriteTypeVAJtKAA10ReceivableRzAA8SendableR_r0_lF":{"name":"writeAndRead(writeTo:value:type:readFrom:)","abstract":"

    Write to one characterestic then reading a value from another.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC6listen2to7timeout10completionyAA24CharacteristicIdentifierV_AA7TimeoutOAA12ListenActionOxctKAA10ReceivableRzlF":{"name":"listen(to:timeout:completion:)","abstract":"

    Listen for changes on a specified characterstic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtKF":{"name":"endListen(to:error:completion:)","abstract":"

    Stop listening to a characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC11flushListen2to14nonZeroTimeout10completionyAA24CharacteristicIdentifierV_AA0I0OyyctKF":{"name":"flushListen(to:nonZeroTimeout:completion:)","abstract":"

    Flush a listen to a characteristic by receiving and discarding values for the specified duration.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC14writeAndListen0D2To5value4type06listenG016timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVALSiAA0F6ActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndListen(writeTo:value:type:listenTo:timeoutInSeconds:completion:)","abstract":"

    Handle a compound operation consisting of writing on one characterstic followed by listening on another for some streamed data.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC16writeAndAssemble0D2To5value06listenG014expectedLength16timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xALS2iAA12ListenActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndAssemble(writeTo:value:listenTo:expectedLength:timeoutInSeconds:completion:)","abstract":"

    Similar to writeAndListen, but use this if you don’t know or don’t have control over how many packets will be sent to you. You still need to know the total size of the data you’re receiving.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicE4TypeV_tF":{"name":"maximumWriteValueLength(for:)","abstract":"

    Ask for the peripheral’s maximum payload length in bytes for a single write request.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","parent_name":"SynchronizedPeripheral"},"Classes/Bluejay.html#/s:7BluejayAAC4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    Helps distinguish one Bluejay instance from another.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC20isBluetoothAvailableSbvp":{"name":"isBluetoothAvailable","abstract":"

    Allows checking whether Bluetooth is powered on. Also returns false if Bluejay is not started yet.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBluetoothStateUpdateImminentSbvp":{"name":"isBluetoothStateUpdateImminent","abstract":"

    Allows checking for if CoreBluetooth state is transitional (update is imminent)","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12isConnectingSbvp":{"name":"isConnecting","abstract":"

    Allows checking whether Bluejay is currently connecting to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isConnectedSbvp":{"name":"isConnected","abstract":"

    Allows checking whether Bluejay is currently connected to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC15isDisconnectingSbvp":{"name":"isDisconnecting","abstract":"

    Allows checking whether Bluejay is currently disconnecting from a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC19shouldAutoReconnectSbvp":{"name":"shouldAutoReconnect","abstract":"

    Allowing checking whether Bluejay will automatic reconnect after an unexpected disconnection. Default is true, and Bluejay will also always set this to true on a successful connection to a peripheral. Conversely, Bluejay will always set this to false after an explicit disconnection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10isScanningSbvp":{"name":"isScanning","abstract":"

    Allows checking whether Bluejay is currently scanning.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10hasStartedSbvp":{"name":"hasStarted","abstract":"

    Allows checking whether Bluejay has started and is available for use.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC21defaultWarningOptionsAA0cD0Vvp":{"name":"defaultWarningOptions","abstract":"

    Warning options to use for each new connection if the options are not specified at the creation of those connections.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBackgroundRestorationEnabledSbvp":{"name":"isBackgroundRestorationEnabled","abstract":"

    Allows checking whether Bluejay has background restoration enabled.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3logyySSF":{"name":"log(_:)","abstract":"

    Allow apps that use Bluejay to log alongside of Bluejay’s internal logs.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7getLogsSSSgyF":{"name":"getLogs()","abstract":"

    Get the current content of the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9clearLogsyyF":{"name":"clearLogs()","abstract":"

    Clears the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@M@Bluejay@objc(cs)Bluejay(im)init":{"name":"init()","abstract":"

    Initializing a Bluejay instance will not yet initialize the CoreBluetooth stack. An explicit start call after Bluejay is intialized will then initialize the CoreBluetooth stack and is required because in cases where a state resotration is trying to restore a listen on a characteristic, a listen restorer must be available before the CoreBluetooth stack is re-initialized. This two-step startup allows you to prepare and gaurantee the setup of your listen restorer in between the initialization of Bluejay and the initialization of the CoreBluetooth stack.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5start4modeyAA9StartModeO_tF":{"name":"start(mode:)","abstract":"

    Starting Bluejay will initialize the CoreBluetooth stack. Simply initializing a Bluejay instance without calling this function will not initialize the CoreBluetooth stack. An explicit start call is required so that we can also support proper background restoration, where CoreBluetooth must be initialized in the AppDelegate’s application(_:didFinishLaunchingWithOptions:) for both starting an iOS background task and for parsing the restore identifier.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC28stopAndExtractBluetoothStateSo16CBCentralManagerC7manager_So12CBPeripheralCSg10peripheraltyF":{"name":"stopAndExtractBluetoothState()","abstract":"

    Stops all operations and clears all states in Bluejay before returning a Core Bluetooth state that can then be used by another library or code outside of Bluejay.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC16cancelEverything5error16shouldDisconnectys5Error_p_SbtF":{"name":"cancelEverything(error:shouldDisconnect:)","abstract":"

    This will cancel the current and all pending operations in the Bluejay queue. It will also disconnect by default after the queue is emptied, but you can cancel everything without disconnecting.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register18connectionObserveryAA010ConnectionD0_p_tF":{"name":"register(connectionObserver:)","abstract":"

    Register for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister18connectionObserveryAA010ConnectionD0_p_tF":{"name":"unregister(connectionObserver:)","abstract":"

    Unregister for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register12rssiObserveryAA12RSSIObserver_p_tF":{"name":"register(rssiObserver:)","abstract":"

    Register for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister12rssiObserveryAA12RSSIObserver_p_tF":{"name":"unregister(rssiObserver:)","abstract":"

    Unregister for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register11logObserveryAA03LogD0_p_tF":{"name":"register(logObserver:)","abstract":"

    Register for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister11logObserveryAA03LogD0_p_tF":{"name":"unregister(logObserver:)","abstract":"

    Unregister for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC25registerDisconnectHandler7handleryAA0cD0_p_tF":{"name":"registerDisconnectHandler(handler:)","abstract":"

    Register a single disconnection handler for giving it a final say on what to do at the end of a disconnection, as well as evaluate and control Bluejay’s auto-reconnect behaviour.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC27unregisterDisconnectHandleryyF":{"name":"unregisterDisconnectHandler()","abstract":"

    Remove any registered disconnection handler.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4scan8duration15allowDuplicates17throttleRSSIDelta18serviceIdentifiers9discovery7expired7stoppedySd_SbSiSayAA17ServiceIdentifierVGSgAA10ScanActionOAA0O9DiscoveryV_SayARGtcApR_AStcSgyAS_s5Error_pSgtctF":{"name":"scan(duration:allowDuplicates:throttleRSSIDelta:serviceIdentifiers:discovery:expired:stopped:)","abstract":"

    Scan for the peripheral(s) specified.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12stopScanningyyF":{"name":"stopScanning()","abstract":"

    Stops current or queued scan.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7connect_7timeout14warningOptions10completionyAA20PeripheralIdentifierV_AA7TimeoutOAA07WarningE0VSgyAA16ConnectionResultOctF":{"name":"connect(_:timeout:warningOptions:completion:)","abstract":"

    Attempt to connect directly to a known peripheral. The call will fail if Bluetooth is not available, or if Bluejay is already connected. Making a connection request while Bluejay is scanning will also cause Bluejay to stop the current scan for you behind the scene prior to fulfilling your connection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10disconnect9immediate10completionySb_yAA19DisconnectionResultOcSgtF":{"name":"disconnect(immediate:completion:)","abstract":"

    Disconnect a connected peripheral or cancel a connecting peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"read(from:completion:)","abstract":"

    Read from the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0J6ResultOctAA8SendableRzlF":{"name":"write(to:value:type:completion:)","abstract":"

    Write to the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC6listen2to20multipleListenOption10completionyAA24CharacteristicIdentifierV_AA08MultipleeF0OyAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"listen(to:multipleListenOption:completion:)","abstract":"

    Listen for notifications on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9endListen2to10completionyAA24CharacteristicIdentifierV_yAA11WriteResultOcSgtF":{"name":"endListen(to:completion:)","abstract":"

    End listening on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isListening2toSbAA24CharacteristicIdentifierV_tKF":{"name":"isListening(to:)","abstract":"

    Check if a peripheral is listening to a specific characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8readRSSIyyKF":{"name":"readRSSI()","abstract":"

    Attempts to read the RSSI (signal strength) of the currently connected peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyyAA22SynchronizedPeripheralCKc_yAA9RunResultOyytGctF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This is the simplest one as the background task will not return any typed values back to the completion block on finishing the background task, except for thrown errors, and it also doesn’t provide an input for an object that might need thread safe access.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyxAA22SynchronizedPeripheralCKc_yAA9RunResultOyxGctlF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run8userData14backgroundTask22completionOnMainThreadyx_q_AA22SynchronizedPeripheralC_xtKcyAA9RunResultOyq_Gctr0_lF":{"name":"run(userData:backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully, as well as supplying an object for thread safe access inside the background task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7combine9sendables10Foundation4DataVSayAA8Sendable_pG_tFZ":{"name":"combine(sendables:)","abstract":"

    A helper function to take an array of Sendables and combine their data together.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManagerDidUpdateState:":{"name":"centralManagerDidUpdateState(_:)","abstract":"

    Bluejay uses this to figure out whether Bluetooth is available or not.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:willRestoreState:":{"name":"centralManager(_:willRestoreState:)","abstract":"

    If Core Bluetooth will restore state, update Bluejay’s internal states to match the states of the Core Bluetooth stack by assigning the peripheral to connectingPeripheral or connectedPeripheral, or niling them out, depending on what the restored CBPeripheral state is.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didConnectPeripheral:":{"name":"centralManager(_:didConnect:)","abstract":"

    When connected, update Bluejay’s states by updating the values for connectingPeripheral, connectedPeripheral, and shouldAutoReconnect. Also, make sure to broadcast the event to observers, and notify the queue so that the current operation in-flight can process this event and get a chance to finish.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDisconnectPeripheral:error:":{"name":"centralManager(_:didDisconnectPeripheral:error:)","abstract":"

    Handle a disconnection event from Core Bluetooth by figuring out what kind of disconnection it is (planned or unplanned), and updating Bluejay’s internal state and sending notifications as appropriate.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didFailToConnectPeripheral:error:":{"name":"centralManager(_:didFailToConnect:error:)","abstract":"

    This mostly happens when either the Bluetooth device or the Core Bluetooth stack somehow only partially completes the negotiation of a connection. For simplicity, Bluejay is currently treating this as a disconnection event, so it can perform all the same clean up logic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDiscoverPeripheral:advertisementData:RSSI:":{"name":"centralManager(_:didDiscover:advertisementData:rssi:)","abstract":"

    This should only be called when the current operation in the queue is a Scan task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html":{"name":"Bluejay","abstract":"

    Bluejay is a simple wrapper around CoreBluetooth that focuses on making a common usage case as straight forward as possible: a single connected peripheral that the user is interacting with regularly (think most personal electronics devices that have an associated iOS app: fitness trackers, guitar amps, etc).

    "},"Classes/SynchronizedPeripheral.html":{"name":"SynchronizedPeripheral","abstract":"

    A synchronous interface to the Bluetooth peripheral, intended to be used inside the backgroundTask block of run(backgroundTask:completionOnMainThread:) to perform multi-part operations without the need for a complicated callback or promise setup.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "},"Typealiases.html":{"name":"Type Aliases","abstract":"

    The following type aliases are available globally.

    "}} \ No newline at end of file +{"Typealiases.html#/s:7Bluejay17RestoreIdentifiera":{"name":"RestoreIdentifier","abstract":"

    An alias to make it clearer that the string should be some kind of identifier for restoration, and not just any arbitrary string.

    "},"Typealiases.html#/s:7Bluejay13LaunchOptionsa":{"name":"LaunchOptions","abstract":"

    An alias to make it clearer that the dictionary should be the launch options from UIApplicationDelegate.

    "},"Typealiases.html#/s:7Bluejay14ListenCallbacka":{"name":"ListenCallback","abstract":"

    Gives name to a specific callback type used for listens.

    "},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Sensible default warning options: all off in favour of not aggressively notifying the user of changes when the app is backgrounded.

    ","parent_name":"WarningOptions"},"Structs/WarningOptions.html#/s:7Bluejay14WarningOptionsV18notifyOnConnection0dE13Disconnection0dE12NotificationACSb_S2btcfc":{"name":"init(notifyOnConnection:notifyOnDisconnection:notifyOnNotification:)","abstract":"

    Creates a connection options that can specify whether iOS can display a system alert when certain conditions are met while your app is suspended, usually an alert dialog outside of your app in the Home screen for example.

    ","parent_name":"WarningOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV20enableBluetoothAlert17backgroundRestoreACSb_AA010BackgroundH4ModeOtcfc":{"name":"init(enableBluetoothAlert:backgroundRestore:)","abstract":"

    Configurations for starting Bluejay.

    ","parent_name":"StartOptions"},"Structs/StartOptions.html#/s:7Bluejay12StartOptionsV7defaultACvpZ":{"name":"default","abstract":"

    Convenience factory method to avoid having to use the public initializer.

    ","parent_name":"StartOptions"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this service.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSS_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a string. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV4uuidACSo6CBUUIDC_tcfc":{"name":"init(uuid:)","abstract":"

    Create a ServiceIdentifier using a CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two ServiceIdentifier.

    ","parent_name":"ServiceIdentifier"},"Structs/ServiceIdentifier.html#/s:7Bluejay17ServiceIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"ServiceIdentifier"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV20peripheralIdentifierAA010PeripheralE0Vvp":{"name":"peripheralIdentifier","abstract":"

    The unique, persistent identifier associated with the peer.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV19advertisementPacketSDySSypGvp":{"name":"advertisementPacket","abstract":"

    The advertisement packet the discovered peripheral is sending.

    ","parent_name":"ScanDiscovery"},"Structs/ScanDiscovery.html#/s:7Bluejay13ScanDiscoveryV4rssiSivp":{"name":"rssi","abstract":"

    The signal strength of the peripheral discovered.

    ","parent_name":"ScanDiscovery"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    The UUID of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4nameSSvp":{"name":"name","abstract":"

    The name of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns both the name and uuid of the peripheral.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:7Bluejay20PeripheralIdentifierV4uuid4nameAC10Foundation4UUIDV_SSSgtcfc":{"name":"init(uuid:name:)","abstract":"

    Create a PeripheralIdentifier using a UUID.

    ","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"PeripheralIdentifier"},"Structs/PeripheralIdentifier.html#/s:SH9hashValueSivp":{"name":"hashValue","parent_name":"PeripheralIdentifier"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingVyACSicfc":{"name":"init(_:)","abstract":"

    Create empty data.

    ","parent_name":"DataPadding"},"Structs/DataPadding.html#/s:7Bluejay11DataPaddingV011toBluetoothB010Foundation0B0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to the Sendable protocol, which allows Bluejay to serialize DataPadding when performing write-related operations.

    ","parent_name":"DataPadding"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV7serviceAA07ServiceC0Vvp":{"name":"service","abstract":"

    The service this characteristic belongs to.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuidSo6CBUUIDCvp":{"name":"uuid","abstract":"

    The CBUUID of this characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierVyACSo16CBCharacteristicCcfc":{"name":"init(_:)","abstract":"

    Create a CharacteristicIdentifier using a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV11descriptionSSvp":{"name":"description","abstract":"

    Returns the essential description of a characteristic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSS_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a string and a ServiceIdentifier. Please supply a valid 128-bit UUID, or a valid 16 or 32-bit commonly used UUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV4uuid7serviceACSo6CBUUIDC_AA07ServiceC0Vtcfc":{"name":"init(uuid:service:)","abstract":"

    Create a CharacteristicIdentifier using a CBUUID and a ServiceIdentifier.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_So16CBCharacteristicCtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between a CharacteristicIdentifier and a CBCharacterstic.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

    Check equality between two CharacteristicIdentifiers.

    ","parent_name":"CharacteristicIdentifier"},"Structs/CharacteristicIdentifier.html#/s:7Bluejay24CharacteristicIdentifierV9hashValueSivp":{"name":"hashValue","abstract":"

    The hash value of the CBUUID.

    ","parent_name":"CharacteristicIdentifier"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifierSSvp":{"name":"restoreIdentifier","abstract":"

    A restore identifier helps uniquely identify which device is triggering background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV18backgroundRestorerAA0bF0_pvp":{"name":"backgroundRestorer","abstract":"

    A background restorer is required to handle the results of a background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV14listenRestorerAA06ListenF0_pvp":{"name":"listenRestorer","abstract":"

    A listen restorer is required for any potential unhandled listens when restoring to a connected peripheral.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV13launchOptionsSDySo019UIApplicationLaunchF3KeyaypGSgvp":{"name":"launchOptions","abstract":"

    The launch options from application(_:didFinishLaunchingWithOptions:) is required to parse the restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV11centralKeysSaySSGSgvp":{"name":"centralKeys","abstract":"

    Convenience return of bluetooth central keys from the launch options.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV015isRestoringFromB0Sbvp":{"name":"isRestoringFromBackground","abstract":"

    If CoreBluetooth is restoring from background, the bluetooth central keys from launch options will contain the designated restore identifier.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html#/s:7Bluejay23BackgroundRestoreConfigV17restoreIdentifier18backgroundRestorer06listenH013launchOptionsACSS_AA0bH0_pAA06ListenH0_pSDySo019UIApplicationLaunchK3KeyaypGSgtcfc":{"name":"init(restoreIdentifier:backgroundRestorer:listenRestorer:launchOptions:)","abstract":"

    Initializes a container for all required configurations necessary to support background restoration.

    ","parent_name":"BackgroundRestoreConfig"},"Structs/BackgroundRestoreConfig.html":{"name":"BackgroundRestoreConfig","abstract":"

    Contains all required configurations for background restoration.

    "},"Structs/CharacteristicIdentifier.html":{"name":"CharacteristicIdentifier","abstract":"

    A wrapper for CBUUID specific to a characteristic to help distinguish it from a CBUUID of a service.

    "},"Structs/DataPadding.html":{"name":"DataPadding","abstract":"

    Helper object that can create empty data to be used as padding in packet construction.

    "},"Structs/PeripheralIdentifier.html":{"name":"PeripheralIdentifier","abstract":"

    Uniquely identifies a peripheral to the current iOS device. The UUID changes and is different on different iOS devices.

    "},"Structs/ScanDiscovery.html":{"name":"ScanDiscovery","abstract":"

    A model capturing what is found from a scan callback.

    "},"Structs/ServiceIdentifier.html":{"name":"ServiceIdentifier","abstract":"

    A wrapper for CBUUID specific to a service to help distinguish it from a CBUUID of a characteristic.

    "},"Structs/StartOptions.html":{"name":"StartOptions","abstract":"

    Wrapper for CBCentralManager initialization configurations when starting a new Bluejay instance.

    "},"Structs/WarningOptions.html":{"name":"WarningOptions","abstract":"

    A connection’s configurations for system alerts.

    "},"Protocols/ServiceObserver.html#/s:7Bluejay15ServiceObserverP17didModifyServices4from011invalidatedF0yAA20PeripheralIdentifierV_SayAA0bJ0VGtF":{"name":"didModifyServices(from:invalidatedServices:)","abstract":"

    Called whenever a peripheral’s services change.

    ","parent_name":"ServiceObserver"},"Protocols/Sendable.html#/s:7Bluejay8SendableP15toBluetoothData10Foundation0E0VyF":{"name":"toBluetoothData()","abstract":"

    A place to implement your serialization logic.

    ","parent_name":"Sendable"},"Protocols/Receivable.html#/s:7Bluejay10ReceivableP13bluetoothDatax10Foundation0D0V_tKcfc":{"name":"init(bluetoothData:)","abstract":"

    A place to implement your deserialization logic.

    ","parent_name":"Receivable"},"Protocols/RSSIObserver.html#/s:7Bluejay12RSSIObserverP11didReadRSSI4from0E05erroryAA20PeripheralIdentifierV_So8NSNumberCs5Error_pSgtF":{"name":"didReadRSSI(from:RSSI:error:)","abstract":"

    Called whenever a peripheral’s RSSI value changes.

    ","parent_name":"RSSIObserver"},"Protocols/LogObserver.html#/s:7Bluejay11LogObserverP14logFileUpdated4logsySS_tF":{"name":"logFileUpdated(logs:)","abstract":"

    Called whenever the log file is updated.

    ","parent_name":"LogObserver"},"Protocols/ListenRestorer.html#/s:7Bluejay14ListenRestorerP019didReceiveUnhandledB04from2on4withAA0B13RestoreActionOAA20PeripheralIdentifierV_AA014CharacteristicM0V10Foundation4DataVSgtF":{"name":"didReceiveUnhandledListen(from:on:with:)","abstract":"

    Called whenever there is an unhandled listen.

    ","parent_name":"ListenRestorer"},"Protocols/DisconnectHandler.html#/s:7Bluejay17DisconnectHandlerP03didB04from4with13willReconnectAA04AutoH4ModeOAA20PeripheralIdentifierV_s5Error_pSgSbtF":{"name":"didDisconnect(from:with:willReconnect:)","abstract":"

    Notifies the delegate that the peripheral is fully disconnected.

    ","parent_name":"DisconnectHandler"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","abstract":"

    Called whenever Bluetooth availability changes, as well as when an object first subscribes to become a ConnectionObserver.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP9connected2toyAA20PeripheralIdentifierV_tF":{"name":"connected(to:)","abstract":"

    Called whenever a peripheral is connected, as well as when an object first subscribes to become a ConnectionObserver and the peripheral is already connected.

    ","parent_name":"ConnectionObserver"},"Protocols/ConnectionObserver.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","abstract":"

    Called whenever a peripheral is disconnected.

    ","parent_name":"ConnectionObserver"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP20didRestoreConnection2toAA0bE10CompletionOAA20PeripheralIdentifierV_tF":{"name":"didRestoreConnection(to:)","abstract":"

    Bluejay was able to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html#/s:7Bluejay18BackgroundRestorerP26didFailToRestoreConnection2to5errorAA0bG10CompletionOAA20PeripheralIdentifierV_s5Error_ptF":{"name":"didFailToRestoreConnection(to:error:)","abstract":"

    Bluejay failed to restore a connection.

    ","parent_name":"BackgroundRestorer"},"Protocols/BackgroundRestorer.html":{"name":"BackgroundRestorer","abstract":"

    Protocols for handling the results of a background restoration.

    "},"Protocols/ConnectionObserver.html":{"name":"ConnectionObserver","abstract":"

    A protocol allowing conforming objects registered to Bluejay to optionally respond to Bluetooth connection events.

    "},"Protocols/DisconnectHandler.html":{"name":"DisconnectHandler","abstract":"

    A protocol allowing a single delegate registered to Bluejay to have a final say at the end of a disconnection, as well as evaluate and control the auto-reconnect behaviour.

    "},"Protocols.html#/s:7Bluejay10FixedWidthP":{"name":"FixedWidth","abstract":"

    Marker protocol to help enforce extraction only on primitives or fixed width types.

    "},"Protocols/ListenRestorer.html":{"name":"ListenRestorer","abstract":"

    Protocol for handling a listen event that does not have a callback due to background restoration.

    "},"Protocols/LogObserver.html":{"name":"LogObserver","abstract":"

    A protocol allowing conforming objects to monitor log file changes.

    "},"Protocols/RSSIObserver.html":{"name":"RSSIObserver","abstract":"

    A protocol allowing conforming objects to monitor the RSSI changes of a connected peripheral.

    "},"Protocols/Receivable.html":{"name":"Receivable","abstract":"

    Protocol to indicate that a type can be received from the Bluetooth connection.

    "},"Protocols/Sendable.html":{"name":"Sendable","abstract":"

    Protocol to indicate that a type can be sent via the Bluetooth connection.

    "},"Protocols/ServiceObserver.html":{"name":"ServiceObserver","abstract":"

    A protocol allowing conforming objects to monitor the services changes of a connected peripheral.

    "},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverServices:":{"name":"peripheral(_:didDiscoverServices:)","abstract":"

    Captures CoreBluetooth’s did discover services event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverCharacteristicsForService:error:":{"name":"peripheral(_:didDiscoverCharacteristicsFor:error:)","abstract":"

    Captures CoreBluetooth’s did discover characteristics event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didWriteValueForCharacteristic:error:":{"name":"peripheral(_:didWriteValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did write to charactersitic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateValueForCharacteristic:error:":{"name":"peripheral(_:didUpdateValueFor:error:)","abstract":"

    Captures CoreBluetooth’s did receive a notification/value from a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateNotificationStateForCharacteristic:error:":{"name":"peripheral(_:didUpdateNotificationStateFor:error:)","abstract":"

    Captures CoreBluetooth’s did turn on or off notification/listening on a characteristic event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didReadRSSI:error:":{"name":"peripheral(_:didReadRSSI:error:)","abstract":"

    Captures CoreBluetooth’s did read RSSI event and pass it to Bluejay’s queue for processing.

    ","parent_name":"Peripheral"},"Extensions/Peripheral.html#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didModifyServices:":{"name":"peripheral(_:didModifyServices:)","abstract":"

    Called when the peripheral removed or added services.

    ","parent_name":"Peripheral"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE15toBluetoothData10Foundation0D0VyF":{"name":"toBluetoothData()","abstract":"

    This function is required to conform to Sendable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/BinaryInteger.html#/s:Sz7BluejayE13bluetoothDatax10Foundation0C0V_tcfc":{"name":"init(bluetoothData:)","abstract":"

    This function is required to conform to Receivable, and figures out the size of the Integer used by the iOS device.

    ","parent_name":"BinaryInteger"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6lengthxSi_SitKAD10FixedWidthRzlF":{"name":"extract(start:length:)","abstract":"

    Convenience function to read a range of Data and deserialize it into a fixed width type.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6lengthACSi_SitKF":{"name":"extract(start:length:)","abstract":"

    Convenience function to extract a range of Data.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE7extract5start6length8encodingSSSgSi_SiSSAAE8EncodingVtKF":{"name":"extract(start:length:encoding:)","abstract":"

    Convenience function to read a range of Data and deserialize it into a String.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE011toBluetoothB0ACyF":{"name":"toBluetoothData()","abstract":"

    Allows using Data as is when using Bluejay and working with write-related operations.

    ","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV7BluejayE09bluetoothB0A2C_tcfc":{"name":"init(bluetoothData:)","abstract":"

    Allows using Data as is when using Bluejay and working with read-related operations.

    ","parent_name":"Data"},"Extensions/CBService.html#/s:So9CBServiceC7BluejayE14characteristic4withSo16CBCharacteristicCSgSo6CBUUIDC_tF":{"name":"characteristic(with:)","abstract":"

    Find a characteristic on a service by CBUUID.

    ","parent_name":"CBService"},"Extensions/CBPeripheralState.html#/s:So17CBPeripheralStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBPeripheralState as a string.

    ","parent_name":"CBPeripheralState"},"Extensions/CBPeripheral.html#/s:So12CBPeripheralC7BluejayE7service4withSo9CBServiceCSgSo6CBUUIDC_tF":{"name":"service(with:)","abstract":"

    Find a service on a peripheral by CBUUID.

    ","parent_name":"CBPeripheral"},"Extensions/CBManagerState.html#/s:So14CBManagerStateV7BluejayE6stringSSyF":{"name":"string()","abstract":"

    Returns the name of a CBManagerState as a string.

    ","parent_name":"CBManagerState"},"Extensions/CBManagerState.html":{"name":"CBManagerState"},"Extensions/CBPeripheral.html":{"name":"CBPeripheral"},"Extensions/CBPeripheralState.html":{"name":"CBPeripheralState"},"Extensions/CBService.html":{"name":"CBService"},"Extensions/Data.html":{"name":"Data"},"Extensions/BinaryInteger.html":{"name":"BinaryInteger","abstract":"

    Extension to Int to make it Sendable and Receivable.

    "},"Extensions/Peripheral.html":{"name":"Peripheral"},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7successyA2CmF":{"name":"success","abstract":"

    The write is successful.

    ","parent_name":"WriteResult"},"Enums/WriteResult.html#/s:7Bluejay11WriteResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The write has failed unexpectedly with an error.

    ","parent_name":"WriteResult"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3newyAcA0B7OptionsVcACmF":{"name":"new(_:)","abstract":"

    Start Bluejay using a new CBCentralManager.

    ","parent_name":"StartMode"},"Enums/StartMode.html#/s:7Bluejay9StartModeO3useyACSo16CBCentralManagerC_So12CBPeripheralCSgtcACmF":{"name":"use(manager:peripheral:)","abstract":"

    Start Bluejay using an existing CBCentralManager.

    ","parent_name":"StartMode"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO8continueyA2CmF":{"name":"continue","abstract":"

    Continue scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO9blacklistyA2CmF":{"name":"blacklist","abstract":"

    Continue scanning, but don’t discover the same peripheral in the current callback again within the same scan session.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO4stopyA2CmF":{"name":"stop","abstract":"

    Stop scanning.

    ","parent_name":"ScanAction"},"Enums/ScanAction.html#/s:7Bluejay10ScanActionO7connectyAcA0B9DiscoveryV_AA7TimeoutOAA14WarningOptionsVyAA16ConnectionResultOctcACmF":{"name":"connect(_:_:_:_:)","abstract":"

    Stop scanning, and connect to a discovery.

    ","parent_name":"ScanAction"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The background task is successful, and the returned value is captured in the associated value.

    ","parent_name":"RunResult"},"Enums/RunResult.html#/s:7Bluejay9RunResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The background task has failed unexpectedly with an error.

    ","parent_name":"RunResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7successyACyxGxcAEmlF":{"name":"success(_:)","abstract":"

    The read is successful and the value read is captured in the associated value.

    ","parent_name":"ReadResult"},"Enums/ReadResult.html#/s:7Bluejay10ReadResultO7failureyACyxGs5Error_pcAEmlF":{"name":"failure(_:)","abstract":"

    The read has failed unexpectedly with an error.

    ","parent_name":"ReadResult"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO4trapyA2CmF":{"name":"trap","abstract":"

    New listen and its new callback on the same characteristic will not overwrite an existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/MultipleListenOption.html#/s:7Bluejay20MultipleListenOptionO11replaceableyA2CmF":{"name":"replaceable","abstract":"

    New listens and its new callback on the same characteristic will replace the existing listen.

    ","parent_name":"MultipleListenOption"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO18promiseRestorationyA2CmF":{"name":"promiseRestoration","abstract":"

    Bluejay will continue to receive but do nothing with the incoming listen events until a new listener is installed.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenRestoreAction.html#/s:7Bluejay19ListenRestoreActionO04stopB0yA2CmF":{"name":"stopListen","abstract":"

    Bluejay will attempt to turn off notifications on the peripheral.

    ","parent_name":"ListenRestoreAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO13keepListeningyA2CmF":{"name":"keepListening","abstract":"

    Keep listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/ListenAction.html#/s:7Bluejay12ListenActionO4doneyA2CmF":{"name":"done","abstract":"

    Stop listening to the characteristic.

    ","parent_name":"ListenAction"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20bluetoothUnavailableyA2CmF":{"name":"bluetoothUnavailable","abstract":"

    Bluetooth is either turned off or unavailable.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO24multipleScanNotSupportedyA2CmF":{"name":"multipleScanNotSupported","abstract":"

    Bluejay does not support another scanning request if Bluejay is still scanning.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO27multipleConnectNotSupportedyA2CmF":{"name":"multipleConnectNotSupported","abstract":"

    Bluejay does not support another connection request if Bluejay is already connected or still connecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO30multipleDisconnectNotSupportedyA2CmF":{"name":"multipleDisconnectNotSupported","abstract":"

    Bluejay does not support another disconnection request if Bluejay is still disconnecting.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18connectionTimedOutyA2CmF":{"name":"connectionTimedOut","abstract":"

    A connection request in Bluejay has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO12notConnectedyA2CmF":{"name":"notConnected","abstract":"

    Bluejay is not connected to a peripheral.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14missingServiceyAcA0D10IdentifierVcACmF":{"name":"missingService(_:)","abstract":"

    A Bluetooth service is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21missingCharacteristicyAcA0D10IdentifierVcACmF":{"name":"missingCharacteristic(_:)","abstract":"

    A Bluetooth characteristic is not found.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO9cancelledyA2CmF":{"name":"cancelled","abstract":"

    A Bluetooth operation is cancelled.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO18explicitDisconnectyA2CmF":{"name":"explicitDisconnect","abstract":"

    Bluejay disconnect is called.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedDisconnectyA2CmF":{"name":"unexpectedDisconnect","abstract":"

    Bluejay disconnected unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO16disconnectQueuedyA2CmF":{"name":"disconnectQueued","abstract":"

    A disconnection operation is queued.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO14listenTimedOutyA2CmF":{"name":"listenTimedOut","abstract":"

    An attempt to listen on a characteristic has timed out.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO10readFailedyA2CmF":{"name":"readFailed","abstract":"

    An attempt to read a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11writeFailedyA2CmF":{"name":"writeFailed","abstract":"

    An attempt to write a characteristic has failed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO11missingDatayA2CmF":{"name":"missingData","abstract":"

    An attempt to read a value from a characteristic has returned no data unexpectedly.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15dataOutOfBoundsyACSi_S2itcACmF":{"name":"dataOutOfBounds(start:length:count:)","abstract":"

    An attempt to read a range of data has failed due to incorrect bounds or an unexpected length.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO20unexpectedPeripheralyAcA0D10IdentifierVcACmF":{"name":"unexpectedPeripheral(_:)","abstract":"

    An unexpected peripheral is cached and retrieved from CoreBluetooth.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO39allowDuplicatesInBackgroundNotSupportedyA2CmF":{"name":"allowDuplicatesInBackgroundNotSupported","abstract":"

    iOS will not continue scanning in the background if allow duplicates is turned on.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO37missingServiceIdentifiersInBackgroundyA2CmF":{"name":"missingServiceIdentifiersInBackground","abstract":"

    iOS will not continue scanning in the background if no service identifiers are specified.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21backgroundTaskRunningyA2CmF":{"name":"backgroundTaskRunning","abstract":"

    Bluejay does not support further Bluetooth operations while a Bluejay background task is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO34multipleBackgroundTaskNotSupportedyA2CmF":{"name":"multipleBackgroundTaskNotSupported","abstract":"

    Bluejay does not support another Bluejay background task when there is already one that is still running.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO15indefiniteFlushyA2CmF":{"name":"indefiniteFlush","abstract":"

    Indefinite flush will not exit.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO7stoppedyA2CmF":{"name":"stopped","abstract":"

    Bluejay has stopped.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO31backgroundRestorationInProgressyA2CmF":{"name":"backgroundRestorationInProgress","abstract":"

    Bluejay cannot perform certain actions when background restoration is still in progress.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO28startupBackgroundTaskExpiredyA2CmF":{"name":"startupBackgroundTaskExpired","abstract":"

    Startup background task has expired during state restoration.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO21multipleListenTrappedyA2CmF":{"name":"multipleListenTrapped","abstract":"

    The original listen declared that duplicated listens are not allowed.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:7Bluejay0A5ErrorO22multipleListenReplacedyA2CmF":{"name":"multipleListenReplaced","abstract":"

    The original listen declared that it can be replaced by a new listen.

    ","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation14LocalizedErrorP16errorDescriptionSSSgvp":{"name":"errorDescription","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP11errorDomainSSvpZ":{"name":"errorDomain","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP9errorCodeSivp":{"name":"errorCode","parent_name":"BluejayError"},"Enums/BluejayError.html#/s:10Foundation13CustomNSErrorP13errorUserInfoSDySSypGvp":{"name":"errorUserInfo","parent_name":"BluejayError"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO12disconnectedyAcA20PeripheralIdentifierVcACmF":{"name":"disconnected(_:)","abstract":"

    The disconnection is successful, and the disconnected peripheral is captured in the associated value.

    ","parent_name":"DisconnectionResult"},"Enums/DisconnectionResult.html#/s:7Bluejay19DisconnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The disconnection has failed unexpectedly with an error.

    ","parent_name":"DisconnectionResult"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO8noChangeyA2CmF":{"name":"noChange","abstract":"

    Bluejay will maintain its current auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/AutoReconnectMode.html#/s:7Bluejay17AutoReconnectModeO6changeyACSb_tcACmF":{"name":"change(shouldAutoReconnect:)","abstract":"

    Override Bluejay’s auto-reconnect behaviour.

    ","parent_name":"AutoReconnectMode"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7successyAcA20PeripheralIdentifierVcACmF":{"name":"success(_:)","abstract":"

    The connection is successful, and the peripheral connected is captured in the associated value.

    ","parent_name":"ConnectionResult"},"Enums/ConnectionResult.html#/s:7Bluejay16ConnectionResultO7failureyACs5Error_pcACmF":{"name":"failure(_:)","abstract":"

    The connection has failed unexpectedly with an error.

    ","parent_name":"ConnectionResult"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO7secondsyACSdcACmF":{"name":"seconds(_:)","abstract":"

    Specify a timeout with a duration in seconds.

    ","parent_name":"Timeout"},"Enums/Timeout.html#/s:7Bluejay7TimeoutO4noneyA2CmF":{"name":"none","abstract":"

    Specify there is no timeout.

    ","parent_name":"Timeout"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8callbackyACyyccACmF":{"name":"callback(_:)","abstract":"

    Put required Bluejay API or application calls that are needed after a background restoration inside this callback.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreCompletion.html#/s:7Bluejay27BackgroundRestoreCompletionO8continueyA2CmF":{"name":"continue","abstract":"

    Return this if no callback is needed after a background restoration.

    ","parent_name":"BackgroundRestoreCompletion"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO7disableyA2CmF":{"name":"disable","abstract":"

    Bluejay will not start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html#/s:7Bluejay21BackgroundRestoreModeO6enableyAcA0bC6ConfigVcACmF":{"name":"enable(_:)","abstract":"

    Bluejay will start CoreBluetooth with state restoration.

    ","parent_name":"BackgroundRestoreMode"},"Enums/BackgroundRestoreMode.html":{"name":"BackgroundRestoreMode","abstract":"

    Determines how Bluejay should opt-in to CoreBluetooth state restoration.

    "},"Enums/BackgroundRestoreCompletion.html":{"name":"BackgroundRestoreCompletion","abstract":"

    Allows capturing further Bluejay operations to be queued and executed after background restoration is completed.

    "},"Enums/Timeout.html":{"name":"Timeout","abstract":"

    Types of connection time outs. Can specify a time out in seconds, or no time out.

    "},"Enums/ConnectionResult.html":{"name":"ConnectionResult","abstract":"

    Indicates a successful, cancelled, or failed connection attempt, where the success case contains the peripheral connected to.

    "},"Enums/AutoReconnectMode.html":{"name":"AutoReconnectMode","abstract":"

    Tells Bluejay whether it should auto-reconnect.

    "},"Enums/DisconnectionResult.html":{"name":"DisconnectionResult","abstract":"

    Indicates a successful, cancelled, or failed disconnection attempt, where the success case contains the peripheral disconnected from.

    "},"Enums/BluejayError.html":{"name":"BluejayError","abstract":"

    Errors specific to Bluejay.

    "},"Enums/ListenAction.html":{"name":"ListenAction","abstract":"

    Indicates whether the current listen on a characteristic should continue or end.

    "},"Enums/ListenRestoreAction.html":{"name":"ListenRestoreAction","abstract":"

    Available actions to take on an unhandled listen event from background restoration.

    "},"Enums/MultipleListenOption.html":{"name":"MultipleListenOption","abstract":"

    Ways to handle calling listen on the same characteristic multiple times.

    "},"Enums/ReadResult.html":{"name":"ReadResult","abstract":"

    Indicates a successful, cancelled, or failed read attempt, where the success case contains the value read.

    "},"Enums/RunResult.html":{"name":"RunResult","abstract":"

    Indicates a successful, cancelled, or failed run(backgroundTask:completionOnMainThread:) attempt, where the success case contains the value returned at the end of the background task.

    "},"Enums/ScanAction.html":{"name":"ScanAction","abstract":"

    Indicates whether a scan should continue, continue but blacklist the current discovery, stop, or stop and connect.

    "},"Enums/StartMode.html":{"name":"StartMode","abstract":"

    Specifies whether to start a new Bluejay instance from scratch, or from an existing CoreBluetooth session.

    "},"Enums/WriteResult.html":{"name":"WriteResult","abstract":"

    Indicates a successful, cancelled, or failed write attempt.

    "},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC4read4fromxAA24CharacteristicIdentifierV_tKAA10ReceivableRzlF":{"name":"read(from:)","abstract":"

    Read a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC5write2to5value4typeyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVtKAA8SendableRzlF":{"name":"write(to:value:type:)","abstract":"

    Write a value from the specified characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC12writeAndRead0D2To5value4type8readFromxAA24CharacteristicIdentifierV_q_So25CBCharacteristicWriteTypeVAJtKAA10ReceivableRzAA8SendableR_r0_lF":{"name":"writeAndRead(writeTo:value:type:readFrom:)","abstract":"

    Write to one characterestic then reading a value from another.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC6listen2to7timeout10completionyAA24CharacteristicIdentifierV_AA7TimeoutOAA12ListenActionOxctKAA10ReceivableRzlF":{"name":"listen(to:timeout:completion:)","abstract":"

    Listen for changes on a specified characterstic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtKF":{"name":"endListen(to:error:completion:)","abstract":"

    Stop listening to a characteristic synchronously.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC11flushListen2to14nonZeroTimeout10completionyAA24CharacteristicIdentifierV_AA0I0OyyctKF":{"name":"flushListen(to:nonZeroTimeout:completion:)","abstract":"

    Flush a listen to a characteristic by receiving and discarding values for the specified duration.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC14writeAndListen0D2To5value4type06listenG016timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVALSiAA0F6ActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndListen(writeTo:value:type:listenTo:timeoutInSeconds:completion:)","abstract":"

    Handle a compound operation consisting of writing on one characterstic followed by listening on another for some streamed data.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC16writeAndAssemble0D2To5value06listenG014expectedLength16timeoutInSeconds10completionyAA24CharacteristicIdentifierV_xALS2iAA12ListenActionOq_ctKAA8SendableRzAA10ReceivableR_r0_lF":{"name":"writeAndAssemble(writeTo:value:listenTo:expectedLength:timeoutInSeconds:completion:)","abstract":"

    Similar to writeAndListen, but use this if you don’t know or don’t have control over how many packets will be sent to you. You still need to know the total size of the data you’re receiving.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay22SynchronizedPeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicE4TypeV_tF":{"name":"maximumWriteValueLength(for:)","abstract":"

    Ask for the peripheral’s maximum payload length in bytes for a single write request.

    ","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP18bluetoothAvailableyySbF":{"name":"bluetoothAvailable(_:)","parent_name":"SynchronizedPeripheral"},"Classes/SynchronizedPeripheral.html#/s:7Bluejay18ConnectionObserverP12disconnected4fromyAA20PeripheralIdentifierV_tF":{"name":"disconnected(from:)","parent_name":"SynchronizedPeripheral"},"Classes/Bluejay.html#/s:7BluejayAAC4uuid10Foundation4UUIDVvp":{"name":"uuid","abstract":"

    Helps distinguish one Bluejay instance from another.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC20isBluetoothAvailableSbvp":{"name":"isBluetoothAvailable","abstract":"

    Allows checking whether Bluetooth is powered on. Also returns false if Bluejay is not started yet.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBluetoothStateUpdateImminentSbvp":{"name":"isBluetoothStateUpdateImminent","abstract":"

    Allows checking for if CoreBluetooth state is transitional (update is imminent)","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12isConnectingSbvp":{"name":"isConnecting","abstract":"

    Allows checking whether Bluejay is currently connecting to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isConnectedSbvp":{"name":"isConnected","abstract":"

    Allows checking whether Bluejay is currently connected to a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC15isDisconnectingSbvp":{"name":"isDisconnecting","abstract":"

    Allows checking whether Bluejay is currently disconnecting from a peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC19shouldAutoReconnectSbvp":{"name":"shouldAutoReconnect","abstract":"

    Allowing checking whether Bluejay will automatic reconnect after an unexpected disconnection. Default is true, and Bluejay will also always set this to true on a successful connection to a peripheral. Conversely, Bluejay will always set this to false after an explicit disconnection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10isScanningSbvp":{"name":"isScanning","abstract":"

    Allows checking whether Bluejay is currently scanning.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10hasStartedSbvp":{"name":"hasStarted","abstract":"

    Allows checking whether Bluejay has started and is available for use.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC21defaultWarningOptionsAA0cD0Vvp":{"name":"defaultWarningOptions","abstract":"

    Warning options to use for each new connection if the options are not specified at the creation of those connections.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC30isBackgroundRestorationEnabledSbvp":{"name":"isBackgroundRestorationEnabled","abstract":"

    Allows checking whether Bluejay has background restoration enabled.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3logyySSF":{"name":"log(_:)","abstract":"

    Allow apps that use Bluejay to log alongside of Bluejay’s internal logs.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7getLogsSSSgyF":{"name":"getLogs()","abstract":"

    Get the current content of the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9clearLogsyyF":{"name":"clearLogs()","abstract":"

    Clears the log file.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@M@Bluejay@objc(cs)Bluejay(im)init":{"name":"init()","abstract":"

    Initializing a Bluejay instance will not yet initialize the CoreBluetooth stack. An explicit start call after Bluejay is intialized will then initialize the CoreBluetooth stack and is required because in cases where a state resotration is trying to restore a listen on a characteristic, a listen restorer must be available before the CoreBluetooth stack is re-initialized. This two-step startup allows you to prepare and gaurantee the setup of your listen restorer in between the initialization of Bluejay and the initialization of the CoreBluetooth stack.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5start4modeyAA9StartModeO_tF":{"name":"start(mode:)","abstract":"

    Starting Bluejay will initialize the CoreBluetooth stack. Simply initializing a Bluejay instance without calling this function will not initialize the CoreBluetooth stack. An explicit start call is required so that we can also support proper background restoration, where CoreBluetooth must be initialized in the AppDelegate’s application(_:didFinishLaunchingWithOptions:) for both starting an iOS background task and for parsing the restore identifier.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC28stopAndExtractBluetoothStateSo16CBCentralManagerC7manager_So12CBPeripheralCSg10peripheraltyF":{"name":"stopAndExtractBluetoothState()","abstract":"

    Stops all operations and clears all states in Bluejay before returning a Core Bluetooth state that can then be used by another library or code outside of Bluejay.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC16cancelEverything5error16shouldDisconnectys5Error_p_SbtF":{"name":"cancelEverything(error:shouldDisconnect:)","abstract":"

    This will cancel the current and all pending operations in the Bluejay queue. It will also disconnect by default after the queue is emptied, but you can cancel everything without disconnecting.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register18connectionObserveryAA010ConnectionD0_p_tF":{"name":"register(connectionObserver:)","abstract":"

    Register for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister18connectionObserveryAA010ConnectionD0_p_tF":{"name":"unregister(connectionObserver:)","abstract":"

    Unregister for notifications on Bluetooth connection events and state changes. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register12rssiObserveryAA12RSSIObserver_p_tF":{"name":"register(rssiObserver:)","abstract":"

    Register for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister12rssiObserveryAA12RSSIObserver_p_tF":{"name":"unregister(rssiObserver:)","abstract":"

    Unregister for notifications when readRSSI is called. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register15serviceObserveryAA07ServiceD0_p_tF":{"name":"register(serviceObserver:)","abstract":"

    Register for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister15serviceObserveryAA07ServiceD0_p_tF":{"name":"unregister(serviceObserver:)","abstract":"

    Unregister for notifications when a connected peripheral’s services change. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8register11logObserveryAA03LogD0_p_tF":{"name":"register(logObserver:)","abstract":"

    Register for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10unregister11logObserveryAA03LogD0_p_tF":{"name":"unregister(logObserver:)","abstract":"

    Unregister for notifications when the log file is updated. Unregistering is not required, Bluejay will unregister for you if the observer is no longer in memory.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC25registerDisconnectHandler7handleryAA0cD0_p_tF":{"name":"registerDisconnectHandler(handler:)","abstract":"

    Register a single disconnection handler for giving it a final say on what to do at the end of a disconnection, as well as evaluate and control Bluejay’s auto-reconnect behaviour.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC27unregisterDisconnectHandleryyF":{"name":"unregisterDisconnectHandler()","abstract":"

    Remove any registered disconnection handler.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4scan8duration15allowDuplicates17throttleRSSIDelta18serviceIdentifiers9discovery7expired7stoppedySd_SbSiSayAA17ServiceIdentifierVGSgAA10ScanActionOAA0O9DiscoveryV_SayARGtcApR_AStcSgyAS_s5Error_pSgtctF":{"name":"scan(duration:allowDuplicates:throttleRSSIDelta:serviceIdentifiers:discovery:expired:stopped:)","abstract":"

    Scan for the peripheral(s) specified.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC12stopScanningyyF":{"name":"stopScanning()","abstract":"

    Stops current or queued scan.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7connect_7timeout14warningOptions10completionyAA20PeripheralIdentifierV_AA7TimeoutOAA07WarningE0VSgyAA16ConnectionResultOctF":{"name":"connect(_:timeout:warningOptions:completion:)","abstract":"

    Attempt to connect directly to a known peripheral. The call will fail if Bluetooth is not available, or if Bluejay is already connected. Making a connection request while Bluejay is scanning will also cause Bluejay to stop the current scan for you behind the scene prior to fulfilling your connection request.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC10disconnect9immediate10completionySb_yAA19DisconnectionResultOcSgtF":{"name":"disconnect(immediate:completion:)","abstract":"

    Disconnect a connected peripheral or cancel a connecting peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"read(from:completion:)","abstract":"

    Read from the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0J6ResultOctAA8SendableRzlF":{"name":"write(to:value:type:completion:)","abstract":"

    Write to the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC6listen2to20multipleListenOption10completionyAA24CharacteristicIdentifierV_AA08MultipleeF0OyAA10ReadResultOyxGctAA10ReceivableRzlF":{"name":"listen(to:multipleListenOption:completion:)","abstract":"

    Listen for notifications on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC9endListen2to10completionyAA24CharacteristicIdentifierV_yAA11WriteResultOcSgtF":{"name":"endListen(to:completion:)","abstract":"

    End listening on the specified characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC11isListening2toSbAA24CharacteristicIdentifierV_tKF":{"name":"isListening(to:)","abstract":"

    Check if a peripheral is listening to a specific characteristic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC8readRSSIyyKF":{"name":"readRSSI()","abstract":"

    Attempts to read the RSSI (signal strength) of the currently connected peripheral.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyyAA22SynchronizedPeripheralCKc_yAA9RunResultOyytGctF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This is the simplest one as the background task will not return any typed values back to the completion block on finishing the background task, except for thrown errors, and it also doesn’t provide an input for an object that might need thread safe access.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run14backgroundTask22completionOnMainThreadyxAA22SynchronizedPeripheralCKc_yAA9RunResultOyxGctlF":{"name":"run(backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC3run8userData14backgroundTask22completionOnMainThreadyx_q_AA22SynchronizedPeripheralC_xtKcyAA9RunResultOyq_Gctr0_lF":{"name":"run(userData:backgroundTask:completionOnMainThread:)","abstract":"

    One of the three ways to run a background task using a synchronous interface to the Bluetooth peripheral. This one allows the background task to potentially return a typed value back to the completion block on finishing the background task successfully, as well as supplying an object for thread safe access inside the background task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/s:7BluejayAAC7combine9sendables10Foundation4DataVSayAA8Sendable_pG_tFZ":{"name":"combine(sendables:)","abstract":"

    A helper function to take an array of Sendables and combine their data together.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManagerDidUpdateState:":{"name":"centralManagerDidUpdateState(_:)","abstract":"

    Bluejay uses this to figure out whether Bluetooth is available or not.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:willRestoreState:":{"name":"centralManager(_:willRestoreState:)","abstract":"

    If Core Bluetooth will restore state, update Bluejay’s internal states to match the states of the Core Bluetooth stack by assigning the peripheral to connectingPeripheral or connectedPeripheral, or niling them out, depending on what the restored CBPeripheral state is.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didConnectPeripheral:":{"name":"centralManager(_:didConnect:)","abstract":"

    When connected, update Bluejay’s states by updating the values for connectingPeripheral, connectedPeripheral, and shouldAutoReconnect. Also, make sure to broadcast the event to observers, and notify the queue so that the current operation in-flight can process this event and get a chance to finish.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDisconnectPeripheral:error:":{"name":"centralManager(_:didDisconnectPeripheral:error:)","abstract":"

    Handle a disconnection event from Core Bluetooth by figuring out what kind of disconnection it is (planned or unplanned), and updating Bluejay’s internal state and sending notifications as appropriate.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didFailToConnectPeripheral:error:":{"name":"centralManager(_:didFailToConnect:error:)","abstract":"

    This mostly happens when either the Bluetooth device or the Core Bluetooth stack somehow only partially completes the negotiation of a connection. For simplicity, Bluejay is currently treating this as a disconnection event, so it can perform all the same clean up logic.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html#/c:@CM@Bluejay@objc(cs)Bluejay(im)centralManager:didDiscoverPeripheral:advertisementData:RSSI:":{"name":"centralManager(_:didDiscover:advertisementData:rssi:)","abstract":"

    This should only be called when the current operation in the queue is a Scan task.

    ","parent_name":"Bluejay"},"Classes/Bluejay.html":{"name":"Bluejay","abstract":"

    Bluejay is a simple wrapper around CoreBluetooth that focuses on making a common usage case as straight forward as possible: a single connected peripheral that the user is interacting with regularly (think most personal electronics devices that have an associated iOS app: fitness trackers, guitar amps, etc).

    "},"Classes/SynchronizedPeripheral.html":{"name":"SynchronizedPeripheral","abstract":"

    A synchronous interface to the Bluetooth peripheral, intended to be used inside the backgroundTask block of run(backgroundTask:completionOnMainThread:) to perform multi-part operations without the need for a complicated callback or promise setup.

    "},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Structs.html":{"name":"Structures","abstract":"

    The following structures are available globally.

    "},"Typealiases.html":{"name":"Type Aliases","abstract":"

    The following type aliases are available globally.

    "}} \ No newline at end of file