Hi, I am a student doing my Final Term Project.

I am suppose to create a GUI using C# that can control and interact with a Robot call Robonova-1. The robot will be connected to the PC via Bluetooth.

I was thinking to have a connection button in my GUI to allow it to establish the connection between the GUI and the robot, but I have no idea how I should go about working on it. Because I have never learn C# before.

Could any of the expert out there help me?

Recommended Answers

All 15 Replies

hi there,

thanks for the reply. is there any other site that i can visit? cant seems to be able to go into the site you given...

Why cant you access it. Heres the site content

As they say Necessity is mother of invention, I recently got a Jabra BT3030 Bluetooth headset. I paired it to my Windows Mobile phone. When I wanted to turn on the Bluetooth, I had to go to wireless manager and turn it on. I am a little bit lazy and had an idea why not map a button on the phone to toggle the bluetooh radio. But, this is not possible by default, so started working on a program to map to the button.

Fortunately it is very simple to interact with Bluetooth radio and devices on the phone using Windows Embedded Source Tools for Bluetooth Technology. This download contains bunch of C# files which you can directly use in your code. You will get classes such as BluetoothDevice and BluetoothRadio which allow you to control the device and paired devices.

1: using System;

   2: using System.Collections.Generic;

   3: using System.Text;

   4: using Microsoft.WindowsMobile.SharedSource.Bluetooth;

   5:  

   6: namespace ToggleBluetooth

   7: {

   8:     class Program

   9:     {

  10:         static void Main(string[] args)

  11:         {

  12:             BluetoothRadio brad = new BluetoothRadio();

  13:             if (brad.BluetoothRadioMode == BluetoothRadioMode.Off)

  14:                 brad.BluetoothRadioMode = BluetoothRadioMode.On;

  15:             else

  16:                 brad.BluetoothRadioMode = BluetoothRadioMode.Off;

  17:         }

  18:     }

  19: }

After that, I added a setup project and made sure that a shortcut for the application is under Programs folder, so that I can map it using the Buttons applet of Settings panel. After the install on the device, you should be able to see the program in the "Assign a program" list.

As usual, here are some links and blog post.

Windows Embedded Source Tools for Bluetooth Technology - http://msdn.microsoft.com/en-us/embedded/aa714533.aspx
Channel 9 Wiki (has a good Q&A) - http://channel9.msdn.com/wiki/bluetoothdevelopment/
MSDN Code Samples page - http://msdn.microsoft.com/en-us/library/bb158662.aspx

NOTE: I did not write this. - http://blogs.msdn.com/codejunkie/archive/2008/09/13/bluetooth-device-control-development-using-c.aspx

Hi there!
It's a very different things: Mobile Bluetooth API and Win32 (desktop) Bluetooth API. Moreover, there are at least 3 drivers more in addition to MS BT drivers.
I used Wireless Communication Library in my projects and it shown very good results for me.

can i use bluetooth code for attendance system

plz someone provide c# bluetooth code for attendance system

This code based on custom header files, does exist byself any class in visual studio have to do with bluetooth? im intersting too but i dont want download from others...

i would like to learn steps, how a bluetooth works, how can be done in a programming language, to try to make something myself ;p

I started something similar, but I instead use serial port over bluetooth. (For a sync with my calendar application for my Windows Mobile).

I think your robot will probably use the same way of communication as it is easier. Sorry but I cannot help as I don't know Robonova

using this bluetooth code how to connect it to PC and how this process will work plz tell me

Based on this: http://www.robotshop.com/PDF/robonova-bluetooth-manual.pdf
1. Then pair your computer with the robot via bluetooth. There open a emulated serial port. (google for you BT device)

2. Find an easy C# serial communication application like this:
http://www.dreamincode.net/forums/topic/35775-serial-port-communication-in-c%23/

3. Find which commands and how should then be sent to the robot (Hex, bin, ....)

4. Test/Google....
---

Sorry but I do not know the robonova, so I cannot give you any better hint on how to do it. So good luck.

using System;

2: using System.Collections.Generic;

3: using System.Text;

4: using Microsoft.WindowsMobile.SharedSource.Bluetooth;

5:

6: namespace ToggleBluetooth

7: {

8: class Program

9: {

10: static void Main(string[] args)

11: {

12: BluetoothRadio brad = new BluetoothRadio();

13: if (brad.BluetoothRadioMode == BluetoothRadioMode.Off)

14: brad.BluetoothRadioMode = BluetoothRadioMode.On;

15: else

16: brad.BluetoothRadioMode = BluetoothRadioMode.Off;

17: }
plz anyone tell me using this code on visual studio 2008 it gives error for Microsoft.WindowsMobile.SharedSource.Bluetooth then what should I do?

I hope Dani will not ban me for this. But have a look on this site:
http://bytes.com/topic/net/answers/766043-c-bluetooth

Basically it should help you a bit. The guy there is trying to establish a connection with a printer, which looks like is the equivalent of your's problem.

I hope you are not just copy-paste source code without any adjustments to your environment.

is that code can be use to enable and disable bluetooth on laptop?
and if possible are there any reference i should included to replace
using Microsoft.WindowsMobile.SharedSource.Bluetooth;

try to visit http://32feet.net/

The person who asked for help is doing it for his school project. I don't know the license, but a 3rd party application (libraries) could be rejected as bad choice...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.