This project has moved. For the latest updates, please go here.

c# connection to bluetooth serial device

Topics: Bluetooth - Microsoft
Feb 6, 2014 at 11:54 PM
I am using the following code to attempt to connect to a bluetooth device, and i cant seem to get it to work. Someone please tell me what im doing wrong. I want to 1) pair with the device and 2) get a virtual comport that i can receive and send data through.

Any help would be greatly appreciated as I am at a complete loss,
Chris
            BluetoothAddress addr = BluetoothAddress.Parse("00066603adcb");

            BluetoothEndPoint ep = new BluetoothEndPoint(addr, BluetoothService.SerialPort);
            bool t = false;
            BluetoothSecurity.PairRequest(addr, "1234");
            BluetoothClient cli = new BluetoothClient();
            cli.Connect(ep);
            t = cli.Connected;


            string[] ports = SerialPort.GetPortNames();

            foreach (string s in ports)
            {
                cboPorts.Items.Add(s);
            }
----
Developer
Feb 7, 2014 at 9:26 AM
Do you really really really need a COM port? Your program can send/receive over the BluetoothClient connection.

Read 1a) and b) at http://32feet.codeplex.com/documentation Then follow to https://32feet.codeplex.com/wikipage?title=General%20Bluetooth%20Data%20Connections etc
Feb 7, 2014 at 2:05 PM
because this app has the ability to communicate over standard rs232 as well. I want to be able to communicate over virtual serial or rs232. I have the rs232 part finished. Are you saying I cant use a virtual serial port with 32feet's bluetooth library?

Please advise,
Chris