PeripheralSpec

A specification of a peripheral that can be simulated.

Use PeripheralSpec.simulatePeripheral to create a new peripheral specification.

Types

Link copied to clipboard
class Builder<ID>

The builder for the PeripheralSpec.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

List of advertisement configurations.

Link copied to clipboard

The connection interval when connected.

Link copied to clipboard

The event handler that will be called for every event emulating a real peripheral.

Link copied to clipboard

The peripheral identifier.

Link copied to clipboard

Whether the peripheral is bonded.

Link copied to clipboard

Whether the peripheral is connected.

Link copied to clipboard

Whether the peripheral has been scanned before and its address type is cached. It is not possible to connect to an unknown device without scanning.

Link copied to clipboard
val maxMtu: Int?

The maximum supported MTU size.

Link copied to clipboard
val name: String?

The name of the peripheral, exposed with Device Name characteristic.

Link copied to clipboard

The proximity of the peripheral.

Link copied to clipboard
val services: List<ServiceDefinition>?

The services available after service discovery.

Link copied to clipboard

The set of supported PHYs.

Link copied to clipboard

The peripheral type.

Functions

Link copied to clipboard

Simulates the situation when the device is scanned and advertisement data is received.

Link copied to clipboard

Simulates the situation when another application on the device connects to the device.

Link copied to clipboard

Simulates peripheral disconnection from the device.

Link copied to clipboard
fun simulateMacChange(newIdentifier: ID)
Link copied to clipboard

Simulates a change in the proximity of the peripheral.

Link copied to clipboard