家知道,
Windows Mobile 6.0 SDK
自带了
cellular emulator
和
fake GPS
,使得我们可以在模拟器上调试
radio
级的
phone call
和基于
GPS
的地理位置应用。前几天,一位
MVP
Dmitry Klionsky
撰写了文章《
Bluetooth for Microsoft Device Emulator
》,讲述了在
Windows Mobile
模拟器上使用蓝牙的方法,我觉得这对于开发移动设备上蓝牙通信的朋友来说,是非常有用的。
我们来看看实现
Bluetooth
的架构,参考图
1(
来源于
Bluetooth for Microsoft Device Emulator
)
,主要包括
emulator
端和
PC
端:
图
1
:
Emulator
和
PC
上实现
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
FreeBT
USB 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 Klionsky
:
Bluetooth for Microsoft Device Emulator
MSDN
:
Bluetooth HCI Transport Driver
MSDN
:
Serial Port Driver
Open source
:
FreeBT
Device Emulator 3.0
Microsoft Remote Tools Framework 1.00
本文转自施炯博客园博客,原文链接:http://www.cnblogs.com/dearsj001/archive/2009/04/11/1433632.html
,如需转载请自行联系原作者