commonMain.ScannerBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kable-core Show documentation
Show all versions of kable-core Show documentation
Kotlin Asynchronous Bluetooth Low Energy
package com.juul.kable
import com.juul.kable.logs.LoggingBuilder
public expect class ScannerBuilder internal constructor() {
/**
* Filters [Advertisement]s during a scan: If [filters] is `null` or empty, then no filtering is performed (i.e. all
* [Advertisement]s are emitted during a scan). If filters are provided (i.e. [filters] is a list of at least one
* [Filter]), then only [Advertisement]s that match at least one [Filter] are emitted during a scan.
*/
@Deprecated(
message = "Use filters(FiltersBuilder.() -> Unit)",
replaceWith = ReplaceWith("filters { }"),
level = DeprecationLevel.WARNING,
)
public var filters: List?
/**
* Filters [Advertisement]s during a scan. If predicates are non-empty, then only [Advertisement]s
* that match at least one of the predicates are emitted during a scan.
*/
public fun filters(builderAction: FiltersBuilder.() -> Unit)
public fun logging(init: LoggingBuilder)
internal fun build(): PlatformScanner
}
// To preserve original behavior make each individual filter a separate predicate:
internal fun List.convertDeprecatedFilters(): List =
map(::listOf).map(::FilterPredicate)