Class CurrentTimeClient

    • Constructor Detail

      • CurrentTimeClient

        protected CurrentTimeClient​(BluetoothConnection connection,
                                    BluetoothService service)
                             throws AttributeNotFoundException
        Creates a current time client, using the current time service provided by a remote device and the connection to this device.
        Parameters:
        connection - the connection to the device.
        service - the current time service provided by the device.
        Throws:
        AttributeNotFoundException - if one of the mandatory attributes of the service is missing.
    • Method Detail

      • start

        public void start()
        Starts this current time client.
      • stop

        public void stop()
        Stops this current time client.
      • onCurrentTimeUpdate

        protected abstract void onCurrentTimeUpdate​(long currentTime)
        Called when the current time is received.
        Parameters:
        currentTime - the current time (in milliseconds).
      • onLocalTimeUpdate

        protected abstract void onLocalTimeUpdate​(long localTimeOffset)
        Called when the local time is received.
        Parameters:
        localTimeOffset - the local time offset (in milliseconds).