Chinaunix

标题: moto a1200开发随笔(8)——通过tapi拨打电话 [打印本页]

作者: chenwayne    时间: 2007-08-19 12:48
标题: moto a1200开发随笔(8)——通过tapi拨打电话
北京理工大学 20981 陈罡
通过研究moto的tapi发现,他们底层的代码写的确实不错,结构清晰,接口简单明了。而且经过试验还发现,通过tapi拨打电话,可以不需要弹出类似短消息的那个是否允许的对话框。呵呵,这样很好,很方便。毕竟虽然说是体贴用户,但是让用户频繁的一遍又一遍的按允许,也是一件很让人不爽的事情。
拨打电话应该来说是非常容易的,呵呵,同样只是编译的时候麻烦一些。Makefile需要链接的库有一些注意的地方,上一篇忘记贴makefile了,参考本篇的,应该不难写出来。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define TEL_NUMBER    "xxxxxxxxxxxx"
using namespace std ;
int main(int argc, char * argv[])
{
INT32               call_fd ;
TAPI_APP_MSGID_T    msg_id[] = { TAPI_APP_ASYNC_VOICECALL_MSG_GRPID } ;
TAPI_RESULT_E       res_id ;
TAPI_CALL_ID_T      call_id ;
TAPI_PHONE_NUMBER_A tel_num = {' '};
const char *        tel_ptr = TEL_NUMBER ;
int                 tel_length = strlen(tel_ptr) ;
int                 i ;
// create call_fd, seems moto make the tapi some how like socket operation
call_fd = TAPI_CLIENT_Init( msg_id, sizeof(msg_id) / sizeof(TAPI_APP_MSGID_T) ) ;
if((call_fd == TAPI_INVALID_SOCKETFD) || (call_fd == 0) ) {
  cout
EZX_BASE=..
CXX=arm-linux-g++
LNK=arm-linux-g++
STP=arm-linux-strip
MOC=$(EZX_BASE)/moc/moc
D2U=dos2unix
CXXFLAGS=-fno-exceptions -fno-rtti -Wall -g
INCLUDE=-I$(EZX_BASE)/include/qt -I$(EZX_BASE)/include/ezx
LIBDIRS=-L$(EZX_BASE)/lib -L$(EZX_BASE)/lib/ezx/lib
LIBS= -lezxappbase -lqte-mt -lpthread -lezxappsdk -lipp-jp \
-lezxopenwindow -lipp-miscGen -lezxjpeg -lezxpm -lezxtapi
OBJS=call.o
APP=call
%.o: %.cpp
    $(D2U) $
%.moc: %.cpp
    $(MOC) $
$(APP): $(OBJS)
    $(CXX) $^ -o $@ $(LIBDIRS) $(LIBS)
    $(STP) $^
clean:
    rm -f -r $(APP) *.o *~

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26691/showart_363284.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2