×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    J2ME - Bluetooth connection on S40

    Hey everyone!

    I am developing a J2ME platform for communication between mobile devices, where I am considering both Symbian S40s and S60s. The idea is to have a mobile server communicating with the mobile clients through Bluetooth. Everything works fine on S60s, both discovery and connection between server and client. The problem starts when I get to the S40 (specifically, I am using Nokia 5310 Music Xpress). If I run the server on this device, everything works fine and I am able to pass data back and forth to the clients. But if I am using this device as a client and a S60 as a server, happens the following:

    In the client, either I make the discover or I "hardcode" the address of the server, the connection fails without any explanation. In the server, it simply acts as never had received a connection.

    Has someone a explanation for this fact? I searched on the device description, and it has JSR-82 and everything should work fine, but it does not and I already tested in two different devices.

    I hope I have made myself clear and thanks in advance.

    Sérgio Pedro

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: J2ME - Bluetooth connection on S40

    Hello sergioffvpedro,

    which S60 devices do you use?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    Re: J2ME - Bluetooth connection on S40

    Hey!

    S60 devices: Nokia N95, Nokia N80 and Nokia 6630.
    S40 devices: Nokia 5310 Music Xpress (2x).

    Do you need some more information?

    Best Regards and thanks in advance,
    Sérgio Pedro

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: J2ME - Bluetooth connection on S40

    Hello Sérgio Pedro,

    thank you for the clarification info on your devices.

    AFAIK there are at least two S60 3rd Ed. (N80) and S60 3rd Ed., FP1 (N95) related known issues (where S60 devices use Bluetooth client):

    KIJ000789 - New Bluetooth discovery should not be started from within DiscoveryListener's callback methods

    The above applies if the S60 3rd Edition devices use the Bluetooth client which start device and service searches from within DiscovertListener's callback methods. I recall specifically reproducing this when testing with Series 40 and S60 devices couple of years ago; there the related application was working both as a client and a server, and as a client was basically performing searches all the time and therefore effectively preventing itself from being found as a server (i.e. the solution for such use cases would be to wait a couple seconds in between device searches and discoveries).

    TSJ000799 - ServiceRecord.getConnectionURL() returns null instead of connection string. How to retrieve the string value?

    The above tech solution is also related to the S60 3rd Edition devices and it advises getting service record info in case the getConnectionURL doesn't work optimally.

    The above ones both apply specifically S60 i.e. when a S60 device performs a Bluetooth client (or as a client/server) and are therefore not directly aligned with your use case (Series 40 device uses the Bluetooth client) as based on your description details. But want to check just in case...


    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    Re: J2ME - Bluetooth connection on S40

    Hey r2j7,

    Thank you very much about your answer. I was aware already about the first problem you described and that's why I always use different threads for device searching and service searching, and in that point there are no problems. In the discover there are no problems, AFAIK.

    The connection URL is also retrieved OK (I'm printing it in the screen). The problem is when I try to connect with the S40 to a S60, S40 as a client (master) and S60 as a server (slave). It simply throws an exception in the S40 and the S60 acts as nothing has happened. BTW, I am using RFCOMM as exchange protocol.

    Thanks a lot for your attention and time and in case that you don't have a concrete explanation, may you tell me the best place to find information about this?

    Thanks in advance,
    Sérgio Pedro

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Sérgio, please read discussions about master/slave versus server/client because those concepts are different. Another starting point to understand your problem, is there&#160;…

  7. #7
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    Re: J2ME - Bluetooth connection on S40

    Hey traud,

    Thank you very much for your answer. I was confusing the terms, but the problem still remains. Today I tested in another S40 (2nd edition) and it didn't even discover the RFCOMM server. I think I'm going to stick just with the S60s for this project.

    Best Regards,
    Sérgio Pedro

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Quote Originally Posted by sergioffvpedro View Post
    I was confusing the terms, but the problem still remains.
    Those mentioned threads are not only about terms. They tell you that Series 40 (and S60) has limited support for scatternet and master/slave-switching. However, Series 40 is much more limited. Even in S60, you will end-up with much more of that problems, if you do not re-design your connection setup.

  9. #9
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    Re: J2ME - Bluetooth connection on S40

    What do you mean by "re-design" the connection setup? As far as I understood, master is the one that starts the connection (client) and slave is the one that accepts the connection (server). Am I wrong?

    Thanks in advance for your help,
    Sérgio Pedro

  10. #10
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    No, you are not wrong about master/slave, however, you are wrong to think those roles are static.

    The concept of server/client (on the application layer) is not related 1:1 to master/slave (on the Bluetooth layer). What about reading, then you might understand this answer. This is no ‘problem’. This is ‘design’. If you design a scatternet, then you get a lot of trouble – however, no need to change your code. If you design to use master/slave-switching, then you must use specific platforms as server/master – all you need is to append master=true on your service URL = server. If you avoid scatternet and switching, then you have to change your code completely – however, then it even works on Series 40.

Similar Threads

  1. piped input/output stream in j2me
    By fevos in forum Mobile Java General
    Replies: 3
    Last Post: 2008-12-02, 11:44
  2. PPC Bluetooth to Nokia phone serial connection
    By naahtec in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2007-07-27, 20:40
  3. Bluetooth connection problem
    By GameTrax in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-12-08, 16:42
  4. Suggestion for resolving PC suite connection via bluetooth
    By Kazi in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-03-14, 19:35
  5. Replies: 5
    Last Post: 2003-02-07, 11:25

Posting Permissions

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