public class CurrentTimeServer extends DefaultLocalServiceListener
CurrentTimeServer
class represents a current time server.Constructor and Description |
---|
CurrentTimeServer(BluetoothService service)
Creates a current time server, using the current time service provided by this device.
|
Modifier and Type | Method and Description |
---|---|
void |
onReadRequest(BluetoothConnection connection,
BluetoothAttribute attribute)
Called when a read request is received.
|
void |
start()
Starts this current time server.
|
void |
stop()
Stops this current time server.
|
onExecuteWriteRequest, onNotificationSent, onPrepareWriteRequest, onReadBlobRequest, onWriteRequest
public CurrentTimeServer(BluetoothService service)
service
- the current time service provided by this device.IllegalArgumentException
- if one of the mandatory attributes of the service is missing.public void onReadRequest(BluetoothConnection connection, BluetoothAttribute attribute)
LocalServiceListener
onReadRequest
in interface LocalServiceListener
onReadRequest
in class DefaultLocalServiceListener
connection
- the connection with the device which has sent the request.attribute
- the attribute to read.public void start()
public void stop()