首页 > 解决方案 > 无法使用 mfeet32.net 与蓝牙设备建立连接::“请求的地址在上下文​​中无效”

问题描述

我正在尝试将 32feet.net 与 vb.net 与 Innateck 蓝牙扫描仪一起使用。该型号是 Innateck 扫描仪型号 BCST-70(确切地说是 BCST-70-1910090473)。扫描仪已被 Windows 10 正确识别。

我将 VisualStudio2015 与 .net 4.6.1 和 InTheHand.Net.Personal 版本 = 3.5.605.0 一起使用。

32feet.net的发现功能(DiscoverDevices())显示设备信息如下:

我的连接代码是:

    Dim addr As BluetoothAddress = Nothing
    Dim sp As Guid = Nothing
    Dim ep As BluetoothEndPoint = Nothing 
    Dim cli As BluetoothClient = Nothing

    addr = BluetoothAddress.Parse("34885D4719A9")
    sp = BluetoothService.HumanInterfaceDevice
    ep = New BluetoothEndPoint(addr, sp)

    Try
        cli = New BluetoothClient(ep) ' <-- error accured here
    Catch ex As Exception
        Debug.Print(ex.Message.ToString)
    End Try

错误是:

异常级别:'System.Net.Sockets.SocketException' dans System.dll 请求的地址在上下文​​中无效

使用的正确地址是什么?它是 GUID 问题吗?我尝试将此代码与 sp = Guid.Parse("e0cbf06c-cd8b-4647-bb8a-263b43f0f974") 一起使用(参见屏幕截图),但方法相同。

任何想法 ?

谢谢你。

条码扫描器的类 GUID

标签: vb.netbluetooth

解决方案


推荐阅读