Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 26th, 2008, 11:01 AM   #1
urip
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0 urip is on a distinguished road
PC application with bluetooth

Hello everybody,

I'm trying to develop a PC application with a Bluetooth connection using a USB dongle.
The application is supposed to search for devices in range, choose one of them, and then send him a file...


I have searched the net looking for a way to do it, but didn't find one.
Is it possible to develop such application? If so, how can I do it? What should I look for? Is Java the ideal language for this application? (I don't care to use C# or C++ instead...)



Thanks....
urip is offline   Reply With Quote
Old Jan 27th, 2008, 5:51 AM   #2
Grich
Hobbyist Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 150
Rep Power: 1 Grich is on a distinguished road
Re: PC application with bluetooth

Personally, use C++.
__________________
SYNTAX ERROR ...
Grich is offline   Reply With Quote
Old Jan 27th, 2008, 8:21 PM   #3
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 290
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
Re: PC application with bluetooth

Here's a more helpful response...

http://sourceforge.net/projects/bluecove/
__________________
http://www.kevinherron.com/
andro is offline   Reply With Quote
Old Feb 13th, 2008, 7:58 AM   #4
urip
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0 urip is on a distinguished road
Re: PC application with bluetooth

Quote:
Originally Posted by andro View Post
Here's a more helpful response...

http://sourceforge.net/projects/bluecove/
Thank you, your link was very helpful.
But now I have another question:

Using bluecove (jsr-82), I've succeeded in making a device discovery search, select a mobile phone, search for services and make a connection attempt..
So far so good, but when I try to connect the mobile, my cell demands a passkey (in order to pair itself to the PC).
So I have two questions (I've listed some code in the bottom):

1. Is it possible to send a message without the passkey and the pairing? (only by clicking yes/no to accept the connection by the cell) For instance, when I send a file from one mobile phone to another, it doesn't request a passkey, only an approval from the mobile user.

2. If it's not possible to connect without the passkey, how do I enter the pairing passkey back in the PC?

This is how I'm trying to initialize the connection:

    ...
    //after finding the remote device...
    int[] attrSet = new int[] { 0x0100};
    UUID uuidSet[] = new UUID[] { new UUID(0x1106) };
    int bl = _discoveryAgent.searchServices(attrSet, uuidSet, devices[i], this);
    ...
 
    public void serviceSearchCompleted(int transID, int respCode)
    {
            if(respCode == SERVICE_SEARCH_COMPLETED)
            {
                try
                {
                    //servRecord holds the found ServiceRecord
                    String connectionUrl = servRecord[0].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
                    StreamConnection streamConnector = (StreamConnection) Connector.open(connectionUrl);
                    String msg = "Success.";
                    OutputStream os = streamConnector.openOutputStream();
                    os.write(msg.getBytes());
                    streamConnector.close();
                }
                catch(Exception exc)
                {
                    System.out.println("Error occured: " + exc);
                }
            }
    }

I hope I explained the code enough,
Thanks
urip is offline   Reply With Quote
Old Feb 13th, 2008, 9:08 AM   #5
itgalary
Newbie
 
itgalary's Avatar
 
Join Date: Feb 2008
Posts: 11
Rep Power: 0 itgalary is on a distinguished road
Re: PC application with bluetooth

Can be done with JSR with J2me
__________________
Free Programming help http://www.itgalary.com
Free Revenue Sharing http://blog.itgalary.com
Online Site seeing http://www.itgalary.com/maps/
itgalary is offline   Reply With Quote
Old Feb 13th, 2008, 12:15 PM   #6
urip
Newbie
 
Join Date: Jan 2008
Posts: 3
Rep Power: 0 urip is on a distinguished road
Re: PC application with bluetooth

In this case, I'm talking about J2SE only, due to the fact I'm programming this application for my computer...

I know this attributes determine the type of service we are looking for:
    int[] attrSet = new int[] { 0x0100};
    UUID uuidSet[] = new UUID[] { new UUID(0x1106) };
Those variables are later on passed to the discovery agent:
    _discoveryAgent.searchServices(attrSet, uuidSet, devices[i], this);

Maybe there are other properties except 0x0100 and 0x1106 that will do the work? I tried to learn more about those properties but found nothing about it.
urip is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
application failed to initialize properly 0xc0000005 ronaldr C++ 3 Dec 27th, 2007 8:24 PM
Tablet PC Edition software on non tablet PC? tAK Coder's Corner Lounge 3 Jul 16th, 2007 3:27 AM
creating an application that stands between the browser and the serve ronias Visual Basic 5 Oct 30th, 2005 4:22 PM
"Not Responding" Message in Windows Form Application G_Zola C# 1 Apr 29th, 2005 10:15 AM
instrumenting an application in .NET G_Zola C# 0 Apr 28th, 2005 4:27 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:55 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC