我正在编写一个蓝牙扫描器,在当地附近定位和识别移动设备。 这是我可以使用C#完成的事情,还是我需要下载到C / C ++ API? 我的应用程序是针对Windows XP和Vista。 指针表示赞赏。
谢谢!
PNRP未启动,无法find
C# – 蒙面文本框的(如何摆脱其中的下划线)
文件比较工具
C# – 获取ManagementObjectSearcher输出到一个TextBox
PC上蓝牙的一个问题是,有几个BT堆栈正在使用,你永远不知道在给定的机器上可以使用哪一个。 最常见的是Widcomm(现在的broadcom)和微软(出现在XP中,也许是其中的一个服务包)。 不过,一些BT硬件厂商BlueSoleil和一些使用Toshiba的厂商。 大多数加密狗将与MS堆栈工作,所以我见过的.NET库倾向于使用它。
每个堆栈都有一个完全不同的方式来做发现的一部分,你浏览附近的设备和查询他们的服务。
如果今天我必须选择一种方法,我可能会在C ++中进行发现,并为.NET添加一个接口。
32feet.net的东西工作得很好,当我尝试它,但不支持Widcomm堆栈。
还有Peter Foot的32feet.net
http://inthehand.com/content/32feet.aspx
当它是v1.5时,我已经玩了这个回来,它运作良好。
迈克Petrichenko有一个很好的BT框架。 它适用于BlueSoleil,Widcomm,东芝和微软。
它现在被称为无线通信库,并与蓝牙802.11和红外协同工作。 Mike将公司命名为Soft Service Company,并以100美元至2050美元的价格出售非商业和商业许可证,无论是否有源代码。
知道蓝牙设备和从PC发送文件到蓝牙设备的最佳方式是使用该代码。
public void ExecuteCommandSync(object command) { try { // create the processstartinfo using "cmd" as the program to be run,// and "/c " as the parameters. // Incidentally,/c tells cmd that we want it to execute the command that follows,// and then exit. System.Diagnostics.processstartinfo procStartInfo = new System.Diagnostics.processstartinfo("cmd","/c " + command); // The following commands are needed to redirect the standard output. // This means that it will be redirected to the Process.StandardOutput StreamReader. procStartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false; // Do not create the black window. procStartInfo.CreateNowindow = true; // Now we create a process,assign its processstartinfo and start it System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo = procStartInfo; proc.Start(); // Get the output into a string string result = proc.StandardOutput.ReadToEnd(); // display the command output. Console.WriteLine(result); } catch (Exception objException) { // Log the exception MessageBox.Show(objException.Message); } }
string command = "fsquirt"; ExecuteCommandSync(command);
因此,BluetoothFileTransferWizard出现,您可以选择可用的设备,并发送文件发送该设备。 如果你不想使用这种方式,请尝试32feet.net.uk。 这对C#和VB.NET的蓝牙开发非常有用。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。