GattServerConnectRequest


public final class GattServerConnectRequest


Represents a connect request from a remote device.

Summary

Public methods

final void

Accepts the connect request and handles incoming requests after that.

final @NonNull BluetoothDevice

the remote device connecting to the server

final void

Rejects the connect request.

Public methods

accept

Added in 1.0.0-alpha02
public final void accept(
    @ExtensionFunctionType @NonNull SuspendFunction1<@NonNull GattServerSessionScopeUnit> block
)

Accepts the connect request and handles incoming requests after that.

Requests from the client before calling this should be saved.

Parameters
@ExtensionFunctionType @NonNull SuspendFunction1<@NonNull GattServerSessionScopeUnit> block

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

getDevice

Added in 1.0.0-alpha02
public final @NonNull BluetoothDevice getDevice()

the remote device connecting to the server

reject

Added in 1.0.0-alpha02
public final void reject()

Rejects the connect request.

All the requests from the client will be rejected.