×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    4

    Advertised service not visible

    I have advertized a serial port service on a Nokia 6255 and a Nokia 2855 but it is not visible to some devices.

    What we have determined is that, while the default services in the phone are being advertized as 16 bit UUIDs, the service I created is being advertised as a 128 bit UUID: 0x00001101-0000-1000-8000-00805f9b34fb instead of 0x1101. This is correctly promoted to a 128 bit UUID but not all devices support 128 bit UUIDs. Other services on the phone such as COM1 are advertized as 0x110.

    I created the connection with

    UUID serialUUID = new UUID("1101");
    server = (StreamConnectionNotifier)Connector.open("btspp://localhost:"+serialUUID.toString()+";name=myservice");

    Replacing serialUUID.toString() with 1101 does not seem to help.

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

    Thumbs up Re: Advertised service not visible

    Hi DanielAspel!

    You have said that some devices don't detect your service if it uses a 128-bit UUID but I suppose that those devices can detect your service if it would use a 16-bit UUID, for example the UUID 0x1101.

    UUID class in the JSR-82 API

    public UUID(java.lang.String uuidValue, boolean shortUUID)

    Creates a UUID object from the string provided. The characters in the string must be from the hexadecimal set [0-9, a-f, A-F]. It is important to note that the prefix "0x" generally used for hex representation of numbers is not allowed. If the string does not have characters from the hexadecimal set, an exception will be thrown. The string length has to be positive and less than or equal to 32. A string length that exceeds 32 is illegal and will cause an exception. Finally, a null input is also considered illegal and causes an exception.
    If shortUUID is true, uuidValue represents a 16-bit or 32-bit UUID. If uuidValue is in the range 0x0000 to 0xFFFF then this constructor will create a 16-bit UUID. If uuidValue is in the range 0x00010000 to 0xFFFFFFFF, then this constructor will create a 32-bit UUID. Therefore, uuidValue may only be 8 characters long.

    On the other hand, if shortUUID is false, then uuidValue represents a 128-bit UUID. Therefore, uuidValue may only be 32 character long

    Parameters:
    uuidValue - the string representation of a 16-bit, 32-bit or 128-bit UUID
    shortUUID - indicates the size of the UUID to be constructed; true is used to indicate short UUIDs, i.e. either 16-bit or 32-bit; false indicates an 128-bit UUID
    Throws:
    NumberFormatException - if uuidValue has characters that are not defined in the hexadecimal set [0-9, a-f, A-F]
    IllegalArgumentException - if uuidValue length is zero; if shortUUID is true and uuidValue's length is greater than 8; if shortUUID is false and uuidValue's length is greater than 32
    NullPointerException - if uuidValue is null
    You have tried to create another server object but using the 16-bit UUID 0x1101, getting the service to be detected for those phones which don't support 128-bit UUIDs! I think that the UUID creation failed and you have really created a 128-bit UUID instead of a 16-bit one! I would use the line "UUID uuid=new UUID("1101", true)" so your UUID will be a 16 bits instead of 128!

    If the UUID creation was right, with two servers (one with a 128-bit UUID and the other with the 16-bit UUID) you are sure that your service is detected by all phones!

    On the other hand, if a phone which is searching for your service doesn't detect the 128-bit UUID service it must search for the 16-bit UUID service!

    I hope to be useful for you!

    NOTE: The Nokia 2855 doesn't have the BLUETOOTH (JSR-82) API (http://www.forum.nokia.com/devices/2855)
    Last edited by Summerman; 2006-10-15 at 18:37.

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    4

    Re: Advertised service not visible

    Actually, I made a mistake when I made my post, I did create the UUID with UUID uuid=new UUID("1101", true)". No error was generated creating the UUID. I have read that the UUID.toString always returns the 128 bit UUID so that is the reason I tried inserting the 1101 right into the connector.open stirng. However, that did not result in a correctly created 16 bit UUID of 1101.

    As for the 2855i, my version does support jsr82. However, the 2855 advertises a 128 bit UUID just like the 6255.

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

    Thumbs up Re: Advertised service not visible

    1) Have you tested this possibility?

    server=(StreamConnectionNotifier)Connector.open("btspp://localhost:"+"0x1101"+";name=myservice");

    It's a silly thing but you can check it!

    2) You can test this line too!

    //Use the other UUID constructor with the long parameter
    public static final UUID SPP =new UUID(0x1101);//Serial Port Profile Service

    It worked perfectly for me!

    Good luck!
    Last edited by Summerman; 2006-10-17 at 12:00.

Similar Threads

  1. Replies: 4
    Last Post: 2006-09-05, 15:15
  2. 6680 and bluetooth service profiles
    By ceruault in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-08, 22:24
  3. BTPointToPoint service not visible from PC
    By glr in forum Bluetooth Technology
    Replies: 3
    Last Post: 2003-11-09, 16:43
  4. Why is a service not visible?
    By marcoblu in forum Bluetooth Technology
    Replies: 1
    Last Post: 2003-08-21, 10:20

Posting Permissions

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