Package ej.bluetooth

Class BluetoothService

    • Constructor Detail

      • BluetoothService

        public BluetoothService()
    • Method Detail

      • getUuid

        public BluetoothUuid getUuid()
        Returns the UUID of this service.
        Returns:
        the UUID of this service
      • getNumCharacteristics

        public int getNumCharacteristics()
        Returns the number of characteristics in this service.
        Returns:
        the number of characteristics in this service.
      • getCharacteristic

        public BluetoothCharacteristic getCharacteristic​(int index)
        Returns the characteristic at the given index in this service.
        Parameters:
        index - the index of the characteristic.
        Returns:
        the characteristic at the given index.
        Throws:
        IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getNumCharacteristics()).
      • setRemoteListener

        public void setRemoteListener​(RemoteServiceListener remoteListener)
        Sets the listener which will receive the events related to this remote service.

        Only one listener may be set at the same time. If the remote listener has not been set, the DefaultRemoteServiceListener will be used to handle the events.

        Parameters:
        remoteListener - the object which will receive the events.
        Throws:
        IllegalStateException - if this service is not a remote service.
      • setLocalListener

        public void setLocalListener​(LocalServiceListener localListener)
        Sets the listener which will receive the events related to this local service.

        Only one listener may be set at the same time. If the local listener has not been set, the DefaultLocalServiceListener will be used to handle the events.

        Parameters:
        localListener - the object which will receive the events.
        Throws:
        IllegalStateException - if this service is not a local service.