Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » How to get advertisement data via new "BluetoothLeAdapter"(can not find any api like "startAdvertisementScan")
How to get advertisement data via new "BluetoothLeAdapter" [message #1782822] Fri, 02 March 2018 06:48 Go to next message
z b is currently offline z bFriend
Messages: 2
Registered: March 2018
Junior Member
I am using "org.eclipse.kura.bluetooth.le.BluetoothLeAdapter", not "org.eclipse.kura.bluetooth.BluetoothAdapter".

because "org.eclipse.kura.bluetooth.BluetoothAdapter" may not work in future.

I use "this.bluetoothLeAdapter.findDevices(10)", but how to get boradcast data???
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1783407 is a reply to message #1782822] Mon, 12 March 2018 16:49 Go to previous messageGo to next message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,

please take a look here [1] for an example using the new BLE APIs.

In few words, the bluetoothLeAdapter.findDevices(timeout) performs a discovery for near devices returns a Future object. The future.get() method will return a List of BluetoothLeDeviceS. Here is a snippet:

Future<List<BluetoothLeDevice>> future = this.bluetoothLeAdapter.findDevices(this.options.getScantime());
try {
filterDevices(future.get());
} catch (InterruptedException | ExecutionException e) {
logger.error("Scan for devices failed", e);
}

You can also pass a Consumer class to the find method to be notified when a devices is detected. Please take a look on the APIs [2] and their implementation [3].

Best,
Pier

[1] https://github.com/eclipse/kura/blob/develop/kura/examples/org.eclipse.kura.example.ble.tisensortag.tinyb/src/main/java/org/eclipse/kura/example/ble/tisensortag/tinyb/BluetoothLe.java

[2] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.api/src/main/java/org/eclipse/kura/bluetooth/le/BluetoothLeAdapter.java

[3] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.ble.provider/src/main/java/org/eclipse/kura/internal/ble/BluetoothLeAdapterImpl.java
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1797469 is a reply to message #1783407] Wed, 31 October 2018 10:28 Go to previous messageGo to next message
jonny jain is currently offline jonny jainFriend
Messages: 2
Registered: October 2018
Junior Member
Thanks for giving this useful article about Bluetooth smart technology. I have also used my Dell laptop to connect with Different Bluetooth devices it can be a nice laptop but after update driver, I got a Bluetooth error message and I am unable to connect my Dell printer with my laptop for best technical I can visit Dell Bluetooth Driver for the instant help. 
https://www.delltechsupportnumbers.com/blog/dell-bluetooth-driver
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1817766 is a reply to message #1783407] Thu, 28 November 2019 18:20 Go to previous messageGo to next message
Joachim Kroeger is currently offline Joachim KroegerFriend
Messages: 4
Registered: November 2019
Junior Member
Hello,
at many points in online documents, I saw these fragments.
My project is also inquiring BLE hardware devices, from which I want to take their GATTproperty change messages.
What is missing in the cocumentation, is the place and procedure to put these code fragments into a living, installed and running Kura instance.

So, what is the procedure to extend the system, when I used the .deb installation and Kura is running?
Greetings
Joachim
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1818342 is a reply to message #1817766] Fri, 13 December 2019 00:03 Go to previous messageGo to next message
Joachim Kroeger is currently offline Joachim KroegerFriend
Messages: 4
Registered: November 2019
Junior Member
In the meantime I figured it out, basically.
I followed the osgi example for 'hello world' and startet debugging.

I modified the example code for the TI sensortags, because it is all deprecated with kura 4.1
Because I do not use these TI devices, I built it as clean code for universal GATT protocol devices. Work in progress, but the callback on value changes is not running yet.

My question is now: What is the best, shortest way, to have a robust, reliable compile, deploy, debug cycle using the osgi connection with the debug script, which allows to debug my code? Target is a Raspi 4.
During deploy, I get virtually dozens of popups and lots of error messages, that the deployment runs into error situations. After 2 or more cycles, I can debug fresh modified sources.
But the sequence of steps is confusing me!
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1819009 is a reply to message #1818342] Sat, 04 January 2020 15:38 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi Joachim,
can you please share the errors you are seeing?

I personally use maven for compilation and the maven build produces the .dp file that wraps my updated packages.
The debug is done using the IDE and Kura started in debug mode using the specific start script in /bin folder.

You can also use the IDE with a specific plugin to deploy your bundles directly to the target environment. The documentation should point to the steps to enable so.

Best regards,
Matteo
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1819012 is a reply to message #1819009] Sat, 04 January 2020 16:30 Go to previous messageGo to next message
Joachim Kroeger is currently offline Joachim KroegerFriend
Messages: 4
Registered: November 2019
Junior Member
Hello Matteo,

I get multiple identical error messages (popups), which are unspecific, no explenations, but say: deployment failed. And lots, which state, already installed.
If I understand right, the applications (bundles) can cause these errors themself ?
The popups appear within eclipse.
I do not use maven. So I will search for that plugin.
Nevertheless, I have a very minor understanding of the OSGI framework.

Thanks a lot for your response!
Happy new year,
Greetings,
Joachim
Re: How to get advertisement data via new "BluetoothLeAdapter" [message #1819050 is a reply to message #1819012] Mon, 06 January 2020 10:35 Go to previous message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Could you please post a few screenshots?

Thanks

Best regards,
Matteo
Previous Topic:Eclipse Kura Bundle project with Maven
Next Topic:kura greenhouse download package list problem
Goto Forum:
  


Current Time: Fri Mar 29 10:40:13 GMT 2024

Powered by FUDForum. Page generated in 0.03869 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top