Characteristic

abstract fun Characteristic(uuid: Uuid, properties: List<CharacteristicProperty> = emptyList(), permissions: List<Permission> = emptyList(), builder: CharacteristicScope.() -> Unit = {})

Declares a characteristic with the given UUID.

Sample code:

Characteristic(
uuid = <Some UUID>,
properties = CharacteristicProperty.READ and CharacteristicProperty.WRITE,
permissions = Permission.READ and Permission.WRITE,
) {
// Note: Client Characteristic Configuration descriptor is added automatically.

CharacteristicUserDescriptionDescriptor("Some description")
}

Parameters

uuid

The UUID of the characteristic.

properties

List of properties of the characteristic.

permissions

The permissions of the characteristic.

builder

Scope of the characteristic.


open fun Characteristic(shortUuid: Int, properties: List<CharacteristicProperty> = emptyList(), permissions: List<Permission> = emptyList(), builder: CharacteristicScope.() -> Unit = {})

Declares a characteristic with the given 16 or 32 bit short UUID.

Parameters

shortUuid

The 16 or 32 bit short UUID of the characteristic.

properties

List of properties of the characteristic.

permissions

The permissions of the characteristic.

builder

Scope of the characteristic.

See also


open fun Characteristic(uuid: Uuid, properties: List<CharacteristicProperty>, permission: Permission, builder: CharacteristicScope.() -> Unit = {}): <Error class: unknown class>

Declares a characteristic with the given UUID.

Sample code:

Characteristic(
uuid = <Some UUID>,
property = CharacteristicProperty.READ and CharacteristicProperty.NOTIFY,
permission = Permission.READ,
) {
// Note: Client Characteristic Configuration descriptor is added automatically.

CharacteristicUserDescriptionDescriptor("Some description")
}

Parameters

uuid

The UUID of the characteristic.

properties

List of properties of the characteristic.

permission

The permission of the characteristic.

builder

Scope of the characteristic.


open fun Characteristic(shortUuid: Int, properties: List<CharacteristicProperty>, permission: Permission, builder: CharacteristicScope.() -> Unit = {}): <Error class: unknown class>

Declares a characteristic with the given 16 or 32 bit short UUID.

Parameters

shortUuid

The 16 or 32 bit short UUID of the characteristic.

properties

List of properties of the characteristic.

permission

The permission of the characteristic.

builder

Scope of the characteristic.

See also


open fun Characteristic(uuid: Uuid, property: CharacteristicProperty, permission: Permission, builder: CharacteristicScope.() -> Unit = {}): <Error class: unknown class>

Declares a characteristic with the given UUID.

Sample code:

Characteristic(
uuid = <Some UUID>,
property = CharacteristicProperty.READ,
permission = Permission.READ,
)

Parameters

uuid

The UUID of the characteristic.

property

List of properties of the characteristic.

permission

The permission of the characteristic.

builder

Scope of the characteristic.


open fun Characteristic(shortUuid: Int, property: CharacteristicProperty, permission: Permission, builder: CharacteristicScope.() -> Unit = {}): <Error class: unknown class>

Declares a characteristic with the given 16 or 32 bit short UUID.

Parameters

shortUuid

The 16 or 32 bit short UUID of the characteristic.

property

List of properties of the characteristic.

permission

The permission of the characteristic.

builder

Scope of the characteristic.

See also


open fun Characteristic(uuid: Uuid, property: CharacteristicProperty, builder: CharacteristicScope.() -> Unit = {}): <Error class: unknown class>

Declares a characteristic with the given UUID without permission to read or write.

Sample code:

Characteristic(
uuid = <Some UUID>,
property = CharacteristicProperty.NOTIFY,
)

Parameters

uuid

The UUID of the characteristic.

property

List of properties of the characteristic.

builder

Scope of the characteristic.


open fun Characteristic(shortUuid: Int, property: CharacteristicProperty, builder: CharacteristicScope.() -> Unit = {}): <Error class: unknown class>

Declares a characteristic with the given 16 or 32 bit short UUID without permission to read or write.

Parameters

shortUuid

The 16 or 32 bit short UUID of the characteristic.

property

List of properties of the characteristic.

builder

Scope of the characteristic.

See also