Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BluetoothManagerBuilder Example + Questions #11

Open
goncalosoares opened this issue Feb 14, 2018 · 6 comments
Open

BluetoothManagerBuilder Example + Questions #11

goncalosoares opened this issue Feb 14, 2018 · 6 comments

Comments

@goncalosoares
Copy link

Hello sputnikdev,

Really cool BT framework you got here. :-)

I was trying to use it and I Tried to create the Bluetooth Manager but somehow I cannot include the BluetoothManagerBuilder:
import org.sputnikdev.bluetooth.manager.impl.BluetoothManagerBuilder
bt_manager = new BluetoothManagerBuilder().withTinyBTransport(true).build()
The import fails. :-(

Also do you an example on how to to make a simple discover connect and read a characteristic?
I have gotten as far as trying like this...

bt_manager.start(true)
Set discoveredDevices = bt_manager.getDiscoveredDevices()
discoveredDevices.each { device ->
println(device.getName())
}

Am I on the right track?

Also When including the BlueGiga Lib I get a following error:

Could not find com.zsmartsystems.bluetooth.bluegiga:com.zsmartsystems.bluetooth.bluegiga:1.0.0-SNAPSHOT.

Once again, awesome framework!!!
:-)

@vkolotov
Copy link
Contributor

Hi @ElCuervoSoares, see examples here: https://github.com/sputnikdev/bluetooth-cli/tree/master/src/main/java/org/sputnikdev/bluetooth/examples

Could not find com.zsmartsystems.bluetooth.bluegiga:com.zsmartsystems.bluetooth.bluegiga:1.0.0-SNAPSHOT.

How do you include BlueGiga transport/lib?

@vkolotov
Copy link
Contributor

vkolotov commented Feb 14, 2018

Your project pom should be like that (see dependencies section, you don't have to include zsmartsystems library, it is supplied with bluegiga transport lib): https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding-bluegiga-transport/blob/master/pom.xml See update below

Also make sure that you use RELEASE versions for the references (from Maven Central repo). The framework is under a heavy development, so might be unstable.

@vkolotov
Copy link
Contributor

Please disregard my message above in regards bluegiga dependency, I have confused it with another project. Yes, you will need to install that library locally, like that:
sh .travis/install-dependencies.sh
in the root folder of the https://github.com/sputnikdev/bluetooth-manager-bluegiga project.

The bluegiga library is not yet released, so we have to do this still. Although it is quite stable.

@goncalosoares
Copy link
Author

Thank you for the answers... I will try it out :-)

It is still funny why I cannot import the BluetoothManagerBuilder... eventough the class is there

import org.sputnikdev.bluetooth.manager.impl.BluetoothManagerBuilder
bt_manager = new BluetoothManagerBuilder().withTinyBTransport(true).build()

@goncalosoares
Copy link
Author

I am importing through gradle like this:
compile group: 'org.sputnikdev', name: 'bluetooth-manager', version: '1.3'

@goncalosoares
Copy link
Author

goncalosoares commented Feb 14, 2018

I found out that if I use the 1.4-SNAPSHOT, it is there. :-)

I have now gotten the following failure:
Exception in thread "main" java.lang.IllegalStateException: java.lang.IllegalStateException: Native libraries for TinyB transport could not be loaded.
at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerBuilder.loadTinyBTransport(BluetoothManagerBuilder.java:210)

Is there any other libraries I need installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants