Camel Bluetooth component
Last updated
Was this helpful?
Last updated
Was this helpful?
Camel Bluetooth component can retrieve information about the bluetooth devices available within the device range. Under the hood Bluetooth component uses bluecove library (). Bluetooth component supports both the consumer and producer endpoints.
Maven users should add the following dependency to their POM file:
io.rhiotcamel-bluetooth${rhiot.version}
Avaliable for rhiot.version >= 0.1.3
For example to find all bluetooth devices available near the device, the following route can be used:
The message body is a io.rhiot.component.bluetooth.BluetoothDevice
instance:
You can also request the bluetooth device scanning using the producer endpoint:
Or using the producer template directly:
Option
Default value
Description
consumer.initialDelay
1000
Milliseconds before the polling starts.
consumer.delay
5000
Delay between each bluetooth device scan.
consumer.useFixedDelay
false
Set to true to use a fixed delay between polls, otherwise fixed rate is used. See ScheduledExecutorService in JDK for details.
bluetoothDevicesProvider
new BluecoveBluetoothDeviceProvider()
reference to theio.rhiot.component.bluetooth.BluetoothDevicesProvider
instance used to scan bluetooth devices.
serviceDiscovery
false
Search for services on bluetooth device.
The Bluetooth component installs it's own dependencies for Debian-based systems using apt-get, these include blueman and libbluetooth-dev, as well as their dependencies. You can configure the installer or set an alternate one on the component:
You can also specify alternate/additional dependencies for your platform, if your platform uses my-custom-tools for example, you should configure the component as follows:
If an Installer is not set on the component, Camel will try to find an instance in the . So for example for Spring application, you can configure the installer as a bean: