MockServerScope

Scope for building a mock GATT server.

This interface extends ServerScope and allows to declare common services used in BLE:

  • Generic Access Service (GAS)

  • Generic Attribute Service (GATT).

Note: The attributes added by these services will be handled automatically, that is no call to PeripheralSpecEventHandler will be made for them.

Functions

Link copied to clipboard
open fun GenericAccessService(builder: ServiceScope.() -> Unit = {})

Declares the Generic Access Service (GAS) with common characteristics:

Link copied to clipboard
open fun GenericAttributeService(initiallyEnabled: Boolean = true)

Declares the Generic Attribute Service (GATT) with the Service Changed characteristic.

Link copied to clipboard
open fun Service(shortUuid: Int, builder: ServiceScope.() -> Unit)
abstract fun Service(uuid: Uuid, builder: ServiceScope.() -> Unit)