How can i enable bluetooth in c #?

I am trying to pair my laptop with a robot using bluetooth and with a C # user interface. The information I need to send is very small and simple. This is a simple line, and that’s it.

I had no experience using bluetooth actually, so as I understand it, for a laptop I could use the built-in bluetooth in my laptop, since I know which COM port is on. However, for the robot I bought a separate Bluetooth device (USB dongle?). I also downloaded and installed Microsoft.WindowsMobile.SharedSource.Bluetooth. Now the problem that I am facing is that I do not know what to do with it. There is a BluetoothDevice class and a BluetoothRadio class. What should i use? I connected the device to a laptop.

I searched online many times and simply could not find anything simple enough. When I try to simplify the code myself, it does not work. I just need to send one simple line from my laptop to a USB Bluetooth device that will be attached to the robot.

I know there is a 32-bit alternative to the Microsoft namespace, but I would rather use Microsoft.

Any suggestions? I would be very grateful for that.

+5
source share
3 answers

I support the 32feet.NET library. I have little knowledge of the Microsoft Shared Source Bluetooth library, but I think there is no support or support with it. Our library is very widely used and well maintained. :-)

, , :

Dim addr As BluetoothAddress _
  = BluetoothAddress.Parse("001122334455")
'
Dim ep As New BluetoothEndPoint(addr, BluetoothService.SerialPort)
Dim cli As New BluetoothClient
cli.Connect(ep)
Dim peerStream As Stream = cli.GetStream()
peerStream.Write/Read ...

http://www.alanjmcf.me.uk/comms/bluetooth/32feet.NET%20--%20User%20Guide.html .

+4

, coding4fun. Bluetooth, . Coding4Fun on Codeplex

+2

Pairing the robot with your laptop should represent a COM port or similar robot. In this case, you can consider Bluetooth as a transport protocol that facilitates your COM port.

+1
source

All Articles