×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    6

    Bluetooth SPP service server in J2ME

    I am testing a simple SPP server functionality in J2ME on the phone. And I try to use a sensor node (client) to connect to the phone.

    Code:
    //Create a UUID for SPP
    UUID uuid = new UUID("1101", true);
    //Create the servicve url
    String connectionString = "btspp://localhost:" + uuid +";name=Sample SPP Server";
    //open server url
    StreamConnectionNotifier streamConnNotifier = (StreamConnectionNotifier)Connector.open( connectionString );
    //wait for a connection from the sensor
    StreamConnection connection = streamConnNotifier.acceptAndOpen();
    The N8's Bluetooth indicator (on status bar) shows the link icon when my sensor is trying to connect. But my program cannot catch the connection at all. I also test this jave code snippet on Mac OS with BlueCove library, it at least can receive something from the sensor after executing
    Code:
    StreamConnection connection = streamConnNotifier.acceptAndOpen();
    Should I specify any COM port number in the J2ME code?

    Thanks a lot!

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Bluetooth SPP service server in J2ME

    If your remote device (sensor node) looks for 0x1101 as UUID, you can throw it away. Your Nokia offers such an service already, your code adds another one. Who knows which one in chosen …

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    6

    Re: Bluetooth SPP service server in J2ME

    Hi traud,

    What do you mean throw UUID away? Could you describe what connectionString I need to use as argument for Connector.open() ?

  4. #4
    Registered User
    Join Date
    Nov 2010
    Posts
    2

    Re: Bluetooth SPP service server in J2ME

    Thanks to all

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Bluetooth SPP service server in J2ME

    You have to throw away your remote device.

  6. #6
    Registered User
    Join Date
    Oct 2009
    Posts
    6

    Re: Bluetooth SPP service server in J2ME

    Hi traud,

    No....it is an expensive sensor node. ;-(

    So, can I change the UUID to any number and let the sensor node know what UUID I am using on the phone side. Then, it should be able to avoid the conflict between Nokia's own service and my own app. Is it correct?

    Thanks for your help.

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Bluetooth SPP service server in J2ME

    The correct way would be a private (128 bit long) UUID for your service. If you are able to change the UUID your node is looking for, than yes, choose another UUID. Otherwise all you can do is stare at it.

  8. #8
    Registered User
    Join Date
    Feb 2011
    Posts
    29

    Re: Bluetooth SPP service server in J2ME

    Hello fengsto...
    Did you solve your problem..?
    How..?
    i am having the same problem as my application blocks at acceptAndOpen() method.
    please Help....

  9. #9
    Registered User
    Join Date
    Oct 2009
    Posts
    6

    Re: Bluetooth SPP service server in J2ME

    Eventually, I switched to Android to implement the phone as the slave mode.

    The Nokia phone seems like it has its own SPP service underlying.

  10. #10
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Bluetooth SPP service server in J2ME

    Some Bluetooth devices which use 0x1101 are looking for the friendly name as well. However, you would not ask, if that name was documented. Alternatively, in your node, you specify BD_ADDR plus RFComm channel ID bypassing service search. pandyaji, here you explained a different scenario: Both devices talk your protocol. You should be able to use a long UUID then to solve your issue.
    Last edited by traud; 2011-02-25 at 11:30.

Similar Threads

  1. J2ME on SIP server for voip service
    By LeloTheGreat in forum Mobile Java General
    Replies: 3
    Last Post: 2010-08-30, 16:53
  2. JSR82 Bluetooth spp service advertise
    By ben_zhang1983 in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2009-05-26, 17:16
  3. SPP bluetooth server with timeout support
    By weyert in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-01-27, 09:29
  4. Displaying of SPP BlueTooth Service
    By scoe in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-12-11, 22:16
  5. Bluetooth RFCOMM connects to PC FAX Service instead of SPP
    By simbalNokia in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-02-28, 12:43

Posting Permissions

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