From: Mauro Tortonesi <mtortonesi@ing.unife.it>
To: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] l2cap xfer fails
Date: Wed, 28 Jan 2004 12:17:47 +0100 [thread overview]
Message-ID: <200401281217.47133.mtortonesi@ing.unife.it> (raw)
In-Reply-To: <200401281200.07012.mtortonesi@ing.unife.it>
On Wednesday 28 January 2004 12:00, Mauro Tortonesi wrote:
> On Wednesday 28 January 2004 11:35, Mauro Tortonesi wrote:
> > i've been testing bluetooth support for nc6. unfortunately, i couldn't
> > transfer data. both kernels are 2.4.25-pre7.
>
> sorry, my kmail client sucks. it keeps crashing and sending unfinished
> emails instead of postponining them. good old pine was not so bad :-(
>
> what i wanted to say is that i can transfer (over L2CAP) data from console,
> but transfer of files redirected to stdin always fails. perhaps i am doing
> something wrong? such as calling write(2) over L2CAP sockets with buffers
> larger that 762 bytes?
s/762/672/
ok, it seems that the problem was really that the size of the buffers i was
passing to write(2) is too big. with this code:
#define IMTU 672
static ssize_t btwrite(int fd, const char *buf, size_t count)
{
ssize_t res, pos = 0;
while (count > pos) {
res = send(fd, buf + pos, MIN(IMTU, count - pos), 0);
switch (res) {
case -1:
if (errno == EINTR || errno == EAGAIN)
continue;
case 0:
return (res);
default:
pos += res;
}
}
return (pos);
}
i can finally use a write(2)-compatible api for writing on L2CAP sockets.
--
Aequam memento rebus in arduis servare mentem...
Mauro Tortonesi mtortonesi@ing.unife.it
mauro@deepspace6.net
mauro@ferrara.linux.it
Deep Space 6 - IPv6 with Linux http://www.deepspace6.net
Ferrara Linux User Group http://www.ferrara.linux.it
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2004-01-28 11:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-28 10:35 [Bluez-devel] l2cap xfer fails Mauro Tortonesi
2004-01-28 11:00 ` Mauro Tortonesi
2004-01-28 11:17 ` Mauro Tortonesi [this message]
2004-01-28 11:22 ` Marcel Holtmann
2004-01-28 11:36 ` Mauro Tortonesi
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=200401281217.47133.mtortonesi@ing.unife.it \
--to=mtortonesi@ing.unife.it \
--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