📄 ril.h
字号:
* "data" is int * * ((int *)data)[0] is == 1 for updates enabled (+CREG=2) * ((int *)data)[0] is == 0 for updates disabled (+CREG=1) * * "response" is NULL * * Valid errors: * SUCCESS * RADIO_NOT_AVAILABLE * GENERIC_FAILURE * * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED */#define RIL_REQUEST_SET_LOCATION_UPDATES 76/***********************************************************************/#define RIL_UNSOL_RESPONSE_BASE 1000/** * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED * * Indicate when value of RIL_RadioState has changed. * * Callee will invoke RIL_RadioStateRequest method on main thread * * "data" is NULL */#define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000/** * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED * * Indicate when call state has changed * * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread * * "data" is NULL * * Response should be invoked on, for example, * "RING", "BUSY", "NO CARRIER", and also call state * transitions (DIALING->ALERTING ALERTING->ACTIVE) * * Redundent or extraneous invocations are tolerated */#define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001/** * RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED * * Called when network state, operator name, or GPRS state has changed * Basically on, +CREG and +CGREG * * Callee will invoke the following requests on main thread: * * RIL_REQUEST_REGISTRATION_STATE * RIL_REQUEST_GPRS_REGISTRATION_STATE * RIL_REQUEST_OPERATOR * * "data" is NULL * * FIXME should this happen when SIM records are loaded? (eg, for * EONS) */#define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1002/** * RIL_UNSOL_RESPONSE_NEW_SMS * * Called when new SMS is received. * * "data" is const char * * This is a pointer to a string containing the PDU of an SMS-DELIVER * as an ascii string of hex digits. The PDU starts with the SMSC address * per TS 27.005 (+CMT:) * * Callee will subsequently confirm the receipt of thei SMS with a * RIL_REQUEST_SMS_ACKNOWLEDGE * * No new RIL_UNSOL_RESPONSE_NEW_SMS * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a * RIL_REQUEST_SMS_ACKNOWLEDGE has been received */#define RIL_UNSOL_RESPONSE_NEW_SMS 1003/** * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT * * Called when new SMS Status Report is received. * * "data" is const char * * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT * as an ascii string of hex digits. The PDU starts with the SMSC address * per TS 27.005 (+CDS:). * * Callee will subsequently confirm the receipt of the SMS with a * RIL_REQUEST_SMS_ACKNOWLEDGE * * No new RIL_UNSOL_RESPONSE_NEW_SMS * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a * RIL_REQUEST_SMS_ACKNOWLEDGE has been received */#define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004/** * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM * * Called when new SMS has been stored on SIM card * * "data" is const int * * ((const int *)data)[0] contains the slot index on the SIM that contains * the new message */#define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005/** * RIL_UNSOL_ON_USSD * * Called when a new USSD message is received. * * "data" is const char ** * ((const char **)data)[0] points to a type code, which is * one of these string values: * "0" USSD-Notify -- text in ((const char **)data)[1] * "1" USSD-Request -- text in ((const char **)data)[1] * "2" Session terminated by network * "3" other local client (eg, SIM Toolkit) has responded * "4" Operation not supported * "5" Network timeout * * The USSD session is assumed to persist if the type code is "1", otherwise * the current session (if any) is assumed to have terminated. * * ((const char **)data)[1] points to a message string if applicable, which * should always be in UTF-8. */#define RIL_UNSOL_ON_USSD 1006/* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006 *//** * RIL_UNSOL_ON_USSD_REQUEST * * Obsolete. Send via RIL_UNSOL_ON_USSD */#define RIL_UNSOL_ON_USSD_REQUEST 1007 /** * RIL_UNSOL_NITZ_TIME_RECEIVED * * Called when radio has received a NITZ time message * * "data" is const char * pointing to NITZ time string * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt" */#define RIL_UNSOL_NITZ_TIME_RECEIVED 1008/** * RIL_UNSOL_SIGNAL_STRENGTH * * Radio may report signal strength rather han have it polled. * * "data" is an "int *" * ((int *)response)[0] is received signal strength (0-31, 99) * ((int *)response)[1] is bit error rate (0-7, 99) * as defined in TS 27.007 8.5 * Other values (eg -1) are not legal */#define RIL_UNSOL_SIGNAL_STRENGTH 1009/** * RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED * * Indicate a PDP context state has changed, or a new context * has been activated or deactivated * * "data" is an array of RIL_PDP_Context_Response identical to that * returned by RIL_REQUEST_PDP_CONTEXT_LIST * * See also: RIL_REQUEST_PDP_CONTEXT_LIST */#define RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED 1010/** * RIL_UNSOL_SUPP_SVC_NOTIFICATION * * Reports supplementary service related notification from the network. * * "data" is a const RIL_SuppSvcNotification * * */#define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011/** * RIL_UNSOL_STK_SESSION_END * * Indicate when STK session is terminated by SIM. * * "data" is NULL */#define RIL_UNSOL_STK_SESSION_END 1012/** * RIL_UNSOL_STK_PROACTIVE_COMMAND * * Indicate when SIM issue a STK proactive command to applications * * "data" is a const char * containing SAT/USAT proactive command * in hexadecimal format string starting with command tag * */#define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013/** * RIL_UNSOL_STK_EVENT_NOTIFY * * Indicate when SIM notifies applcations some event happens. * Generally, application does not need to have any feedback to * SIM but shall be able to indicate appropriate messages to users. * * "data" is a const char * containing SAT/USAT commands or responses * sent by ME to SIM or commands handled by ME, in hexadecimal format string * starting with first byte of response data or command tag * */#define RIL_UNSOL_STK_EVENT_NOTIFY 1014/** * RIL_UNSOL_STK_CALL_SETUP * * Indicate when SIM wants application to setup a voice call. * * "data" is const int * * ((const int *)data)[0] contains timeout value (in milliseconds) */#define RIL_UNSOL_STK_CALL_SETUP 1015/** * RIL_UNSOL_SIM_SMS_STORAGE_FULL * * Indicates that SMS storage on the SIM is full. Sent when the network * attempts to deliver a new SMS message. Messages cannot be saved on the * SIM until space is freed. In particular, incoming Class 2 messages * cannot be stored. * * "data" is null * */#define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016/** * RIL_UNSOL_SIM_REFRESH * * Indicates that file(s) on the SIM have been updated, or the SIM * has been reinitialized. * * "data" is an int * * ((int *)data)[0] is a RIL_SimRefreshResult. * ((int *)data)[1] is the EFID of the updated file if the result is * SIM_FILE_UPDATE or NULL for any other result. * * Note: If the radio state changes as a result of the SIM refresh (eg, * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED * should be sent. */#define RIL_UNSOL_SIM_REFRESH 1017/** * RIL_UNSOL_CALL_RING * * Ring indication for an incoming call (eg, RING or CRING event). * * "data" is null */#define RIL_UNSOL_CALL_RING 1018/***********************************************************************//** * RIL_Request Function pointer * * @param request is one of RIL_REQUEST_* * @param data is pointer to data defined for that RIL_REQUEST_* * data is owned by caller, and should not be modified or freed by callee * @param t should be used in subsequent call to RIL_onResponse * @param datalen the length of data * */typedef void (*RIL_RequestFunc) (int request, void *data, size_t datalen, RIL_Token t);/** * This function should return the current radio state synchronously */typedef RIL_RadioState (*RIL_RadioStateRequest)();/** * This function returns "1" if the specified RIL_REQUEST code is * supported and 0 if it is not * * @param requestCode is one of RIL_REQUEST codes */typedef int (*RIL_Supports)(int requestCode);/** * This function is called from a separate thread--not the * thread that calls RIL_RequestFunc--and indicates that a pending * request should be cancelled. * * On cancel, the callee should do its best to abandon the request and * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point. * * Subsequent calls to RIL_onRequestComplete for this request with * other results will be tolerated but ignored. (That is, it is valid * to ignore the cancellation request) * * RIL_Cancel calls should return immediately, and not wait for cancellation * * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007 * interface * * @param t token wants to be canceled */typedef void (*RIL_Cancel)(RIL_Token t);typedef void (*RIL_TimedCallback) (void *param);/** * Return a version string for your RIL implementation */typedef const char * (*RIL_GetVersion) (void);typedef struct { int version; /* set to RIL_VERSION */ RIL_RequestFunc onRequest; RIL_RadioStateRequest onStateRequest; RIL_Supports supports; RIL_Cancel onCancel; RIL_GetVersion getVersion;} RIL_RadioFunctions;#ifdef RIL_SHLIBstruct RIL_Env { /** * "t" is parameter passed in on previous call to RIL_Notification * routine. * * If "e" != SUCCESS, then response can be null/is ignored * * "response" is owned by caller, and should not be modified or * freed by callee * * RIL_onRequestComplete will return as soon as possible */ void (*OnRequestComplete)(RIL_Token t, RIL_Errno e, void *response, size_t responselen); /** * "unsolResponse" is one of RIL_UNSOL_RESPONSE_* * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_* * * "data" is owned by caller, and should not be modified or freed by callee */ void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen); /** * Call user-specifed "callback" function on on the same thread that * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies * a relative time value at which the callback is invoked. If relativeTime is * NULL or points to a 0-filled structure, the callback will be invoked as * soon as possible */ void (*RequestTimedCallback) (RIL_TimedCallback callback, void *param, const struct timeval *relativeTime); };/** * RIL implementations must defined RIL_Init * argc and argv will be command line arguments intended for the RIL implementation * Return NULL on error * * @param env is environment point defined as RIL_Env * @param argc number of arguments * @param argv list fo arguments * */const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);#else /* RIL_SHLIB *//** * Call this once at startup to register notification routine * * @param callbacks user-specifed callback function */void RIL_register (const RIL_RadioFunctions *callbacks);/** * * RIL_onRequestComplete will return as soon as possible * * @param t is parameter passed in on previous call to RIL_Notification * routine. * @param e error code * if "e" != SUCCESS, then response can be null/is ignored * @param response is owned by caller, and should not be modified or * freed by callee * @param responselen the length of response in byte */void RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen);/** * @param unsolResponse is one of RIL_UNSOL_RESPONSE_* * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_* * "data" is owned by caller, and should not be modified or freed by callee * @param datalen the length of data in byte */void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, size_t datalen);/** * Call user-specifed "callback" function on on the same thread that * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies * a relative time value at which the callback is invoked. If relativeTime is * NULL or points to a 0-filled structure, the callback will be invoked as * soon as possible * * @param callback user-specifed callback function * @param param parameter list * @param relativeTime a relative time value at which the callback is invoked */void RIL_requestTimedCallback (RIL_TimedCallback callback, void *param, const struct timeval *relativeTime);#endif /* RIL_SHLIB */#ifdef __cplusplus}#endif#endif /*ANDROID_RIL_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -