复位模块
2012-11-19 09:21
162 查看
request reset modem
ATReset():
case RIL_REQUEST_RESET_RADIO: LOGD("got request RIL_REQUEST_RESET_RADIO"); #ifdef MODEM_RESET int type = ((int *)data)[0]; LOGD("======Reset type = %d, data[0]=%d========", type, ((int *)data)[0]); ATReset(type); #endif RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0); break;
ATReset():
/* Called on command or reader thread * * AT reset function: * resetType: 0 means normal reset * 1 means reset when AP sleep, this time just need colse tty nodes , * and reopen them, and kernel has created noded success. */ static void ATReset(int resetType) { int fd = -1; ssize_t written; static int reset_num = 0; static int sleep_reset_num = 0; s_resetType = resetType; if(resetType == 0){ reset_num++; LOGI("AT channel normal reset , s_resetting=%d, reset_num=%d\n", s_resetting, reset_num); if(s_closed == 1){ LOGI("AT channel reset, but the ttynode is colsed, so nothing need to do\n"); return; } s_resetting = 1; pthread_mutex_lock(&s_reset_mutex); pthread_cond_wait(&s_reset_cond, &s_reset_mutex); pthread_mutex_unlock(&s_reset_mutex); //may be need wait 2s modem_PowerOn(); s_resetting = 0; pthread_mutex_lock(&s_state_mutex); pthread_cond_broadcast (&s_state_cond); pthread_mutex_unlock(&s_state_mutex); LOGI("*****completed reset operation,start to open tty node\n"); write2Kernel("*****completed reset operation,start to open tty node\n"); }else if(resetType == 1){ sleep_reset_num++; LOGI("AT channel AP sleep reset, s_resetting=%d, sleep_reset_num=%d\n", s_resetting, sleep_reset_num); RIL_requestTimedCallback(initializeCallback, NULL, &TIMEVAL_0); } return; }
相关文章推荐
- 《程序员面试笔试宝典》样章试读
- imp,exp与impdp,expdp的适用范围与区别
- String 转xml文件(含中文,dom4j)
- <每日一句英语> 2012-11-19
- 浅谈exp与expdp的区别
- UML类图关系大全
- Asp.net mvc View动态编译要小心啊
- flex DateChooser
- linux命令 lsof 可以查看端口被占用情况
- 用户体验分析 是什么让用户离开您的网站?
- [转载]一个WordPress博客能挣多少广告费?
- eclipse导入maven工程 出现的异常
- C++ 对象关系映射(ORM)介绍
- Android蓝牙通信 .[转]
- 串口转以太网模块:WIZ108SR 数据手册
- struts2+spring+hibernate整合
- Android开发之EditText属性详解
- vs.php 2.10 for 2010 注册码
- 指向函数的指针
- Android 中自定义 Adapter