Skip to contentSkip to conversation

connect() and L2CAP_CONN_TIMEOUT

Bluez-devel Marco Pracucci 2 participants 7 messages Aug 9, 2006 – Aug 23, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,

I need to be sure that an SDP connection does not take more than X seconds. In order to achieve my goal, I have correctly set the page timeout of my local device. However, if I'm right, the page timeout is the max time the local Link Manager will wait for a baseband page response. But what does it happen if the page request is successfully completed and an error occur during the connection to L2CAP remote "layer"? Is there a timeout for this? Maybe L2CAP_CONN_TIMEOUT...

I have posted this message, because practical experiments demonstrate that sometimes the sdp_connect() timeout expires after 40 seconds.

Have you any idea and/or suggestion?

Thanks,
Marco Pracucci

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Marco,

Quoted 10 lines

I need to be sure that an SDP connection does not take more than X seconds. In order to achieve my goal, I have correctly set the page timeout of my local device. However, if I'm right, the page timeout is the max time the local Link Manager will wait for a baseband page response. But what does it happen if the page request is successfully completed and an error occur during the connection to L2CAP remote "layer"? Is there a timeout for this? Maybe L2CAP_CONN_TIMEOUT...

I have posted this message, because practical experiments demonstrate that sometimes the sdp_connect() timeout expires after 40 seconds.

run "hcidump -X -V" to check what timeout you really run into.

Regards

Marcel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Marcel,

I have dump it (hcidump -i hci1 -t -X -V). Here I publish only interesting commands and events:

2006-08-10 11:10:51.168745 < HCI Command: Create Connection
(0x01|0x0005) plen 13
bdaddr 00:07:80:81:03:E0 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
Packet type: DM1 DM3 DM5 DH1 DH3 DH5
2006-08-10 11:10:51.171492 > HCI Event: Command Status (0x0f) plen 4

Create Connection (0x01|0x0005) status 0x00 ncmd 1

2006-08-10 11:10:54.773623 > HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 7B:00:00:01:C3:E0 role 0x00
Role: Master
2006-08-10 11:10:54.921650 > HCI Event: Connect Complete (0x03) plen 11

status 0x21 handle 1 bdaddr 7B:00:00:01:C3:E0 type ACL encrypt 0x00
Error: Role Change Not Allowed

No other related event has been received, but the connect() system call returns after 40 seconds (2006-08-10 11:11:31). Have you any idea and/or suggestion?

Marco Pracucci

P.S. bdaddr 7B:00:00:01:C3:E0 is wrong: is it a little bug of hcidump?

Quoted 8 lines
Quoted 8 lines

I need to be sure that an SDP connection does not take more than X seconds. In order to achieve my goal, I have correctly set the page timeout of my local device. However, if I'm right, the page timeout is the max time the local Link Manager will wait for a baseband page response. But what does it happen if the page request is successfully completed and an error occur during the connection to L2CAP remote "layer"? Is there a timeout for this? Maybe L2CAP_CONN_TIMEOUT...

Quoted 6 lines
Quoted 3 lines

I have posted this message, because practical experiments demonstrate that sometimes the sdp_connect() timeout expires after 40 seconds.

run "hcidump -X -V" to check what timeout you really run into.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#3 lore raw

Hi Marco,

Quoted 14 lines

I have dump it (hcidump -i hci1 -t -X -V). Here I publish only interesting commands and events:

2006-08-10 11:10:51.168745 < HCI Command: Create Connection
(0x01|0x0005) plen 13
bdaddr 00:07:80:81:03:E0 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
Packet type: DM1 DM3 DM5 DH1 DH3 DH5
2006-08-10 11:10:51.171492 > HCI Event: Command Status (0x0f) plen 4

Create Connection (0x01|0x0005) status 0x00 ncmd 1

2006-08-10 11:10:54.773623 > HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 7B:00:00:01:C3:E0 role 0x00
Role: Master
2006-08-10 11:10:54.921650 > HCI Event: Connect Complete (0x03) plen 11
Quoted 8 lines

status 0x21 handle 1 bdaddr 7B:00:00:01:C3:E0 type ACL encrypt 0x00
Error: Role Change Not Allowed

No other related event has been received, but the connect() system call returns after 40 seconds (2006-08-10 11:11:31). Have you any idea and/or suggestion?

P.S. bdaddr 7B:00:00:01:C3:E0 is wrong: is it a little bug of hcidump?

I don't know of any bug in hcidump. What version are you using. If the address is displayed wrong then actually the wrong address might be used.

Regards

Marcel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Hi Marcel,

Quoted 7 lines
Quoted 7 lines
2006-08-10 11:10:54.773623 > HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 7B:00:00:01:C3:E0 role 0x00
Role: Master
2006-08-10 11:10:54.921650 > HCI Event: Connect Complete (0x03) plen 11

status 0x21 handle 1 bdaddr 7B:00:00:01:C3:E0 type ACL encrypt 0x00
Error: Role Change Not Allowed

Quoted 7 lines
Quoted 2 lines

P.S. bdaddr 7B:00:00:01:C3:E0 is wrong: is it a little bug of hcidump?

I don't know of any bug in hcidump. What version are you using. If the address is displayed wrong then actually the wrong address might be used.

hcidump version: 1.30
Bluez libs: 2.25

If it's not an hcidump bug, it could be a protocol stack. Since the remote device implements a closed/proprietary Bluetooth stack (from BlueGiga Technologies), it could be a bug of it.

What do you think? Have you any other suggestion?

Regards,
Marco Pracucci

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#5 lore raw

Hi Marco,

Quoted 13 lines
Quoted 7 lines
Quoted 7 lines
2006-08-10 11:10:54.773623 > HCI Event: Role Change (0x12) plen 8
status 0x00 bdaddr 7B:00:00:01:C3:E0 role 0x00
Role: Master
2006-08-10 11:10:54.921650 > HCI Event: Connect Complete (0x03) plen 11

status 0x21 handle 1 bdaddr 7B:00:00:01:C3:E0 type ACL encrypt 0x00
Error: Role Change Not Allowed

Quoted 5 lines
Quoted 1 line

P.S. bdaddr 7B:00:00:01:C3:E0 is wrong: is it a little bug of hcidump?

I don't know of any bug in hcidump. What version are you using. If the address is displayed wrong then actually the wrong address might be used.

Quoted 8 lines

hcidump version: 1.30
Bluez libs: 2.25

If it's not an hcidump bug, it could be a protocol stack. Since the remote device implements a closed/proprietary Bluetooth stack (from BlueGiga Technologies), it could be a bug of it.

What do you think? Have you any other suggestion?

it must be actually a bug on our side. I actually trust hcidump to do the right thing and this means that somehow the wrong address gets used. Please include some more information about your system and kernel version you use. You should also create a binary dump in BTSnoop format.

Regards

Marcel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw
In reply to Marco Pracucci

Hi Marcel,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I need to be sure that an SDP connection does not take more than X seconds. In order to achieve my goal, I have correctly set the page timeout of my local device. However, if I'm right, the page timeout is the max time the local Link Manager will wait for a baseband page response. But what does it happen if the page request is successfully completed and an error occur during the connection to L2CAP remote "layer"? Is there a timeout for this? Maybe L2CAP_CONN_TIMEOUT...

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

I have posted this message, because practical experiments demonstrate that sometimes the sdp_connect() timeout expires after 40 seconds.

run "hcidump -X -V" to check what timeout you really run into.

I have resolved the connect() timeout problem, setting two socket options before connect() system call: SO_SNDTIMEO, SO_RCVTIMEO. Now, it seems to work fine.

Marco Pracucci

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel