在Windows Mobile模拟器上使用蓝牙

本文发布于 15 年前,部分内容可能已经失去参考价值。

    大家知道,Windows Mobile 6.0 SDK自带了cellular emulatorfake GPS,使得我们可以在模拟器上调试radio级的phone call和基于GPS的地理位置应用。前几天,一位MVP Dmitry Klionsky撰写了文章《Bluetooth for Microsoft Device Emulator》,讲述了在Windows Mobile模拟器上使用蓝牙的方法,我觉得这对于开发移动设备上蓝牙通信的朋友来说,是非常有用的。

    我们来看看实现Bluetooth的架构,参考图1(来源于Bluetooth for Microsoft Device Emulator),主要包括emulator端和PC端:

1EmulatorPC上实现Bluetooth通信的架构

1. Emulator

Bluetooth HCI Transport Driver

Serial Port Driver

Microsoft Remote Tools Framework remote agent

2.  PC

Microsoft Remote Tools Framework desktop plugin

FreeBT USB Driver runtime

FreeBTUSB Driver

Connected Bluetooth USB device

    注意:作者采用了FreeBT这个开源的工程来控制Bluetooth的接入。

    在Windows Mobile模拟器上使用蓝牙的必要条件有:

1. Visual studio 2005 with SP1 或者 Visual studio 2008

2. Windows Mobile 5.0 Pocket PC/Smartphone SDK and/or Windows Mobile 6 Standard/Professional SDK emulator images

3. Device Emulator 3.0

4. Microsoft Remote Tools Framework 1.00

5. 一个具有USB接口的Bluetooth dongle

    在Windows Mobile模拟器上使用蓝牙的步骤如下(详细请参考Bluetooth for Microsoft Device Emulator):

1.  PC端安装下载的FreeBT的蓝牙驱动,方法自然是通过“windows设备管理器”,为新的硬件设备(也就是连接的Bluetooth USB device)添加下载过来的驱动(主要是找到fbtusb.inf文件)。

2. Remote Tools Framework plugin中运行BthEmulManager.cetool,将其和模拟器建立连接。

3. 连接建立以后,蓝牙设备的信息(Address, Manufacturer, HCI Version, LMP Version)就会显示在界面上了,如图2所示(来源于Bluetooth for Microsoft Device Emulator.

2:建立蓝牙联系以后,在模拟器上的信息

4. Microsoft Remote Tools Framework允许我们同时开启两个模拟器,因此,如果手头有两个Bluetooth USB dongle的话,我们就可以在两个模拟器上调试蓝牙的收发通信了。

参考链接:

Dmitry KlionskyBluetooth for Microsoft Device Emulator

MSDNBluetooth HCI Transport Driver

MSDNSerial Port Driver

Open sourceFreeBT

Device Emulator 3.0

Microsoft Remote Tools Framework 1.00

转自 网络(如侵权请联系删除) 15 年前
云服务器 精选特惠
可能相关的内容