Zero length L2CAP packets
Hi,
while working on the avetana jsr82 implementation we discovered, that the bt spec as well as jsr82 allow to transmit zero length l2cap packets. IMHO the linux socket interface does not support zero length packets and a read returning zero indicates an end of file (in this case meaning that the connection has been closed).
What happens if the other side actually sends a zero length packet? Is this dropped inside the kernel? Or will read return zero which i'll misinterpret as the eof marker? How can i distinguish between eof and a zero length packet?
Regards,
Till
Signature · 15 lines
Dr.-Ing. Till Harbaum Tel.: +49 721 4998963 BeeCon GmbH Fax: +49 721 4998962 Haid-und-Neu Strasse 7, 76131 Karlsruhe Mobil: +49 179 9087904 [email protected] http://www.beecon.de ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Bluez-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Till,
Quoted 10 lines
while working on the avetana jsr82 implementation we discovered, that the bt spec as well as jsr82 allow to transmit zero length l2cap packets. IMHO the linux socket interface does not support zero length packets and a read returning zero indicates an end of file (in this case meaning that the connection has been closed).
What happens if the other side actually sends a zero length packet? Is this dropped inside the kernel? Or will read return zero which i'll misinterpret as the eof marker? How can i distinguish between eof and a zero length packet?
actually I see no problem with zero length L2CAP packets. I modified the l2test program to actually be able to send and receive them, but there is no problem at all. This is a socket and not a file and so you might use poll() or select() to detect the hangup of the connection and not some weird zero length magic.
The kernel btw is dropping no packets. I see all of these zero packets flying from one end to the other.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Marcel Holtmann
maintainerHi Moritz,
Quoted 10 lines
I just tried writing a 0-length packet on my open L2CAP Connection and I cannot see anything happening with hcidump. The remote end is a Mac. But I guess that I should see anything regardless of the remote end. 1-byte packets and more get transferred correctly but
write (fd, "foo", 0);
on my open L2CAP Descriptor fd does not give any reaction in hcidump.
my version of bluez is libbluetooth1 2.11-1
update the library and utils and also the kernel. Maybe you need to use send() for sending 0 byte payload, because this is what is used in the l2test program.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel