Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用C启用和禁用蓝牙#_C#_Visual Studio 2008_Bluetooth_Windows Ce_Smart Device Framework - Fatal编程技术网

C# 如何使用C启用和禁用蓝牙#

C# 如何使用C启用和禁用蓝牙#,c#,visual-studio-2008,bluetooth,windows-ce,smart-device-framework,C#,Visual Studio 2008,Bluetooth,Windows Ce,Smart Device Framework,我目前正在进行蓝牙激活(只需在Windows CE版本6的特定操作后自动启用和禁用蓝牙即可) 我正在使用SmartDeviceFramework即CAB文件,然后将其安装到Windows CE中 下面是我使用的方法 (inthand.Net.Personal.dll蓝牙文件): 所以我在这里面临错误: BluetoothRadio radio = BluetoothRadio.PrimaryRadio; radio.Mode = RadioMode.Discoverable; // gives

我目前正在进行蓝牙激活(只需在Windows CE版本6的特定操作后自动启用和禁用蓝牙即可)
我正在使用SmartDeviceFramework即CAB文件,然后将其安装到Windows CE中

下面是我使用的方法 (inthand.Net.Personal.dll蓝牙文件):

所以我在这里面临错误:

BluetoothRadio radio = BluetoothRadio.PrimaryRadio;
radio.Mode = RadioMode.Discoverable; // gives error here 
错误

Error setting BluetoothRadio.Mode
当设备中禁用蓝牙且执行上述线路并关闭应用程序时,上述错误会发生一次 但是,当应用程序关闭时,当我在移动设备中转到Bluetooth Manager时,蓝牙被启用

我的问题

我必须点击按钮2次才能启用按钮(当 应用程序关闭时出错(但蓝牙已设置为打开),第二次关闭 搜索范围内的设备)而不是单击一次

我的假设

我认为当程序尝试时可能会出现一些安全问题 将蓝牙从手机关闭状态切换到可发现状态

那么,是否有任何过程System.Digonostics;dll),通过该过程,我可以在C中的WindowsMobile CE中自动设置蓝牙开启关闭#

我试过了,但没有得到它,所以有人可以帮我,或者建议任何蓝牙连接的dll文件


谢谢

您可能会发现这很有用:

可在此处下载适用于蓝牙技术的Windows嵌入式源代码工具:


希望这有帮助:)

我不完全确定您使用的库是什么,所以我不确定它到底为什么会给您这个错误

以下是有关如何在设备上设置蓝牙连接模式的MSFTs文档。如果你能使用这些DLL,你可能会有一些运气


物联网、蓝牙和32英尺.net?向我投赞成票;)。谢谢你的回复。我尝试使用32feet.net(inthand.net.Personal.dll),但在启用蓝牙时出错。你知道在哪里可以找到Microsoft.WindowsMobile.SharedSource.Bluetooth dll吗?这个dll会工作吗?任何想法我都尝试过,但没有成功实施。我的假设BthGetMode和BthSetMode的值为int。。我想要无线电模式。。。但这不是我想要的解决方案…尝试了Microsoft.WindowsMobile.SharedSource.Bluetooth,但找不到dll(如果存在),但谢谢。下载并安装上述内容,然后导航到:C:\Program Files\Microsoft\Windows Embedded Source Tools\您将在那里找到dll;)第一个链接现在产生404
Error setting BluetoothRadio.Mode