0

I'm following the advice of Zimano on using the Bluez client as an example to implement Bluetooth in my Linux application.

I have installed:

libbluetooth-dev
libglib2.0-dev
libdbus-1-dev

The Bluez client example uses a D-Bus helper library that is included as part of Bluez in a gdbus folder when the soure code is downloaded.

I have looked at it for a few hours and I think if I want to follow the Bluez client example, I need to add and compile the gdbus source from the Bluez source with my program. My question is, do I have that wrong? Is that gdbus included elsewhere? The naming is so close to files in glib-2.0/gio that I am concerned that I am missing something.

Community
  • 1
  • 1
MrSnrub
  • 57
  • 7
  • Looking at it a little more, I believe I need to build bluez from the source to get access to everything needed to implement something similar to the example. Will try that... – MrSnrub May 02 '16 at 20:34

2 Answers2

3

GDBus is part of GIO, which is distributed with GLib.

Based on the package names you've provided I'm guessing you are using a Debian-derived distribution, so libglib2.0-dev is the package you need.

nemequ
  • 16,623
  • 1
  • 43
  • 62
0

This is indeed quite a mess for naming. It appears to be that:

  1. Official Glib Dbus library is named "GDBus", BUT it is part of "GIO" => thus you would (*) need (<glib.h> and) <gio/gio.h> , not <gdbus.h>

  2. Bluez "gdbus.h" is their completely own local support library not found anywhere in binary form as such, also their license is restrictive for free inclusion.

(*) But of course the Bluez client still remains dependent on their own "gdbus.h" support library.