public final class ServiceBuilder
extends java.lang.Object
BleService
s.Modifier and Type | Method and Description |
---|---|
CharacteristicBuilder |
addCharacteristic(java.util.UUID charUuid)
Add a new
BleCharacteristic to this service. |
GattDatabase |
build()
Builds the current
BleService , and returns the parent GattDatabase . |
BleService |
buildService()
Builds and returns the current
BleService . |
ServiceBuilder |
newService(java.util.UUID serviceUuid)
Complete this service, and create a new one to be entered into the database.
|
ServiceBuilder |
primary()
Set this service to the type
BluetoothGattService.SERVICE_TYPE_PRIMARY . |
ServiceBuilder |
secondary()
Set this service to the type
BluetoothGattService.SERVICE_TYPE_SECONDARY . |
public final ServiceBuilder primary()
BluetoothGattService.SERVICE_TYPE_PRIMARY
. This is the default, so it shouldn't be necessary
to call this, but leaving it here for explicitness.public final ServiceBuilder secondary()
BluetoothGattService.SERVICE_TYPE_SECONDARY
.public final CharacteristicBuilder addCharacteristic(java.util.UUID charUuid)
BleCharacteristic
to this service.public final ServiceBuilder newService(java.util.UUID serviceUuid)
public final GattDatabase build()
BleService
, and returns the parent GattDatabase
.public final BleService buildService()
BleService
. Use this method if you are building out a BleService
, not to be built into a GattDatabase
.