Skip to contentSkip to conversation

Using bluez-utils from another application

Bluez-users [email protected] 3 participants 5 messages May 14, 2008 – May 15, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi!

Just installed bluez-libs-2.25 and bluez-utils-2.25.
I know there are more recent versions avaiable but since Im developping for an Embedded Linux System based on ARM9 my resources are very limited and I was not able to compile "libdbus" which is necessary for the recent version of bluez.However... the installed versions are working fine. By the way Im using a 2.2.21 Kernel, but the bluetooth related stuff is patched to 2.2.26.
My goal is to use functionalities provided by hciconfig and hcitool in another C Program. Finally this features (e.g. Listing active local bluetooth devices, do a scan for remote devices, ask for available services) will be visualized graphically in this C programm.

So there are basically tow ways:
- System Calls like system("hciconfig") (which is not very handy and beautiful)
- Using the Library

Concerning the second point (using Library) I did some research in hciconfig.c.
I expected that there a some higher-level functions that I can call from another C programm by including the necessary header files. But it seems there must be also done some low-level stuff, like opening a HCI socket.

If anybody has some experience or hints in using bluez-lib from another application please let me know.

Thanks,
Johannes

Signature · 11 lines
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

-------------------------------------------------------------------------
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
maintainer
#1 lore raw

Hi Johannes,

Quoted 2 lines

Just installed bluez-libs-2.25 and bluez-utils-2.25.
I know there are more recent versions avaiable but since Im developping for an Embedded Linux System based on ARM9 my resources are very limited and I was not able to compile "libdbus" which is necessary for the recent version of bluez.However... the installed versions are working fine.

your version is ancient. I have the release date as January 2006 and this means it is over two years old. That is a full lifetime in the Linux world.

I am simply not buying the D-Bus cross-compilation issue. Sorry, but it is not that hard.

Quoted 1 line

By the way Im using a 2.2.21 Kernel, but the bluetooth related stuff is patched to 2.2.26.

We never had a 2.2.21 kernel with Bluetooth support.

Quoted 1 line

My goal is to use functionalities provided by hciconfig and hcitool in another C Program. Finally this features (e.g. Listing active local bluetooth devices, do a scan for remote devices, ask for available services) will be visualized graphically in this C programm.

You are going to duplicate all the work that has been done for now reason. Spending the time to cross-compile D-Bus would be better invested.

Quoted 3 lines

So there are basically tow ways:
- System Calls like system("hciconfig") (which is not very handy and beautiful)
- Using the Library

Again, cross-compile D-Bus and use our D-Bus based API. It is more elegant than any low-level stuff will ever be.

Quoted 3 lines

Concerning the second point (using Library) I did some research in hciconfig.c.
I expected that there a some higher-level functions that I can call from another C programm by including the necessary header files. But it seems there must be also done some low-level stuff, like opening a HCI socket.

Yes. You always have to open a HCI raw socket to do raw packet manipulation.

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

#2 lore raw

[Bluez-users] i would like to donate a bunch of non working bluetooth hardware

Hello everybody,

I have been trying to get a good bluetooth experience with stereo audio,
voice device, pointer devices. I got two non 100% working devices, and
i would like to donate them to a developer that has the skills and time to improve bluez with better support. If a developer can sent his postage address to my email. I will send a package to you.

The devices are a voice headset, and a stereo headset. and if you also have experience with xorg evdev a presentation pointer keyboard devices that has no driver.

Kind regards,

Jelle de Jong

-------------------------------------------------------------------------
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

#3 lore raw
In reply to Marcel Holtmann

Hi Marcel,

thanks for your hint.

I've tried to compile some of the recent Versions of dbus again. But it alw= ays fails with:

if arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include -DDBUS_L= OCALEDIR=3D\"/opt/devel/toolchains/arm9/arm-linux/share/locale\" -DDBUS_COM= PILATION -DDBUS_DAEMONDIR=3D\"/opt/devel/toolchains/arm9/arm-linux/bin\" -D= DBUS_MACHINE_UUID_FILE=3D\""/opt/devel/toolchains/arm9/arm-linux/var/lib/db=
us/machine-id"\" -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -=
Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wfloat-e= qual -Wsign-compare -fno-common -fPIC -MT dbus-launch.o -MD -MP -MF ".deps/= dbus-launch.Tpo" -c -o dbus-launch.o dbus-launch.c; \
then mv -f ".deps/dbus-launch.Tpo" ".deps/dbus-launch.Po"; else rm =
-f ".deps/dbus-launch.Tpo"; exit 1; fi
dbus-launch.c: In Funktion =BBkill_bus_when_session_ends=AB:
dbus-launch.c:413: error: impossible constraint in asm' dbus-launch.c:414: error: impossible constraint in asm' dbus-launch.c:445: error: impossible constraint in asm' dbus-launch.c:444: error: impossible constraint in asm' dbus-launch.c:451: error: impossible constraint in asm' dbus-launch.c:475: error: impossible constraint in asm'

Anyway this is not your problem, but any help is welcome.
Maybee my header files are too old since im using as cross compiler arm-lin= ux-gcc 3.3.3.

Maybee I can compile an older version of dbus. However, which dbus version needs bluez-utils at least?

Thanks
Johannes

-------- Original-Nachricht --------

Quoted 29 lines

Datum: Thu, 15 May 2008 11:36:15 +0200
Von: Marcel Holtmann <[email protected]>
An: BlueZ users <[email protected]>
Betreff: Re: [Bluez-users] Using bluez-utils from another application

Hi Johannes,
=

Quoted 2 lines

Just installed bluez-libs-2.25 and bluez-utils-2.25.
I know there are more recent versions avaiable but since Im developping

for an Embedded Linux System based on ARM9 my resources are very limited and I was not able to compile "libdbus" which is necessary for the recent version of bluez.However... the installed versions are working fine. =

=

your version is ancient. I have the release date as January 2006 and this means it is over two years old. That is a full lifetime in the Linux world.
=

I am simply not buying the D-Bus cross-compilation issue. Sorry, but it is not that hard.
=

Quoted 1 line

By the way Im using a 2.2.21 Kernel, but the bluetooth related stuff is

patched to 2.2.26.
=

Quoted 6 lines

We never had a 2.2.21 kernel with Bluetooth support. =

Quoted 1 line

My goal is to use functionalities provided by hciconfig and hcitool in

another C Program. Finally this features (e.g. Listing active local bluetooth devices, do a scan for remote devices, ask for available servic=

es) will

Quoted 43 lines

be visualized graphically in this C programm.
=

You are going to duplicate all the work that has been done for now reason. Spending the time to cross-compile D-Bus would be better invested.
=

Quoted 2 lines

So there are basically tow ways:
- System Calls like system("hciconfig") (which is not very handy and

beautiful)

Quoted 1 line

- Using the Library

=

Again, cross-compile D-Bus and use our D-Bus based API. It is more elegant than any low-level stuff will ever be.
=

Quoted 1 line

Concerning the second point (using Library) I did some research in

hciconfig.c.

Quoted 1 line

I expected that there a some higher-level functions that I can call from

another C programm by including the necessary header files.

Quoted 1 line

But it seems there must be also done some low-level stuff, like opening

a HCI socket.
=

Yes. You always have to open a HCI raw socket to do raw packet manipulation.
=

Regards
=

Marcel
=

=

=

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft =

Quoted 7 lines

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

-- =

Martin Kupf

249 Spiele f=FCr nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de

-------------------------------------------------------------------------
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

maintainer
#4 lore raw

SGkgSm9oYW5uZXMsCgo+IHRoYW5rcyBmb3IgeW91ciBoaW50Lgo+IAo+IEkndmUgdHJpZWQgdG8g Y29tcGlsZSBzb21lIG9mIHRoZSByZWNlbnQgVmVyc2lvbnMgb2YgZGJ1cyB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