GattServerConnectRequest


class GattServerConnectRequest


Represents a connect request from a remote device.

Summary

Public functions

suspend Unit
accept(block: suspend GattServerSessionScope.() -> Unit)

Accepts the connect request and handles incoming requests after that.

Unit

Rejects the connect request.

Public properties

BluetoothDevice

the remote device connecting to the server

Public functions

accept

Added in 1.0.0-alpha02
suspend fun accept(block: suspend GattServerSessionScope.() -> Unit): Unit

Accepts the connect request and handles incoming requests after that.

Requests from the client before calling this should be saved.

Parameters
block: suspend GattServerSessionScope.() -> Unit

a block of code that is invoked after the connection is made.

reject

Added in 1.0.0-alpha02
fun reject(): Unit

Rejects the connect request.

All the requests from the client will be rejected.

Public properties

device

Added in 1.0.0-alpha02
val deviceBluetoothDevice

the remote device connecting to the server