Skip to contentSkip to conversation

Moving over to GCC 4.0

Bluez-devel Marcel Holtmann 5 participants 13 messages Jul 6, 2005 – Jul 9, 2005 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

Hi Folks,

since Debian Etch now also switched to GCC 4.0 as default compiler, it is time to address all GCC 4.0 problems in the BlueZ source code. I started two days ago with fixing most of its crazy compiler warnings. The GCC 4.0 is really picky with the signedness and so I moved over to explicit types like uint8_t, uint16_t and uint32_t where possible. I now hope that I haven't introduced any signedness bugs. Please start testing the CVS versions of libs and utils.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

[Bluez-devel] Querying device information.

Please forgive me if I'm asking a question with an obvious answer.

If, from a user-space application, I have a socket which has been created via:

socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)

are there any special Bluetooth ioctls which can be used to, for example, query device information? If so, where can I find and/or read about them? Is there another interface I should be using? Thanks.

Signature · 15 lines
Dave Mielke           | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: [email protected] | Canada  K2A 1H7   | if you're concerned about Hell.
http://FamilyRadio.com/                   | http://Mielke.cc/bible/


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
author maintainer
#2 lore raw

Re: [Bluez-devel] Querying device information.

Hi Dave,

Quoted 7 lines

If, from a user-space application, I have a socket which has been created via:

socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)

are there any special Bluetooth ioctls which can be used to, for example, query device information? If so, where can I find and/or read about them? Is there another interface I should be using? Thanks.

this depends on the information you want. In general you need to use the BlueZ HCI API.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw

Re: [Bluez-devel] Querying device information.

[quoted lines by Marcel Holtmann on 2005/07/06 at 14:26 +0200]

Quoted 1 line

this depends on the information you want.

Bluetooth is new to me so I'll describe what I'm looking for in terms of USB. I'm looking to determine what kind of device is connected to the other end of the socket in the same way that I'd use the USB Vendor/Product identifiers.

Signature · 15 lines
Dave Mielke           | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: [email protected] | Canada  K2A 1H7   | if you're concerned about Hell.
http://FamilyRadio.com/                   | http://Mielke.cc/bible/


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
author maintainer
#4 lore raw

Re: [Bluez-devel] Querying device information.

Hi Dave,

Quoted 5 lines
Quoted 1 line

this depends on the information you want.

Bluetooth is new to me so I'll describe what I'm looking for in terms of USB. I'm looking to determine what kind of device is connected to the other end of the socket in the same way that I'd use the USB Vendor/Product identifiers.

no you can't, but you can use SDP to retrieve information about the services/profiles offered by the peer device.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw

[Bluez-devel] hcid dies on socket connect attempt.

On a Fedora Core 4 system we have:

dbus-0.33-3
bluez-utils-2.15-7
bluez-libs-2.15-1

hcid starts up fine:

==============================================================================
hcid -n
hcid[12537]: Bluetooth HCI daemon
hcid[12537]: Starting security manager 0
==============================================================================

As soon as I try to get a Bluetooth connection, however, it dies (see below).
What might be wrong?

This code works well on Fedora Core 3. Has something changed? We establish the connection as follows:

   int connection;
   connection = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);

   struct sockaddr_rc local;
   local.rc_family = AF_BLUETOOTH;
   local.rc_channel = 0;
   bacpy(&local.rc_bdaddr, BDADDR_ANY);
   bind(connection, (struct sockaddr *)&local, sizeof(local));
   
   struct sockaddr_rc remote;
   remote.rc_family = AF_BLUETOOTH;
   remote.rc_channel = /* supplied channel number */;
   bacpy(&remote.rc_bdaddr, &/* supplied addreess */);
   connect(connection, (struct sockaddr *)&remote, sizeof(remote));

Now here's now hcid dies:

==============================================================================
hcid[12537]: link_key_request (sba=00:0A:3A:53:D7:FC, dba=00:A0:96:0A:C9:10) hcid[12537]: pin_code_request (sba=00:0A:3A:53:D7:FC, dba=00:A0:96:0A:C9:10) 12537: arguments to dbus_type_is_basic() were incorrect, assertion "_dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID" failed in file dbus-signature.c line 259.
This is normally a bug in some application using the D-BUS library. type unknown isn't supported yet in dbus_message_append_args_valist *** buffer overflow detected ***: hcid: processing events terminated ======= Backtrace: ========= /lib/libc.so.6(__chk_fail+0x41)[0x781565]
hcid: processing events[0x880e8b] /usr/lib/libdbus-1.so.1[0x296155] /usr/lib/libdbus-1.so.1[0x27649e] /usr/lib/libdbus-1.so.1(dbus_connection_dispatch+0x20a)[0x27af44]
hcid: processing events[0x8809c0]
hcid: processing events[0x8808b0]
hcid: processing events(main+0x4c5)[0x87cfef] /lib/libc.so.6(__libc_start_main+0xc6)[0x6b7de6]
hcid: processing events[0x87c071]
======= Memory map: ========

0026a000-002d3000 r-xp 00000000 fd:00 3051963    /usr/lib/libdbus-1.so.1.0.0
002d3000-002d8000 rwxp 00069000 fd:00 3051963    /usr/lib/libdbus-1.so.1.0.0
00301000-0031b000 r-xp 00000000 fd:00 8676400    /lib/ld-2.3.5.so
0031b000-0031c000 r-xp 00019000 fd:00 8676400    /lib/ld-2.3.5.so
0031c000-0031d000 rwxp 0001a000 fd:00 8676400    /lib/ld-2.3.5.so
003cd000-003ce000 r-xp 003cd000 00:00 0
006a3000-007c7000 r-xp 00000000 fd:00 8676401    /lib/libc-2.3.5.so
007c7000-007c9000 r-xp 00124000 fd:00 8676401    /lib/libc-2.3.5.so
007c9000-007cb000 rwxp 00126000 fd:00 8676401    /lib/libc-2.3.5.so

007cb000-007cd000 rwxp 007cb000 00:00 0
0085c000-00865000 r-xp 00000000 fd:00 8676405
/lib/libgcc_s-4.0.0-20050520.so.1
00865000-00866000 rwxp 00009000 fd:00 8676405
/lib/libgcc_s-4.0.0-20050520.so.1
0087a000-00884000 r-xp 00000000 fd:00 3051713 /usr/sbin/hcid
00884000-00885000 rwxp 00009000 fd:00 3051713 /usr/sbin/hcid
00a09000-00a15000 r-xp 00000000 fd:00 3048829
/usr/lib/libbluetooth.so.1.0.15
00a15000-00a16000 rwxp 0000c000 fd:00 3048829
/usr/lib/libbluetooth.so.1.0.15

00eb6000-00ec8000 r-xp 00000000 fd:00 8676413    /lib/libnsl-2.3.5.so
00ec8000-00ec9000 r-xp 00011000 fd:00 8676413    /lib/libnsl-2.3.5.so
00ec9000-00eca000 rwxp 00012000 fd:00 8676413    /lib/libnsl-2.3.5.so

00eca000-00ecc000 rwxp 00eca000 00:00 0
08462000-08483000 rw-p 08462000 00:00 0 [heap]
b7f78000-b7f7a000 rw-p b7f78000 00:00 0
b7f9e000-b7f9f000 rw-p b7f9e000 00:00 0
bfb89000-bfb9f000 rw-p bfb89000 00:00 0 [stack]
Aborted
==============================================================================

Signature · 15 lines
Dave Mielke           | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: [email protected] | Canada  K2A 1H7   | if you're concerned about Hell.
http://FamilyRadio.com/                   | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
author maintainer
#6 lore raw

Re: [Bluez-devel] hcid dies on socket connect attempt.

Hi Dave,

Quoted 14 lines

On a Fedora Core 4 system we have:

   dbus-0.33-3
   bluez-utils-2.15-7
   bluez-libs-2.15-1

hcid starts up fine:

==============================================================================
hcid -n
hcid[12537]: Bluetooth HCI daemon
hcid[12537]: Starting security manager 0
==============================================================================

Quoted 3 lines

As soon as I try to get a Bluetooth connection, however, it dies (see below).
What might be wrong?

last time I looked at the D-Bus 0.33 changes in the Fedora packages they seemed to be wrong. Try it with the latest BlueZ CVS.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#7 lore raw
In reply to Marcel Holtmann

just FYI everybody... sourceforge seems to have broken anonymous cvs (both bluez and bluetooth-alsa are affected)

$ cvs update -d
cvs [update aborted]: unrecognized auth response from cvs.bluez.org: cvs pserver: cannot read /cvsroot/bluez/CVSROOT/config: Input/output error
Quoted 17 lines · Marcel Holtmann

Hi Folks,

since Debian Etch now also switched to GCC 4.0 as default compiler, it is time to address all GCC 4.0 problems in the BlueZ source code. I started two days ago with fixing most of its crazy compiler warnings. The GCC 4.0 is really picky with the signedness and so I moved over to explicit types like uint8_t, uint16_t and uint32_t where possible. I now hope that I haven't introduced any signedness bugs. Please start testing the CVS versions of libs and utils.

Regards

Marcel

Quoted 9 lines

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

author maintainer
#8 lore raw

Hi Brad,

Quoted 6 lines

just FYI everybody... sourceforge seems to have broken anonymous cvs (both bluez and bluetooth-alsa are affected)

$ cvs update -d
cvs [update aborted]: unrecognized auth response from cvs.bluez.org: cvs 
pserver: cannot read /cvsroot/bluez/CVSROOT/config: Input/output error

argh, not again. This crazy error postponed the bluez-{libs|utils}-2.18 release already, because I always build the release packages from the anonymous CVS.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#9 lore raw

Hi Marcel,

Quoted 5 lines
Quoted 5 lines

just FYI everybody... sourceforge seems to have broken anonymous cvs (both bluez and bluetooth-alsa are affected)

$ cvs update -d
cvs [update aborted]: unrecognized auth response from cvs.bluez.org: cv=

s

Quoted 5 lines
Quoted 1 line

pserver: cannot read /cvsroot/bluez/CVSROOT/config: Input/output error

=20
argh, not again. This crazy error postponed the bluez-{libs|utils}-2.18 release already, because I always build the release packages from the anonymous CVS.

I've been seeing this problem on and off for a week or more.

Peter

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

author maintainer
#10 lore raw

Hi Peter,

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

just FYI everybody... sourceforge seems to have broken anonymous cvs (both bluez and bluetooth-alsa are affected)

$ cvs update -d
cvs [update aborted]: unrecognized auth response from cvs.bluez.org: cvs
pserver: cannot read /cvsroot/bluez/CVSROOT/config: Input/output error
Quoted 5 lines
Quoted 3 lines

argh, not again. This crazy error postponed the bluez-{libs|utils}-2.18 release already, because I always build the release packages from the anonymous CVS.

I've been seeing this problem on and off for a week or more.

start filing bug reports at sf.net so they have to react on it and hopefully improve their CVS service.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#11 lore raw
In reply to Marcel Holtmann

Hi Marcel,

Quoted 9 lines · Marcel Holtmann

Hi Folks,

since Debian Etch now also switched to GCC 4.0 as default compiler, it is time to address all GCC 4.0 problems in the BlueZ source code. I started two days ago with fixing most of its crazy compiler warnings. The GCC 4.0 is really picky with the signedness and so I moved over to explicit types like uint8_t, uint16_t and uint32_t where possible. I now hope that I haven't introduced any signedness bugs. Please start testing the CVS versions of libs and utils.

Good news. :)

I'd like to know if you're going to accept patches which fixes Linus sparse warnings, they seems to be trivial though.

PS: I think CVS is back again, it's working here.

Thanks,

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

author maintainer
#12 lore raw

Hi Luiz,

Quoted 8 lines
Quoted 7 lines

since Debian Etch now also switched to GCC 4.0 as default compiler, it is time to address all GCC 4.0 problems in the BlueZ source code. I started two days ago with fixing most of its crazy compiler warnings. The GCC 4.0 is really picky with the signedness and so I moved over to explicit types like uint8_t, uint16_t and uint32_t where possible. I now hope that I haven't introduced any signedness bugs. Please start testing the CVS versions of libs and utils.

Quoted 4 lines

Good news. :)

I'd like to know if you're going to accept patches which fixes Linus sparse
warnings, they seems to be trivial though.

I never used sparse outside the kernel, but go ahead and send patches.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel