×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    5

    Help on Bluetooth application

    Hello there... I have to make a bluetooth application, but I don't know exactly what APIs to use. I want to make a simple remote control application, involving a mobile phone with bluetooth (no OBEX) and a PC that has a blue soleil bundle stick.

    I read all about bluetooth protocol stack. I read some stuff about Bluetooth APIs, but I don;t know wich API is easier to use for my application.

    Application Summary:

    Mobile Part: The mobile application must act as a client, connecting to the computer. The main functions that this application must do are: sending files to computer, sending messages to computer (a message is a string, and I think will look like this: open <file path>)

    Computer Part: Computer application will run as a server, waiting for clients to connect. The main functions of the server are: receiving and storing files from client(s), opening files (this one is easy, I just need to make a command line to open a file with the associated application) and, most important, sending system messages (u know, all the system messages).

    Sending system messages is important to simulate the remote control. Imagine a PowerPoint file; with a press of a button on the cell phone, I should be able to open the file; then, with another button on the phone, I should be able to press the computer's ENTER key to put my slidings into full screen; with yet another button, I must simulate a click on the mouse to change slides.

    On the mobile part, there are some APIs I've found on the Internet some Java APIs like J2ME, bluecove, benhui. What is the easiest to learn and easiest to use to make my mobile application? Where can I find the best tutorials to learn the main functions; step by step tutorials are my favorites.

    On the computer part, I don't think I can use Java, because I don't think I can send system messages to the OS. I would like to use Visual C# or Visual C++ development tools, but I don't know what classes should I use. On MSD I found that a way to connect via Bluetooth is using the COM port, or via another class (I don't remember exactly its name). The problem with the second solution (who I think is most simpler and nicer) is that I've tried to intall Microsoft Bluetooth Device or something like this, but still, I cannot see it on System Resources; only the blue soleil appears.


    Ok.. Enough writing... So, if anyone can help me, if anyone tried to make something similar, I'll be thankful to post here some links to tutorials, code or anything else that my be of value.

    Later Edit: The mobile phone used for testing is a Nokia 6230i. But I would like the application to run on as many mobiles as possible...

  2. #2
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore, India
    Posts
    100

    Re: Help on Bluetooth application

    May be this thread might be of interest for you
    http://discussion.forum.nokia.com/fo...ight=Bluetooth
    with regards,
    Khalandar Pasha N
    (khalandar_p@yahoo.co.in)

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    5

    Unhappy Re: Help on Bluetooth application

    Thanks for the reply. I've been trying to make those examples work.. Some worked on my Mobile phone, but they didn't seem to work on my PC with the Blusoleil Dongle.

    I couldn't find any class for C++ (the PC side will be in C++). The only way that I could see something moving was using the serial ports. Do anyone knows a class/library for bluetooth in C++ (a free one)? I found one documentation, in C#, with a Core class or library. Do you know where can I find this library for VC++?

    Thanks, in advance

    Later Edit: I just found out I need to install some Windows XP SDK, to have support from MS classes, but still, I think I have a problem, because my Blusoleil dongle is not on the supported devices list for MS classes.. I can only just pray to work, or... I must find some store to buy a new dongle...
    Last edited by stefan.radu.munteanu; 2007-05-11 at 11:59.

  4. #4
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    Re: Help on Bluetooth application

    If you have some background in socket programming that would be the best way to implement BT application on windows. Socket API's are fully compatible with BT and if you can spend some time on internet you'll find many sample codes. If you could not find it, pls post reply. I used to have some samples, I'll try to locate it.

    ~b

  5. #5
    Registered User
    Join Date
    Mar 2007
    Posts
    5

    Talking Re: Help on Bluetooth application

    Some experience with Sockets I have from some little applications I've madeee, but many were based on AsyncSocket class, witch is a little easier to use (I think), because this class is non-blocking from the start when u make a listener. Whatever.. Yes, I know some stuff about sockets, I fount on the Internet a good example of using bluetooth with sockets here, but I've tryied to run it and it doesn't work on my device. I just get an error, but I can't see the error; it just print the first char of the error . I'm guessing the problem is from the Bluesoleil dongle, witch is not on the supported devices list from Microsoft.

    The error is from this part of code, so there's a problem with my device:
    SOCKET s = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);

    const DWORD lastError = ::GetLastError();

    if (s == INVALID_SOCKET)
    {
    printf("Failed to get bluetooth socket! %s\n", GetLastErrorMessage(lastError));
    exit(1);
    }
    If you have some other good examples, I'll love to have them, so I can do further more tests and learning. I just need the server side, the client side will be on the mobile phone. If you have something with receiving files and/or sending/receiving messages will be great.

    Meanwhile, I'll go to some computer shops to find some USB Bluetooth that is compatible with MS.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    There are several options: Go for a Java Bluetooth API (JSR-82) for Windows. Then you can use Java, too. Or go for the SDK of your Bluetooth Software Stack which is for IVT Bluesoleil …

    Furthermore, normally there is no reason to buy a new USB adapter. All you have to do is to switch the driver in the Windows device manager and then you can use the Micorosft Bluetooth SDK.

  7. #7
    Registered User
    Join Date
    Mar 2007
    Posts
    5

    Wink Re: Help on Bluetooth application

    I wrote above that I will use c++, and I'll use the Microsoft Classes. I've bought today a dongle that works with MS SDK: CANYON CN-BTU4. I'm beginning working on my project this night or tomorrow morning.

    browndrf, I'm waiting your examples. There's never too much examples

  8. #8
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    124

    Re: Help on Bluetooth application

    I agree with traud, you don't need to install the software that comes with USB dongles. In fact sometimes you may not be able to use standard sockets if you have their drivers installed. The code you found should work. Why don't you uninstall the driver software, just plug-in the dongle and try your application again. If fails again, user WSAGetLastError() and print the return value and check it in winsock.h

    -b

  9. #9
    Registered User
    Join Date
    Mar 2007
    Posts
    5

    Re: Help on Bluetooth application

    Do you read what I post? I said I bought a good Bluetooth Dongle, so nevermind the Bluesoleil 0.8 SDK or the fact that the other device didn't work... Please post some other examples.. maybe something step by step: getting my PC devices, for a specified device making a bluetooth service (based on RFCOMM), listening and managing connections... I will use Visual Studio (2003, because I can see that VS 2005 has a lot of changes on C++ part, wich kind of sucks). So can you help?

Similar Threads

  1. Bluetooth application in Nokia 6600?
    By alkazoid2 in forum Bluetooth Technology
    Replies: 12
    Last Post: 2006-07-17, 14:37
  2. Replies: 0
    Last Post: 2004-10-31, 13:13
  3. Bluetooth Application Identifier Tool before Application is Installed on Series 60
    By asabagh in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-10-31, 13:12
  4. filtering application as a recipient?
    By aidj in forum General Messaging
    Replies: 1
    Last Post: 2002-11-12, 06:26
  5. help with building Bluetooth application
    By liaoyw in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-10-29, 06:18

Posting Permissions

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