当前位置:操作系统 > 安卓/Android >>

Android RIL源码研究笔记 の ril (二)

这篇文章介绍ril.cpp中实现部分代码中的四个字符串输出函数及其相应的枚举类型。首先看requestToString()函数的
代码,它的功能是将将ril_command.h和ril_unsol_commands.h中的命令转换成字符串描述:
[cpp]
const char * requestToString(int request) { 
    switch(request) { 
        case RIL_REQUEST_GET_SIM_STATUS: return "GET_SIM_STATUS"; 
        case RIL_REQUEST_ENTER_SIM_PIN: return "ENTER_SIM_PIN"; 
        case RIL_REQUEST_ENTER_SIM_PUK: return "ENTER_SIM_PUK"; 
        case RIL_REQUEST_ENTER_SIM_PIN2: return "ENTER_SIM_PIN2"; 
        case RIL_REQUEST_ENTER_SIM_PUK2: return "ENTER_SIM_PUK2"; 
        case RIL_REQUEST_CHANGE_SIM_PIN: return "CHANGE_SIM_PIN"; 
        case RIL_REQUEST_CHANGE_SIM_PIN2: return "CHANGE_SIM_PIN2"; 
        case RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION: return "ENTER_NETWORK_DEPERSONALIZATION"; 
        case RIL_REQUEST_GET_CURRENT_CALLS: return "GET_CURRENT_CALLS"; 
        case RIL_REQUEST_DIAL: return "DIAL"; 
        case RIL_REQUEST_GET_IMSI: return "GET_IMSI"; 
        case RIL_REQUEST_HANGUP: return "HANGUP"; 
        case RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND: return "HANGUP_WAITING_OR_BACKGROUND"; 
        case RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND: return "HANGUP_FOREGROUND_RESUME_BACKGROUND"; 
        case RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE: return "SWITCH_WAITING_OR_HOLDING_AND_ACTIVE"; 
        case RIL_REQUEST_CONFERENCE: return "CONFERENCE"; 
        case RIL_REQUEST_UDUB: return "UDUB"; 
        case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: return "LAST_CALL_FAIL_CAUSE"; 
        case RIL_REQUEST_SIGNAL_STRENGTH: return "SIGNAL_STRENGTH"; 
        case RIL_REQUEST_REGISTRATION_STATE: return "REGISTRATION_STATE"; 
        case RIL_REQUEST_GPRS_REGISTRATION_STATE: return "GPRS_REGISTRATION_STATE"; 
        case RIL_REQUEST_OPERATOR: return "OPERATOR"; 
        case RIL_REQUEST_RADIO_POWER: return "RADIO_POWER"; 
        case RIL_REQUEST_DTMF: return "DTMF"; 
        case RIL_REQUEST_SEND_SMS: return "SEND_SMS"; 
        case RIL_REQUEST_SEND_SMS_EXPECT_MORE: return "SEND_SMS_EXPECT_MORE"; 
        case RIL_REQUEST_SETUP_DATA_CALL: return "SETUP_DATA_CALL"; 
        case RIL_REQUEST_SIM_IO: return "SIM_IO"; 
        case RIL_REQUEST_SEND_USSD: return "SEND_USSD"; 
        case RIL_REQUEST_CANCEL_USSD: return "CANCEL_USSD"; 
        case RIL_REQUEST_GET_CLIR: return "GET_CLIR"; 
        case RIL_REQUEST_SET_CLIR: return "SET_CLIR"; 
        case RIL_REQUEST_QUERY_CALL_FORWARD_STATUS: return "QUERY_CALL_FORWARD_STATUS"; 
        case RIL_REQUEST_SET_CALL_FORWARD: return "SET_CALL_FORWARD"; 
        case RIL_REQUEST_QUERY_CALL_WAITING: return "QUERY_CALL_WAITING"; 
        case RIL_REQUEST_SET_CALL_WAITING: return "SET_CALL_WAITING"; 
        case RIL_REQUEST_SMS_ACKNOWLEDGE: return "SMS_ACKNOWLEDGE"; 
        case RIL_REQUEST_GET_IMEI: return "GET_IMEI"; 
        case RIL_REQUEST_GET_IMEISV: return "GET_IMEISV"; 
        case RIL_REQUEST_ANSWER: return "ANSWER"; 
        case RIL_REQUEST_DEACTIVATE_DATA_CALL: return "DEACTIVATE_DATA_CALL"; 
        case RIL_REQUEST_QUERY_FACILITY_LOCK: return "QUERY_FACILITY_LOCK"; 
        case RIL_REQUEST_SET_FACILITY_LOCK: return "SET_FACILITY_LOCK"; 
        case RIL_REQUEST_CHANGE_BARRING_PASSWORD: return "CHANGE_BARRING_PASSWORD"; 
        case RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE: return "QUERY_NETWORK_SELECTION_MODE"; 
        case RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC: return "SET_NETWORK_SELECTION_AUTOMATIC"; 
        case RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL: return "SET_NETWORK_SELECTION_MANUAL"; 
        case RIL_REQUEST_QUERY_AVAILABLE_NETWORKS : return "QUERY_AVAILABLE_NETWORKS "; 
        case RIL_REQUEST_DTMF_START: return "DTMF_START"; 
        case RIL_REQUEST_DTMF_STOP: return "DTMF_STOP"; 
        case RIL_REQUEST_BASEBAND_VERSION: return "BASEBAND_VERSION"; 
        case RIL_REQUEST_SEPARATE_CONNECTION: return "SEPARATE_CONNECTION"; 
        case RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE: return "SET_PREFERRED_NETWORK_TYPE"; 
        case RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE: return "GET_PREFERRED_NETWORK_TYPE"; 
        case RIL_REQUEST_GET_NEIGHBORING_CELL_IDS: return "GET_NEIGHBORING_CELL_IDS"; 
        case RIL_REQUEST_SET_MUTE: return "SET_MUTE"; 
        case RIL_REQUEST_GET_MUTE: return "GET_MUTE"; 
        case RIL_REQUEST_QUERY_CLIP: return "QUERY_CLIP"; 
        case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE: return "LAST_DATA_CALL_FAIL_CAUSE"; 
        case RIL_REQUEST_DATA_CALL_LIST: return "DATA_CALL_LIST"; 
        case RIL_REQUES

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,