Skip to content

Commit

Permalink
Merge pull request #10 from MarcDerhammer/feature/scanOptions
Browse files Browse the repository at this point in the history
Allow passing `options` to `scanForPeripherals`
  • Loading branch information
NickKibish authored Feb 26, 2024
2 parents b00e811 + ecad9b8 commit 30f5c98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/iOS-BLE-Library/CentralManager/CentralManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ extension CentralManager {
///
/// Calling this method stops an ongoing scan if it is already running and finishes the publisher returned by ``scanForPeripherals(withServices:)``.
///
/// - Parameter services: The services to scan for.
/// - Parameters:
/// - services: The services to scan for.
/// - options: A dictionary to customize the scan, such as specifying whether duplicate results should be reported.
/// - Returns: A publisher that emits scan results or an error.
public func scanForPeripherals(withServices services: [CBUUID]?)
public func scanForPeripherals(withServices services: [CBUUID]?, options: [String: Any]? = nil)
-> AnyPublisher<ScanResult, Error>
{
stopScan()
Expand All @@ -261,7 +263,7 @@ extension CentralManager {
return e
}
.bluetooth {
self.centralManager.scanForPeripherals(withServices: services)
self.centralManager.scanForPeripherals(withServices: services, options: options)
}
.autoconnect()
.eraseToAnyPublisher()
Expand Down

0 comments on commit 30f5c98

Please sign in to comment.