Linux bluetooth development
 help / color / mirror / Atom feed
From: "Henryk Plötz" <henryk@ploetzli.ch>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] Regarding a2recv
Date: Mon, 9 May 2005 00:54:13 +0200	[thread overview]
Message-ID: <20050509005413.3787d2d7.henryk@ploetzli.ch> (raw)
In-Reply-To: <20050508125039.1494.qmail@web8305.mail.in.yahoo.com>

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

Moin,

Am Sun, 8 May 2005 13:50:39 +0100 (BST) schrieb Mayank Batra:

> I believe that should have been a problem because
> interchanding packet_type and message_type does make a
> lot of difference to the avdtp packet.

Yes, it does.

I now completely restructured the a2recv code into something that more
closely resembles a socket server application. Basically it is now a
giant endless loop that is blocking in select() on the serverfd and
optionally the cmdfd and streamfd (should they be open) and as soon as
there is data to read or a connection to accept I am reading it.

There is also an internal state like that from the AVDTP spec and I'm
treating incoming packets based on that state. This will allow any
sequence of AVDTP_DISCOVER, AVDTP_GET_CAPABILITIES, AVDTP_OPEN, etc.
commands to occur and also makes it possible to have the server handle
more than one connection during its lifetime (only one at a time, of
course).

The code is currently completely lacking any error handling, and simply
ignores the offending packet (or exits), so that should be added. I also
don't like the structs used for the avdtp signalling packets, I think
there should only be one struct that includes a struct avdtp_header and
a union with all the other optional signalling contents. Then there
would have to be specialised read()/write() functions which figure out
(based on the header) how long the packet actually is and automatically
send/receive that many bytes. However, that would also require
modification of a2play so I thought I'd ask first.

That would make it easier to send rejection messages (which may differ
from the acceptance message in length) and do proper error handling.

> Why doesn't the streaming start?

If I only knew ...
The current code shows me that the stream connection is correctly
established and the start streaming response is sent. Then after some
seconds I get a read error on the command fd with error message
"Connection timed out". 

Again, please check that I didn't break your devices. I can only test
with a2play. There might also still be some flaws in the state handling
since this is slightly more complex than the original straight linear
design.

-- 
Henryk Plötz
Grüße aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-05-08 22:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 12:45 [Bluez-devel] Regarding a2recv Mayank Batra
2005-05-05 13:14 ` Marcel Holtmann
2005-05-05 14:40 ` Brad Midgley
2005-05-06  4:05 ` Henryk Plötz
2005-05-08 12:50   ` Mayank Batra
2005-05-08 22:54     ` Henryk Plötz [this message]
2005-05-09  0:01       ` Marcel Holtmann
2005-05-09  0:58         ` Henryk Plötz
2005-05-09  1:03           ` Marcel Holtmann
2005-05-09  1:35             ` Henryk Plötz
2005-05-09  1:44               ` Marcel Holtmann
2005-05-09  4:29               ` Brad Midgley
2005-05-09 12:48                 ` Henryk Plötz
2005-05-09 12:58                   ` Marcel Holtmann
2005-05-09 16:25                   ` Brad Midgley
2005-05-09  4:29       ` Brad Midgley
2005-05-09 12:38         ` Henryk Plötz
2005-05-09 21:31           ` Brad Midgley
2005-05-10  7:20       ` Mayank Batra

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=20050509005413.3787d2d7.henryk@ploetzli.ch \
    --to=henryk@ploetzli.ch \
    --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