Skip to contentSkip to conversation

piconet..

Bluez-devel Steffen Larsen 2 participants 13 messages Dec 11, 2004 – Dec 13, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi again!,

I am trying to form a piconet, consisting of one server and two clients. I have snaped the most of the code from l2test.c and also made an advertising service and all. My problem is just that one one client can connect and the other one fails (host is down, i belive) . I have implemented the server using fork(), so that the parent process is still listening for new connections and closing my sockets correct (as what I can see..). I have browsed this newsgroup for answers, and can see something about setting the master/slave switch should help. I have also tried this, but it dosn't help. Anyone that have a clue about, what could be wrong??

PS. I belive that the PSM in the L2CAP layer can serve more than one client or am I totally wrong? otherwise I should update the PSM everytime a new client connect..

I anyone want the source code, I can send it. But I haven't attached it in this document, due to the size of it.. :-)

-Thanks in advance!

/Steffen Larsen

#2 lore raw
In reply to Marcel Holtmann

Hi Marcel,

Quoted 14 lines

Hi Steffen,

Quoted 11 lines

I am trying to form a piconet, consisting of one server and two clients. I have snaped the most of the code from l2test.c and also made an advertising service and all. My problem is just that one one client can connect and the other one fails (host is down, i belive) . I have implemented the server using fork(), so that the parent process is still listening for new connections and closing my sockets correct (as what I can see..).
I have browsed this newsgroup for answers, and can see something about setting the master/slave switch should help. I have also tried this, but it dosn't help. Anyone that have a clue about, what could be wrong??

Quoted 1 line

show us the output of "hciconfig -a" for your devices.

ok.. I will do this later today. :-)

Quoted 5 lines
Quoted 3 lines

PS. I belive that the PSM in the L2CAP layer can serve more than one client or am I totally wrong? otherwise I should update the PSM everytime a new client connect..

It can also serve multiple PSM on the same ACL link.

Ok.. how do I do that?

Currently I am setting the PSM on my socket like this:

<code snip>
loc_addr.l2_family = AF_BLUETOOTH;

bacpy(&loc_addr.l2_bdaddr, local_bdaddr);

loc_addr.l2_psm = htobs(psm);

if (bind(sk, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {

printf("could not bind socket: %i\n", sk);

syslog(LOG_ERR, "Can't bind socket. %s(%d)", strerror(errno), errno);

exit(1);

}

</code snip>

/Steffen Larsen

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw
In reply to Steffen Larsen

Hi Steffen,

Quoted 11 lines

I am trying to form a piconet, consisting of one server and two clients. I have snaped the most of the code from l2test.c and also made an advertising service and all. My problem is just that one one client can connect and the other one fails (host is down, i belive) . I have implemented the server using fork(), so that the parent process is still listening for new connections and closing my sockets correct (as what I can see..).
I have browsed this newsgroup for answers, and can see something about setting the master/slave switch should help. I have also tried this, but it dosn't help. Anyone that have a clue about, what could be wrong??

show us the output of "hciconfig -a" for your devices.

Quoted 3 lines

PS. I belive that the PSM in the L2CAP layer can serve more than one client or am I totally wrong? otherwise I should update the PSM everytime a new client connect..

It can also serve multiple PSM on the same ACL link.

Regards

Marcel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw
In reply to Marcel Holtmann

Hi Marcel,

Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

PS. I belive that the PSM in the L2CAP layer can serve more than one client or am I totally wrong? otherwise I should update the PSM everytime a new client connect..

It can also serve multiple PSM on the same ACL link.

Ok.. how do I do that?

you call listen() and then accept() for every incoming connection. It is the same as for TCP/IP.

Ok.. I am already doing this in my parent thread. So the problem must be somewhere else.
I'll try to do the hciconfig -a in a brief moment and sent the output to the list... :-)

/Steffen Larsen

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#3 lore raw
In reply to Steffen Larsen

Hi Steffen,

Quoted 22 lines
Quoted 5 lines
Quoted 3 lines

PS. I belive that the PSM in the L2CAP layer can serve more than one client or am I totally wrong? otherwise I should update the PSM everytime a new client connect..

It can also serve multiple PSM on the same ACL link.

Ok.. how do I do that?

Currently I am setting the PSM on my socket like this:

<code snip>
loc_addr.l2_family = AF_BLUETOOTH;

bacpy(&loc_addr.l2_bdaddr, local_bdaddr);

loc_addr.l2_psm = htobs(psm);

if (bind(sk, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0) {

printf("could not bind socket: %i\n", sk);

Quoted 7 lines

syslog(LOG_ERR, "Can't bind socket. %s(%d)", strerror(errno), errno);

exit(1);

}

</code snip>

you call listen() and then accept() for every incoming connection. It is the same as for TCP/IP.

Regards

Marcel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw
In reply to Steffen Larsen

Hi Marcel and others, ;-)

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

PS. I belive that the PSM in the L2CAP layer can serve more than

one

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

client or am I totally wrong? otherwise I should update the PSM everytime a new client connect..

It can also serve multiple PSM on the same ACL link.

Ok.. how do I do that?

Quoted 6 lines
Quoted 2 lines

you call listen() and then accept() for every incoming connection. It is the same as for TCP/IP.

Ok.. I am already doing this in my parent thread. So the problem must be somewhere else.
I'll try to do the hciconfig -a in a brief moment and sent the output to

the

Quoted 1 line

list... :-)

My source code for most of my BTserver can be found at:
http://www.diku.dk/hjemmesider/studerende/zool/bt/prot.cc
As you can see in my souce (see the listenL2CAP method), I do almost as you told me to do and what l2test.c is doing.
I use the standard bind, listen and accept methods and spawns of a new child, when I get a connection. But I still can't make it work when I have more than one client (a piconet). Why is that? can you see a minor flaw in my code?

I have made a hciconfig -a with one of my USB dongles (it is a DBT 120 unit):

hci0: Type: USB
BD Address: 00:40:05:60:41:0D ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:653 acl:0 sco:0 events:19 errors:0
TX bytes:314 acl:0 sco:0 commands:18 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'fsck-0'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x1bb LMP Ver: 1.1 (0x1) LMP Subver: 0x1bb
Manufacturer: Cambridge Silicon Radio (10)

I can only give you this one, because one of my friends have the other two dongles. I will though sent the output later tonight, when I get them back. :-)

PS: It also seems like that the l2test works with more clients.. I really can't see the big difference in my code and l2test.. But mabye it is me.. ;-)

/Steffen Larsen

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#7 lore raw
In reply to Marcel Holtmann

Hi again Marcel,

Quoted 3 lines
Quoted 3 lines

My source code for most of my BTserver can be found at:
http://www.diku.dk/hjemmesider/studerende/zool/bt/prot.cc
As you can see in my souce (see the listenL2CAP method), I do almost as

you

Quoted 3 lines
Quoted 3 lines

told me to do and what l2test.c is doing.
I use the standard bind, listen and accept methods and spawns of a new child, when I get a connection. But I still can't make it work when I

have

Quoted 1 line
Quoted 1 line

more than one client (a piconet). Why is that? can you see a minor flaw

in

Quoted 21 lines
Quoted 21 lines

my code?

I have made a hciconfig -a with one of my USB dongles (it is a DBT 120 unit):

hci0: Type: USB
BD Address: 00:40:05:60:41:0D ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:653 acl:0 sco:0 events:19 errors:0
TX bytes:314 acl:0 sco:0 commands:18 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'fsck-0'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x1bb LMP Ver: 1.1 (0x1) LMP Subver: 0x1bb
Manufacturer: Cambridge Silicon Radio (10)

Quoted 1 line
Quoted 1 line

I can only give you this one, because one of my friends have the other

two

Quoted 1 line
Quoted 1 line

dongles. I will though sent the output later tonight, when I get them

back.

Quoted 1 line
Quoted 1 line

:-)

I got the two others:

hci0: Type: USB
BD Address: 00:01:53:00:14:EE ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:81 acl:0 sco:0 events:10 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'knoglen'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

hci0: Type: USB
BD Address: 00:01:53:00:0D:B5 ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:87 acl:0 sco:0 events:11 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'JESPER'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

Quoted 3 lines

so far so good, but check with "hciconfig hci0 revision" for the firmware version. This one is too old. It should be HCI 16.4 or newer, but if this is a DBT-120 Rev. B3 you might have a chance to update it.

Well. It is the B3 revision, so I would be able to do that. :-)

Quoted 2 lines

I think you should use fork(). What is wrong with using poll() or select() and an event loop.

Hmm.. This dosn't really answer my question. I am using fork()., and would like to get my application to work. I tried to compare it towards the l2test, but couldn't see that much difference. And the l2test works with the same dongles; connecting two clients against one server. Can you point somewhere in my code, where I should do some changes, so it could work??

I really starts to nag me, why my code dosn't work. All things works fine (like connecting/disconnecting etc.) with one clients, but with two... :-( And I have tried to make my server MASTER by setting the L2CAP_LM_MASTER in the link manager.

Quoted 2 lines

And btw since you use code from l2test.c etc. you should include the GPL license statement at the top of your code.

No worry.. I will.

-Thanks again for a quick answer! :-)

/Steffen Larsen

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#6 lore raw
In reply to Steffen Larsen

Hi Steffen,

Quoted 28 lines

My source code for most of my BTserver can be found at:
http://www.diku.dk/hjemmesider/studerende/zool/bt/prot.cc
As you can see in my souce (see the listenL2CAP method), I do almost as you told me to do and what l2test.c is doing.
I use the standard bind, listen and accept methods and spawns of a new child, when I get a connection. But I still can't make it work when I have more than one client (a piconet). Why is that? can you see a minor flaw in my code?

I have made a hciconfig -a with one of my USB dongles (it is a DBT 120 unit):

hci0: Type: USB
BD Address: 00:40:05:60:41:0D ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:653 acl:0 sco:0 events:19 errors:0
TX bytes:314 acl:0 sco:0 commands:18 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'fsck-0'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x1bb LMP Ver: 1.1 (0x1) LMP Subver: 0x1bb
Manufacturer: Cambridge Silicon Radio (10)

Quoted 3 lines

I can only give you this one, because one of my friends have the other two dongles. I will though sent the output later tonight, when I get them back. :-)

so far so good, but check with "hciconfig hci0 revision" for the firmware version. This one is too old. It should be HCI 16.4 or newer, but if this is a DBT-120 Rev. B3 you might have a chance to update it.

Quoted 3 lines

PS: It also seems like that the l2test works with more clients.. I really can't see the big difference in my code and l2test.. But mabye it is me.. ;-)

I think you should use fork(). What is wrong with using poll() or select() and an event loop.

And btw since you use code from l2test.c etc. you should include the GPL license statement at the top of your code.

Regards

Marcel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#8 lore raw
In reply to Steffen Larsen

Hi Steffen,

Quoted 18 lines

I got the two others:

hci0: Type: USB
BD Address: 00:01:53:00:14:EE ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:81 acl:0 sco:0 events:10 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'knoglen'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

Quoted 15 lines

hci0: Type: USB
BD Address: 00:01:53:00:0D:B5 ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:87 acl:0 sco:0 events:11 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'JESPER'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

these two are HCI 16.4 and so there should be no problem. See my CSR page why it is good to have HCI 16.x at least.

Quoted 5 lines
Quoted 3 lines

so far so good, but check with "hciconfig hci0 revision" for the firmware version. This one is too old. It should be HCI 16.4 or newer, but if this is a DBT-120 Rev. B3 you might have a chance to update it.

Well. It is the B3 revision, so I would be able to do that. :-)

I suppose you do that (at your own risk of course).

Quoted 5 lines

Hmm.. This dosn't really answer my question. I am using fork()., and would like to get my application to work. I tried to compare it towards the l2test, but couldn't see that much difference. And the l2test works with the same dongles; connecting two clients against one server. Can you point somewhere in my code, where I should do some changes, so it could work??

Getting the fork stuff right is not very easy. You must carefully think about what file descriptors to close at what time and in what process. I am not going to check your code for such mistakes, because it will take me too much time and the other reason is that it is C++ and not C.

Quoted 4 lines

I really starts to nag me, why my code dosn't work. All things works fine (like connecting/disconnecting etc.) with one clients, but with two... :-( And I have tried to make my server MASTER by setting the L2CAP_LM_MASTER in the link manager.

Update the dongle or try to swap the pre HCI 16.4 one. The master option can help, but you must choose the master device carefully.

Regards

Marcel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#9 lore raw

Hi Marcel,

Quoted 37 lines
Quoted 18 lines

I got the two others:

hci0: Type: USB
BD Address: 00:01:53:00:14:EE ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:81 acl:0 sco:0 events:10 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'knoglen'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

Quoted 15 lines

hci0: Type: USB
BD Address: 00:01:53:00:0D:B5 ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:87 acl:0 sco:0 events:11 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'JESPER'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

these two are HCI 16.4 and so there should be no problem. See my CSR page why it is good to have HCI 16.x at least.

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

so far so good, but check with "hciconfig hci0 revision" for the firmware version. This one is too old. It should be HCI 16.4 or newer, but if this is a DBT-120 Rev. B3 you might have a chance to update it.

Well. It is the B3 revision, so I would be able to do that. :-)

I suppose you do that (at your own risk of course).

Quoted 1 line

Hmm.. This dosn't really answer my question. I am using fork()., and

would

Quoted 2 lines
Quoted 2 lines

like to get my application to work. I tried to compare it towards the l2test, but couldn't see that much difference. And the l2test works with

the

Quoted 7 lines
Quoted 2 lines

same dongles; connecting two clients against one server. Can you point somewhere in my code, where I should do some changes, so it could work??

Getting the fork stuff right is not very easy. You must carefully think about what file descriptors to close at what time and in what process. I am not going to check your code for such mistakes, because it will take me too much time and the other reason is that it is C++ and not C.

I understand. I have been spending alot of time in it my self. I will look deeper into the socket, and which of them that have been closed and at which time... But I think I have checked this a million times.. But I will try again! :-)

Quoted 2 lines

Update the dongle or try to swap the pre HCI 16.4 one. The master option can help, but you must choose the master device carefully.

Yes I can try to swap the devices. You mention that the master device should be carefully choosen. I what way?
I have just assumed that my server should be the master, and thats that. What should I taken in to consideration?

-Once again thanks for all the quick answers! :-)

/Steffen Larsen

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#10 lore raw

HI Marcel and other!,

I found out what I did wrong. All my sockets and fork()'ing just worked fine. My problem was that I tried to make:

----- Original Message -----
From: "Steffen Larsen" <[email protected]>
To: <[email protected]>
Sent: Saturday, December 11, 2004 6:50 PM
Subject: Re: [Bluez-devel] piconet..

Quoted 41 lines

Hi Marcel,

Quoted 39 lines
Quoted 18 lines

I got the two others:

hci0: Type: USB
BD Address: 00:01:53:00:14:EE ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:81 acl:0 sco:0 events:10 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'knoglen'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

Quoted 15 lines

hci0: Type: USB
BD Address: 00:01:53:00:0D:B5 ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:87 acl:0 sco:0 events:11 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'JESPER'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

these two are HCI 16.4 and so there should be no problem. See my CSR page why it is good to have HCI 16.x at least.

Quoted 2 lines
Quoted 2 lines

so far so good, but check with "hciconfig hci0 revision" for the firmware version. This one is too old. It should be HCI 16.4 or

newer,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

but if this is a DBT-120 Rev. B3 you might have a chance to update

it.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Well. It is the B3 revision, so I would be able to do that. :-)

I suppose you do that (at your own risk of course).

Quoted 1 line

Hmm.. This dosn't really answer my question. I am using fork()., and

would

Quoted 2 lines
Quoted 2 lines

like to get my application to work. I tried to compare it towards the l2test, but couldn't see that much difference. And the l2test works

with

Quoted 3 lines

the

Quoted 2 lines
Quoted 2 lines

same dongles; connecting two clients against one server. Can you point somewhere in my code, where I should do some changes, so it could

work??

Quoted 8 lines
Quoted 5 lines

Getting the fork stuff right is not very easy. You must carefully think about what file descriptors to close at what time and in what process. I am not going to check your code for such mistakes, because it will take me too much time and the other reason is that it is C++ and not C.

I understand. I have been spending alot of time in it my self. I will look deeper into the socket, and which of them that have been closed and at

which

Quoted 7 lines

time... But I think I have checked this a million times.. But I will try again! :-)

Quoted 2 lines

Update the dongle or try to swap the pre HCI 16.4 one. The master option can help, but you must choose the master device carefully.

Yes I can try to swap the devices. You mention that the master device

should

Quoted 10 lines

be carefully choosen. I what way?
I have just assumed that my server should be the master, and thats that. What should I taken in to consideration?

-Once again thanks for all the quick answers! :-)

/Steffen Larsen

Quoted 10 lines

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#11 lore raw

Sorry!.. Was to quick on the 'send' button!

My problem was that I used the:

bacpy(&loc_addr.l2_bdaddr, local_bdaddr);

instead of :
bacpy(&loc_addr.l2_bdaddr, BDADDR_ANY);

Before I bind my address and PSM..

Thus binding my PSM and all to a hardcoded address instead of BDADDR_ANY.. My mistake! doh!..
Well sorry for all the fuss and mail spam I caused.. But thanks for all your answers anyways. It is cool that a mailing list is functioning the way this
do: quick and good answers! :-)

/Steffen Larsen

----- Original Message -----
From: "Steffen Larsen" <[email protected]>
To: <[email protected]>
Sent: Monday, December 13, 2004 10:48 AM
Subject: Re: [Bluez-devel] piconet..

Quoted 7 lines

HI Marcel and other!,

I found out what I did wrong. All my sockets and fork()'ing just worked fine. My problem was that I tried to make:

Quoted 25 lines

----- Original Message -----
From: "Steffen Larsen" <[email protected]>
To: <[email protected]>
Sent: Saturday, December 11, 2004 6:50 PM
Subject: Re: [Bluez-devel] piconet..

Quoted 18 lines

Hi Marcel,

Quoted 16 lines
Quoted 16 lines

I got the two others:

hci0: Type: USB
BD Address: 00:01:53:00:14:EE ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:81 acl:0 sco:0 events:10 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'knoglen'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver:

0x20d

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines

Manufacturer: Cambridge Silicon Radio (10)

hci0: Type: USB
BD Address: 00:01:53:00:0D:B5 ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN
RX bytes:87 acl:0 sco:0 events:11 errors:0
TX bytes:39 acl:0 sco:0 commands:10 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'JESPER'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver:

0x20d

Quoted 18 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

Manufacturer: Cambridge Silicon Radio (10)

these two are HCI 16.4 and so there should be no problem. See my CSR page why it is good to have HCI 16.x at least.

Quoted 2 lines
Quoted 2 lines

so far so good, but check with "hciconfig hci0 revision" for the firmware version. This one is too old. It should be HCI 16.4 or

newer,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

but if this is a DBT-120 Rev. B3 you might have a chance to update

it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Well. It is the B3 revision, so I would be able to do that. :-)

I suppose you do that (at your own risk of course).

Quoted 1 line

Hmm.. This dosn't really answer my question. I am using fork()., and

would

Quoted 1 line
Quoted 1 line

like to get my application to work. I tried to compare it towards

the

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

l2test, but couldn't see that much difference. And the l2test works

with

Quoted 2 lines

the

Quoted 1 line
Quoted 1 line

same dongles; connecting two clients against one server. Can you

point

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

somewhere in my code, where I should do some changes, so it could

work??

Quoted 2 lines
Quoted 2 lines

Getting the fork stuff right is not very easy. You must carefully

think

Quoted 1 line
Quoted 1 line
Quoted 1 line

about what file descriptors to close at what time and in what process.

I

Quoted 1 line
Quoted 1 line
Quoted 1 line

am not going to check your code for such mistakes, because it will

take

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

me too much time and the other reason is that it is C++ and not C.

I understand. I have been spending alot of time in it my self. I will

look

Quoted 6 lines
Quoted 1 line

deeper into the socket, and which of them that have been closed and at

which

Quoted 4 lines

time... But I think I have checked this a million times.. But I will try again! :-)

Quoted 1 line

Update the dongle or try to swap the pre HCI 16.4 one. The master

option

Quoted 27 lines
Quoted 3 lines
Quoted 1 line

can help, but you must choose the master device carefully.

Yes I can try to swap the devices. You mention that the master device

should

Quoted 10 lines

be carefully choosen. I what way?
I have just assumed that my server should be the master, and thats that. What should I taken in to consideration?

-Once again thanks for all the quick answers! :-)

/Steffen Larsen

Quoted 10 lines

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Quoted 10 lines

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#12 lore raw

Hi Steffen,

Quoted 11 lines

My problem was that I used the:

bacpy(&loc_addr.l2_bdaddr, local_bdaddr);

instead of :
bacpy(&loc_addr.l2_bdaddr, BDADDR_ANY);

Before I bind my address and PSM..

Thus binding my PSM and all to a hardcoded address instead of BDADDR_ANY.. My mistake! doh!..

I don't see a problem here as long as you put in the local address of your Bluetooth dongle (hci0) in there. If this is not working correctly then we might have a kernel bug.

Quoted 3 lines

Well sorry for all the fuss and mail spam I caused.. But thanks for all your answers anyways. It is cool that a mailing list is functioning the way this
do: quick and good answers! :-)

You are welcome.

Regards

Marcel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel