Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

J2ME Bluetooth UUID Help

Status
Not open for further replies.

blundellp

Technical User
Apr 6, 2005
25
0
0
GB
Can I post J2ME questions here?

I was just wondering can someone help me with my problem.

I'm trying to create my own Bluetooth service, the code is:-

Code:
    public class createBluetoothService extends Thread
    {
       public void run()
       {
        try
        {
            StreamConnectionNotifier myNotifier = (StreamConnectionNotifier)
            Connector.open("btspp://localhost: 033BFE40DD46464eBDFC981D229E51CE;name=NightOutService; authorize=false; authenticate=false; encrypt=false");
            StreamConnection conn = myNotifier.acceptAndOpen();
        }
        catch(Exception e)
        {
            System.out.println("btspp error" +e);
        }
       } 
    }

I get the error,

"
btspp errorjava.lang.IllegalArgumentException: Malformed URL: btspp://localhost: 033BFE40DD46464eBDFC981D229E51CE;name=NightOutService; authorize=false; authenticate=false; encrypt=false
"

I think it's something to do with the UUID I'm using however i've tried various different ones, this one was created from the program
[link] [/url]

Any help is much appreciated, and sorry if i've posted in the wrong place

Paul
 
Well, not sure I can help with your question that is TMHO more Bluetooth question than a Java One.
What I can, however, say is that :
- In java, by convention, a class identifier begins with an upperCase. Your class name should be : "CreateBluetoothService"
- I downloaded the UUID generator you linked to and read that in the documentation :
The GUID Generator component lets you generate globally unique identifiers, or GUIDs, that you can use to identify your Microsoft® ActiveX® classes, objects, and interfaces.
As is, I'm not shure the generated GUID is bluetooth compatible...


Water is not bad as long as it remains outside human body ;-)
 
Ah yeah thats just my slack eye missing the capital letter :) thanks

Ah I see about hte microsoft GUID, i'll keep looking, I also found


and it fails with this UUID aswell, annoying I'll keep looking for some more information on this and find a Bluetooth forum hehe thanks for the help
 
That's a bad URL exception, are you sure you are not missing the port?

Cheers,
Dian
 
With Bluetooth connections the port number is the UUID, I found the error I had a rogue semi colon on the end of my string and it also doesn't like the blank spaces,
thanks for your time and effort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top