Search in sources :

Example 1 with BluetoothDiscoveryListener

use of org.eclipse.smarthome.binding.bluetooth.BluetoothDiscoveryListener in project smarthome by eclipse.

the class BluetoothDiscoveryService method addBluetoothAdapter.

@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
protected void addBluetoothAdapter(BluetoothAdapter adapter) {
    this.adapters.add(adapter);
    BluetoothDiscoveryListener listener = new BluetoothDiscoveryListener() {

        @Override
        public void deviceDiscovered(BluetoothDevice device) {
            BluetoothDiscoveryService.this.deviceDiscovered(adapter, device);
        }
    };
    adapter.addDiscoveryListener(listener);
    registeredListeners.put(adapter.getUID(), listener);
}
Also used : BluetoothDevice(org.eclipse.smarthome.binding.bluetooth.BluetoothDevice) BluetoothDiscoveryListener(org.eclipse.smarthome.binding.bluetooth.BluetoothDiscoveryListener) Reference(org.osgi.service.component.annotations.Reference)

Aggregations

BluetoothDevice (org.eclipse.smarthome.binding.bluetooth.BluetoothDevice)1 BluetoothDiscoveryListener (org.eclipse.smarthome.binding.bluetooth.BluetoothDiscoveryListener)1 Reference (org.osgi.service.component.annotations.Reference)1