2008-05-17 14:41:02

by Fritz Code

[permalink] [raw]
Subject: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code

Hi,

since I don't have resources for Glib or another abstraction layer on my
Embedded Linux I can only use plain C for communication with bluez through
dbus.
But so far I've only find howto's with GLib or Qt etc.
Are there any documents that describe my case (plain c communication) ?

For general understanding of the bluez architecture and tools, a statement
and a question:

hcid is the daemon which exposes different Interfaces through dbus, e.g. the
Interface "Adapter".
Another Application can access bluez functionalities through dbus by using
the Interfaces exposed from hcid. (hopefully also by using plain C).

E.g.: You want to develop an application "example-app" which should list
available local buetooth devices, remote devices and its services.
In this case it is enough to start hcid and use its Interface "Adapter" from
"example-app" ?

The other tools like, hcitool, hciconfig etc. are not necessary, they are
own applications, right.
In order to use bluez features from another application (through dbus) the
only tool/util needed is hcid?
And this is configured by hcid.conf?



Thanks...





--
Regards,
--Codefritz


Attachments:
(No filename) (1.11 kB)
(No filename) (1.28 kB)
(No filename) (230.00 B)
(No filename) (164.00 B)
Download all attachments

2008-05-18 09:10:18

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code

Hi Fritz,

> well in my doc folder I can only find four txt's which list the
> Interfaces and some methods, but since there a types like "string"
> used it seems it is not supposed to be used as low level c interface.
> And I would really appreciate a step-by-step tutorial with some
> examples how to use low-level C interface of bluez with dbus.

what has strings to do with not using low-level API. Please start with
a D-Bus beginners tutorial since I can't really guide you through this
one. There is enough example code within the bluez-utils source and on
the web that will get you started.

Regards

Marcel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-05-18 08:32:59

by Fritz Code

[permalink] [raw]
Subject: Re: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code

Good morning Marcel,

well in my doc folder I can only find four txt's which list the Interfaces
and some methods, but since there a types like "string" used it seems it is
not supposed to be used as low level c interface.
And I would really appreciate a step-by-step tutorial with some examples how
to use low-level C interface of bluez with dbus.

Thanks a lot,

Fritz.

On Sun, May 18, 2008 at 2:04 AM, Marcel Holtmann <[email protected]>
wrote:

> Hi Fritz,
>
> > is there anywhere a HowTo / Tutorial how to use the low-level C API
> > of bluez through dbus?
> >
> > I've found a Tutorial for using the low-level C API of dbus here
> > (unfortunately just a ver basic Tut.)
> > http://dbus.freedesktop.org/doc/dbus/libdbus-tutorial.html
> >
> > But I didn't find anything about the characteristics of the Adapter
> > Interface of bluez (hcid) if its used from low-level API.
> > E.g. the method names which I have to pass the method
> > dbus_message_new_method_call() ...
>
> they are all documented. Check the doc/ directory within bluez-utils.
>
> Regards
>
> Marcel
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>



--
Regards,
--Codefritz


Attachments:
(No filename) (1.48 kB)
(No filename) (2.27 kB)
(No filename) (230.00 B)
(No filename) (164.00 B)
Download all attachments

2008-05-18 00:04:38

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code

Hi Fritz,

> is there anywhere a HowTo / Tutorial how to use the low-level C API
> of bluez through dbus?
>
> I've found a Tutorial for using the low-level C API of dbus here
> (unfortunately just a ver basic Tut.)
> http://dbus.freedesktop.org/doc/dbus/libdbus-tutorial.html
>
> But I didn't find anything about the characteristics of the Adapter
> Interface of bluez (hcid) if its used from low-level API.
> E.g. the method names which I have to pass the method
> dbus_message_new_method_call() ...

they are all documented. Check the doc/ directory within bluez-utils.

Regards

Marcel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-05-17 18:38:10

by Fritz Code

[permalink] [raw]
Subject: Re: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code

Hi Marcel,

is there anywhere a HowTo / Tutorial how to use the low-level C API of bluez
through dbus?

I've found a Tutorial for using the low-level C API of dbus here
(unfortunately just a ver basic Tut.)
http://dbus.freedesktop.org/doc/dbus/libdbus-tutorial.html

But I didn't find anything about the characteristics of the Adapter
Interface of bluez (hcid) if its used from low-level API.
E.g. the method names which I have to pass the method
dbus_message_new_method_call() ...

thanks,
Fritz

On Sat, May 17, 2008 at 4:47 PM, Marcel Holtmann <[email protected]>
wrote:

> Hi Fritz,
>
> > since I don't have resources for Glib or another abstraction layer
> > on my Embedded Linux I can only use plain C for communication with
> > bluez through dbus.
> > But so far I've only find howto's with GLib or Qt etc.
> > Are there any documents that describe my case (plain c
> > communication) ?
> >
> > For general understanding of the bluez architecture and tools, a
> > statement and a question:
> >
> > hcid is the daemon which exposes different Interfaces through dbus,
> > e.g. the Interface "Adapter".
> > Another Application can access bluez functionalities through dbus by
> > using the Interfaces exposed from hcid. (hopefully also by using
> > plain C).
> >
> > E.g.: You want to develop an application "example-app" which should
> > list available local buetooth devices, remote devices and its
> > services.
> > In this case it is enough to start hcid and use its Interface
> > "Adapter" from "example-app" ?
> >
> > The other tools like, hcitool, hciconfig etc. are not necessary,
> > they are own applications, right.
> > In order to use bluez features from another application (through
> > dbus) the only tool/util needed is hcid?
> > And this is configured by hcid.conf?
>
> if you use bluez-utils-3.31 or any later release, the only thing you
> need is hcid. It will do everything for you. The only exception is if
> your adapter is connected via an UART and using hci_uart driver, then
> you also need hciattach, but that is it.
>
> And of course you can write a client application using D-Bus low-level
> (libdbus) only. It is a little bit more work than using high level
> languages, but it is possible. I still have plans to provide a D-Bus
> only replacement for hciconfig, hcitool etc.
>
> Regards
>
> Marcel
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>



--
Regards,
--Codefritz


Attachments:
(No filename) (2.71 kB)
(No filename) (3.63 kB)
(No filename) (230.00 B)
(No filename) (164.00 B)
Download all attachments

2008-05-17 16:55:11

by Anders Eriksson

[permalink] [raw]
Subject: Re: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code


[email protected] said:
> And of course you can write a client application using D-Bus low-level
> (libdbus) only. It is a little bit more work than using high level
> languages, but it is possible. I still have plans to provide a D-Bus only
> replacement for hciconfig, hcitool etc.

If the long term plan is that hcid is the only daemon necessary, and it is
accessed using dbus, how can I make hcid start on application request. In other
words, is there an "xinetd for dbus" which can dtrt?

/Anders


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2008-05-17 14:47:02

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] using bluez dbus interface exposed from hcid with plain c code

Hi Fritz,

> since I don't have resources for Glib or another abstraction layer
> on my Embedded Linux I can only use plain C for communication with
> bluez through dbus.
> But so far I've only find howto's with GLib or Qt etc.
> Are there any documents that describe my case (plain c
> communication) ?
>
> For general understanding of the bluez architecture and tools, a
> statement and a question:
>
> hcid is the daemon which exposes different Interfaces through dbus,
> e.g. the Interface "Adapter".
> Another Application can access bluez functionalities through dbus by
> using the Interfaces exposed from hcid. (hopefully also by using
> plain C).
>
> E.g.: You want to develop an application "example-app" which should
> list available local buetooth devices, remote devices and its
> services.
> In this case it is enough to start hcid and use its Interface
> "Adapter" from "example-app" ?
>
> The other tools like, hcitool, hciconfig etc. are not necessary,
> they are own applications, right.
> In order to use bluez features from another application (through
> dbus) the only tool/util needed is hcid?
> And this is configured by hcid.conf?

if you use bluez-utils-3.31 or any later release, the only thing you
need is hcid. It will do everything for you. The only exception is if
your adapter is connected via an UART and using hci_uart driver, then
you also need hciattach, but that is it.

And of course you can write a client application using D-Bus low-level
(libdbus) only. It is a little bit more work than using high level
languages, but it is possible. I still have plans to provide a D-Bus
only replacement for hciconfig, hcitool etc.

Regards

Marcel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users