views:

561

answers:

3

Hello, currently writes an application to connect to the device "BTLink Bluetooth to Serial Adapter"

More information about device: device specification Have created such a code:

    BluetoothAddress btAddress = null;
    if (!BluetoothAddress.TryParse(comboBoxDevices.SelectedValue.ToString().Trim(), out btAddress))
            throw new Exception(String.Format("Adress: {0} wrong !", comboBoxDevices.SelectedValue.ToString().Trim()));
    BluetoothEndPoint endPoint = new BluetoothEndPoint(btAddress, BluetoothService.DialupNetworking);
    _bluetoothClient.Connect(endPoint);

I have tested two types of GUIDs:BluetoothService.DialupNetworking, BluetoothService.SerialPort. I received this message: "No connection could be made because the target machine actively refused it" What is wrong ?

Best regards, mykhaylo

+1  A: 

Have you checked with 32Feet.net or on their support Forums (the provider of the classes you're using)?

ctacke
+1  A: 

I would first try to connect to the target machine using the device's built-in Bluetooth capabilities. Only after this succeeds would I try to connect to it programatically.

To be able to connect to a Bluetooth device you need to know the following:

  • The Bluetooth profile to use. You've tried both Serial and Dialup, but which of them is actually the desired one? Many devices only support a single profile and will refuse to connect to another device requesting a non supported service.
  • Authentication information. Some devices require a pre-defined password.
  • Many devices can only form a connection to a single BT device. Is the target device already connected somewhere else?

The error you are experiencing is most probably related to one of the above and has not to do with the use of the bluetooth library.

kgiannakakis