代码之家  ›  专栏  ›  技术社区  ›  Michał Ziober

蓝牙到串行适配器-连接异常

  •  0
  • Michał Ziober  · 技术社区  · 16 年前

    当前写入应用程序以连接到设备“btlink蓝牙到串行适配器”

    有关设备的详细信息: device specification 已经创建了这样的代码:

        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);
    

    我测试了两种类型的guid:bluetouthservice.dialupNetworking、bluetouthservice.serialport。 我收到这条消息:“无法建立连接,因为目标计算机主动拒绝了它。” 怎么了?

    最好的问候, 米哈伊洛

    3 回复  |  直到 14 年前
        1
  •  1
  •   kgiannakakis    16 年前

    我将首先尝试使用设备的内置蓝牙功能连接到目标机器。只有在成功之后,我才能尝试通过编程连接到它。

    要连接到蓝牙设备,您需要了解以下信息:

    • 要使用的蓝牙模式。你试过串行和拨号,但实际上哪个是你想要的?许多设备只支持一个配置文件,并将拒绝连接到请求不支持服务的其他设备。
    • 身份验证信息。有些设备需要预先定义的密码。
    • 许多设备只能与单个BT设备形成连接。目标设备是否已连接到其他地方?

    您遇到的错误很可能与上述某个错误有关,与使用蓝牙库无关。

        2
  •  1
  •   ctacke    16 年前

    你用32英尺网检查过吗 their support Forums (提供 classes you're using )?

        3
  •  1
  •   Hans    14 年前

    我用一个标准做了一个类似的设置和程序 serial Bluetooth adapter 没有问题。您需要确保使用正确的蓝牙配置文件,端口必须可用,并且必须接受身份验证代码。只是一些建议。