×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    Bluetooth L2CAP Socket: Read() vs. Recv()

    Hello everyone,

    I've modified the sample BluetoothPointToPoint application that comes with the 7650 developer kit to use L2CAP sockets instead of RFCOMM. It seems to work fine, but one of the changes I had to make was to change the original server to read from the socket using Read() instead of RecvOneOrMore(). If I used RecvOneOrMore() (or even plain Recv()) I got a system error -5, which I believe is KErrNotSupported. Now, this has me a bit stumped because the only caveat mentioned by the API for RSocket is that RecvOneOrMore() (or Recv()) must be used on a connected socket, which my L2CAP socket certainly is. The only difference I can see about L2CAP sockets is that they are of type "Sequenced Packet", but I do not understand how this precludes the use of Recv(). Can someone please explain?

    Incidentally, could someone also explain how come Read() will return after reading only 30 bytes into the provided descriptor, even though the descriptor is declared as TBuf8<32>? This seems to contradict the API documentation for Read() which says "The function only complete when the full amount of requested data has been received (or the connection breaks). This means when the descriptor has been filled to its maximum length (not its current length)."

    Cheers,

    james

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    16

    Read() va. Recv()

    I'm using IrDA sockets and have also noticed that RecvOneOrMore() returns with KErrNotSupported. However, when I changed it to Read() into a TBuf8<6>, it reads exactly 6 as the docs explain.

    Have you found a solution to your problem? If so, I'd be interested in it.

    Thanx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •