public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] Problem with read on RFCOMM Sockets
@ 2004-06-15 18:31 ionut dediu
  2004-06-15 22:49 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: ionut dediu @ 2004-06-15 18:31 UTC (permalink / raw)
  To: bluez-devel

Hy
I have a Fedora linux running kernel 2.6.5-1.358. I
made a simple client program on the PC which reads
data sent from a Phone Server application through
rfcomm. Read allways returns the correct no of bytes,
but the buffer in which I read allways has just 1 byte
of data. I saw from another post that there were
similar problems with rfcomm sockets, and as I
understand this could be a kernel bug. Could you tell
me what upgrade should I make to the kernel ? Thanks a
lot in advance.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: [Bluez-devel] Problem with read on RFCOMM Sockets
@ 2004-06-16 13:17 Williams, Richard
  2004-06-16 13:27 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Williams, Richard @ 2004-06-16 13:17 UTC (permalink / raw)
  To: BlueZ Mailing List


I understand why strlen should not be used in this case, but why
unsigned char instead of char ? There are many examples of the=20
use of the generic file I/O read() function in the literature=20
using char buffers. Is this case different ?

thanks, Best regards,

Rich

Hi,

> Here is the source code. For testing the receiving of
> data I tried commenting the select loop, and do just
> receiveData, and I get the same results: read returns
> the correct number of bytes, but in the buffer is
> copied just one byte of data. Please tell me if I'm
> doing smth wrong. Thanks a lot.

your buffer should be "unsigned char" and you shouldn't use strlen() to
check to length of your buffer. Rely on the return value of read().

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-16 13:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-15 18:31 [Bluez-devel] Problem with read on RFCOMM Sockets ionut dediu
2004-06-15 22:49 ` Marcel Holtmann
2004-06-16 11:11   ` ionut dediu
2004-06-16 11:32     ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2004-06-16 13:17 Williams, Richard
2004-06-16 13:27 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox