2007-09-21 08:34:17

by David Rehle

[permalink] [raw]
Subject: [Bluez-users] can't etablish more than two connections

Hi all,

depending on my previous post on bluez-devel list, i want to tell same
issue with more informations.

i can not establish more than two clientconnections with my bluetooth
server. I use sockets in C. Server allocates a socket, bind(), listen()
and accepts incomming client-requests in a loop.

I tried both, rfcomm and l2cap. But the third client always gets a "Host
is down" error during connect();

First i used only one rfcomm port 1, where two connections can be
established.
Next i tried to build two sockets with different rfcomm channels, but it
fails with same error.
After that i built two server-apps with different rfcomm channels with
same error.

I do not understand why there can be two connections on only one rfcomm
port (or l2cap psm) established. It is not clear to me, why there can
connect two clients on one rfcomm-channel 1 and not only one client, or
more than two??? (same for l2cap)

I am using bluez-libs and utils version 3.9 on ubuntu linux (feisty fawn).

hciconfing -a tells me the following:

hci0: Type: USB
BD Address: myBDaddress ACL MTU: 384:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:1842 acl:55 sco:0 events:103 errors:0
TX bytes:1307 acl:53 sco:0 commands:24 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'myPCname'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 2.0 (0x3) HCI Rev: 0x7a6 LMP Ver: 2.0 (0x3) LMP
Subver: 0x7a6
Manufacturer: Cambridge Silicon Radio (10)

i tried another USB-BT device with samme issue, where hciconfig -a told
me the following:

hci0: Type: USB
BD Address: myBDaddress ACL MTU: 384:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:15077 acl:139 sco:0 events:424 errors:0
TX bytes:3337 acl:129 sco:0 commands:120 errors:0
Features: 0xff 0xff 0x9f 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'myPCname'
Class: 0x3e0100
Service Classes: Networking, Rendering, Capturing, Object
Transfer, Audio
Device Class: Computer, Uncategorized
HCI Ver: 2.0 (0x3) HCI Rev: 0x976 LMP Ver: 2.0 (0x3) LMP
Subver: 0x976
Manufacturer: Cambridge Silicon Radio (10)

I called the manufacturer to ask him if his hardware supports only two
connections, but he told me that it has to be possible to connect seven
devices, like bluetooth specification says.

Does somebody got same issues?
Has anybody an idea why only two connections can be established?

Thank you for any suggestions.


with kind regards

David

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


2007-09-24 15:52:00

by David Rehle

[permalink] [raw]
Subject: Re: [Bluez-users] can't etablish more than two connections

Hi Marcel,

i only changed Link mode to "master". Previous it was set to "accept".
Next i changed link policy to "hold,sniff,park". Previous it was set to
nothing.

I want my server to be master without the possibility to change to
"slave". My server shall serve some incomming requests and i think it
does it now.

For what side effects you are talking?

There is no much complexity, only to send some data via sockets after a
request...

Regards,

David


Marcel Holtmann schrieb:
> Hi David,
>
>> As Marcel points out I"m being lazy with terminology. It's in the
>> hcid.conf link mode and link policy that you control how you negotiate
>> master/slave.
>
> and you better not touch these settings. If the defaults don't work, you
> should really know what you are doing. There are many side effects that
> can trouble your life later on.
>
> Regards
>
> Marcel

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

2007-09-24 07:09:40

by David Rehle

[permalink] [raw]
Subject: Re: [Bluez-users] can't etablish more than two connections

Hi,

a very big THANK YOU!!!

that was my mistake, now it is possible to establish more than two
connections.

THANK YOU THANK YOU THANK YOU

and also thank you for this great software, next i go to build a multi
dongle application


with kind regards

David


Brad Midgley schrieb:
> David
>
> As Marcel points out I"m being lazy with terminology. It's in the
> hcid.conf link mode and link policy that you control how you negotiate
> master/slave.
>
> Brad
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>

--
Dipl.-Ing. (FH) David Rehle
Technischer Angestellter IT-Komponenten
BAER-Projekt

-------------------------------------------------------------------------

TFH Berlin
Haus Bauwesen - Raum 209
Luxemburger Str. 10
13353 Berlin

Tel. 0 30 / 45 04 - 54 05
Fax 0 30 / 45 04 - 54 08
http://www.tfh-berlin.de/BAER

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

2007-09-24 07:12:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] can't etablish more than two connections

Hi David,

> As Marcel points out I"m being lazy with terminology. It's in the
> hcid.conf link mode and link policy that you control how you negotiate
> master/slave.

and you better not touch these settings. If the defaults don't work, you
should really know what you are doing. There are many side effects that
can trouble your life later on.

Regards

Marcel



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

2007-09-23 22:55:22

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-users] can't etablish more than two connections

David

As Marcel points out I"m being lazy with terminology. It's in the
hcid.conf link mode and link policy that you control how you negotiate
master/slave.

Brad

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

2007-09-22 00:30:21

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] can't etablish more than two connections

Hi Brad,

> Sometimes this is a result of running your bluetooth adapter in slave
> mode when you needed master mode.

there is no such thing. All initiated connections are the master from
the beginning. All accepted connections are slave. This is the fact
until you switch the role.

Regards

Marcel



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

2007-09-21 17:57:05

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-users] can't etablish more than two connections

David

Sometimes this is a result of running your bluetooth adapter in slave
mode when you needed master mode.

hcitool con

will show what the nature of the connections is. You likely can't
create a third piconet.

hcid.conf can be used to force master mode.

Brad

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