Service
Declares a service with the given UUID.
Sample code:
Service(<Some UUID>) {
val handle = Characteristic(
uuid = <Some UUID>,
properties = CharacteristicProperty.READ and CharacteristicProperty.NOTIFY,
permission = Permission.READ,
) {
// Note: Client Characteristic Configuration descriptor is added automatically.
CharacteristicUserDescriptionDescriptor("Some description")
}
Characteristic(...)
IncludedService(<Some UUID>) {
Characteristic(...)
}
}Content copied to clipboard
Parameters
uuid
The UUID of the service.
builder
Scope of the primary service.
Declares a service with the given 16 or 32 bit short UUID.
Sample code:
Service(<16 or 32-bit UUID>) {
val handle = Characteristic(
uuid = <Some UUID>,
properties = CharacteristicProperty.READ and CharacteristicProperty.NOTIFY,
permission = Permission.READ,
) {
// Note: Client Characteristic Configuration descriptor is added automatically.
CharacteristicUserDescriptionDescriptor("Some description")
}
Characteristic(...)
IncludedService(<Some UUID>) {
Characteristic(...)
}
}Content copied to clipboard
Parameters
shortUuid
The 16 or 32 bit short UUID of the service, i.e. 0x1809.
builder
Scope of the primary service.