android 系统上做GC双模的--modem 的被动消息处理
2011-03-17 12:34
351 查看
一、概述
在android 上做双模手机,CDMA EVDO模块主动上报消息在ril 层,应用层必须要做处理;
ril层主要是解析 URAT 上报指令,通过socket 传给java层,有java 来提示给用户
二、unsolicited 消息从modem上报到java的流程。
c++部份
readerLoop()
line = readline();
processLine(line);
handleUnsolicited(line);
if (s_unsolHandler != NULL) {
s_unsolHandler (line1, line2);//实际执行的是void onUnsolicited (const char *s, const char *sms_pdu)
if (strStartsWith(s,"+CRING:")
|| strStartsWith(s,"RING")
|| strStartsWith(s,"NO CARRIER")
|| strStartsWith(s,"+CCWA")
)
RIL_onUnsolicitedResponse (RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED, NULL, 0);
p.writeInt32 (RESPONSE_UNSOLICITED);
p.writeInt32 (unsolResponse);
ret = s_unsolResponses[unsolResponseIndex].responseFunction(p, data, datalen);
ret = sendResponse(p);
sendResponseRaw(p.data(), p.dataSize());
ret = blockingWrite(fd, (void *)&header, sizeof(header));
blockingWrite(fd, data, dataSize);
java部份
ril.java->RILReceiver.run()
for(;;)
{
...
length = readRilMessage(is, buffer);
p = Parcel.obtain();
p.unmarshall(buffer, 0, length);
p.setDataPosition(0);
processResponse(p);
processUnsolicited (p);
response = p.readInt();
switch(response) {
...
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: ret = responseVoid(p); break;
...
}
switch(response) {
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED:
if (RILJ_LOGD) unsljLog(response);
mCallStateRegistrants
.notifyRegistrants(new AsyncResult(null, null, null));
...
}
在android 上做双模手机,CDMA EVDO模块主动上报消息在ril 层,应用层必须要做处理;
ril层主要是解析 URAT 上报指令,通过socket 传给java层,有java 来提示给用户
二、unsolicited 消息从modem上报到java的流程。
c++部份
readerLoop()
line = readline();
processLine(line);
handleUnsolicited(line);
if (s_unsolHandler != NULL) {
s_unsolHandler (line1, line2);//实际执行的是void onUnsolicited (const char *s, const char *sms_pdu)
if (strStartsWith(s,"+CRING:")
|| strStartsWith(s,"RING")
|| strStartsWith(s,"NO CARRIER")
|| strStartsWith(s,"+CCWA")
)
RIL_onUnsolicitedResponse (RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED, NULL, 0);
p.writeInt32 (RESPONSE_UNSOLICITED);
p.writeInt32 (unsolResponse);
ret = s_unsolResponses[unsolResponseIndex].responseFunction(p, data, datalen);
ret = sendResponse(p);
sendResponseRaw(p.data(), p.dataSize());
ret = blockingWrite(fd, (void *)&header, sizeof(header));
blockingWrite(fd, data, dataSize);
java部份
ril.java->RILReceiver.run()
for(;;)
{
...
length = readRilMessage(is, buffer);
p = Parcel.obtain();
p.unmarshall(buffer, 0, length);
p.setDataPosition(0);
processResponse(p);
processUnsolicited (p);
response = p.readInt();
switch(response) {
...
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: ret = responseVoid(p); break;
...
}
switch(response) {
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED:
if (RILJ_LOGD) unsljLog(response);
mCallStateRegistrants
.notifyRegistrants(new AsyncResult(null, null, null));
...
}
相关文章推荐
- android 系统上做GC双模的--modem 的被动消息处理
- android 系统上做GC双模的---数据业务的处理分析
- android 系统上做GC双模的---数据业务的处理分析
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread [转]
- android消息处理系统原理
- Android系统Handler消息处理机制(一)
- 从Handler+Message+Looper源码带你分析Android系统的消息处理机制
- 深入理解Android消息处理系统——Looper、Handler、Thread
- 深入理解Android消息处理系统——Looper、Handler、Thread
- Android消息处理系统原理简要概述
- 深入理解Android消息处理系统——Looper、Handler、Thread
- Android系统中的消息处理Looper、Handler、Message
- Android系统中的消息处理Looper、Handler、Message
- 深入理解Android消息处理系统——Looper、Handler、Thread
- Android系统之Phone模块-接电话Unsolicited消息的接收和处理过程