×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    6

    Post PrintStream makes Bluetooth to disconnect?!

    Ok, try to understand this.... Some codes work, others, raise "SymbianOS error = -36: System error".

    The code below works:

    InputStream in = ((StreamConnection)con).openInputStream();
    in.read(driver);
    if (true) {
    out.println("1");
    }

    This, doesn't:

    InputStream in = ((StreamConnection)con).openInputStream();
    in.read(driver);
    if (true) {
    out.println("1");
    out.println("2"); //The error's cause
    }

    And this, works:

    InputStream in = ((StreamConnection)con).openInputStream();
    if (true) {
    out.println("1");
    out.println("2"); //Now, it works.
    }


    Any idea about what's going on?

    thank you!
    Alê!

  2. #2
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    150

    Thumbs up Re: PrintStream makes Bluetooth to disconnect?!

    Hi alegomes!

    The Symbian error -36 is: KErrDisconnected -36 Disconnected

    As you can say, your BT connection is disconnected in a certain moment! I've noted that between two readings with the "InputStream" object you haven't closed the BT connection and you are trying to create a new connection from your device to the same BT URL before closing the previous one!

    I think that this code can provoke some problems in the BT implementation so I would close the BT connection before creating a new InputStream pointing to the same BT URL! Other possibility is not to close it and to read from and write to it while it is alive and without creating a new InputStream object!

    You can check it and it might be that it works!

    NOTES:
    Are you using a BT URL and you haven't write it in your POST?
    Code:
    Connector con =Connector.open(btUrl);
    InputStream in = ((StreamConnection)con).openInputStream();
    Where is your "out" object pointing to?
    Code:
    Connector con =Connector.open(btUrl);
    OutputStream out= ((StreamConnection)con).openOutputStream();
    It would be interesting to know that!
    Last edited by Summerman; 2006-10-18 at 12:31.

Similar Threads

  1. How to disconnect Bluetooth link?
    By jhnlmn in forum Bluetooth Technology
    Replies: 8
    Last Post: 2010-04-13, 09:11
  2. How To Make The S60 Emulator See My USB Bluetooth Dongle ?
    By Mo7ammed_01 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-07-25, 00:14
  3. How To Make The S60 Emulator See My USB Bluetooth Dongle ?
    By Mo7ammed_01 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-07-25, 00:12
  4. Bluetooth headset disconnect
    By akmits in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-05-13, 19:28
  5. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50

Posting Permissions

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