利用WinCE6.0的新特性CellCore快速进行GSM驱动开发

CE 6.0 ships with a number of new/updated features - this includes tools integration into Visual Studio 2005 (which provides updates to MFC, ATL, STL, WTL, compilers, C++ language conformance etc...) - kernel changes to support more than 32 processes and more than 32MB Virtual Memory per process.

Beyond the tools and kernel changes there are also some new and interesting technologies to work with, these include the new Windows Network Projector (more on this later), CellCore, and others.

CellCore is an interesting addition to CE 6.0, providing support for SMS messaging and internet connectivity for embedded devices over the cellular network - CE 6.0 ships with a sample RIL driver for Enfora devices, for the recent CE 6.0 Electronic Picture Frame launch demo I used an Enfora GSM/GPRS GSM1218 device connected to an ICOP eBox 2300 over a serial connection.

There are two steps needed to add CellCore/RIL driver support to your embedded operating system design - the first is to search the CE 6.0 catalog for "CellCore" (see image below).

CellCore

You hae the option of adding just the features you need (such as SMS support) or all features (All Modules) - this adds the components at the API level but doesn't add the Enfora sample RIL driver - this is added through a custom environment variable "IMGENFORA=1" set through the OSDesign Properties dialog.

Here's an extract from C:/WINCE600/PLATFORM/DEVICEEMULATOR/FILES/platform.bib

IF IMGENFORA
    rilgsm.dll          $(_FLATRELEASEDIR)/rilenfora.dll          NK  SHK
ENDIF IMGENFORA

Setting the IMGENFORA environment variable will only work for the CEPC and Device Emulator platforms - the Enfora drivers are located in the CEPC and Device Emulator Platform folders - if you want to get the Enfora RIL driver working with another platform then you need to copy the Enfora driver source over to your platform folder - for example, copying the CEPC Enfora driver from /wince600/platform/CEPC/SRC/DRIVERS/RILPDD over to my ICOP eBox 2300 platform folder /Wince600/Platform/ICOP_2300/SRC/DRIVERS/RILPDD gets the files in the right place, you also have to modify some additional files to get this to work.

First, modify the DIRS file for your DRIVERS folder so that the rilpdd folder gets built - like so...

DIRS= /
# @CESYSGEN IF CELLCORE_MODULES_RIL
rilpdd /
# @CESYSGEN ENDIF CELLCORE_MODULES_RIL

Next step is to copy the IMGENFORA block from the CEPC Platform.BIB and Platform.REG files - these files are located in the C:/WINCE600/PLATFORM/CEPC/FILES folder - you would need to add the IMGENFORA blocks into your platforms BIB and REG files.

At this point you should be able to set the IMGENFORA=1 environment variable for your OSDesign/Platform and build your operating system design, which can then take advantage of the Enfora RIL/GSM/GPRS device.

Note that the Enfora device "assumes" that it's connected to COM2 of your embedded device, which interestingly can be mapped for the Device Emulator to use a physical COM port of your desktop PC.

CellCore support has been added to CE 6.0 for machine-to-machine communication either using SMS messages or connecting over the cellular network to the internet and calling XML Web Services or other technologies to communicate back to the enterprise (or to other cellular connected devices) - You could imagine vending machines that report back to a warehouse when they need to be refilled - combine this with "Smart" GPS navigation and you can see that cost savings could be made by reducing the number of miles needed for a delivery van each day by only restocking the vending machines that are running low and being smart about the route taken, reducing miles, fuel etc...

 

CE 6.0有许多新特征被整合到了Visual Studio2005当中,包括最新的MFC, ATL, STL, WTL, 编译器,语言一致性等等。目前内核不仅可以支持超过32个处理器,而且每个进程可以支持大于32MB的虚拟内存。除了工具和内核这些变化之外,还有一些有趣的新技术可以搞,比如Windows Network Projector,还有CellCore等等。我们现在来讲讲CellCore,它是CE6.0其中最有用的新特性之一,它令嵌入式系统可以通过蜂窝网络为上层应用提供电话,短消息和internet连接等服务。CE6.0包含了专门为Enfora设备而准备一个简单的RIL驱动。例如可以通过串口将一个运行CE6.0系统的电子相框和一个Enfora GSM/GPRS GSM1218电子相框进行连接,从而让这个相框可以通过网络实时更新我们的照片。

只需要两个步骤就可以添加CellCore/RIL驱动来支持我们的嵌入式操作系统。首先在CE6.0的catalog里面找到”CellCore”,如图所示:


你可以只选择你需要的选项(例如SMS支持)或者所有功能(ALL Modules),这样做的话就只会添加到你的API层(MDD模块)但是不能添加Enfora例程的RIL驱动层(PDD模块),要添加Enfora的例程我们可以通过在添加”IMGENFORA=1”的环境变量来实现。

另外,别忘记在bib文件中添加加载Enfora的DLL的开关:
C:/WINCE600/PLATFORM/DEVICEEMULATOR/FILES/platform.bib
    IF IMGENFORA
        rilgsm.dll          $(_FLATRELEASEDIR)/rilenfora.dll          NK SHK
    ENDIF IMGENFORA

设置IMGENFORA环境变量只能在CEPC平台和模拟器平台上产生作用,因为Enfora驱动位于CEPC平台和模拟器平台的文件夹下。如果你希望Enfora在你自己的平台下工作你需要将Enfora的文件在DEVICEEMULATOR文件夹下复制至你自己的平台文件夹下。例如我们的平台是x5,那么我就要复制去/Wince600/Platform/x5/SRC/DRIVERS/RILPDD,然后你需要修改一些其他的文件来令到这个文件能够运行。首先,按照如下方式在驱动文件夹DRIVERS下修改路径文件DIRS,从而确保RILPDD能够被编译:
DIRS= /
# @CESYSGEN IF CELLCORE_MODULES_RIL
rilpdd /
# @CESYSGEN ENDIF CELLCORE_MODULES_RIL
接下来在我们x5平台下的BIB文件和REG里粘贴IMGENFORA块,别忘记这两个文件是在WINCE600/PLATFORM/CEPC/FILES底下的。

这样,我们就可以通过设置环境变量IMGENFORA=1来实现为我们的平台添加Enfora RIL驱动,从而使得上层应用能够控制我们的GSM/GPRS设备。

还有一点要注意的就是,Enfora驱动会假定你通过COM2口来连接你的GSM嵌入式设备,在模拟器里面我们可以使用桌面PC的物理COM口来映射它。

另外有一点要注意的是,GSM驱动与多数复杂的WIN CE驱动一样同样分为MDD和PDD两层,CellCore是运行在一个叫RIL的驱动之上的,如果要想在实际的GSM物理设备上稳定地跑起来,重新针对实际硬件开发PDD层是必须的,这点需要对GSM通讯协议与AT命令状态及其机制非常熟悉才行。幸亏的是,比起例如SMS那些复杂的处理,只对PDD层开发的确大量减少了我们的工作量。

CellCore支持安装CE6.0的设备之间互相发送SMS短信来通信,或者通过蜂窝网络连接到Internet,并能够远程调用XML Web Services或者与企业服务器上的应用进行通信(这当然也包括一些同样运行CellCore的终端设备),你可以想象在安装CE6.0的自动售货机当它们没有库存的时候自动通过无线网络向仓库的服务器提交补充库存申请。它还能和智能的GPS定位器结合,运用一些图遍历的算法,实现货车只需前往需要补充货物的自动售货机,并且在这个过程中选择行车路线最短的路径,以降低燃料和成本。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值