create

@RequiresPermission(value = "android.permission.BLUETOOTH_CONNECT")
suspend fun create(context: Context, scope: CoroutineScope, vararg config: ServerBleGattServiceConfig, mock: MockServerDevice? = null, options: ServerConnectionOption = ServerConnectionOption()): ServerBleGatt

Declares and starts server based on config. It can be either real BLE server or mocked variant which run locally on a device.

Return

An instance of ServerBleGatt

Parameters

context

An application context.

config

Service config which is used later to create services per each connection.

logger

Logger instance for displaying logs.

mock

A mock device if run as a mocked variant.

options

An additional options to configure a server behaviour.