Wednesday, 3. December 2008, 14:36:49
The
DG eCall recommends that the following essential requirements for transmitting both voice and data through the mobile networks should be adopted:
1.Pan-European solution:
o Roaming capability
o Belonging to GSM Standards (ETSI, 3GPP) that must be available for long enough to support vehicle life cycle
o Commonly implemented by all European Telcos & within preferably all GSM modules
2.Real time transport mechanism
3.Quasi simultaneous voice call and data transfer
4.Secure transport and routing mechanism (E112)
5.Automatic Acknowledgement
The DG eCall recommends that the architecture for eCall, as illustrated in following figure, is adopted by all stakeholders when implementing eCall. The process is described below:
1) The eCall Generator initiate the eCall by sensors triggered and/or manually, send the in-vehicle
triggered eCall to a PSAP. The eCall consists of two elements: a pure voice (audio) telephone call
based on 112 and the minimum set of data (MSD)
2) The eCall (data + voice) carried through the mobile network, is recognized by the mobile network
operator (MNO) as a 112 emergency call, and is first handled by the MNO. Based on the 112
handling the MNO enrich the call with the CLI (caller line identification), and at the same time,
according to the USD and the E112 recommendation, add the best location available (based on the
best effort principle11). After the 112 handling, the telecom operator delivers the 112-voice together
with the CLI, mobile location and the eCall MSD to the appropriate PSAP.
3) The PSAP transmits an acknowledgement to the eCall Generator specifying that the MSD have been
properly received.
Monday, 18. August 2008, 11:15:59
Friday, 25. July 2008, 11:32:23
//========================================================================
//TITLE:
// 预编译指令与相关宏小结
//AUTHOR:
// norains
//DATE:
// Saturday 10-December-2007
//Environment:
// EVC4.0 + Windows CE 5.0 Standard SDK
//========================================================================
1.预编译指令
01) #
空指令,无任何效果
02) #include
包含一个源代码文件
03) #define
定义宏
04) #undef
取消已定义的宏
05) #if
如果给定条件为真,则编译下面代码
06) #else
作为其他预处理的剩余选项进行编译
07) #ifdef
如果宏已经定义,则编译下面代码
08) #ifndef
如果宏没有定义,则编译下面代码
09) #elif
如果前面的#if给定条件不为真,当前条件为真,则编译下面代码
10) #endif
结束一个#if……#else条件编译块
11) #line
改变当前的行数和文件名称
12) #pragma
为编译程序提供非常规的控制流信息
13) #error
停止编译并显示错误信息
2.与编译器相关的宏
文中只列出部分相关宏,如果想查看完整的宏列表,可参考MSDN的"Predefined Macros"一节
01) _MSC_VER
Microsoft 编译器的版本宏.
各版本编译器相应的数值如下表所示:
Compiler _MSC_VER value
-------------------- -----------------------
C Compiler version 6.0 600
C/C++ compiler version 7.0 700
Visual C++, Windows, version 1.0 800
Visual C++, 32-bit, version 1.0 800
Visual C++, Windows, version 2.0 900
Visual C++, 32-bit, version 2.x 900
Visual C++, 32-bit, version 4.0 1000
Visual C++, 32-bit, version 5.0 1100
Visual C++, 32-bit, version 6.0 1200
Visual C++, 32-bit, version 2002 1300
Visual C++, 32-bit, version 2003 1310
Visual C++, 32-bit, version 2005 1400
Embedded Visual C++, 32-bit,version 4.0 Cross 1200 - 1202
02) _MFC_VER
MFC版本宏.
Version _MFC_VER value
-------------- -----------------
4.21 0x0421
6.0 0x0600
7.0 0x0700
03) __TIME__
编译当前源文件的时间,格式为 "hh:mm:ss" 样式的字符串.
04) __DATE__
编译当前源文件的日期,格式为 "Mmm dd yyyy" 样式的字符串.
05) __FILE__
编译的当前源文件名.
3.实例解说
01) 根据_MFC_VER值判断当前的编译环境.
#if _MSC_VER >= 1400
// this is Visual C++ 2005
#elif _MSC_VER >= 1310
// this is Visual c++ .NET 2003
#elif _MSC_VER > 1300
// this is Visual C++ .NET 2002
#endif
02) #else if 和 #elif 的细微差别
#if _MSC_VER < 1202
//EVC 4.0 complier is cross 1200 - 1202
#else if _MSC_VER >= 1400
//Visual C++ 2005 complier is 1400
#else
//Visual C++ 2005 complier is 1400
#endif
这段预编译代码在Evc4.0和visual studio 2005中编译会出错,提示错误为"unexpected #else".此时只要将"#else if"置换成"#elif"即可:
#if _MSC_VER < 1202
//EVC 4.0 complier is cross 1200 - 1202
#elif _MSC_VER >= 1400
//Visual C++ 2005 complier is 1400
#else
//Visual C++ 2005 complier is 1400
#endif
上面代码可以顺利编译通过.
03) 包含上级目录的某个头文件
如果当前文件需要包含上级目录的某个头文件,可采用"..\\"形式,比如:
#include "..\\Configure.h"
甚至还可以层层递推,定位于上上级目录:
#include "..\\..\\Configure.h"
04) 包含当前目录的某个文件夹下的头文件
如果当前文件需要包含当前目录下的某个文件夹中的某个头文件,可采用".\\"形式,比如:
#include ".\\Include\\Configure.h"
05) 判断当前CPU类型
#ifdef _X86_
//x86
#endif
#ifdef _MIPS_
//Mips
#endif
#ifdef _ARM_
//Arm
#endif
06)代码中手动添加lib库
#pragma comment (lib,"..\\Engine\\Engine.lib")
Thursday, 24. July 2008, 09:26:05
linux so
基本概念
库有动态与静态两种,动态通常用.so为后缀,静态用.a为后缀。
例如:libhello.so libhello.a 为了在同一系统中使用不同版本的库,可以在库文件名后加上版本号为后缀,例如: libhello.so.1.0,由于程序连接默认以.so为文件后缀名。所以为了使用这些库,通常使用建立符号连接的方式。
ln -s libhello.so.1.0 libhello.so.1
ln -s libhello.so.1 libhello.so
1、使用库
当要使用静态的程序库时,连接器会找出程序所需的函数,然后将它们拷贝到执行文件,由于这种拷贝是完整的,所以一旦连接成功,静态程序库也就不再需要了。然而,对动态库而言,就不是这样。动态库会在执行程序内留下一个标记指明当程序执行时,首先必须载入这个库。由于动态库节省空间,linux下进行连接的缺省操作是首先连接动态库,也就是说,如果同时存在静态和动态库,不特别指定的话,将与动态库相连接。现在假设有一个叫hello的程序开发包,它提供一个静态库libhello.a 一个动态库libhello.so,一个头文件hello.h,头文件中提供sayhello()这个函数 /* hello.h */ void sayhello(); 另外还有一些说明文档。
这一个典型的程序开发包结构 与动态库连接 linux默认的就是与动态库连接,下面这段程序testlib.c使用hello库中的sayhello()函数
/*testlib.c*/
#include <>
#include <>
int main()
{
sayhello();
return 0;
}
使用如下命令进行编译 $gcc -c testlib.c -o testlib.o
用如下命令连接: $gcc testlib.o -lhello -o testlib
连接时要注意,假设libhello.o 和libhello.a都在缺省的库搜索路径下/usr/lib下,如果在其它位置要加上-L参数 与与静态库连接麻烦一些,主要是参数问题。还是上面的例子:
$gcc testlib.o -o testlib -WI,-Bstatic -lhello
注:这个特别的"-WI,-Bstatic"参数,实际上是传给了连接器ld。指示它与静态库连接,如果系统中只有静态库当然就不需要这个参数了。 如果要和多个库相连接,而每个库的连接方式不一样,比如上面的程序既要和libhello进行静态连接,又要和libbye进行动态连接,其命令应为:
$gcc testlib.o -o testlib -WI,-Bstatic -lhello -WI,-Bdynamic -lbye
2、动态库的路径问题 为了让执行程序顺利找到动态库,有三种方法:
(1)把库拷贝到/usr/lib和/lib目录下。
(2)在LD_LIBRARY_PATH环境变量中加上库所在路径。
例如动态库libhello.so在/home/ting/lib目录下,以bash为例,使用命令:
$export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ting/lib
(3) 修改/etc/ld.so.conf文件,把库所在的路径加到文件末尾,并执行ldconfig刷新。这样,加入的目录下的所有库文件都可见。
3、查看库中的符号
有时候可能需要查看一个库中到底有哪些函数,nm命令可以打印出库中的涉及到的所有符号。库既可以是静态的也可以是动态的。nm列出的符号有很多,常见的有三种:
一种是在库中被调用,但并没有在库中定义(表明需要其他库支持),用U表示;
一种是库中定义的函数,用T表示,这是最常见的;
另外一种是所谓的“弱 态”符号,它们虽然在库中被定义,但是可能被其他库中的同名符号覆盖,用W表示。
例如,假设开发者希望知道上文提到的hello库中是否定义了 printf():
$nm libhello.so |grep printf U
其中printf U表示符号printf被引用,但是并没有在函数内定义,由此可以推断,要正常使用hello库,必须有其它库支持,再使用ldd命令查看hello依赖于哪些库:
$ldd hello libc.so.6=>/lib/libc.so.6(0x400la000) /lib/ld-linux.so.2=>/lib/ld-linux.so.2 (0x40000000)
从上面的结果可以继续查看printf最终在哪里被定义,有兴趣可以go on
4、生成库
第一步要把源代码编绎成目标代码。
以下面的代码为例,生成上面用到的hello库:
/* hello.c */
#include <>
void sayhello()
{
printf("hello,world ");
}
用gcc编绎该文件,在编绎时可以使用任何全法的编绎参数,例如-g加入调试代码等: gcc -c hello.c -o hello.o
(1)连接成静态库 连接成静态库使用ar命令,其实ar是archive的意思
$ar cqs libhello.a hello.o
(2)连接成动态库 生成动态库用gcc来完成,由于可能存在多个版本,因此通常指定版本号:
$gcc -shared -Wl,-soname,libhello.so.1 -o libhello.so.1.0 hello.o
另外再建立两个符号连接:
$ln -s libhello.so.1.0 libhello.so.1
$ln -s libhello.so.1 libhello.so
这样一个libhello的动态连接库就生成了。最重要的是传gcc -shared 参数使其生成是动态库而不是普通执行程序。 -Wl 表示后面的参数也就是-soname,libhello.so.1直接传给连接器ld进行处理。实际上,每一个库都有一个soname,当连接器发现它正在查找的程序库中有这样一个名称,连接器便会将soname嵌入连结中的二进制文件内,而不是它正在运行的实际文件名,在程序执行期间,程序会查找拥有 soname名字的文件,而不是库的文件名,换句话说,soname是库的区分标志。这样做的目的主要是允许系统中多个版本的库文件共存,习惯上在命名库文件的时候通常与soname相同 libxxxx.so.major.minor 其中,xxxx是库的名字,major是主版本号,minor 是次版本号
Tuesday, 17. June 2008, 07:41:09
WiMAX, LTE
LTE and WiMax may be two peas in an OFDM pod, but they are not twins. Here are three significant differences:
1. Both use orthogonal frequency division multiple access (OFDMA) in the downlink. But WiMax optimizes for maximum channel usage by processing all the information in a wide channel. LTE, on the other hand, organizes the available spectrum into smaller chunks. This translates into higher power consumption, for WiMAX. An architecture that exploits the principles of SDR, however, could reconfigure its FFT function for better power efficiency.
2. LTE uses single-carrier frequency division multiple access (SC-FDMA) for uplink signaling, while WiMax sticks with OFDMA. LTE opted for the SC-FDMA specifically to boost power efficiency. Programmable solutions may be flexible enough to reuse gates and keep power low in LTE mode.
3. WiMax implementations are predominantly Time-Division Duplex (TDD). LTE seems to be heading in the Frequency-Division Duplex (FDD) direction with separate up and downstream channels. A WiMax TDD radio is simpler and makes techniques like beamforming easier.
Friday, 13. June 2008, 11:28:25
Notes from the book Vehicle Location and Navigation Systems.
I will try to update as I going through the book

Tuesday, 10. June 2008, 09:27:27
调用DLL有两种方法:静态调用和动态调用.
(一).静态调用其步骤如下:
1.把你的youApp.DLL拷到你目标工程(需调用youApp.DLL的工程)的Debug目录下;
2.把你的youApp.lib拷到你目标工程(需调用youApp.DLL的工程)目录下;
3.把你的youApp.h(包含输出函数的定义)拷到你目标工程(需调用youApp.DLL的工程)目
录下;
4.打开你的目标工程选中工程,选择Visual C++的Project主菜单的Settings菜单;
5.执行第4步后,VC将会弹出一个对话框,在对话框的多页显示控件中选择Link页。然
后在Object/library modules输入框中输入:youApp.lib
6.选择你的目标工程Head Files加入:youApp.h文件;
7.最后在你目标工程(*.cpp,需要调用DLL中的函数)中包含你的:#include "youApp.h"
注:youApp是你DLL的工程名。
2.动态调用其程序如下:
动态调用时只需做静态调用步骤1.
{
HINSTANCE hDllInst = LoadLibrary("youApp.DLL");
if(hDllInst)
{
typedef DWORD (WINAPI *MYFUNC)(DWORD,DWORD);
MYFUNC youFuntionNameAlias = NULL; // youFuntionNameAlias 函数别名
youFuntionNameAlias = (MYFUNC)GetProcAddress
(hDllInst,"youFuntionName");
// youFuntionName 在DLL中声明的函数名
if(youFuntionNameAlias)
{
youFuntionNameAlias(param1,param2);
}
FreeLibrary(hDllInst);
}
}
显式(静态)调用:
LIB + DLL + .H,注意.H中dllexport改为dllimport
隐式(动态)调用:
DLL + 函数原型声明,先LoadLibrary,再GetProcAddress(即找到DLL中函数的地址),不用后FreeLibrary
Tuesday, 3. June 2008, 12:29:46
在程序开发过程中不断会碰到不同timestamp的转换,在这里做一个总结:
一.时间类型间的转换:
1.time_t 转 FILETIME
FILETIME ft;
LONGLONG ll = Int32x32To64(t, 10000000) + 116444736000000000;
ft.dwLowDateTime = (DWORD) ll;
ft.dwHighDateTime = (DWORD)(ll >> 32);
2.FILETIME 转 time_t
FILETIME ft;
LONGLONG llTime;
time_t t;
llTime = (ft.dwHighDateTime << 32) + ft.dwLowDateTime;
t = (DWORD)((LONGLONG)(llTime - 116444736000000000) / 10000000);
3.SYSTEMTIME 转 FILETIME
FILETIME ft;
SYSTEMTIME st;
SystemTimeToFileTime( &st, &ft );
4. FILETIME 转 SYSTEMTIME
FILETIME ft;
SYSTEMTIME st;
FileTimeToSystemTime( &ft, &st);
Monday, 19. May 2008, 14:51:53
Timer under Windows/WinCE
Read more...
Wednesday, 7. May 2008, 13:17:02
vanet
Some resources helpful to understand VANET
Read more...
1 2 3 Next »
Showing posts 1 -
10 of
26.