public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: <becicka@uiuc.edu>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] l2cap connection problems
Date: Tue, 13 Jul 2004 16:50:46 -0500	[thread overview]
Message-ID: <70a9c48b.5f72b479.8225b00@expms2.cites.uiuc.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

I have written a client and server that need to be able to
communicate over Bluetooth.  I am attempting to use L2CAP, but
am not able to consistently connect to the server.  My
application requires the server socket that accepts L2CAP
connections to be non-blocking.  On the client side, I am
using a non-blocking connect (connect with 2 second timeout).
 However, in trying to debug the connection problem, I have
tried using non-blocking sockets at both ends.  Even in this
situation, my results were the same.  Sometimes the connection
is accepted immediately (roughly half the time), the server
begins streaming data to the client, and everything works
great.  Just as frequently, the connection attempt times out
at the client (when the client uses a blocking connect), or
the connection succeeds after some number (potentially very
many) of non-blocking connect attempts.  Occasionally the
connection attempt appears as if it will never succeed.  I
have attached a file containing hcidump output for 3 cases
which are annotated in the file.  In all 3 cases a blocking
accept is used at the server.  It seems as if the HCI layer
events are identical regardless of whether or not the L2CAP
layer accept (server) and connect (client) succeed.  Any
thoughts as to what the problem might be?  For whatever it's
worth, I am using D-Link DBT120 USB adapters.  Thanks in advance.

Troy K. Becicka
Graduate Student
University of Illinois at Urbana-Champaign
Computer Engineering

[-- Attachment #2: bt_con_debug --]
[-- Type: APPLICATION/OCTET-STREAM, Size: 5519 bytes --]


This is the hcidump output at the server when a blocking
connect is used and the connection is not accepted 
(i.e. eventually times out).

> HCI Event: Connect Request(0x04) plen 10
< HCI Command: Accept Connection Request(0x01|0x0009) plen 7
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connect Complete(0x03) plen 11
< HCI Command: Change Connection Packet Type(0x01|0x000f) plen 4
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connection Packet Type Changed(0x1d) plen 5
> HCI Event: Max Slots Change(0x1b) plen 3
> ACL data: handle 0x0004 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 100 scid 0x0040
< ACL data: handle 0x0004 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
> HCI Event: Max Slots Change(0x1b) plen 3
> HCI Event: Number of Completed Packets(0x13) plen 5



This is the hcidump output at the server for one timeout
period (i.e. using a nonblocking connect) when the connection
is not accepted.

> HCI Event: Connect Request(0x04) plen 10
< HCI Command: Accept Connection Request(0x01|0x0009) plen 7
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connect Complete(0x03) plen 11
< HCI Command: Change Connection Packet Type(0x01|0x000f) plen 4
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connection Packet Type Changed(0x1d) plen 5
> HCI Event: Max Slots Change(0x1b) plen 3
> ACL data: handle 0x0004 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 100 scid 0x0040
< ACL data: handle 0x0004 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
> HCI Event: Max Slots Change(0x1b) plen 3
> HCI Event: Number of Completed Packets(0x13) plen 5
> HCI Event: Disconn Complete(0x05) plen 4




This is the hcidump output at the server when the connection is accepted.

[root@tale becicka]# hcidump
HCIDump - HCI packet analyzer ver 1.3
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Connect Request(0x04) plen 10
< HCI Command: Accept Connection Request(0x01|0x0009) plen 7
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connect Complete(0x03) plen 11
< HCI Command: Change Connection Packet Type(0x01|0x000f) plen 4
> HCI Event: Command Status(0x0f) plen 4
> HCI Event: Connection Packet Type Changed(0x1d) plen 5
> HCI Event: Max Slots Change(0x1b) plen 3
> HCI Event: Max Slots Change(0x1b) plen 3
> ACL data: handle 0x0004 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 100 scid 0x0040
< ACL data: handle 0x0004 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
> HCI Event: Number of Completed Packets(0x13) plen 5
> ACL data: handle 0x0004 flags 0x02 dlen 12
    L2CAP(s): Config req: dcid 0x0040 flags 0x0000 clen 0
< ACL data: handle 0x0004 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0040 flags 0x0000 result 0 clen 0
< ACL data: handle 0x0004 flags 0x02 dlen 12
    L2CAP(s): Config req: dcid 0x0040 flags 0x0000 clen 0
> HCI Event: Number of Completed Packets(0x13) plen 5
> ACL data: handle 0x0004 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0040 flags 0x0000 result 0 clen 0
> ACL data: handle 0x0004 flags 0x02 dlen 6
    L2CAP(d): cid 0x40 len 2 [psm 100]
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]
> ACL data: handle 0x0004 flags 0x02 dlen 24
    L2CAP(d): cid 0x40 len 20 [psm 100]
> HCI Event: Number of Completed Packets(0x13) plen 5
< ACL data: handle 0x0004 flags 0x02 dlen 32
    L2CAP(d): cid 0x40 len 28 [psm 100]



             reply	other threads:[~2004-07-13 21:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 21:50 becicka [this message]
2004-07-15 10:58 ` [Bluez-devel] l2cap connection problems Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2004-07-15 15:50 becicka
2004-07-15 16:16 becicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70a9c48b.5f72b479.8225b00@expms2.cites.uiuc.edu \
    --to=becicka@uiuc.edu \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox