当另一个应用程序需要访问蓝牙连接时抑制 BTExplorer (Bluetopia)

发布于 2024-12-03 16:53:55 字数 1217 浏览 1 评论 0原文

我正在为 Motorola MC55 设备开发 C# 设备应用程序(使用 Bluetopia)。此应用程序启动蓝牙查询和配对过程(通过企业移动开发套件)并记下虚拟串行端口 #:

public void DoConnection(IRemoteBTDevice rd)
{
    RemoteDevice remoteDevice = new RemoteDevice(rd.DeviceName, rd.Id.Replace(":", ""), "");

    this.bluetooth.RemoteDevices.Add(remoteDevice);
    this.bluetooth.RemoteDevices.Refresh();

    if (!remoteDevice.IsPaired)
    {
        remoteDevice.Pair(rd.Pin);
    }

    //TODO Note serial port # (get it by means of remoteDevice.LocalComPort) 

    //Works smoothly, but a second process has to do this (requirement).
    remoteDevice.OpenPort();
}

但只要一秒钟进程(例如另一个 C# 设备应用程序)打开该串行端口,启动 BTExplorer。如何抑制这种现象呢?

this.comX = new SerialPort(this.BluetoothPortName);
this.comX.Open();

我只是使用另一个程序集:http://32feet.codeplex.com/。它可以在 Motorola ES400 (Microsoft Stack) 上顺利运行。看到这个后: http://32feet.codeplex.com/wikipage?title=Stonestreet %20One%20Bluetopia,我使用了相同的代码,但它在 MC55 上还不能顺利工作。

感谢您的支持, 罗杰·胡贝尔

I am developing a C# device application for Motorola MC55 devices (Bluetopia is used). This application sets the bluetooth inquiry and pairing procedure in motion (by means of the Enterprise Mobility Developer Kit) and writes down the virtual serial port #:

public void DoConnection(IRemoteBTDevice rd)
{
    RemoteDevice remoteDevice = new RemoteDevice(rd.DeviceName, rd.Id.Replace(":", ""), "");

    this.bluetooth.RemoteDevices.Add(remoteDevice);
    this.bluetooth.RemoteDevices.Refresh();

    if (!remoteDevice.IsPaired)
    {
        remoteDevice.Pair(rd.Pin);
    }

    //TODO Note serial port # (get it by means of remoteDevice.LocalComPort) 

    //Works smoothly, but a second process has to do this (requirement).
    remoteDevice.OpenPort();
}

But as soon as a second process (e.g. another c# device application) opens that serial port, BTExplorer is launched. How do I suppress this phenomenon?

this.comX = new SerialPort(this.BluetoothPortName);
this.comX.Open();

I'm just using another Assembly: http://32feet.codeplex.com/. It works smoothly for Motorola ES400 (Microsoft Stack). After seeing this: http://32feet.codeplex.com/wikipage?title=Stonestreet%20One%20Bluetopia, I used the same code, but it doesn't work trouble-free for MC55 yet.

Thank you for your support,
Roger Huber

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

a√萤火虫的光℡ 2024-12-10 16:53:55

据我了解,实际上是 BTExplorer.exe 提供/控制虚拟 COM 端口服务,因此它需要在使用虚拟 COM 端口时运行...

请务必告知您在使用我的 32feet.NET Bluetopia 支持时的 MC55。正如我在 32feet.NET:Stonestreet One Bluetopia 中指出的,我在M3 移动设备具有最新版本的 Bluetopia 堆栈。也许 StoneStreetOne 改变了您的版本之间的某些内容...(如果 Bluetopia 启动完全失败,那么我会更多地登录 3.3 版——我距离发布已经不远了)。

当然,如果第二个 C# 程序需要使用虚拟 COM 端口,那么 32feet.NET 将无济于事——如上所述,仍然需要 BTExplorer。但是,如果您可以更改该程序以使用BluetoothClient等而不是COM端口...(当然要记住“一次一个Bluetopia”限制)。

艾伦

As I understand it, it is BTExplorer.exe that actually provides/controls the virtual COM port service, so it needs to be running when a virtual COM port is in use...

Do be sure to let know what the issues you see on your MC55 when using my 32feet.NET Bluetopia support. As I noted at 32feet.NET: Stonestreet One Bluetopia I tested on a M3 Mobile device which has a quite recent version of the Bluetopia stack. Maybe StoneStreetOne changed something between your versions... (If Bluetopia start-up fails completely then I've more logging in version 3.3 -- which I'm not too far away from releasing).

Of course if that second C# program needs to use a virtual COM port then 32feet.NET won't help -- BTExplorer is still required as discussed above. However if you could change that program to use BluetoothClient etc instead of COM ports... (Remembering of course the "Bluetopia one at a time" restriction of course).

Alan

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文