Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2006

    Receiving RFCOMM binary data.

    I am interfacing a Nokia 6682 to a Nonin Bluetooth pulse oximeter. The data format I am using consists of binary data where every fifth byte is 0X01. To read the data I have hacked the btsppecho example midlet. I can successfully connect to the pulse oximeter and I receive data. However only occasionally do I receive the 0x01. It seems as if the Bluetooth stack in the phone is stripping off most ASCII control codes.

    While I do not know any details, I have been told that this Bluetooth transmitted data has been successully received by Sony Ericsson phones and phones using Windows CE. I also know that this Bluetooth connection works with PCs using Visual Basic. It may also have been made to work with a Nokia 6630.

    How do I set up the communication link so that the binary data is received without modification? I have not been able to discover any API that will do this.
    Last edited by pisaacson; 2006-08-16 at 03:59.

  2. #2
    Super Contributor
    Join Date
    Dec 2005

    Re: Receiving RFCOMM binary data.


    I'm not bt exprert, just from docs and FN:
    - according to FN Tech Lib:
    Reading incoming stream does not work properly in certain Nokia S60 and Series 80 devices.
    Reported against
    S60 2nd Edition: Nokia 6600 v.4.09.1
    S60 2nd Edition, Feature Pack 1: Nokia 6620, Nokia 6260, Nokia 6670, Nokia 7610
    Series 80 2nd Edition: Nokia 9300, Nokia 9500
    Date identified
    December 22, 2004
    Detailed description
    When the Bluetooth Serial Port Profile (RFCOMM protocol) is used, reading incoming stream is sometimes interrupted with IOException. The read() method of the InputStream class may throw an IOException if the other end has closed the stream while the InputStream is still reading it.

    Another issue is that the InputStream cannot use a bigger byte array than 512 bytes when reading stream. A bigger byte array may crash the MIDlet.
    How to reproduce
    Run, for example, the BtsppEcho example application.

    Solution to the IOException issue: Ensure that the InputStream.read() has finished before closing the output stream in the other end.
    Solution to the stream size issue: Do not use a bigger byte array than 512 bytes. Read the input stream in a loop or keep the whole length of the stream under 512 bytes.

    Generic workaround to both issues: Use L2CAP connection instead of SPP (RFCOMM), if appropriate. This is feasible when you have access to the L2CAP protocol in both ends of your application (for example, connections between two devices).
    also try that section on forum:
    its more related to general topic as bluetooth issues (not strictly tied to specific programming language usage),


  3. #3
    Registered User
    Join Date
    Aug 2006

    Re: Receiving RFCOMM binary data.

    Thanks for the reply. However I am not having any of the problems described in the above FN. My midlet runs indefinitely without a problem other than the binary data is corrupted.

    According to the Bluetooth spec (Part F:1), RFCOMM has many different configurations. While these are described in detail in TS 07.10, I have not neen able to find any APIs to control them.

    I suspect I need to change the RFCOMM configuration, but I may be doing something else stupid. (I am new to both Bluetooth and Java.)

    Can anybody give me a clue?

Similar Threads

  1. suckho, i have encontered the same problems. Could you tell me how you resolved it?
    By dicson_hu in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-12-09, 10:56
  2. GPRS connection problems on 6600..
    By suckho in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2005-12-02, 14:00
  3. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  4. Replies: 2
    Last Post: 2004-09-15, 22:47

Posting Permissions

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