0

I want to create on my Linux desktop a small server listening to requests using Bluetooth. Clients (such as mobile phones or tablets) will connect to this server and exchange data back and forth.

It should be straightforward, but I'm unable to find an up-to-date tutorial for Bluez's new DBUS-based API, and Bluez documentation is basically just a huge data dump.

Any suggestions on how I should proceed? (The language used does not really matter, since there are DBUS bindings for all major languages.)

Jon Smark
  • 2,528
  • 24
  • 31

1 Answers1

0

These are some useful links to get started, it's not much but it's a start.

As you said yourself, there are dbus bindings in many languages however the language does matter. For example, some old low-level C API are not advised (see for yourself the advices in the dbus tutorial on freedesktop.org)

I suggest the following steps to start (especially for LE) :

  1. Read the adapter-api.txt (first link) description and try to build a proxy to interact the org.bluez.Adapter1 interface (when trying to build the proxy: name would be 'org.bluez' and object path '/org/bluez/hci0' as describded in adapter-api.txt). Call StartDiscovery and StopDiscovery

  2. Once scanning is done, print your proxy introspection to find the devices discovered (you should see MAC addresses preceded by "dev_")

  3. Build proxies to interact with the device (read the device-api.txt file description to find out what you need)

  4. For LE, if you want to access the Services of a Device. Introspect your device proxy and you will find it'serices. Repeat the process to reach Characteristics and Descriptors.