PreviewScanResult

class PreviewScanResult(peripheral: Peripheral, isConnectable: Boolean?, advertisingData: AdvertisingData = fromName(peripheral.name), rssi: Int = -50, txPowerLevel: Int? = null, primaryPhy: PrimaryPhy = PrimaryPhy.PHY_LE_1M, secondaryPhy: Phy? = null, timestamp: Long = 0) : ScanResult

Preview implementation of ScanResult for showing scan results on Compose previews.

Parameters

peripheral

The peripheral associated with the scan result.

isConnectable

Whether the peripheral is connectable. Use null if the API doesn't provide this information.

advertisingData

The advertising data associated with the scan result. By default, this is set to the result of fromName using the peripheral's name.

rssi

The received signal strength (RSSI) in dBm, defaults to -50 dBm.

txPowerLevel

The transmission power level.

primaryPhy

The primary PHY used to transmit the advertisement, defaults to PHY LE 1M.

secondaryPhy

The secondary PHY used to transmit the advertisement, or null (default) if not used.

timestamp

The timestamp since when the scan record was observed.

Constructors

Link copied to clipboard
constructor(peripheral: Peripheral, isConnectable: Boolean?, advertisingData: AdvertisingData = fromName(peripheral.name), rssi: Int = -50, txPowerLevel: Int? = null, primaryPhy: PrimaryPhy = PrimaryPhy.PHY_LE_1M, secondaryPhy: Phy? = null, timestamp: Long = 0)

Properties

Link copied to clipboard
open override val advertisingData: AdvertisingData
Link copied to clipboard
open override val isConnectable: Boolean?
Link copied to clipboard
open override val peripheral: Peripheral
Link copied to clipboard
open override val primaryPhy: PrimaryPhy
Link copied to clipboard
open override val rssi: Int
Link copied to clipboard
open override val secondaryPhy: Phy?
Link copied to clipboard
open override val timestamp: Long
Link copied to clipboard
open override val txPowerLevel: Int?

Functions

Link copied to clipboard
open override fun toString(): String