* [Bluez-devel] l2cap xfer fails
@ 2004-01-28 10:35 Mauro Tortonesi
2004-01-28 11:00 ` Mauro Tortonesi
0 siblings, 1 reply; 5+ messages in thread
From: Mauro Tortonesi @ 2004-01-28 10:35 UTC (permalink / raw)
To: BlueZ Mailing List
i've been testing bluetooth support for nc6. unfortunately, i couldn't=20
transfer data. both kernels are 2.4.25-pre7.
1st test - client side:
[mauro@daneel nc6]$ ./src/nc6 -b 00:0D:88:8E:CA:07 10
erneuwenoun
ervimn=F2orinw=F2trin=F2ri
rtbon=F2reonb=F2obre=F2eorinrt
weinbrt=F2oint=F2io1re
trbon=F2beone=F2otrn=F2rtietr
rin=F2eroinrt=F2inr=F2int
rbn=F2on=F2rtibit
rinr=F2tboinrt=F2inrirbtmrkimfr
rebmrtmre=F2ireireo=F2
1st test - server side:
[mauro@giskard nc6]$ ./src/nc6 -vvv -b -l -p 10 > dump.bin
nc6: listening on (null) psm 10 ...
nc6: connect to (null) psm 10 from 00:0D:88:8E:CA:07 psm 10
nc6: using seqpacket socket
nc6: using buffer size of 8192
nc6: read eof from remote
nc6: closed local for write
nc6: remote hold timed out
nc6: closed local for read
nc6: closed remote for write
nc6: connection closed (sent 0, rcvd 182)
2nd test - client side:
[mauro@daneel nc6]$ cat src/main.c | ./src/nc6 -vvv -b 00:0D:88:8E:CA:07 10
nc6: using buffer size of 8192
nc6: error writing to remote: Invalid argument
nc6: connessione terminata (inviati 0, ricevuti 0)
nc6: closed local
nc6: closed remote
2nd test - server side:
[mauro@giskard nc6]$ ./src/nc6 -vvv -b -l -p 10 > dump.bin
nc6: listening on (null) psm 10 ...
nc6: connect to (null) psm 10 from 00:0D:88:8E:CA:07 psm 10
nc6: using seqpacket socket
nc6: using buffer size of 8192
nc6: read eof from remote
nc6: closed local for write
nc6: remote hold timed out
nc6: closed local for read
nc6: closed remote for write
nc6: connection closed (sent 0, rcvd 0)
=2D-=20
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
=46errara 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] l2cap xfer fails
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
2004-01-28 11:22 ` Marcel Holtmann
0 siblings, 2 replies; 5+ messages in thread
From: Mauro Tortonesi @ 2004-01-28 11:00 UTC (permalink / raw)
To: BlueZ Mailing List
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 emai=
ls=20
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,=
=20
but transfer of files redirected to stdin always fails. perhaps i am doing=
=20
something wrong? such as calling write(2) over L2CAP sockets with buffers=20
larger that 762 bytes?
> 1st test - client side:
>
> [mauro@daneel nc6]$ ./src/nc6 -b 00:0D:88:8E:CA:07 10
> erneuwenoun
> ervimn=F2orinw=F2trin=F2ri
> rtbon=F2reonb=F2obre=F2eorinrt
> weinbrt=F2oint=F2io1re
> trbon=F2beone=F2otrn=F2rtietr
> rin=F2eroinrt=F2inr=F2int
> rbn=F2on=F2rtibit
> rinr=F2tboinrt=F2inrirbtmrkimfr
> rebmrtmre=F2ireireo=F2
>
> 1st test - server side:
>
> [mauro@giskard nc6]$ ./src/nc6 -vvv -b -l -p 10 > dump.bin
> nc6: listening on (null) psm 10 ...
> nc6: connect to (null) psm 10 from 00:0D:88:8E:CA:07 psm 10
> nc6: using seqpacket socket
> nc6: using buffer size of 8192
> nc6: read eof from remote
> nc6: closed local for write
> nc6: remote hold timed out
> nc6: closed local for read
> nc6: closed remote for write
> nc6: connection closed (sent 0, rcvd 182)
>
>
> 2nd test - client side:
>
> [mauro@daneel nc6]$ cat src/main.c | ./src/nc6 -vvv -b 00:0D:88:8E:CA:07 =
10
> nc6: using buffer size of 8192
> nc6: error writing to remote: Invalid argument
> nc6: connessione terminata (inviati 0, ricevuti 0)
> nc6: closed local
> nc6: closed remote
>
> 2nd test - server side:
>
> [mauro@giskard nc6]$ ./src/nc6 -vvv -b -l -p 10 > dump.bin
> nc6: listening on (null) psm 10 ...
> nc6: connect to (null) psm 10 from 00:0D:88:8E:CA:07 psm 10
> nc6: using seqpacket socket
> nc6: using buffer size of 8192
> nc6: read eof from remote
> nc6: closed local for write
> nc6: remote hold timed out
> nc6: closed local for read
> nc6: closed remote for write
> nc6: connection closed (sent 0, rcvd 0)
=2D-=20
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
=46errara 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] l2cap xfer fails
2004-01-28 11:00 ` Mauro Tortonesi
@ 2004-01-28 11:17 ` Mauro Tortonesi
2004-01-28 11:22 ` Marcel Holtmann
1 sibling, 0 replies; 5+ messages in thread
From: Mauro Tortonesi @ 2004-01-28 11:17 UTC (permalink / raw)
To: BlueZ Mailing List
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] l2cap xfer fails
2004-01-28 11:00 ` Mauro Tortonesi
2004-01-28 11:17 ` Mauro Tortonesi
@ 2004-01-28 11:22 ` Marcel Holtmann
2004-01-28 11:36 ` Mauro Tortonesi
1 sibling, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2004-01-28 11:22 UTC (permalink / raw)
To: Mauro Tortonesi; +Cc: BlueZ Mailing List
Hi Mauro,
> 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?
I haven't checked the nc6 Bluetooth support so far, but the L2CAP is a
SOCK_SEQPACKET and it has an in and an out MTU. The default MTU is 672
and this means if you send data with a larger buffer, the write() will
fail.
Regards
Marcel
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] l2cap xfer fails
2004-01-28 11:22 ` Marcel Holtmann
@ 2004-01-28 11:36 ` Mauro Tortonesi
0 siblings, 0 replies; 5+ messages in thread
From: Mauro Tortonesi @ 2004-01-28 11:36 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: BlueZ Mailing List
On Wednesday 28 January 2004 12:22, Marcel Holtmann wrote:
> Hi Mauro,
>
> > 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?
>
> I haven't checked the nc6 Bluetooth support so far, but the L2CAP is a
> SOCK_SEQPACKET and it has an in and an out MTU. The default MTU is 672
> and this means if you send data with a larger buffer, the write() will
> fail.
you're right. in fact:
nc6 --mtu=672 -b address -p psm
works perfectly.
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-01-28 11:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2004-01-28 11:22 ` Marcel Holtmann
2004-01-28 11:36 ` Mauro Tortonesi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox