![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2008
Posts: 3
Rep Power: 0
![]() |
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.... |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 198
Rep Power: 2
![]() |
Re: PC application with bluetooth
Personally, use C++.
__________________
SYNTAX ERROR ... |
|
|
|
|
|
#3 |
|
Professional Programmer
|
Re: PC application with bluetooth
__________________
http://www.kevinherron.com/ |
|
|
|
|
|
#4 | |
|
Newbie
Join Date: Jan 2008
Posts: 3
Rep Power: 0
![]() |
Re: PC application with bluetooth
Quote:
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 |
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2008
Posts: 11
Rep Power: 0
![]() |
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/ |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Jan 2008
Posts: 3
Rep Power: 0
![]() |
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) };_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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |