manfromnn

rild.h

Sep 16th, 2014
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 145.65 KB | None | 0 0
  1. /*
  2.  * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  3.  * Not a Contribution
  4.  * Copyright (C) 2006 The Android Open Source Project
  5.  *
  6.  * Licensed under the Apache License, Version 2.0 (the "License");
  7.  * you may not use this file except in compliance with the License.
  8.  * You may obtain a copy of the License at
  9.  *
  10.  *      http://www.apache.org/licenses/LICENSE-2.0
  11.  *
  12.  * Unless required by applicable law or agreed to in writing, software
  13.  * distributed under the License is distributed on an "AS IS" BASIS,
  14.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.  * See the License for the specific language governing permissions and
  16.  * limitations under the License.
  17.  */
  18.  
  19. #ifndef ANDROID_RIL_H
  20. #define ANDROID_RIL_H 1
  21.  
  22. #include <stdlib.h>
  23. #include <stdint.h>
  24. #include <telephony/ril_cdma_sms.h>
  25. #include <telephony/ril_msim.h>
  26. #ifndef FEATURE_UNIT_TEST
  27. #include <sys/time.h>
  28. #endif /* !FEATURE_UNIT_TEST */
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #define RIL_VERSION 9     /* Current version */
  35. #ifdef LEGACY_RIL
  36. #define RIL_VERSION_MIN 2 /* Minimum RIL_VERSION supported */
  37. #else
  38. #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
  39. #endif
  40. #define RIL_QCOM_VERSION 3 /* Qualcomm internal RIL version */
  41.  
  42. #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
  43. #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
  44.  
  45. #define MAX_RILDS 3
  46. #define MAX_SOCKET_NAME_LENGTH 6
  47. #define MAX_CLIENT_ID_LENGTH 2
  48. #define MAX_DEBUG_SOCKET_NAME_LENGTH 12
  49. #define MAX_QEMU_PIPE_NAME_LENGTH  11
  50.  
  51. typedef void * RIL_Token;
  52.  
  53. typedef enum {
  54.     RIL_E_SUCCESS = 0,
  55.     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
  56.     RIL_E_GENERIC_FAILURE = 2,
  57.     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
  58.     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
  59.     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
  60.     RIL_E_REQUEST_NOT_SUPPORTED = 6,
  61.     RIL_E_CANCELLED = 7,
  62.     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
  63.                                                    call on a Class C GPRS device */
  64.     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
  65.                                                    registers in network */
  66.     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
  67.     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
  68.                                                    shall be retrieved because of SIM or RUIM
  69.                                                    card absent */
  70.     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
  71.                                                    location */
  72.     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
  73.     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
  74.     RIL_E_ILLEGAL_SIM_OR_ME = 15,               /* network selection failed due to
  75.                                                    illegal SIM or ME */
  76.     RIL_E_UNUSED = 16,
  77.     RIL_E_DIAL_MODIFIED_TO_USSD = 17,           /* DIAL request modified to USSD */
  78.     RIL_E_DIAL_MODIFIED_TO_SS = 18,             /* DIAL request modified to SS */
  79.     RIL_E_DIAL_MODIFIED_TO_DIAL = 19,           /* DIAL request modified to DIAL with different data */
  80.     RIL_E_USSD_MODIFIED_TO_DIAL = 20,           /* USSD request modified to DIAL */
  81.     RIL_E_USSD_MODIFIED_TO_SS = 21,             /* USSD request modified to SS */
  82.     RIL_E_USSD_MODIFIED_TO_USSD = 22,           /* USSD request modified to different USSD request */
  83.     RIL_E_SS_MODIFIED_TO_DIAL = 23,             /* SS request modified to DIAL */
  84.     RIL_E_SS_MODIFIED_TO_USSD = 24,             /* SS request modified to USSD */
  85.     RIL_E_SS_MODIFIED_TO_SS = 25,               /* SS request modified to different SS request */
  86.     RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26       /* Subscription not supported by RIL */
  87. } RIL_Errno;
  88.  
  89. typedef enum {
  90.     RIL_CALL_ACTIVE = 0,
  91.     RIL_CALL_HOLDING = 1,
  92.     RIL_CALL_DIALING = 2,    /* MO call only */
  93.     RIL_CALL_ALERTING = 3,   /* MO call only */
  94.     RIL_CALL_INCOMING = 4,   /* MT call only */
  95.     RIL_CALL_WAITING = 5     /* MT call only */
  96. } RIL_CallState;
  97.  
  98. typedef enum {
  99.     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
  100.     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
  101.     /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
  102.     RADIO_STATE_SIM_NOT_READY = 2,         /* Radio is on, but the SIM interface is not ready */
  103.     RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3,  /* SIM PIN locked, PUK required, network
  104.                                               personalization locked, or SIM absent */
  105.     RADIO_STATE_SIM_READY = 4,             /* Radio is on and SIM interface is available */
  106.     RADIO_STATE_RUIM_NOT_READY = 5,        /* Radio is on, but the RUIM interface is not ready */
  107.     RADIO_STATE_RUIM_READY = 6,            /* Radio is on and the RUIM interface is available */
  108.     RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
  109.                                               personalization locked, or RUIM absent */
  110.     RADIO_STATE_NV_NOT_READY = 8,          /* Radio is on, but the NV interface is not available */
  111.     RADIO_STATE_NV_READY = 9,              /* Radio is on and the NV interface is available */
  112.     RADIO_STATE_ON = 10                    /* Radio is on */
  113. } RIL_RadioState;
  114.  
  115. typedef enum {
  116.     RADIO_TECH_UNKNOWN = 0,
  117.     RADIO_TECH_GPRS = 1,
  118.     RADIO_TECH_EDGE = 2,
  119.     RADIO_TECH_UMTS = 3,
  120.     RADIO_TECH_IS95A = 4,
  121.     RADIO_TECH_IS95B = 5,
  122.     RADIO_TECH_1xRTT =  6,
  123.     RADIO_TECH_EVDO_0 = 7,
  124.     RADIO_TECH_EVDO_A = 8,
  125.     RADIO_TECH_HSDPA = 9,
  126.     RADIO_TECH_HSUPA = 10,
  127.     RADIO_TECH_HSPA = 11,
  128.     RADIO_TECH_EVDO_B = 12,
  129.     RADIO_TECH_EHRPD = 13,
  130.     RADIO_TECH_LTE = 14,
  131.     RADIO_TECH_HSPAP = 15, // HSPA+
  132.     RADIO_TECH_GSM = 16, // Only supports voice
  133.     RADIO_TECH_TD_SCDMA = 17,
  134.     RADIO_TECH_IWLAN = 18,
  135.     RADIO_TECH_DCHSPAP = 30
  136. } RIL_RadioTechnology;
  137.  
  138. // Do we want to split Data from Voice and the use
  139. // RIL_RadioTechnology for get/setPreferredVoice/Data ?
  140. typedef enum {
  141.     PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
  142.     PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
  143.     PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
  144.     PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
  145.     PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
  146.     PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
  147.     PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
  148.     PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
  149.     PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
  150.     PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
  151.     PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
  152.     PREF_NET_TYPE_LTE_ONLY                 = 11, /* LTE only */
  153.     PREF_NET_TYPE_LTE_WCDMA                = 12, /* LTE/WCDMA */
  154.     PREF_NET_TYPE_TD_SCDMA_ONLY            = 13, /* TD-SCDMA only */
  155.     PREF_NET_TYPE_TD_SCDMA_WCDMA           = 14, /* TD-SCDMA and WCDMA */
  156.     PREF_NET_TYPE_TD_SCDMA_LTE             = 15, /* TD-SCDMA and LTE */
  157.     PREF_NET_TYPE_TD_SCDMA_GSM             = 16, /* TD-SCDMA and GSM */
  158.     PREF_NET_TYPE_TD_SCDMA_GSM_LTE         = 17, /* TD-SCDMA,GSM and LTE */
  159.     PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA       = 18, /* TD-SCDMA, GSM/WCDMA */
  160.     PREF_NET_TYPE_TD_SCDMA_WCDMA_LTE       = 19, /* TD-SCDMA, WCDMA and LTE */
  161.     PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_LTE   = 20, /* TD-SCDMA, GSM/WCDMA and LTE */
  162.     PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO  = 21, /* TD-SCDMA, GSM/WCDMA, CDMA and EvDo */
  163.     PREF_NET_TYPE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA   = 22  /* TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA */
  164. } RIL_PreferredNetworkType;
  165.  
  166. /* Source for cdma subscription */
  167. typedef enum {
  168.    CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
  169.    CDMA_SUBSCRIPTION_SOURCE_NV = 1
  170. } RIL_CdmaSubscriptionSource;
  171.  
  172. /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
  173. typedef enum {
  174.     RIL_UUS_TYPE1_IMPLICIT = 0,
  175.     RIL_UUS_TYPE1_REQUIRED = 1,
  176.     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
  177.     RIL_UUS_TYPE2_REQUIRED = 3,
  178.     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
  179.     RIL_UUS_TYPE3_REQUIRED = 5,
  180.     RIL_UUS_TYPE3_NOT_REQUIRED = 6
  181. } RIL_UUS_Type;
  182.  
  183. /* User-to-User Signaling Information data coding schemes. Possible values for
  184.  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
  185.  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
  186. typedef enum {
  187.     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
  188.     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
  189.     RIL_UUS_DCS_X244 = 2,         /* X.244 */
  190.     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
  191.                                      convergence function */
  192.     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
  193. } RIL_UUS_DCS;
  194.  
  195. /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
  196.  * This data is passed in RIL_ExtensionRecord and rec contains this
  197.  * structure when type is RIL_UUS_INFO_EXT_REC */
  198. typedef struct {
  199.   RIL_UUS_Type    uusType;    /* UUS Type */
  200.   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
  201.   int             uusLength;  /* Length of UUS Data */
  202.   char *          uusData;    /* UUS Data */
  203. } RIL_UUS_Info;
  204.  
  205. /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
  206. typedef struct {
  207.   char isPresent;    /* non-zero if signal information record is present */
  208.   char signalType;   /* as defined 3.7.5.5-1 */
  209.   char alertPitch;   /* as defined 3.7.5.5-2 */
  210.   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
  211. } RIL_CDMA_SignalInfoRecord;
  212.  
  213. typedef struct {
  214.     RIL_CallState   state;
  215.     int             index;      /* Connection Index for use with, eg, AT+CHLD */
  216.     int             toa;        /* type of address, eg 145 = intl */
  217.     char            isMpty;     /* nonzero if is mpty call */
  218.     char            isMT;       /* nonzero if call is mobile terminated */
  219.     char            als;        /* ALS line indicator if available
  220.                                    (0 = line 1) */
  221.     char            isVoice;    /* nonzero if this is is a voice call */
  222.     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
  223.     char *          number;     /* Remote party number */
  224.     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
  225.     char *          name;       /* Remote party name */
  226.     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
  227.     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
  228. } RIL_Call;
  229.  
  230. /* Deprecated, use RIL_Data_Call_Response_v6 */
  231. typedef struct {
  232.     int             cid;        /* Context ID, uniquely identifies this call */
  233.     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
  234.     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
  235.                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
  236.     char *          apn;        /* ignored */
  237.     char *          address;    /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
  238. } RIL_Data_Call_Response_v4;
  239.  
  240. /*
  241.  * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
  242.  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
  243.  */
  244. typedef struct {
  245.     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
  246. #ifndef HCRADIO
  247.     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
  248.                                            back-off timer value RIL wants to override the one
  249.                                            pre-configured in FW.
  250.                                            The unit is miliseconds.
  251.                                            The value < 0 means no value is suggested.
  252.                                            The value 0 means retry should be done ASAP.
  253.                                            The value of INT_MAX(0x7fffffff) means no retry. */
  254. #endif
  255.     int             cid;        /* Context ID, uniquely identifies this call */
  256.     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
  257.     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
  258.                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
  259.                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
  260.                                    such as "IP" or "IPV6" */
  261.     char *          ifname;     /* The network interface name */
  262.     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
  263.                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
  264.                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
  265.                                    one of each. If the prefix length is absent the addresses
  266.                                    are assumed to be point to point with IPv4 having a prefix
  267.                                    length of 32 and IPv6 128. */
  268.     char *          dnses;      /* A space-delimited list of DNS server addresses,
  269.                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
  270.                                    May be empty. */
  271.     char *          gateways;   /* A space-delimited list of default gateway addresses,
  272.                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
  273.                                    May be empty in which case the addresses represent point
  274.                                    to point connections. */
  275. } RIL_Data_Call_Response_v6;
  276.  
  277. typedef enum {
  278.     RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
  279.     RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
  280. } RIL_RadioTechnologyFamily;
  281.  
  282. typedef struct {
  283.     RIL_RadioTechnologyFamily tech;
  284.     unsigned char             retry;       /* 0 == not retry, nonzero == retry */
  285.     int                       messageRef;  /* Valid field if retry is set to nonzero.
  286.                                               Contains messageRef from RIL_SMS_Response
  287.                                               corresponding to failed MO SMS.
  288.                                             */
  289.  
  290.     union {
  291.         /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */
  292.         RIL_CDMA_SMS_Message* cdmaMessage;
  293.  
  294.         /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */
  295.         char**                gsmMessage;
  296.     } message;
  297. } RIL_IMS_SMS_Message;
  298.  
  299. typedef struct {
  300.     int messageRef;   /* TP-Message-Reference for GSM,
  301.                          and BearerData MessageId for CDMA
  302.                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
  303.     char *ackPDU;     /* or NULL if n/a */
  304.     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
  305.                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
  306.                          -1 if unknown or not applicable*/
  307. } RIL_SMS_Response;
  308.  
  309. /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
  310. typedef struct {
  311.     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
  312.                     /*      0 = "REC UNREAD"    */
  313.                     /*      1 = "REC READ"      */
  314.                     /*      2 = "STO UNSENT"    */
  315.                     /*      3 = "STO SENT"      */
  316.     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
  317.                        the TP-layer length is "strlen(pdu)/2". */
  318.     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
  319.                        (as expected by TS 27.005) or NULL for default SMSC */
  320. } RIL_SMS_WriteArgs;
  321.  
  322. /** Used by RIL_REQUEST_DIAL */
  323. typedef struct {
  324.     char * address;
  325.     int clir;
  326.             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
  327.              * clir == 0 on "use subscription default value"
  328.              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
  329.              * clir == 2 on "CLIR suppression" (allow CLI presentation)
  330.              */
  331.     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
  332. } RIL_Dial;
  333.  
  334. typedef struct {
  335.     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
  336.     int fileid;     /* EF id */
  337.     char *path;     /* "pathid" from TS 27.007 +CRSM command.
  338.                        Path is in hex asciii format eg "7f205f70"
  339.                        Path must always be provided.
  340.                      */
  341.     int p1;
  342.     int p2;
  343.     int p3;
  344.     char *data;     /* May be NULL*/
  345.     char *pin2;     /* May be NULL*/
  346. } RIL_SIM_IO_v5;
  347.  
  348. typedef struct {
  349.     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
  350.     int fileid;     /* EF id */
  351.     char *path;     /* "pathid" from TS 27.007 +CRSM command.
  352.                        Path is in hex asciii format eg "7f205f70"
  353.                        Path must always be provided.
  354.                      */
  355.     int p1;
  356.     int p2;
  357.     int p3;
  358.     char *data;     /* May be NULL*/
  359.     char *pin2;     /* May be NULL*/
  360.     char *aidPtr;   /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
  361. } RIL_SIM_IO_v6;
  362.  
  363. typedef struct {
  364.     int sw1;
  365.     int sw2;
  366.     char *simResponse;  /* In hex string format ([a-fA-F0-9]*). */
  367. } RIL_SIM_IO_Response;
  368.  
  369. /* See also com.android.internal.telephony.gsm.CallForwardInfo */
  370.  
  371. typedef struct {
  372.     int             status;     /*
  373.                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
  374.                                  * status 1 = active, 0 = not active
  375.                                  *
  376.                                  * For RIL_REQUEST_SET_CALL_FORWARD:
  377.                                  * status is:
  378.                                  * 0 = disable
  379.                                  * 1 = enable
  380.                                  * 2 = interrogate
  381.                                  * 3 = registeration
  382.                                  * 4 = erasure
  383.                                  */
  384.  
  385.     int             reason;      /* from TS 27.007 7.11 "reason" */
  386.     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
  387.                                     See table for Android mapping from
  388.                                     MMI service code
  389.                                     0 means user doesn't input class */
  390.     int             toa;         /* "type" from TS 27.007 7.11 */
  391.     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
  392.     int             timeSeconds; /* for CF no reply only */
  393. }RIL_CallForwardInfo;
  394.  
  395. typedef struct {
  396.    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
  397.                         * Upper 16 bits is LAC and lower 16 bits
  398.                         * is CID (as described in TS 27.005)
  399.                         * Primary Scrambling Code (as described in TS 25.331)
  400.                         *         in 9 bits in UMTS
  401.                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
  402.                         */
  403.    int    rssi;        /* Received RSSI in GSM,
  404.                         * Level index of CPICH Received Signal Code Power in UMTS
  405.                         */
  406. } RIL_NeighboringCell;
  407.  
  408. /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
  409. typedef enum {
  410.     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
  411.     CALL_FAIL_NORMAL = 16,
  412.     CALL_FAIL_BUSY = 17,
  413.     CALL_FAIL_CONGESTION = 34,
  414.     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
  415.     CALL_FAIL_CALL_BARRED = 240,
  416.     CALL_FAIL_FDN_BLOCKED = 241,
  417.     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
  418.     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
  419.     CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244, /* STK Call Control */
  420.     CALL_FAIL_DIAL_MODIFIED_TO_SS = 245,
  421.     CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246,
  422.     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
  423.     CALL_FAIL_CDMA_DROP = 1001,
  424.     CALL_FAIL_CDMA_INTERCEPT = 1002,
  425.     CALL_FAIL_CDMA_REORDER = 1003,
  426.     CALL_FAIL_CDMA_SO_REJECT = 1004,
  427.     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
  428.     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
  429.     CALL_FAIL_CDMA_PREEMPTED = 1007,
  430.     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
  431.                                             during emergency callback mode */
  432.     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
  433.     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
  434. } RIL_LastCallFailCause;
  435.  
  436. /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
  437. typedef enum {
  438.     PDP_FAIL_NONE = 0, /* No error, connection ok */
  439.  
  440.     /* an integer cause code defined in TS 24.008
  441.        section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
  442.        If the implementation does not have access to the exact cause codes,
  443.        then it should return one of the following values,
  444.        as the UI layer needs to distinguish these
  445.        cases for error notification and potential retries. */
  446.     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
  447.     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
  448.     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
  449.     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
  450.     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
  451.     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
  452.     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
  453.     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
  454.     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
  455.     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
  456.     PDP_FAIL_NSAPI_IN_USE = 0x23,                  /* no retry */
  457.     PDP_FAIL_REGULAR_DEACTIVATION = 0x24,          /* restart radio */
  458.     PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,             /* no retry */
  459.     PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,             /* no retry */
  460.     PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
  461.     PDP_FAIL_PROTOCOL_ERRORS   = 0x6F,             /* no retry */
  462.  
  463.     /* Not mentioned in the specification */
  464.     PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
  465.     PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
  466.  
  467.    /* reasons for data call drop - network/modem disconnect */
  468.     PDP_FAIL_SIGNAL_LOST = -3,
  469.     PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
  470.                                              with parameters appropriate for new technology */
  471.     PDP_FAIL_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
  472.                                              powered off - no retry */
  473.     PDP_FAIL_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
  474.                                              mode was up on same APN/data profile - no retry until
  475.                                              tethered call is off */
  476.  
  477.     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* retry silently */
  478. } RIL_DataCallFailCause;
  479.  
  480. /* See RIL_REQUEST_SETUP_DATA_CALL */
  481. typedef enum {
  482.     RIL_DATA_PROFILE_DEFAULT    = 0,
  483.     RIL_DATA_PROFILE_TETHERED   = 1,
  484.     RIL_DATA_PROFILE_OEM_BASE   = 1000    /* Start of OEM-specific profiles */
  485. } RIL_DataProfile;
  486.  
  487. /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
  488. typedef struct {
  489.     int     notificationType;   /*
  490.                                  * 0 = MO intermediate result code
  491.                                  * 1 = MT unsolicited result code
  492.                                  */
  493.     int     code;               /* See 27.007 7.17
  494.                                    "code1" for MO
  495.                                    "code2" for MT. */
  496.     int     index;              /* CUG index. See 27.007 7.17. */
  497.     int     type;               /* "type" from 27.007 7.17 (MT only). */
  498.     char *  number;             /* "number" from 27.007 7.17
  499.                                    (MT only, may be NULL). */
  500. } RIL_SuppSvcNotification;
  501.  
  502. #define RIL_CARD_MAX_APPS     8
  503.  
  504. typedef enum {
  505.     RIL_CARDSTATE_ABSENT   = 0,
  506.     RIL_CARDSTATE_PRESENT  = 1,
  507.     RIL_CARDSTATE_ERROR    = 2
  508. } RIL_CardState;
  509.  
  510. typedef enum {
  511.     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
  512.     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
  513.     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
  514.                                                         since each app can only have 1 active perso
  515.                                                         involved */
  516.     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
  517.     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
  518.     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
  519.     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
  520.     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
  521.     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
  522.     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
  523.     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
  524.     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
  525.     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
  526.     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
  527.     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
  528.     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
  529.     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
  530.     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
  531.     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
  532.     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
  533.     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
  534.     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
  535.     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
  536.     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
  537.     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
  538. } RIL_PersoSubstate;
  539.  
  540. typedef enum {
  541.     RIL_APPSTATE_UNKNOWN               = 0,
  542.     RIL_APPSTATE_DETECTED              = 1,
  543.     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
  544.     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
  545.     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
  546.                                                when app_state is assigned to this value */
  547.     RIL_APPSTATE_READY                 = 5
  548. } RIL_AppState;
  549.  
  550. typedef enum {
  551.     RIL_PINSTATE_UNKNOWN              = 0,
  552.     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
  553.     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
  554.     RIL_PINSTATE_DISABLED             = 3,
  555.     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
  556.     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
  557. } RIL_PinState;
  558.  
  559. typedef enum {
  560.   RIL_APPTYPE_UNKNOWN = 0,
  561.   RIL_APPTYPE_SIM     = 1,
  562.   RIL_APPTYPE_USIM    = 2,
  563.   RIL_APPTYPE_RUIM    = 3,
  564.   RIL_APPTYPE_CSIM    = 4,
  565.   RIL_APPTYPE_ISIM    = 5
  566. } RIL_AppType;
  567.  
  568. typedef struct
  569. {
  570.   RIL_AppType      app_type;
  571.   RIL_AppState     app_state;
  572.   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
  573.                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
  574.   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
  575.                                        0x30, 0x30, 0x30 */
  576.   char             *app_label_ptr;  /* null terminated string */
  577.   int              pin1_replaced;   /* applicable to USIM, CSIM & ISIM */
  578.   RIL_PinState     pin1;
  579.   RIL_PinState     pin2;
  580. } RIL_AppStatus;
  581.  
  582. /* Deprecated, use RIL_CardStatus_v6 */
  583. typedef struct
  584. {
  585.   RIL_CardState card_state;
  586.   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
  587.   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  588.   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
  589.   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
  590.   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
  591. } RIL_CardStatus_v5;
  592.  
  593. typedef struct
  594. {
  595.   RIL_CardState card_state;
  596.   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
  597.   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
  598.   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
  599.   int           ims_subscription_app_index;      /* value < RIL_CARD_MAX_APPS, -1 if none */
  600.   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
  601.   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
  602. } RIL_CardStatus_v6;
  603.  
  604. /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
  605.  *      or as part of RIL_SimRefreshResponse_v7
  606.  */
  607. typedef enum {
  608.     /* A file on SIM has been updated.  data[1] contains the EFID. */
  609.     SIM_FILE_UPDATE = 0,
  610.     /* SIM initialized.  All files should be re-read. */
  611.     SIM_INIT = 1,
  612.     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
  613.     SIM_RESET = 2
  614. } RIL_SimRefreshResult;
  615.  
  616. typedef struct {
  617.     RIL_SimRefreshResult result;
  618.     int                  ef_id; /* is the EFID of the updated file if the result is */
  619.                                 /* SIM_FILE_UPDATE or 0 for any other result. */
  620.     char *               aid;   /* is AID(application ID) of the card application */
  621.                                 /* See ETSI 102.221 8.1 and 101.220 4 */
  622.                                 /*     For SIM_FILE_UPDATE result it can be set to AID of */
  623.                                 /*         application in which updated EF resides or it can be */
  624.                                 /*         NULL if EF is outside of an application. */
  625.                                 /*     For SIM_INIT result this field is set to AID of */
  626.                                 /*         application that caused REFRESH */
  627.                                 /*     For SIM_RESET result it is NULL. */
  628. } RIL_SimRefreshResponse_v7;
  629.  
  630. /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
  631. typedef struct {
  632.     char *          number;             /* Remote party number */
  633.     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
  634.     char *          name;               /* Remote party name */
  635.     RIL_CDMA_SignalInfoRecord signalInfoRecord;
  636. } RIL_CDMA_CallWaiting_v5;
  637.  
  638. typedef struct {
  639.     char *          number;             /* Remote party number */
  640.     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
  641.     char *          name;               /* Remote party name */
  642.     RIL_CDMA_SignalInfoRecord signalInfoRecord;
  643.     /* Number type/Number plan required to support International Call Waiting */
  644.     int             number_type;        /* 0=Unknown, 1=International, 2=National,
  645.                                            3=Network specific, 4=subscriber */
  646.     int             number_plan;        /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
  647. } RIL_CDMA_CallWaiting_v6;
  648.  
  649. /**
  650.  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
  651.  *
  652.  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
  653.  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
  654.  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
  655.  * CBM message ID.
  656.  *
  657.  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
  658.  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
  659.  * and 9.4.4.2.3 for UMTS.
  660.  * All other values can be treated as empty CBM data coding scheme.
  661.  *
  662.  * selected 0 means message types specified in <fromServiceId, toServiceId>
  663.  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
  664.  *
  665.  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
  666.  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
  667.  */
  668. typedef struct {
  669.     int fromServiceId;
  670.     int toServiceId;
  671.     int fromCodeScheme;
  672.     int toCodeScheme;
  673.     unsigned char selected;
  674. } RIL_GSM_BroadcastSmsConfigInfo;
  675.  
  676. /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
  677. #define RIL_RESTRICTED_STATE_NONE           0x00
  678. /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
  679. #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
  680. /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
  681. #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
  682. /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
  683. #define RIL_RESTRICTED_STATE_CS_ALL         0x04
  684. /* Block packet data access due to restriction. */
  685. #define RIL_RESTRICTED_STATE_PS_ALL         0x10
  686.  
  687. /* The status for an OTASP/OTAPA session */
  688. typedef enum {
  689.     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
  690.     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
  691.     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
  692.     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
  693.     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
  694.     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
  695.     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
  696.     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
  697.     CDMA_OTA_PROVISION_STATUS_COMMITTED,
  698.     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
  699.     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
  700.     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
  701. } RIL_CDMA_OTA_ProvisionStatus;
  702.  
  703. typedef struct {
  704.     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  705.     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
  706. } RIL_GW_SignalStrength;
  707.  
  708. typedef struct {
  709.     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  710.     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
  711. } RIL_SignalStrengthWcdma;
  712.  
  713. typedef struct {
  714.     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
  715.                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
  716.                * value will be 75.
  717.                */
  718.     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
  719.                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
  720.                * will be 125.
  721.                */
  722. } RIL_CDMA_SignalStrength;
  723.  
  724.  
  725. typedef struct {
  726.     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
  727.                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
  728.                * value will be 75.
  729.                */
  730.     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
  731.                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
  732.                * will be 125.
  733.                */
  734.     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
  735. } RIL_EVDO_SignalStrength;
  736.  
  737. typedef struct {
  738.     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  739.     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
  740.                           * Range: 44 to 140 dBm
  741.                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
  742.                           * Reference: 3GPP TS 36.133 9.1.4 */
  743.     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
  744.                           * Range: 20 to 3 dB.
  745.                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
  746.                           * Reference: 3GPP TS 36.133 9.1.7 */
  747.     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
  748.                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
  749.                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
  750.                           * Reference: 3GPP TS 36.101 8.1.1 */
  751.     int cqi;             /* The current Channel Quality Indicator.
  752.                           * Range: 0 to 15.
  753.                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
  754.                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
  755. } RIL_LTE_SignalStrength;
  756.  
  757. typedef struct {
  758.     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
  759.     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
  760.                           * Range: 44 to 140 dBm
  761.                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
  762.                           * Reference: 3GPP TS 36.133 9.1.4 */
  763.     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
  764.                           * Range: 20 to 3 dB.
  765.                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
  766.                           * Reference: 3GPP TS 36.133 9.1.7 */
  767.     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
  768.                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
  769.                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
  770.                           * Reference: 3GPP TS 36.101 8.1.1 */
  771.     int cqi;             /* The current Channel Quality Indicator.
  772.                           * Range: 0 to 15.
  773.                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
  774.                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
  775.     int timingAdvance;   /* timing advance in micro seconds for a one way trip from cell to device.
  776.                           * Approximate distance can be calculated using 300m/us * timingAdvance.
  777.                           * Range: 0 to 0x7FFFFFFE
  778.                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
  779.                           * Reference: 3GPP 36.321 section 6.1.3.5
  780.                           * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */
  781. } RIL_LTE_SignalStrength_v8;
  782.  
  783. typedef struct {
  784.     int rscp;    /* The Received Signal Code Power in dBm multipled by -1.
  785.                   * Range : 25 to 120
  786.                   * INT_MAX: 0x7FFFFFFF denotes invalid value.
  787.                   * Reference: 3GPP TS 25.123, section 9.1.1.1 */
  788. } RIL_TD_SCDMA_SignalStrength_CAF;
  789.  
  790. /* Deprecated, use RIL_SignalStrength_v6 */
  791. typedef struct {
  792.     RIL_GW_SignalStrength   GW_SignalStrength;
  793.     RIL_CDMA_SignalStrength CDMA_SignalStrength;
  794.     RIL_EVDO_SignalStrength EVDO_SignalStrength;
  795. } RIL_SignalStrength_v5;
  796.  
  797. typedef struct {
  798.     RIL_GW_SignalStrength   GW_SignalStrength;
  799.     RIL_CDMA_SignalStrength CDMA_SignalStrength;
  800.     RIL_EVDO_SignalStrength EVDO_SignalStrength;
  801.     RIL_LTE_SignalStrength  LTE_SignalStrength;
  802. } RIL_SignalStrength_v6;
  803.  
  804. typedef struct {
  805.     RIL_GW_SignalStrength       GW_SignalStrength;
  806.     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
  807.     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
  808.     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
  809. } RIL_SignalStrength_v8;
  810.  
  811. typedef struct {
  812.     RIL_GW_SignalStrength           GW_SignalStrength;
  813.     RIL_CDMA_SignalStrength         CDMA_SignalStrength;
  814.     RIL_EVDO_SignalStrength         EVDO_SignalStrength;
  815.     RIL_LTE_SignalStrength_v8       LTE_SignalStrength;
  816.     RIL_TD_SCDMA_SignalStrength_CAF TD_SCDMA_SignalStrength;
  817. } RIL_SignalStrength_v9_CAF;
  818.  
  819. /** RIL_CellIdentityGsm */
  820. typedef struct {
  821.     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
  822.     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
  823.     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
  824.     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
  825. } RIL_CellIdentityGsm;
  826.  
  827. /** RIL_CellIdentityWcdma */
  828. typedef struct {
  829.     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
  830.     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
  831.     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
  832.     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
  833.     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
  834. } RIL_CellIdentityWcdma;
  835.  
  836. /** RIL_CellIdentityCdma */
  837. typedef struct {
  838.     int networkId;      /* Network Id 0..65535, INT_MAX if unknown */
  839.     int systemId;       /* CDMA System Id 0..32767, INT_MAX if unknown  */
  840.     int basestationId;  /* Base Station Id 0..65535, INT_MAX if unknown  */
  841.     int longitude;      /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
  842.                          * It is represented in units of 0.25 seconds and ranges from -2592000
  843.                          * to 2592000, both values inclusive (corresponding to a range of -180
  844.                          * to +180 degrees). INT_MAX if unknown */
  845.  
  846.     int latitude;       /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
  847.                          * It is represented in units of 0.25 seconds and ranges from -1296000
  848.                          * to 1296000, both values inclusive (corresponding to a range of -90
  849.                          * to +90 degrees). INT_MAX if unknown */
  850. } RIL_CellIdentityCdma;
  851.  
  852. /** RIL_CellIdentityLte */
  853. typedef struct {
  854.     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
  855.     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
  856.     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
  857.     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
  858.     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
  859. } RIL_CellIdentityLte;
  860.  
  861. /** RIL_CellInfoGsm */
  862. typedef struct {
  863.   RIL_CellIdentityGsm   cellIdentityGsm;
  864.   RIL_GW_SignalStrength signalStrengthGsm;
  865. } RIL_CellInfoGsm;
  866.  
  867. /** RIL_CellInfoWcdma */
  868. typedef struct {
  869.   RIL_CellIdentityWcdma cellIdentityWcdma;
  870.   RIL_SignalStrengthWcdma signalStrengthWcdma;
  871. } RIL_CellInfoWcdma;
  872.  
  873. /** RIL_CellInfoCdma */
  874. typedef struct {
  875.   RIL_CellIdentityCdma      cellIdentityCdma;
  876.   RIL_CDMA_SignalStrength   signalStrengthCdma;
  877.   RIL_EVDO_SignalStrength   signalStrengthEvdo;
  878. } RIL_CellInfoCdma;
  879.  
  880. /** RIL_CellInfoLte */
  881. typedef struct {
  882.   RIL_CellIdentityLte        cellIdentityLte;
  883.   RIL_LTE_SignalStrength_v8  signalStrengthLte;
  884. } RIL_CellInfoLte;
  885.  
  886. // Must be the same as CellInfo.TYPE_XXX
  887. typedef enum {
  888.   RIL_CELL_INFO_TYPE_GSM    = 1,
  889.   RIL_CELL_INFO_TYPE_CDMA   = 2,
  890.   RIL_CELL_INFO_TYPE_LTE    = 3,
  891.   RIL_CELL_INFO_TYPE_WCDMA  = 4,
  892. } RIL_CellInfoType;
  893.  
  894. // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX
  895. typedef enum {
  896.     RIL_TIMESTAMP_TYPE_UNKNOWN = 0,
  897.     RIL_TIMESTAMP_TYPE_ANTENNA = 1,
  898.     RIL_TIMESTAMP_TYPE_MODEM = 2,
  899.     RIL_TIMESTAMP_TYPE_OEM_RIL = 3,
  900.     RIL_TIMESTAMP_TYPE_JAVA_RIL = 4,
  901. } RIL_TimeStampType;
  902.  
  903. typedef struct {
  904.   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
  905.   int               registered;     /* !0 if this cell is registered 0 if not registered */
  906.   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
  907.   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
  908.   union {
  909.     RIL_CellInfoGsm     gsm;
  910.     RIL_CellInfoCdma    cdma;
  911.     RIL_CellInfoLte     lte;
  912.     RIL_CellInfoWcdma   wcdma;
  913.   } CellInfo;
  914. } RIL_CellInfo;
  915.  
  916. /* Names of the CDMA info records (C.S0005 section 3.7.5) */
  917. typedef enum {
  918.   RIL_CDMA_DISPLAY_INFO_REC,
  919.   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
  920.   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
  921.   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
  922.   RIL_CDMA_SIGNAL_INFO_REC,
  923.   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
  924.   RIL_CDMA_LINE_CONTROL_INFO_REC,
  925.   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
  926.   RIL_CDMA_T53_CLIR_INFO_REC,
  927.   RIL_CDMA_T53_RELEASE_INFO_REC,
  928.   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
  929. } RIL_CDMA_InfoRecName;
  930.  
  931. /* Display Info Rec as defined in C.S0005 section 3.7.5.1
  932.    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
  933.    Note: the Extended Display info rec contains multiple records of the
  934.    form: display_tag, display_len, and display_len occurrences of the
  935.    chari field if the display_tag is not 10000000 or 10000001.
  936.    To save space, the records are stored consecutively in a byte buffer.
  937.    The display_tag, display_len and chari fields are all 1 byte.
  938. */
  939.  
  940. typedef struct {
  941.   char alpha_len;
  942.   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
  943. } RIL_CDMA_DisplayInfoRecord;
  944.  
  945. /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
  946.    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
  947.    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
  948. */
  949.  
  950. typedef struct {
  951.   char len;
  952.   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
  953.   char number_type;
  954.   char number_plan;
  955.   char pi;
  956.   char si;
  957. } RIL_CDMA_NumberInfoRecord;
  958.  
  959. /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
  960. typedef enum {
  961.   RIL_REDIRECTING_REASON_UNKNOWN = 0,
  962.   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
  963.   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
  964.   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
  965.   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
  966.   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
  967.   RIL_REDIRECTING_REASON_RESERVED
  968. } RIL_CDMA_RedirectingReason;
  969.  
  970. typedef struct {
  971.   RIL_CDMA_NumberInfoRecord redirectingNumber;
  972.   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
  973.   RIL_CDMA_RedirectingReason redirectingReason;
  974. } RIL_CDMA_RedirectingNumberInfoRecord;
  975.  
  976. /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
  977. typedef struct {
  978.   char lineCtrlPolarityIncluded;
  979.   char lineCtrlToggle;
  980.   char lineCtrlReverse;
  981.   char lineCtrlPowerDenial;
  982. } RIL_CDMA_LineControlInfoRecord;
  983.  
  984. /* T53 CLIR Information Record */
  985. typedef struct {
  986.   char cause;
  987. } RIL_CDMA_T53_CLIRInfoRecord;
  988.  
  989. /* T53 Audio Control Information Record */
  990. typedef struct {
  991.   char upLink;
  992.   char downLink;
  993. } RIL_CDMA_T53_AudioControlInfoRecord;
  994.  
  995. typedef struct {
  996.  
  997.   RIL_CDMA_InfoRecName name;
  998.  
  999.   union {
  1000.     /* Display and Extended Display Info Rec */
  1001.     RIL_CDMA_DisplayInfoRecord           display;
  1002.  
  1003.     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
  1004.     RIL_CDMA_NumberInfoRecord            number;
  1005.  
  1006.     /* Signal Info Rec */
  1007.     RIL_CDMA_SignalInfoRecord            signal;
  1008.  
  1009.     /* Redirecting Number Info Rec */
  1010.     RIL_CDMA_RedirectingNumberInfoRecord redir;
  1011.  
  1012.     /* Line Control Info Rec */
  1013.     RIL_CDMA_LineControlInfoRecord       lineCtrl;
  1014.  
  1015.     /* T53 CLIR Info Rec */
  1016.     RIL_CDMA_T53_CLIRInfoRecord          clir;
  1017.  
  1018.     /* T53 Audio Control Info Rec */
  1019.     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
  1020.   } rec;
  1021. } RIL_CDMA_InformationRecord;
  1022.  
  1023. #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
  1024.  
  1025. typedef struct {
  1026.   char numberOfInfoRecs;
  1027.   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
  1028. } RIL_CDMA_InformationRecords;
  1029.  
  1030. /* Data Call Profile: Simple IP User Profile Parameters*/
  1031. typedef struct {
  1032.   int  profileId;
  1033.   int  priority;       /* priority. [0..255], 0 - highest */
  1034. } RIL_DataCallProfileInfo;
  1035.  
  1036. typedef enum {
  1037.   SS_CFU,
  1038.   SS_CF_BUSY,
  1039.   SS_CF_NO_REPLY,
  1040.   SS_CF_NOT_REACHABLE,
  1041.   SS_CF_ALL,
  1042.   SS_CF_ALL_CONDITIONAL,
  1043.   SS_CLIP,
  1044.   SS_CLIR,
  1045.   SS_COLP,
  1046.   SS_COLR,
  1047.   SS_WAIT,
  1048.   SS_BAOC,
  1049.   SS_BAOIC,
  1050.   SS_BAOIC_EXC_HOME,
  1051.   SS_BAIC,
  1052.   SS_BAIC_ROAMING,
  1053.   SS_ALL_BARRING,
  1054.   SS_OUTGOING_BARRING,
  1055.   SS_INCOMING_BARRING
  1056. } RIL_SsServiceType;
  1057.  
  1058. typedef enum {
  1059.   SS_ACTIVATION,
  1060.   SS_DEACTIVATION,
  1061.   SS_INTERROGATION,
  1062.   SS_REGISTRATION,
  1063.   SS_ERASURE
  1064. } RIL_SsRequestType;
  1065.  
  1066. typedef enum {
  1067.   SS_ALL_TELE_AND_BEARER_SERVICES,
  1068.   SS_ALL_TELESEVICES,
  1069.   SS_TELEPHONY,
  1070.   SS_ALL_DATA_TELESERVICES,
  1071.   SS_SMS_SERVICES,
  1072.   SS_ALL_TELESERVICES_EXCEPT_SMS
  1073. } RIL_SsTeleserviceType;
  1074.  
  1075. #define SS_INFO_MAX 4
  1076. #define NUM_SERVICE_CLASSES 7
  1077.  
  1078. typedef struct {
  1079.   int numValidIndexes; /* This gives the number of valid values in cfInfo.
  1080.                        For example if voice is forwarded to one number and data
  1081.                        is forwarded to a different one then numValidIndexes will be
  1082.                        2 indicating total number of valid values in cfInfo.
  1083.                        Similarly if all the services are forwarded to the same
  1084.                        number then the value of numValidIndexes will be 1. */
  1085.  
  1086.   RIL_CallForwardInfo cfInfo[NUM_SERVICE_CLASSES]; /* This is the response data
  1087.                                                       for SS request to query call
  1088.                                                       forward status. see
  1089.                                                       RIL_REQUEST_QUERY_CALL_FORWARD_STATUS */
  1090. } RIL_CfData;
  1091.  
  1092. typedef struct {
  1093.   RIL_SsServiceType serviceType;
  1094.   RIL_SsRequestType requestType;
  1095.   RIL_SsTeleserviceType teleserviceType;
  1096.   int serviceClass;
  1097.   RIL_Errno result;
  1098.  
  1099.   union {
  1100.     int ssInfo[SS_INFO_MAX]; /* This is the response data for most of the SS GET/SET
  1101.                                 RIL requests. E.g. RIL_REQUSET_GET_CLIR returns
  1102.                                 two ints, so first two values of ssInfo[] will be
  1103.                                 used for response if serviceType is SS_CLIR and
  1104.                                 requestType is SS_INTERROGATION */
  1105.  
  1106.     RIL_CfData cfData;
  1107.   };
  1108. } RIL_StkCcUnsolSsResponse;
  1109.  
  1110. /**
  1111.  * RIL_REQUEST_GET_SIM_STATUS
  1112.  *
  1113.  * Requests status of the SIM interface and the SIM card
  1114.  *
  1115.  * "data" is NULL
  1116.  *
  1117.  * "response" is const RIL_CardStatus_v6 *
  1118.  *
  1119.  * Valid errors:
  1120.  *  Must never fail
  1121.  */
  1122. #define RIL_REQUEST_GET_SIM_STATUS 1
  1123.  
  1124. /**
  1125.  * RIL_REQUEST_ENTER_SIM_PIN
  1126.  *
  1127.  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
  1128.  *
  1129.  * "data" is const char **
  1130.  * ((const char **)data)[0] is PIN value
  1131.  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1132.  *
  1133.  * "response" is int *
  1134.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1135.  *
  1136.  * Valid errors:
  1137.  *
  1138.  * SUCCESS
  1139.  * RADIO_NOT_AVAILABLE (radio resetting)
  1140.  * GENERIC_FAILURE
  1141.  * PASSWORD_INCORRECT
  1142.  */
  1143.  
  1144. #define RIL_REQUEST_ENTER_SIM_PIN 2
  1145.  
  1146. /**
  1147.  * RIL_REQUEST_ENTER_SIM_PUK
  1148.  *
  1149.  * Supplies SIM PUK and new PIN.
  1150.  *
  1151.  * "data" is const char **
  1152.  * ((const char **)data)[0] is PUK value
  1153.  * ((const char **)data)[1] is new PIN value
  1154.  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1155.  *
  1156.  * "response" is int *
  1157.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1158.  *
  1159.  * Valid errors:
  1160.  *
  1161.  *  SUCCESS
  1162.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1163.  *  GENERIC_FAILURE
  1164.  *  PASSWORD_INCORRECT
  1165.  *     (PUK is invalid)
  1166.  */
  1167.  
  1168. #define RIL_REQUEST_ENTER_SIM_PUK 3
  1169.  
  1170. /**
  1171.  * RIL_REQUEST_ENTER_SIM_PIN2
  1172.  *
  1173.  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
  1174.  * returned as a a failure from a previous operation.
  1175.  *
  1176.  * "data" is const char **
  1177.  * ((const char **)data)[0] is PIN2 value
  1178.  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1179.  *
  1180.  * "response" is int *
  1181.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1182.  *
  1183.  * Valid errors:
  1184.  *
  1185.  *  SUCCESS
  1186.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1187.  *  GENERIC_FAILURE
  1188.  *  PASSWORD_INCORRECT
  1189.  */
  1190.  
  1191. #define RIL_REQUEST_ENTER_SIM_PIN2 4
  1192.  
  1193. /**
  1194.  * RIL_REQUEST_ENTER_SIM_PUK2
  1195.  *
  1196.  * Supplies SIM PUK2 and new PIN2.
  1197.  *
  1198.  * "data" is const char **
  1199.  * ((const char **)data)[0] is PUK2 value
  1200.  * ((const char **)data)[1] is new PIN2 value
  1201.  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1202.  *
  1203.  * "response" is int *
  1204.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1205.  *
  1206.  * Valid errors:
  1207.  *
  1208.  *  SUCCESS
  1209.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1210.  *  GENERIC_FAILURE
  1211.  *  PASSWORD_INCORRECT
  1212.  *     (PUK2 is invalid)
  1213.  */
  1214.  
  1215. #define RIL_REQUEST_ENTER_SIM_PUK2 5
  1216.  
  1217. /**
  1218.  * RIL_REQUEST_CHANGE_SIM_PIN
  1219.  *
  1220.  * Supplies old SIM PIN and new PIN.
  1221.  *
  1222.  * "data" is const char **
  1223.  * ((const char **)data)[0] is old PIN value
  1224.  * ((const char **)data)[1] is new PIN value
  1225.  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1226.  *
  1227.  * "response" is int *
  1228.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1229.  *
  1230.  * Valid errors:
  1231.  *
  1232.  *  SUCCESS
  1233.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1234.  *  GENERIC_FAILURE
  1235.  *  PASSWORD_INCORRECT
  1236.  *     (old PIN is invalid)
  1237.  *
  1238.  */
  1239.  
  1240. #define RIL_REQUEST_CHANGE_SIM_PIN 6
  1241.  
  1242.  
  1243. /**
  1244.  * RIL_REQUEST_CHANGE_SIM_PIN2
  1245.  *
  1246.  * Supplies old SIM PIN2 and new PIN2.
  1247.  *
  1248.  * "data" is const char **
  1249.  * ((const char **)data)[0] is old PIN2 value
  1250.  * ((const char **)data)[1] is new PIN2 value
  1251.  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1252.  *
  1253.  * "response" is int *
  1254.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1255.  *
  1256.  * Valid errors:
  1257.  *
  1258.  *  SUCCESS
  1259.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1260.  *  GENERIC_FAILURE
  1261.  *  PASSWORD_INCORRECT
  1262.  *     (old PIN2 is invalid)
  1263.  *
  1264.  */
  1265.  
  1266. #define RIL_REQUEST_CHANGE_SIM_PIN2 7
  1267.  
  1268. /**
  1269.  * RIL_REQUEST_ENTER_DEPERSONALIZATION_CODE
  1270.  *
  1271.  * Requests that personlization be deactivated
  1272.  *
  1273.  * "data" is const char **
  1274.  * ((const char **)(data))[0]] is personlization type
  1275.  * ((const char **)(data))[1]] is depersonlization code
  1276.  *
  1277.  * "response" is int *
  1278.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  1279.  *
  1280.  * Valid errors:
  1281.  *
  1282.  *  SUCCESS
  1283.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1284.  *  GENERIC_FAILURE
  1285.  *  PASSWORD_INCORRECT
  1286.  *     (code is invalid)
  1287.  */
  1288.  
  1289. #define RIL_REQUEST_ENTER_DEPERSONALIZATION_CODE 8
  1290.  
  1291. /**
  1292.  * RIL_REQUEST_GET_CURRENT_CALLS
  1293.  *
  1294.  * Requests current call list
  1295.  *
  1296.  * "data" is NULL
  1297.  *
  1298.  * "response" must be a "const RIL_Call **"
  1299.  *
  1300.  * Valid errors:
  1301.  *
  1302.  *  SUCCESS
  1303.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1304.  *  GENERIC_FAILURE
  1305.  *      (request will be made again in a few hundred msec)
  1306.  */
  1307.  
  1308. #define RIL_REQUEST_GET_CURRENT_CALLS 9
  1309.  
  1310.  
  1311. /**
  1312.  * RIL_REQUEST_DIAL
  1313.  *
  1314.  * Initiate voice call
  1315.  *
  1316.  * "data" is const RIL_Dial *
  1317.  * "response" is NULL
  1318.  *
  1319.  * This method is never used for supplementary service codes
  1320.  *
  1321.  * Valid errors:
  1322.  *  SUCCESS
  1323.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1324.  *  DIAL_MODIFIED_TO_USSD
  1325.  *  DIAL_MODIFIED_TO_SS
  1326.  *  DIAL_MODIFIED_TO_DIAL
  1327.  *  GENERIC_FAILURE
  1328.  */
  1329. #define RIL_REQUEST_DIAL 10
  1330.  
  1331. /**
  1332.  * RIL_REQUEST_GET_IMSI
  1333.  *
  1334.  * Get the SIM IMSI
  1335.  *
  1336.  * Only valid when radio state is "RADIO_STATE_ON"
  1337.  *
  1338.  * "data" is const char **
  1339.  * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  1340.  * "response" is a const char * containing the IMSI
  1341.  *
  1342.  * Valid errors:
  1343.  *  SUCCESS
  1344.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1345.  *  GENERIC_FAILURE
  1346.  */
  1347.  
  1348. #define RIL_REQUEST_GET_IMSI 11
  1349.  
  1350. /**
  1351.  * RIL_REQUEST_HANGUP
  1352.  *
  1353.  * Hang up a specific line (like AT+CHLD=1x)
  1354.  *
  1355.  * After this HANGUP request returns, RIL should show the connection is NOT
  1356.  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
  1357.  *
  1358.  * "data" is an int *
  1359.  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
  1360.  *
  1361.  * "response" is NULL
  1362.  *
  1363.  * Valid errors:
  1364.  *  SUCCESS
  1365.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1366.  *  GENERIC_FAILURE
  1367.  */
  1368.  
  1369. #define RIL_REQUEST_HANGUP 12
  1370.  
  1371. /**
  1372.  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
  1373.  *
  1374.  * Hang up waiting or held (like AT+CHLD=0)
  1375.  *
  1376.  * After this HANGUP request returns, RIL should show the connection is NOT
  1377.  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
  1378.  *
  1379.  * "data" is NULL
  1380.  * "response" is NULL
  1381.  *
  1382.  * Valid errors:
  1383.  *  SUCCESS
  1384.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1385.  *  GENERIC_FAILURE
  1386.  */
  1387.  
  1388. #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
  1389.  
  1390. /**
  1391.  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
  1392.  *
  1393.  * Hang up waiting or held (like AT+CHLD=1)
  1394.  *
  1395.  * After this HANGUP request returns, RIL should show the connection is NOT
  1396.  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
  1397.  *
  1398.  * "data" is NULL
  1399.  * "response" is NULL
  1400.  *
  1401.  * Valid errors:
  1402.  *  SUCCESS
  1403.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1404.  *  GENERIC_FAILURE
  1405.  */
  1406.  
  1407. #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
  1408.  
  1409. /**
  1410.  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
  1411.  *
  1412.  * Switch waiting or holding call and active call (like AT+CHLD=2)
  1413.  *
  1414.  * State transitions should be is follows:
  1415.  *
  1416.  * If call 1 is waiting and call 2 is active, then if this re
  1417.  *
  1418.  *   BEFORE                               AFTER
  1419.  * Call 1   Call 2                 Call 1       Call 2
  1420.  * ACTIVE   HOLDING                HOLDING     ACTIVE
  1421.  * ACTIVE   WAITING                HOLDING     ACTIVE
  1422.  * HOLDING  WAITING                HOLDING     ACTIVE
  1423.  * ACTIVE   IDLE                   HOLDING     IDLE
  1424.  * IDLE     IDLE                   IDLE        IDLE
  1425.  *
  1426.  * "data" is NULL
  1427.  * "response" is NULL
  1428.  *
  1429.  * Valid errors:
  1430.  *  SUCCESS
  1431.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1432.  *  GENERIC_FAILURE
  1433.  */
  1434.  
  1435. #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
  1436. #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
  1437.  
  1438. /**
  1439.  * RIL_REQUEST_CONFERENCE
  1440.  *
  1441.  * Conference holding and active (like AT+CHLD=3)
  1442.  
  1443.  * "data" is NULL
  1444.  * "response" is NULL
  1445.  *
  1446.  * Valid errors:
  1447.  *  SUCCESS
  1448.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1449.  *  GENERIC_FAILURE
  1450.  */
  1451. #define RIL_REQUEST_CONFERENCE 16
  1452.  
  1453. /**
  1454.  * RIL_REQUEST_UDUB
  1455.  *
  1456.  * Send UDUB (user determined used busy) to ringing or
  1457.  * waiting call answer)(RIL_BasicRequest r);
  1458.  *
  1459.  * "data" is NULL
  1460.  * "response" is NULL
  1461.  *
  1462.  * Valid errors:
  1463.  *  SUCCESS
  1464.  *  RADIO_NOT_AVAILABLE (radio resetting)
  1465.  *  GENERIC_FAILURE
  1466.  */
  1467. #define RIL_REQUEST_UDUB 17
  1468.  
  1469. /**
  1470.  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
  1471.  *
  1472.  * Requests the failure cause code for the most recently terminated call
  1473.  *
  1474.  * "data" is NULL
  1475.  * "response" is a "int *"
  1476.  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
  1477.  * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
  1478.  * failure reasons are derived from the possible call failure scenarios
  1479.  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
  1480.  *
  1481.  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
  1482.  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
  1483.  *
  1484.  * If the implementation does not have access to the exact cause codes,
  1485.  * then it should return one of the values listed in RIL_LastCallFailCause,
  1486.  * as the UI layer needs to distinguish these cases for tone generation or
  1487.  * error notification.
  1488.  *
  1489.  * Valid errors:
  1490.  *  SUCCESS
  1491.  *  RADIO_NOT_AVAILABLE
  1492.  *  GENERIC_FAILURE
  1493.  *
  1494.  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
  1495.  */
  1496. #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
  1497.  
  1498. /**
  1499.  * RIL_REQUEST_SIGNAL_STRENGTH
  1500.  *
  1501.  * Requests current signal strength and associated information
  1502.  *
  1503.  * Must succeed if radio is on.
  1504.  *
  1505.  * "data" is NULL
  1506.  *
  1507.  * "response" is a const RIL_SignalStrength *
  1508.  *
  1509.  * Valid errors:
  1510.  *  SUCCESS
  1511.  *  RADIO_NOT_AVAILABLE
  1512.  */
  1513. #define RIL_REQUEST_SIGNAL_STRENGTH 19
  1514.  
  1515. /**
  1516.  * RIL_REQUEST_VOICE_REGISTRATION_STATE
  1517.  *
  1518.  * Request current registration state
  1519.  *
  1520.  * "data" is NULL
  1521.  * "response" is a "char **"
  1522.  * ((const char **)response)[0] is registration state 0-6,
  1523.  *              0 - Not registered, MT is not currently searching
  1524.  *                  a new operator to register
  1525.  *              1 - Registered, home network
  1526.  *              2 - Not registered, but MT is currently searching
  1527.  *                  a new operator to register
  1528.  *              3 - Registration denied
  1529.  *              4 - Unknown
  1530.  *              5 - Registered, roaming
  1531.  *             10 - Same as 0, but indicates that emergency calls
  1532.  *                  are enabled.
  1533.  *             12 - Same as 2, but indicates that emergency calls
  1534.  *                  are enabled.
  1535.  *             13 - Same as 3, but indicates that emergency calls
  1536.  *                  are enabled.
  1537.  *             14 - Same as 4, but indicates that emergency calls
  1538.  *                  are enabled.
  1539.  *
  1540.  * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
  1541.  *                              NULL if not.Valid LAC are 0x0000 - 0xffff
  1542.  * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
  1543.  *                              NULL if not.
  1544.  *                                 Valid CID are 0x00000000 - 0xffffffff
  1545.  *                                    In GSM, CID is Cell ID (see TS 27.007)
  1546.  *                                            in 16 bits
  1547.  *                                    In UMTS, CID is UMTS Cell Identity
  1548.  *                                             (see TS 25.331) in 28 bits
  1549.  * ((const char **)response)[3] indicates the available voice radio technology,
  1550.  *                              valid values as defined by RIL_RadioTechnology.
  1551.  * ((const char **)response)[4] is Base Station ID if registered on a CDMA
  1552.  *                              system or NULL if not.  Base Station ID in
  1553.  *                              decimal format
  1554.  * ((const char **)response)[5] is Base Station latitude if registered on a
  1555.  *                              CDMA system or NULL if not. Base Station
  1556.  *                              latitude is a decimal number as specified in
  1557.  *                              3GPP2 C.S0005-A v6.0. It is represented in
  1558.  *                              units of 0.25 seconds and ranges from -1296000
  1559.  *                              to 1296000, both values inclusive (corresponding
  1560.  *                              to a range of -90 to +90 degrees).
  1561.  * ((const char **)response)[6] is Base Station longitude if registered on a
  1562.  *                              CDMA system or NULL if not. Base Station
  1563.  *                              longitude is a decimal number as specified in
  1564.  *                              3GPP2 C.S0005-A v6.0. It is represented in
  1565.  *                              units of 0.25 seconds and ranges from -2592000
  1566.  *                              to 2592000, both values inclusive (corresponding
  1567.  *                              to a range of -180 to +180 degrees).
  1568.  * ((const char **)response)[7] is concurrent services support indicator if
  1569.  *                              registered on a CDMA system 0-1.
  1570.  *                                   0 - Concurrent services not supported,
  1571.  *                                   1 - Concurrent services supported
  1572.  * ((const char **)response)[8] is System ID if registered on a CDMA system or
  1573.  *                              NULL if not. Valid System ID are 0 - 32767
  1574.  * ((const char **)response)[9] is Network ID if registered on a CDMA system or
  1575.  *                              NULL if not. Valid System ID are 0 - 65535
  1576.  * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
  1577.  *                               on a CDMA or EVDO system or NULL if not. Valid values
  1578.  *                               are 0-255.
  1579.  * ((const char **)response)[11] indicates whether the current system is in the
  1580.  *                               PRL if registered on a CDMA or EVDO system or NULL if
  1581.  *                               not. 0=not in the PRL, 1=in the PRL
  1582.  * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
  1583.  *                               if registered on a CDMA or EVDO system or NULL if not.
  1584.  *                               Valid values are 0-255.
  1585.  * ((const char **)response)[13] if registration state is 3 (Registration
  1586.  *                               denied) this is an enumerated reason why
  1587.  *                               registration was denied.  See 3GPP TS 24.008,
  1588.  *                               10.5.3.6 and Annex G.
  1589.  *                                 0 - General
  1590.  *                                 1 - Authentication Failure
  1591.  *                                 2 - IMSI unknown in HLR
  1592.  *                                 3 - Illegal MS
  1593.  *                                 4 - Illegal ME
  1594.  *                                 5 - PLMN not allowed
  1595.  *                                 6 - Location area not allowed
  1596.  *                                 7 - Roaming not allowed
  1597.  *                                 8 - No Suitable Cells in this Location Area
  1598.  *                                 9 - Network failure
  1599.  *                                10 - Persistent location update reject
  1600.  *                                11 - PLMN not allowed
  1601.  *                                12 - Location area not allowed
  1602.  *                                13 - Roaming not allowed in this Location Area
  1603.  *                                15 - No Suitable Cells in this Location Area
  1604.  *                                17 - Network Failure
  1605.  *                                20 - MAC Failure
  1606.  *                                21 - Sync Failure
  1607.  *                                22 - Congestion
  1608.  *                                23 - GSM Authentication unacceptable
  1609.  *                                25 - Not Authorized for this CSG
  1610.  *                                32 - Service option not supported
  1611.  *                                33 - Requested service option not subscribed
  1612.  *                                34 - Service option temporarily out of order
  1613.  *                                38 - Call cannot be identified
  1614.  *                                48-63 - Retry upon entry into a new cell
  1615.  *                                95 - Semantically incorrect message
  1616.  *                                96 - Invalid mandatory information
  1617.  *                                97 - Message type non-existent or not implemented
  1618.  *                                98 - Message not compatible with protocol state
  1619.  *                                99 - Information element non-existent or not implemented
  1620.  *                               100 - Conditional IE error
  1621.  *                               101 - Message not compatible with protocol state
  1622.  *                               111 - Protocol error, unspecified
  1623.  * ((const char **)response)[14] is the Primary Scrambling Code of the current
  1624.  *                               cell as described in TS 25.331, in hexadecimal
  1625.  *                               format, or NULL if unknown or not registered
  1626.  *                               to a UMTS network.
  1627.  *
  1628.  * Please note that registration state 4 ("unknown") is treated
  1629.  * as "out of service" in the Android telephony system
  1630.  *
  1631.  * Registration state 3 can be returned if Location Update Reject
  1632.  * (with cause 17 - Network Failure) is received repeatedly from the network,
  1633.  * to facilitate "managed roaming"
  1634.  *
  1635.  * Valid errors:
  1636.  *  SUCCESS
  1637.  *  RADIO_NOT_AVAILABLE
  1638.  *  GENERIC_FAILURE
  1639.  */
  1640. #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
  1641.  
  1642. /**
  1643.  * RIL_REQUEST_DATA_REGISTRATION_STATE
  1644.  *
  1645.  * Request current DATA registration state
  1646.  *
  1647.  * "data" is NULL
  1648.  * "response" is a "char **"
  1649.  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
  1650.  * ((const char **)response)[1] is LAC if registered or NULL if not
  1651.  * ((const char **)response)[2] is CID if registered or NULL if not
  1652.  * ((const char **)response)[3] indicates the available data radio technology,
  1653.  *                              valid values as defined by RIL_RadioTechnology.
  1654.  * ((const char **)response)[4] if registration state is 3 (Registration
  1655.  *                               denied) this is an enumerated reason why
  1656.  *                               registration was denied.  See 3GPP TS 24.008,
  1657.  *                               Annex G.6 "Additonal cause codes for GMM".
  1658.  *      7 == GPRS services not allowed
  1659.  *      8 == GPRS services and non-GPRS services not allowed
  1660.  *      9 == MS identity cannot be derived by the network
  1661.  *      10 == Implicitly detached
  1662.  *      14 == GPRS services not allowed in this PLMN
  1663.  *      16 == MSC temporarily not reachable
  1664.  *      40 == No PDP context activated
  1665.  * ((const char **)response)[5] The maximum number of simultaneous Data Calls that can be
  1666.  *                              established using RIL_REQUEST_SETUP_DATA_CALL.
  1667.  *
  1668.  * The values at offsets 6..10 are optional LTE location information in decimal.
  1669.  * If a value is unknown that value may be NULL. If all values are NULL,
  1670.  * none need to be present.
  1671.  *  ((const char **)response)[6] is TAC, a 16-bit Tracking Area Code.
  1672.  *  ((const char **)response)[7] is CID, a 0-503 Physical Cell Identifier.
  1673.  *  ((const char **)response)[8] is ECI, a 28-bit E-UTRAN Cell Identifier.
  1674.  *  ((const char **)response)[9] is CSGID, a 27-bit Closed Subscriber Group Identity.
  1675.  *  ((const char **)response)[10] is TADV, a 6-bit timing advance value.
  1676.  *
  1677.  * LAC and CID are in hexadecimal format.
  1678.  * valid LAC are 0x0000 - 0xffff
  1679.  * valid CID are 0x00000000 - 0x0fffffff
  1680.  *
  1681.  * Please note that registration state 4 ("unknown") is treated
  1682.  * as "out of service" in the Android telephony system
  1683.  *
  1684.  * Valid errors:
  1685.  *  SUCCESS
  1686.  *  RADIO_NOT_AVAILABLE
  1687.  *  GENERIC_FAILURE
  1688.  */
  1689. #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
  1690.  
  1691. /**
  1692.  * RIL_REQUEST_OPERATOR
  1693.  *
  1694.  * Request current operator ONS or EONS
  1695.  *
  1696.  * "data" is NULL
  1697.  * "response" is a "const char **"
  1698.  * ((const char **)response)[0] is long alpha ONS or EONS
  1699.  *                                  or NULL if unregistered
  1700.  *
  1701.  * ((const char **)response)[1] is short alpha ONS or EONS
  1702.  *                                  or NULL if unregistered
  1703.  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
  1704.  *                                  or NULL if unregistered
  1705.  *
  1706.  * Valid errors:
  1707.  *  SUCCESS
  1708.  *  RADIO_NOT_AVAILABLE
  1709.  *  GENERIC_FAILURE
  1710.  */
  1711. #define RIL_REQUEST_OPERATOR 22
  1712.  
  1713. /**
  1714.  * RIL_REQUEST_RADIO_POWER
  1715.  *
  1716.  * Toggle radio on and off (for "airplane" mode)
  1717.  * If the radio is is turned off/on the radio modem subsystem
  1718.  * is expected return to an initialized state. For instance,
  1719.  * any voice and data calls will be terminated and all associated
  1720.  * lists emptied.
  1721.  *
  1722.  * "data" is int *
  1723.  * ((int *)data)[0] is > 0 for "Radio On"
  1724.  * ((int *)data)[0] is == 0 for "Radio Off"
  1725.  *
  1726.  * "response" is NULL
  1727.  *
  1728.  * Turn radio on if "on" > 0
  1729.  * Turn radio off if "on" == 0
  1730.  *
  1731.  * Valid errors:
  1732.  *  SUCCESS
  1733.  *  RADIO_NOT_AVAILABLE
  1734.  *  GENERIC_FAILURE
  1735.  */
  1736. #define RIL_REQUEST_RADIO_POWER 23
  1737.  
  1738. /**
  1739.  * RIL_REQUEST_DTMF
  1740.  *
  1741.  * Send a DTMF tone
  1742.  *
  1743.  * If the implementation is currently playing a tone requested via
  1744.  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
  1745.  * should be played instead
  1746.  *
  1747.  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
  1748.  * "response" is NULL
  1749.  *
  1750.  * FIXME should this block/mute microphone?
  1751.  * How does this interact with local DTMF feedback?
  1752.  *
  1753.  * Valid errors:
  1754.  *  SUCCESS
  1755.  *  RADIO_NOT_AVAILABLE
  1756.  *  GENERIC_FAILURE
  1757.  *
  1758.  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
  1759.  *
  1760.  */
  1761. #define RIL_REQUEST_DTMF 24
  1762.  
  1763. /**
  1764.  * RIL_REQUEST_SEND_SMS
  1765.  *
  1766.  * Send an SMS message
  1767.  *
  1768.  * "data" is const char **
  1769.  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
  1770.  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
  1771.  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
  1772.  *      less the SMSC address
  1773.  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
  1774.  *
  1775.  * "response" is a const RIL_SMS_Response *
  1776.  *
  1777.  * Based on the return error, caller decides to resend if sending sms
  1778.  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
  1779.  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
  1780.  *
  1781.  * Valid errors:
  1782.  *  SUCCESS
  1783.  *  RADIO_NOT_AVAILABLE
  1784.  *  SMS_SEND_FAIL_RETRY
  1785.  *  FDN_CHECK_FAILURE
  1786.  *  GENERIC_FAILURE
  1787.  *
  1788.  * FIXME how do we specify TP-Message-Reference if we need to resend?
  1789.  */
  1790. #define RIL_REQUEST_SEND_SMS 25
  1791.  
  1792.  
  1793. /**
  1794.  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
  1795.  *
  1796.  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
  1797.  * except that more messages are expected to be sent soon. If possible,
  1798.  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
  1799.  *
  1800.  * "data" is const char **
  1801.  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
  1802.  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
  1803.  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
  1804.  *      less the SMSC address
  1805.  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
  1806.  *
  1807.  * "response" is a const RIL_SMS_Response *
  1808.  *
  1809.  * Based on the return error, caller decides to resend if sending sms
  1810.  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
  1811.  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
  1812.  *
  1813.  * Valid errors:
  1814.  *  SUCCESS
  1815.  *  RADIO_NOT_AVAILABLE
  1816.  *  SMS_SEND_FAIL_RETRY
  1817.  *  GENERIC_FAILURE
  1818.  *
  1819.  */
  1820. #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
  1821.  
  1822.  
  1823. /**
  1824.  * RIL_REQUEST_SETUP_DATA_CALL
  1825.  *
  1826.  * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
  1827.  * return success it is added to the list of data calls and a
  1828.  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
  1829.  * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
  1830.  * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
  1831.  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
  1832.  *
  1833.  * The RIL is expected to:
  1834.  *  - Create one data call context.
  1835.  *  - Create and configure a dedicated interface for the context
  1836.  *  - The interface must be point to point.
  1837.  *  - The interface is configured with one or more addresses and
  1838.  *    is capable of sending and receiving packets. The prefix length
  1839.  *    of the addresses must be /32 for IPv4 and /128 for IPv6.
  1840.  *  - Must NOT change the linux routing table.
  1841.  *  - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
  1842.  *    number of simultaneous data call contexts.
  1843.  *
  1844.  * "data" is a const char **
  1845.  * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
  1846.  *                          for values above 2 this is RIL_RadioTechnology + 2.
  1847.  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
  1848.  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
  1849.  *                          override the one in the profile. NULL indicates no APN overrride.
  1850.  * ((const char **)data)[3] is the username for APN, or NULL
  1851.  * ((const char **)data)[4] is the password for APN, or NULL
  1852.  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
  1853.  *                          0 => PAP and CHAP is never performed.
  1854.  *                          1 => PAP may be performed; CHAP is never performed.
  1855.  *                          2 => CHAP may be performed; PAP is never performed.
  1856.  *                          3 => PAP / CHAP may be performed - baseband dependent.
  1857.  * ((const char **)data)[6] is the connection type to request must be one of the
  1858.  *                          PDP_type values in TS 27.007 section 10.1.1.
  1859.  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
  1860.  * ((const char **)data)[7] Optional connection property parameters, format to be defined.
  1861.  *
  1862.  * "response" is a RIL_Data_Call_Response_v6
  1863.  *
  1864.  * FIXME may need way to configure QoS settings
  1865.  *
  1866.  * Valid errors:
  1867.  *  SUCCESS should be returned on both success and failure of setup with
  1868.  *  the RIL_Data_Call_Response_v6.status containing the actual status.
  1869.  *  For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
  1870.  *
  1871.  *  Other errors could include:
  1872.  *    RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
  1873.  *    OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED.
  1874.  *
  1875.  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
  1876.  */
  1877. #define RIL_REQUEST_SETUP_DATA_CALL 27
  1878.  
  1879.  
  1880. /**
  1881.  * RIL_REQUEST_SIM_IO
  1882.  *
  1883.  * Request SIM I/O operation.
  1884.  * This is similar to the TS 27.007 "restricted SIM" operation
  1885.  * where it assumes all of the EF selection will be done by the
  1886.  * callee.
  1887.  *
  1888.  * "data" is a const RIL_SIM_IO_v6 *
  1889.  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
  1890.  * or may specify a PIN2 for operations that require a PIN2 (eg
  1891.  * updating FDN records)
  1892.  *
  1893.  * "response" is a const RIL_SIM_IO_Response *
  1894.  *
  1895.  * Arguments and responses that are unused for certain
  1896.  * values of "command" should be ignored or set to NULL
  1897.  *
  1898.  * Valid errors:
  1899.  *  SUCCESS
  1900.  *  RADIO_NOT_AVAILABLE
  1901.  *  GENERIC_FAILURE
  1902.  *  SIM_PIN2
  1903.  *  SIM_PUK2
  1904.  */
  1905. #define RIL_REQUEST_SIM_IO 28
  1906.  
  1907. /**
  1908.  * RIL_REQUEST_SEND_USSD
  1909.  *
  1910.  * Send a USSD message
  1911.  *
  1912.  * If a USSD session already exists, the message should be sent in the
  1913.  * context of that session. Otherwise, a new session should be created.
  1914.  *
  1915.  * The network reply should be reported via RIL_UNSOL_ON_USSD
  1916.  *
  1917.  * Only one USSD session may exist at a time, and the session is assumed
  1918.  * to exist until:
  1919.  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
  1920.  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
  1921.  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
  1922.  *
  1923.  * "data" is a const char * containing the USSD request in UTF-8 format
  1924.  * "response" is NULL
  1925.  *
  1926.  * Valid errors:
  1927.  *  SUCCESS
  1928.  *  RADIO_NOT_AVAILABLE
  1929.  *  FDN_CHECK_FAILURE
  1930.  *  USSD_MODIFIED_TO_DIAL
  1931.  *  USSD_MODIFIED_TO_SS
  1932.  *  USSD_MODIFIED_TO_USSD
  1933.  *  GENERIC_FAILURE
  1934.  *
  1935.  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
  1936.  */
  1937.  
  1938. #define RIL_REQUEST_SEND_USSD 29
  1939.  
  1940. /**
  1941.  * RIL_REQUEST_CANCEL_USSD
  1942.  *
  1943.  * Cancel the current USSD session if one exists
  1944.  *
  1945.  * "data" is null
  1946.  * "response" is NULL
  1947.  *
  1948.  * Valid errors:
  1949.  *  SUCCESS
  1950.  *  RADIO_NOT_AVAILABLE
  1951.  *  GENERIC_FAILURE
  1952.  */
  1953.  
  1954. #define RIL_REQUEST_CANCEL_USSD 30
  1955.  
  1956. /**
  1957.  * RIL_REQUEST_GET_CLIR
  1958.  *
  1959.  * Gets current CLIR status
  1960.  * "data" is NULL
  1961.  * "response" is int *
  1962.  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
  1963.  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
  1964.  *
  1965.  * Valid errors:
  1966.  *  SUCCESS
  1967.  *  RADIO_NOT_AVAILABLE
  1968.  *  SS_MODIFIED_TO_DIAL
  1969.  *  SS_MODIFIED_TO_USSD
  1970.  *  SS_MODIFIED_TO_SS
  1971.  *  GENERIC_FAILURE
  1972.  */
  1973. #define RIL_REQUEST_GET_CLIR 31
  1974.  
  1975. /**
  1976.  * RIL_REQUEST_SET_CLIR
  1977.  *
  1978.  * "data" is int *
  1979.  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
  1980.  *
  1981.  * "response" is NULL
  1982.  *
  1983.  * Valid errors:
  1984.  *  SUCCESS
  1985.  *  RADIO_NOT_AVAILABLE
  1986.  *  SS_MODIFIED_TO_DIAL
  1987.  *  SS_MODIFIED_TO_USSD
  1988.  *  SS_MODIFIED_TO_SS
  1989.  *  GENERIC_FAILURE
  1990.  */
  1991. #define RIL_REQUEST_SET_CLIR 32
  1992.  
  1993. /**
  1994.  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
  1995.  *
  1996.  * "data" is const RIL_CallForwardInfo *
  1997.  *
  1998.  * "response" is const RIL_CallForwardInfo **
  1999.  * "response" points to an array of RIL_CallForwardInfo *'s, one for
  2000.  * each distinct registered phone number.
  2001.  *
  2002.  * For example, if data is forwarded to +18005551212 and voice is forwarded
  2003.  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
  2004.  *
  2005.  * If, however, both data and voice are forwarded to +18005551212, then
  2006.  * a single RIL_CallForwardInfo can be returned with the service class
  2007.  * set to "data + voice = 3")
  2008.  *
  2009.  * Valid errors:
  2010.  *  SUCCESS
  2011.  *  RADIO_NOT_AVAILABLE
  2012.  *  SS_MODIFIED_TO_DIAL
  2013.  *  SS_MODIFIED_TO_USSD
  2014.  *  SS_MODIFIED_TO_SS
  2015.  *  GENERIC_FAILURE
  2016.  */
  2017. #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
  2018.  
  2019.  
  2020. /**
  2021.  * RIL_REQUEST_SET_CALL_FORWARD
  2022.  *
  2023.  * Configure call forward rule
  2024.  *
  2025.  * "data" is const RIL_CallForwardInfo *
  2026.  * "response" is NULL
  2027.  *
  2028.  * Valid errors:
  2029.  *  SUCCESS
  2030.  *  RADIO_NOT_AVAILABLE
  2031.  *  SS_MODIFIED_TO_DIAL
  2032.  *  SS_MODIFIED_TO_USSD
  2033.  *  SS_MODIFIED_TO_SS
  2034.  *  GENERIC_FAILURE
  2035.  */
  2036. #define RIL_REQUEST_SET_CALL_FORWARD 34
  2037.  
  2038.  
  2039. /**
  2040.  * RIL_REQUEST_QUERY_CALL_WAITING
  2041.  *
  2042.  * Query current call waiting state
  2043.  *
  2044.  * "data" is const int *
  2045.  * ((const int *)data)[0] is the TS 27.007 service class to query.
  2046.  * "response" is a const int *
  2047.  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
  2048.  *
  2049.  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
  2050.  * must follow, with the TS 27.007 service class bit vector of services
  2051.  * for which call waiting is enabled.
  2052.  *
  2053.  * For example, if ((const int *)response)[0]  is 1 and
  2054.  * ((const int *)response)[1] is 3, then call waiting is enabled for data
  2055.  * and voice and disabled for everything else
  2056.  *
  2057.  * Valid errors:
  2058.  *  SUCCESS
  2059.  *  RADIO_NOT_AVAILABLE
  2060.  *  SS_MODIFIED_TO_DIAL
  2061.  *  SS_MODIFIED_TO_USSD
  2062.  *  SS_MODIFIED_TO_SS
  2063.  *  GENERIC_FAILURE
  2064.  */
  2065. #define RIL_REQUEST_QUERY_CALL_WAITING 35
  2066.  
  2067.  
  2068. /**
  2069.  * RIL_REQUEST_SET_CALL_WAITING
  2070.  *
  2071.  * Configure current call waiting state
  2072.  *
  2073.  * "data" is const int *
  2074.  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
  2075.  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
  2076.  *                           services to modify
  2077.  * "response" is NULL
  2078.  *
  2079.  * Valid errors:
  2080.  *  SUCCESS
  2081.  *  RADIO_NOT_AVAILABLE
  2082.  *  SS_MODIFIED_TO_DIAL
  2083.  *  SS_MODIFIED_TO_USSD
  2084.  *  SS_MODIFIED_TO_SS
  2085.  *  GENERIC_FAILURE
  2086.  */
  2087. #define RIL_REQUEST_SET_CALL_WAITING 36
  2088.  
  2089. /**
  2090.  * RIL_REQUEST_SMS_ACKNOWLEDGE
  2091.  *
  2092.  * Acknowledge successful or failed receipt of SMS previously indicated
  2093.  * via RIL_UNSOL_RESPONSE_NEW_SMS
  2094.  *
  2095.  * "data" is int *
  2096.  * ((int *)data)[0] is 1 on successful receipt
  2097.  *                  (basically, AT+CNMA=1 from TS 27.005
  2098.  *                  is 0 on failed receipt
  2099.  *                  (basically, AT+CNMA=2 from TS 27.005)
  2100.  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
  2101.  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
  2102.  *                  capacity exceeded) and 0xFF (unspecified error) are
  2103.  *                  reported.
  2104.  *
  2105.  * "response" is NULL
  2106.  *
  2107.  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
  2108.  *
  2109.  * Valid errors:
  2110.  *  SUCCESS
  2111.  *  RADIO_NOT_AVAILABLE
  2112.  *  GENERIC_FAILURE
  2113.  */
  2114. #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
  2115.  
  2116. /**
  2117.  * RIL_REQUEST_GET_IMEI - DEPRECATED
  2118.  *
  2119.  * Get the device IMEI, including check digit
  2120.  *
  2121.  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
  2122.  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
  2123.  *
  2124.  * "data" is NULL
  2125.  * "response" is a const char * containing the IMEI
  2126.  *
  2127.  * Valid errors:
  2128.  *  SUCCESS
  2129.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2130.  *  GENERIC_FAILURE
  2131.  */
  2132.  
  2133. #define RIL_REQUEST_GET_IMEI 38
  2134.  
  2135. /**
  2136.  * RIL_REQUEST_GET_IMEISV - DEPRECATED
  2137.  *
  2138.  * Get the device IMEISV, which should be two decimal digits
  2139.  *
  2140.  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
  2141.  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
  2142.  *
  2143.  * "data" is NULL
  2144.  * "response" is a const char * containing the IMEISV
  2145.  *
  2146.  * Valid errors:
  2147.  *  SUCCESS
  2148.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2149.  *  GENERIC_FAILURE
  2150.  */
  2151.  
  2152. #define RIL_REQUEST_GET_IMEISV 39
  2153.  
  2154.  
  2155. /**
  2156.  * RIL_REQUEST_ANSWER
  2157.  *
  2158.  * Answer incoming call
  2159.  *
  2160.  * Will not be called for WAITING calls.
  2161.  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
  2162.  * instead
  2163.  *
  2164.  * "data" is NULL
  2165.  * "response" is NULL
  2166.  *
  2167.  * Valid errors:
  2168.  *  SUCCESS
  2169.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2170.  *  GENERIC_FAILURE
  2171.  */
  2172.  
  2173. #define RIL_REQUEST_ANSWER 40
  2174.  
  2175. /**
  2176.  * RIL_REQUEST_DEACTIVATE_DATA_CALL
  2177.  *
  2178.  * Deactivate packet data connection and remove from the
  2179.  * data call list if SUCCESS is returned. Any other return
  2180.  * values should also try to remove the call from the list,
  2181.  * but that may not be possible. In any event a
  2182.  * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
  2183.  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
  2184.  * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
  2185.  *
  2186.  * "data" is const char **
  2187.  * ((char**)data)[0] indicating CID
  2188.  * ((char**)data)[1] indicating Disconnect Reason
  2189.  *                   0 => No specific reason specified
  2190.  *                   1 => Radio shutdown requested
  2191.  *
  2192.  * "response" is NULL
  2193.  *
  2194.  * Valid errors:
  2195.  *  SUCCESS
  2196.  *  RADIO_NOT_AVAILABLE
  2197.  *  GENERIC_FAILURE
  2198.  *
  2199.  * See also: RIL_REQUEST_SETUP_DATA_CALL
  2200.  */
  2201. #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
  2202.  
  2203. /**
  2204.  * RIL_REQUEST_QUERY_FACILITY_LOCK
  2205.  *
  2206.  * Query the status of a facility lock state
  2207.  *
  2208.  * "data" is const char **
  2209.  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
  2210.  *                      (eg "AO" for BAOC, "SC" for SIM lock)
  2211.  * ((const char **)data)[1] is the password, or "" if not required
  2212.  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
  2213.  *                           services to query
  2214.  * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  2215.  *                            This is only applicable in the case of Fixed Dialing Numbers
  2216.  *                            (FDN) requests.
  2217.  *
  2218.  * "response" is an int *
  2219.  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
  2220.  *                           services for which the specified barring facility
  2221.  *                           is active. "0" means "disabled for all"
  2222.  *
  2223.  *
  2224.  * Valid errors:
  2225.  *  SUCCESS
  2226.  *  RADIO_NOT_AVAILABLE
  2227.  *  SS_MODIFIED_TO_DIAL
  2228.  *  SS_MODIFIED_TO_USSD
  2229.  *  SS_MODIFIED_TO_SS
  2230.  *  GENERIC_FAILURE
  2231.  *
  2232.  */
  2233. #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
  2234.  
  2235. /**
  2236.  * RIL_REQUEST_SET_FACILITY_LOCK
  2237.  *
  2238.  * Enable/disable one facility lock
  2239.  *
  2240.  * "data" is const char **
  2241.  *
  2242.  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
  2243.  * (eg "AO" for BAOC)
  2244.  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
  2245.  * ((const char **)data)[2] = password
  2246.  * ((const char **)data)[3] = string representation of decimal TS 27.007
  2247.  *                            service class bit vector. Eg, the string
  2248.  *                            "1" means "set this facility for voice services"
  2249.  * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
  2250.  *                            This is only applicable in the case of Fixed Dialing Numbers
  2251.  *                            (FDN) requests.
  2252.  *
  2253.  * "response" is int *
  2254.  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
  2255.  *
  2256.  * Valid errors:
  2257.  *  SUCCESS
  2258.  *  RADIO_NOT_AVAILABLE
  2259.  *  SS_MODIFIED_TO_DIAL
  2260.  *  SS_MODIFIED_TO_USSD
  2261.  *  SS_MODIFIED_TO_SS
  2262.  *  GENERIC_FAILURE
  2263.  *
  2264.  */
  2265. #define RIL_REQUEST_SET_FACILITY_LOCK 43
  2266.  
  2267. /**
  2268.  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
  2269.  *
  2270.  * Change call barring facility password
  2271.  *
  2272.  * "data" is const char **
  2273.  *
  2274.  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
  2275.  * (eg "AO" for BAOC)
  2276.  * ((const char **)data)[1] = old password
  2277.  * ((const char **)data)[2] = new password
  2278.  *
  2279.  * "response" is NULL
  2280.  *
  2281.  * Valid errors:
  2282.  *  SUCCESS
  2283.  *  RADIO_NOT_AVAILABLE
  2284.  *  SS_MODIFIED_TO_DIAL
  2285.  *  SS_MODIFIED_TO_USSD
  2286.  *  SS_MODIFIED_TO_SS
  2287.  *  GENERIC_FAILURE
  2288.  *
  2289.  */
  2290. #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
  2291.  
  2292. /**
  2293.  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
  2294.  *
  2295.  * Query current network selectin mode
  2296.  *
  2297.  * "data" is NULL
  2298.  *
  2299.  * "response" is int *
  2300.  * ((const int *)response)[0] is
  2301.  *     0 for automatic selection
  2302.  *     1 for manual selection
  2303.  *
  2304.  * Valid errors:
  2305.  *  SUCCESS
  2306.  *  RADIO_NOT_AVAILABLE
  2307.  *  GENERIC_FAILURE
  2308.  *
  2309.  */
  2310. #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
  2311.  
  2312. /**
  2313.  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
  2314.  *
  2315.  * Specify that the network should be selected automatically
  2316.  *
  2317.  * "data" is NULL
  2318.  * "response" is NULL
  2319.  *
  2320.  * This request must not respond until the new operator is selected
  2321.  * and registered
  2322.  *
  2323.  * Valid errors:
  2324.  *  SUCCESS
  2325.  *  RADIO_NOT_AVAILABLE
  2326.  *  ILLEGAL_SIM_OR_ME
  2327.  *  GENERIC_FAILURE
  2328.  *
  2329.  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
  2330.  *       no retries needed, such as illegal SIM or ME.
  2331.  *       Returns GENERIC_FAILURE for all other causes that might be
  2332.  *       fixed by retries.
  2333.  *
  2334.  */
  2335. #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
  2336.  
  2337. /**
  2338.  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
  2339.  *
  2340.  * Manually select a specified network.
  2341.  *
  2342.  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
  2343.  * "response" is NULL
  2344.  *
  2345.  * This request must not respond until the new operator is selected
  2346.  * and registered
  2347.  *
  2348.  * Valid errors:
  2349.  *  SUCCESS
  2350.  *  RADIO_NOT_AVAILABLE
  2351.  *  ILLEGAL_SIM_OR_ME
  2352.  *  GENERIC_FAILURE
  2353.  *
  2354.  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
  2355.  *       no retries needed, such as illegal SIM or ME.
  2356.  *       Returns GENERIC_FAILURE for all other causes that might be
  2357.  *       fixed by retries.
  2358.  *
  2359.  */
  2360. #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
  2361.  
  2362. /**
  2363.  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
  2364.  *
  2365.  * Scans for available networks
  2366.  *
  2367.  * "data" is NULL
  2368.  * "response" is const char ** that should be an array of n*4 strings, where
  2369.  *    n is the number of available networks
  2370.  * For each available network:
  2371.  *
  2372.  * ((const char **)response)[n+0] is long alpha ONS or EONS
  2373.  * ((const char **)response)[n+1] is short alpha ONS or EONS
  2374.  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
  2375.  * ((const char **)response)[n+3] is a string value of the status:
  2376.  *           "unknown"
  2377.  *           "available"
  2378.  *           "current"
  2379.  *           "forbidden"
  2380.  *
  2381.  * This request must not respond until the new operator is selected
  2382.  * and registered
  2383.  *
  2384.  * Valid errors:
  2385.  *  SUCCESS
  2386.  *  RADIO_NOT_AVAILABLE
  2387.  *  GENERIC_FAILURE
  2388.  *
  2389.  */
  2390. #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
  2391.  
  2392. /**
  2393.  * RIL_REQUEST_DTMF_START
  2394.  *
  2395.  * Start playing a DTMF tone. Continue playing DTMF tone until
  2396.  * RIL_REQUEST_DTMF_STOP is received
  2397.  *
  2398.  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
  2399.  * it should cancel the previous tone and play the new one.
  2400.  *
  2401.  * "data" is a char *
  2402.  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
  2403.  * "response" is NULL
  2404.  *
  2405.  * Valid errors:
  2406.  *  SUCCESS
  2407.  *  RADIO_NOT_AVAILABLE
  2408.  *  GENERIC_FAILURE
  2409.  *
  2410.  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
  2411.  */
  2412. #define RIL_REQUEST_DTMF_START 49
  2413.  
  2414. /**
  2415.  * RIL_REQUEST_DTMF_STOP
  2416.  *
  2417.  * Stop playing a currently playing DTMF tone.
  2418.  *
  2419.  * "data" is NULL
  2420.  * "response" is NULL
  2421.  *
  2422.  * Valid errors:
  2423.  *  SUCCESS
  2424.  *  RADIO_NOT_AVAILABLE
  2425.  *  GENERIC_FAILURE
  2426.  *
  2427.  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
  2428.  */
  2429. #define RIL_REQUEST_DTMF_STOP 50
  2430.  
  2431. /**
  2432.  * RIL_REQUEST_BASEBAND_VERSION
  2433.  *
  2434.  * Return string value indicating baseband version, eg
  2435.  * response from AT+CGMR
  2436.  *
  2437.  * "data" is NULL
  2438.  * "response" is const char * containing version string for log reporting
  2439.  *
  2440.  * Valid errors:
  2441.  *  SUCCESS
  2442.  *  RADIO_NOT_AVAILABLE
  2443.  *  GENERIC_FAILURE
  2444.  *
  2445.  */
  2446. #define RIL_REQUEST_BASEBAND_VERSION 51
  2447.  
  2448. /**
  2449.  * RIL_REQUEST_SEPARATE_CONNECTION
  2450.  *
  2451.  * Separate a party from a multiparty call placing the multiparty call
  2452.  * (less the specified party) on hold and leaving the specified party
  2453.  * as the only other member of the current (active) call
  2454.  *
  2455.  * Like AT+CHLD=2x
  2456.  *
  2457.  * See TS 22.084 1.3.8.2 (iii)
  2458.  * TS 22.030 6.5.5 "Entering "2X followed by send"
  2459.  * TS 27.007 "AT+CHLD=2x"
  2460.  *
  2461.  * "data" is an int *
  2462.  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
  2463.  *
  2464.  * "response" is NULL
  2465.  *
  2466.  * Valid errors:
  2467.  *  SUCCESS
  2468.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2469.  *  GENERIC_FAILURE
  2470.  */
  2471. #define RIL_REQUEST_SEPARATE_CONNECTION 52
  2472.  
  2473.  
  2474. /**
  2475.  * RIL_REQUEST_SET_MUTE
  2476.  *
  2477.  * Turn on or off uplink (microphone) mute.
  2478.  *
  2479.  * Will only be sent while voice call is active.
  2480.  * Will always be reset to "disable mute" when a new voice call is initiated
  2481.  *
  2482.  * "data" is an int *
  2483.  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
  2484.  *
  2485.  * "response" is NULL
  2486.  *
  2487.  * Valid errors:
  2488.  *  SUCCESS
  2489.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2490.  *  GENERIC_FAILURE
  2491.  */
  2492.  
  2493. #define RIL_REQUEST_SET_MUTE 53
  2494.  
  2495. /**
  2496.  * RIL_REQUEST_GET_MUTE
  2497.  *
  2498.  * Queries the current state of the uplink mute setting
  2499.  *
  2500.  * "data" is NULL
  2501.  * "response" is an int *
  2502.  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
  2503.  *
  2504.  * Valid errors:
  2505.  *  SUCCESS
  2506.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2507.  *  SS_MODIFIED_TO_DIAL
  2508.  *  SS_MODIFIED_TO_USSD
  2509.  *  SS_MODIFIED_TO_SS
  2510.  *  GENERIC_FAILURE
  2511.  */
  2512.  
  2513. #define RIL_REQUEST_GET_MUTE 54
  2514.  
  2515. /**
  2516.  * RIL_REQUEST_QUERY_CLIP
  2517.  *
  2518.  * Queries the status of the CLIP supplementary service
  2519.  *
  2520.  * (for MMI code "*#30#")
  2521.  *
  2522.  * "data" is NULL
  2523.  * "response" is an int *
  2524.  * (int *)response)[0] is 1 for "CLIP provisioned"
  2525.  *                           and 0 for "CLIP not provisioned"
  2526.  *                           and 2 for "unknown, e.g. no network etc"
  2527.  *
  2528.  * Valid errors:
  2529.  *  SUCCESS
  2530.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2531.  *  GENERIC_FAILURE
  2532.  */
  2533.  
  2534. #define RIL_REQUEST_QUERY_CLIP 55
  2535.  
  2536. /**
  2537.  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
  2538.  * field in RIL_Data_Call_Response_v6.
  2539.  *
  2540.  * Requests the failure cause code for the most recently failed PDP
  2541.  * context or CDMA data connection active
  2542.  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
  2543.  *
  2544.  * "data" is NULL
  2545.  *
  2546.  * "response" is a "int *"
  2547.  * ((int *)response)[0] is an integer cause code defined in TS 24.008
  2548.  *   section 6.1.3.1.3 or close approximation
  2549.  *
  2550.  * If the implementation does not have access to the exact cause codes,
  2551.  * then it should return one of the values listed in
  2552.  * RIL_DataCallFailCause, as the UI layer needs to distinguish these
  2553.  * cases for error notification
  2554.  * and potential retries.
  2555.  *
  2556.  * Valid errors:
  2557.  *  SUCCESS
  2558.  *  RADIO_NOT_AVAILABLE
  2559.  *  GENERIC_FAILURE
  2560.  *
  2561.  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
  2562.  *
  2563.  * Deprecated use the status field in RIL_Data_Call_Response_v6.
  2564.  */
  2565.  
  2566. #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
  2567.  
  2568. /**
  2569.  * RIL_REQUEST_DATA_CALL_LIST
  2570.  *
  2571.  * Returns the data call list. An entry is added when a
  2572.  * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
  2573.  * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
  2574.  * when RIL_REQUEST_RADIO_POWER off/on is issued.
  2575.  *
  2576.  * "data" is NULL
  2577.  * "response" is an array of RIL_Data_Call_Response_v6
  2578.  *
  2579.  * Valid errors:
  2580.  *  SUCCESS
  2581.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2582.  *  GENERIC_FAILURE
  2583.  *
  2584.  * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
  2585.  */
  2586.  
  2587. #define RIL_REQUEST_DATA_CALL_LIST 57
  2588.  
  2589. /**
  2590.  * RIL_REQUEST_RESET_RADIO - DEPRECATED
  2591.  *
  2592.  * Request a radio reset. The RIL implementation may postpone
  2593.  * the reset until after this request is responded to if the baseband
  2594.  * is presently busy.
  2595.  *
  2596.  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
  2597.  *
  2598.  * "data" is NULL
  2599.  * "response" is NULL
  2600.  *
  2601.  * Valid errors:
  2602.  *  SUCCESS
  2603.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2604.  *  GENERIC_FAILURE
  2605.  *  REQUEST_NOT_SUPPORTED
  2606.  */
  2607.  
  2608. #define RIL_REQUEST_RESET_RADIO 58
  2609.  
  2610. /**
  2611.  * RIL_REQUEST_OEM_HOOK_RAW
  2612.  *
  2613.  * This request reserved for OEM-specific uses. It passes raw byte arrays
  2614.  * back and forth.
  2615.  *
  2616.  * It can be invoked on the Java side from
  2617.  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
  2618.  *
  2619.  * "data" is a char * of bytes copied from the byte[] data argument in java
  2620.  * "response" is a char * of bytes that will returned via the
  2621.  * caller's "response" Message here:
  2622.  * (byte[])(((AsyncResult)response.obj).result)
  2623.  *
  2624.  * An error response here will result in
  2625.  * (((AsyncResult)response.obj).result) == null and
  2626.  * (((AsyncResult)response.obj).exception) being an instance of
  2627.  * com.android.internal.telephony.gsm.CommandException
  2628.  *
  2629.  * Valid errors:
  2630.  *  All
  2631.  */
  2632.  
  2633. #define RIL_REQUEST_OEM_HOOK_RAW 59
  2634.  
  2635. /**
  2636.  * RIL_REQUEST_OEM_HOOK_STRINGS
  2637.  *
  2638.  * This request reserved for OEM-specific uses. It passes strings
  2639.  * back and forth.
  2640.  *
  2641.  * It can be invoked on the Java side from
  2642.  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
  2643.  *
  2644.  * "data" is a const char **, representing an array of null-terminated UTF-8
  2645.  * strings copied from the "String[] strings" argument to
  2646.  * invokeOemRilRequestStrings()
  2647.  *
  2648.  * "response" is a const char **, representing an array of null-terminated UTF-8
  2649.  * stings that will be returned via the caller's response message here:
  2650.  *
  2651.  * (String[])(((AsyncResult)response.obj).result)
  2652.  *
  2653.  * An error response here will result in
  2654.  * (((AsyncResult)response.obj).result) == null and
  2655.  * (((AsyncResult)response.obj).exception) being an instance of
  2656.  * com.android.internal.telephony.gsm.CommandException
  2657.  *
  2658.  * Valid errors:
  2659.  *  All
  2660.  */
  2661.  
  2662. #define RIL_REQUEST_OEM_HOOK_STRINGS 60
  2663.  
  2664. /**
  2665.  * RIL_REQUEST_SCREEN_STATE
  2666.  *
  2667.  * Indicates the current state of the screen.  When the screen is off, the
  2668.  * RIL should notify the baseband to suppress certain notifications (eg,
  2669.  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
  2670.  * in an effort to conserve power.  These notifications should resume when the
  2671.  * screen is on.
  2672.  *
  2673.  * "data" is int *
  2674.  * ((int *)data)[0] is == 1 for "Screen On"
  2675.  * ((int *)data)[0] is == 0 for "Screen Off"
  2676.  *
  2677.  * "response" is NULL
  2678.  *
  2679.  * Valid errors:
  2680.  *  SUCCESS
  2681.  *  GENERIC_FAILURE
  2682.  */
  2683. #define RIL_REQUEST_SCREEN_STATE 61
  2684.  
  2685.  
  2686. /**
  2687.  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
  2688.  *
  2689.  * Enables/disables supplementary service related notifications
  2690.  * from the network.
  2691.  *
  2692.  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
  2693.  *
  2694.  * "data" is int *
  2695.  * ((int *)data)[0] is == 1 for notifications enabled
  2696.  * ((int *)data)[0] is == 0 for notifications disabled
  2697.  *
  2698.  * "response" is NULL
  2699.  *
  2700.  * Valid errors:
  2701.  *  SUCCESS
  2702.  *  RADIO_NOT_AVAILABLE
  2703.  *  GENERIC_FAILURE
  2704.  *
  2705.  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
  2706.  */
  2707. #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
  2708.  
  2709. /**
  2710.  * RIL_REQUEST_WRITE_SMS_TO_SIM
  2711.  *
  2712.  * Stores a SMS message to SIM memory.
  2713.  *
  2714.  * "data" is RIL_SMS_WriteArgs *
  2715.  *
  2716.  * "response" is int *
  2717.  * ((const int *)response)[0] is the record index where the message is stored.
  2718.  *
  2719.  * Valid errors:
  2720.  *  SUCCESS
  2721.  *  GENERIC_FAILURE
  2722.  *
  2723.  */
  2724. #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
  2725.  
  2726. /**
  2727.  * RIL_REQUEST_DELETE_SMS_ON_SIM
  2728.  *
  2729.  * Deletes a SMS message from SIM memory.
  2730.  *
  2731.  * "data" is int  *
  2732.  * ((int *)data)[0] is the record index of the message to delete.
  2733.  *
  2734.  * "response" is NULL
  2735.  *
  2736.  * Valid errors:
  2737.  *  SUCCESS
  2738.  *  GENERIC_FAILURE
  2739.  *
  2740.  */
  2741. #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
  2742.  
  2743. /**
  2744.  * RIL_REQUEST_SET_BAND_MODE
  2745.  *
  2746.  * Assign a specified band for RF configuration.
  2747.  *
  2748.  * "data" is int *
  2749.  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
  2750.  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
  2751.  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
  2752.  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
  2753.  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
  2754.  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
  2755.  * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
  2756.  * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
  2757.  * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
  2758.  * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
  2759.  * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
  2760.  * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
  2761.  * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
  2762.  * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
  2763.  * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
  2764.  * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
  2765.  * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
  2766.  * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
  2767.  * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
  2768.  *
  2769.  * "response" is NULL
  2770.  *
  2771.  * Valid errors:
  2772.  *  SUCCESS
  2773.  *  RADIO_NOT_AVAILABLE
  2774.  *  GENERIC_FAILURE
  2775.  */
  2776. #define RIL_REQUEST_SET_BAND_MODE 65
  2777.  
  2778. /**
  2779.  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
  2780.  *
  2781.  * Query the list of band mode supported by RF.
  2782.  *
  2783.  * "data" is NULL
  2784.  *
  2785.  * "response" is int *
  2786.  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
  2787.  * each available band mode.
  2788.  *
  2789.  *  0 for "unspecified" (selected by baseband automatically)
  2790.  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
  2791.  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
  2792.  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
  2793.  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
  2794.  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
  2795.  *  6 for "Cellular (800-MHz Band)"
  2796.  *  7 for "PCS (1900-MHz Band)"
  2797.  *  8 for "Band Class 3 (JTACS Band)"
  2798.  *  9 for "Band Class 4 (Korean PCS Band)"
  2799.  *  10 for "Band Class 5 (450-MHz Band)"
  2800.  *  11 for "Band Class 6 (2-GMHz IMT2000 Band)"
  2801.  *  12 for "Band Class 7 (Upper 700-MHz Band)"
  2802.  *  13 for "Band Class 8 (1800-MHz Band)"
  2803.  *  14 for "Band Class 9 (900-MHz Band)"
  2804.  *  15 for "Band Class 10 (Secondary 800-MHz Band)"
  2805.  *  16 for "Band Class 11 (400-MHz European PAMR Band)"
  2806.  *  17 for "Band Class 15 (AWS Band)"
  2807.  *  18 for "Band Class 16 (US 2.5-GHz Band)"
  2808.  *
  2809.  * Valid errors:
  2810.  *  SUCCESS
  2811.  *  RADIO_NOT_AVAILABLE
  2812.  *  GENERIC_FAILURE
  2813.  *
  2814.  * See also: RIL_REQUEST_SET_BAND_MODE
  2815.  */
  2816. #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
  2817.  
  2818. /**
  2819.  * RIL_REQUEST_STK_GET_PROFILE
  2820.  *
  2821.  * Requests the profile of SIM tool kit.
  2822.  * The profile indicates the SAT/USAT features supported by ME.
  2823.  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
  2824.  *
  2825.  * "data" is NULL
  2826.  *
  2827.  * "response" is a const char * containing SAT/USAT profile
  2828.  * in hexadecimal format string starting with first byte of terminal profile
  2829.  *
  2830.  * Valid errors:
  2831.  *  RIL_E_SUCCESS
  2832.  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2833.  *  RIL_E_GENERIC_FAILURE
  2834.  */
  2835. #define RIL_REQUEST_STK_GET_PROFILE 67
  2836.  
  2837. /**
  2838.  * RIL_REQUEST_STK_SET_PROFILE
  2839.  *
  2840.  * Download the STK terminal profile as part of SIM initialization
  2841.  * procedure
  2842.  *
  2843.  * "data" is a const char * containing SAT/USAT profile
  2844.  * in hexadecimal format string starting with first byte of terminal profile
  2845.  *
  2846.  * "response" is NULL
  2847.  *
  2848.  * Valid errors:
  2849.  *  RIL_E_SUCCESS
  2850.  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2851.  *  RIL_E_GENERIC_FAILURE
  2852.  */
  2853. #define RIL_REQUEST_STK_SET_PROFILE 68
  2854.  
  2855. /**
  2856.  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
  2857.  *
  2858.  * Requests to send a SAT/USAT envelope command to SIM.
  2859.  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
  2860.  *
  2861.  * "data" is a const char * containing SAT/USAT command
  2862.  * in hexadecimal format string starting with command tag
  2863.  *
  2864.  * "response" is a const char * containing SAT/USAT response
  2865.  * in hexadecimal format string starting with first byte of response
  2866.  * (May be NULL)
  2867.  *
  2868.  * Valid errors:
  2869.  *  RIL_E_SUCCESS
  2870.  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2871.  *  RIL_E_GENERIC_FAILURE
  2872.  */
  2873. #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
  2874.  
  2875. /**
  2876.  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
  2877.  *
  2878.  * Requests to send a terminal response to SIM for a received
  2879.  * proactive command
  2880.  *
  2881.  * "data" is a const char * containing SAT/USAT response
  2882.  * in hexadecimal format string starting with first byte of response data
  2883.  *
  2884.  * "response" is NULL
  2885.  *
  2886.  * Valid errors:
  2887.  *  RIL_E_SUCCESS
  2888.  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2889.  *  RIL_E_GENERIC_FAILURE
  2890.  */
  2891. #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
  2892.  
  2893. /**
  2894.  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
  2895.  *
  2896.  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
  2897.  * been initialized by ME already. (We could see the call has been in the 'call
  2898.  * list') So, STK application needs to accept/reject the call according as user
  2899.  * operations.
  2900.  *
  2901.  * "data" is int *
  2902.  * ((int *)data)[0] is > 0 for "accept" the call setup
  2903.  * ((int *)data)[0] is == 0 for "reject" the call setup
  2904.  *
  2905.  * "response" is NULL
  2906.  *
  2907.  * Valid errors:
  2908.  *  RIL_E_SUCCESS
  2909.  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  2910.  *  RIL_E_GENERIC_FAILURE
  2911.  */
  2912. #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
  2913.  
  2914. /**
  2915.  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
  2916.  *
  2917.  * Connects the two calls and disconnects the subscriber from both calls.
  2918.  *
  2919.  * "data" is NULL
  2920.  * "response" is NULL
  2921.  *
  2922.  * Valid errors:
  2923.  *  SUCCESS
  2924.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2925.  *  GENERIC_FAILURE
  2926.  */
  2927. #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
  2928.  
  2929. /**
  2930.  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
  2931.  *
  2932.  * Requests to set the preferred network type for searching and registering
  2933.  * (CS/PS domain, RAT, and operation mode)
  2934.  *
  2935.  * "data" is int * which is RIL_PreferredNetworkType
  2936.  *
  2937.  * "response" is NULL
  2938.  *
  2939.  * Valid errors:
  2940.  *  SUCCESS
  2941.  *  RADIO_NOT_AVAILABLE (radio resetting)
  2942.  *  GENERIC_FAILURE
  2943.  *  MODE_NOT_SUPPORTED
  2944.  */
  2945. #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
  2946.  
  2947. /**
  2948.  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
  2949.  *
  2950.  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
  2951.  * for searching and registering
  2952.  *
  2953.  * "data" is NULL
  2954.  *
  2955.  * "response" is int *
  2956.  * ((int *)reponse)[0] is == RIL_PreferredNetworkType
  2957.  *
  2958.  * Valid errors:
  2959.  *  SUCCESS
  2960.  *  RADIO_NOT_AVAILABLE
  2961.  *  GENERIC_FAILURE
  2962.  *
  2963.  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
  2964.  */
  2965. #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
  2966.  
  2967. /**
  2968.  * RIL_REQUEST_NEIGHBORING_CELL_IDS
  2969.  *
  2970.  * Request neighboring cell id in GSM network
  2971.  *
  2972.  * "data" is NULL
  2973.  * "response" must be a " const RIL_NeighboringCell** "
  2974.  *
  2975.  * Valid errors:
  2976.  *  SUCCESS
  2977.  *  RADIO_NOT_AVAILABLE
  2978.  *  GENERIC_FAILURE
  2979.  */
  2980. #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
  2981.  
  2982. /**
  2983.  * RIL_REQUEST_SET_LOCATION_UPDATES
  2984.  *
  2985.  * Enables/disables network state change notifications due to changes in
  2986.  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
  2987.  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
  2988.  *
  2989.  * Note:  The RIL implementation should default to "updates enabled"
  2990.  * when the screen is on and "updates disabled" when the screen is off.
  2991.  *
  2992.  * "data" is int *
  2993.  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
  2994.  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
  2995.  *
  2996.  * "response" is NULL
  2997.  *
  2998.  * Valid errors:
  2999.  *  SUCCESS
  3000.  *  RADIO_NOT_AVAILABLE
  3001.  *  GENERIC_FAILURE
  3002.  *
  3003.  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
  3004.  */
  3005. #define RIL_REQUEST_SET_LOCATION_UPDATES 76
  3006.  
  3007. /**
  3008.  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
  3009.  *
  3010.  * Request to set the location where the CDMA subscription shall
  3011.  * be retrieved
  3012.  *
  3013.  * "data" is int *
  3014.  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
  3015.  *
  3016.  * "response" is NULL
  3017.  *
  3018.  * Valid errors:
  3019.  *  SUCCESS
  3020.  *  RADIO_NOT_AVAILABLE
  3021.  *  GENERIC_FAILURE
  3022.  *  SIM_ABSENT
  3023.  *  SUBSCRIPTION_NOT_AVAILABLE
  3024.  *
  3025.  * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
  3026.  */
  3027. #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
  3028.  
  3029. /**
  3030.  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
  3031.  *
  3032.  * Request to set the roaming preferences in CDMA
  3033.  *
  3034.  * "data" is int *
  3035.  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
  3036.  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
  3037.  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
  3038.  *
  3039.  * "response" is NULL
  3040.  *
  3041.  * Valid errors:
  3042.  *  SUCCESS
  3043.  *  RADIO_NOT_AVAILABLE
  3044.  *  GENERIC_FAILURE
  3045.  */
  3046. #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
  3047.  
  3048. /**
  3049.  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
  3050.  *
  3051.  * Request the actual setting of the roaming preferences in CDMA in the modem
  3052.  *
  3053.  * "data" is NULL
  3054.  *
  3055.  * "response" is int *
  3056.  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
  3057.  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
  3058.  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
  3059.  *
  3060.  * "response" is NULL
  3061.  *
  3062.  * Valid errors:
  3063.  *  SUCCESS
  3064.  *  RADIO_NOT_AVAILABLE
  3065.  *  GENERIC_FAILURE
  3066.  */
  3067. #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
  3068.  
  3069. /**
  3070.  * RIL_REQUEST_SET_TTY_MODE
  3071.  *
  3072.  * Request to set the TTY mode
  3073.  *
  3074.  * "data" is int *
  3075.  * ((int *)data)[0] is == 0 for TTY off
  3076.  * ((int *)data)[0] is == 1 for TTY Full
  3077.  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
  3078.  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
  3079.  *
  3080.  * "response" is NULL
  3081.  *
  3082.  * Valid errors:
  3083.  *  SUCCESS
  3084.  *  RADIO_NOT_AVAILABLE
  3085.  *  GENERIC_FAILURE
  3086.  */
  3087. #define RIL_REQUEST_SET_TTY_MODE 80
  3088.  
  3089. /**
  3090.  * RIL_REQUEST_QUERY_TTY_MODE
  3091.  *
  3092.  * Request the setting of TTY mode
  3093.  *
  3094.  * "data" is NULL
  3095.  *
  3096.  * "response" is int *
  3097.  * ((int *)response)[0] is == 0 for TTY off
  3098.  * ((int *)response)[0] is == 1 for TTY Full
  3099.  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
  3100.  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
  3101.  *
  3102.  * "response" is NULL
  3103.  *
  3104.  * Valid errors:
  3105.  *  SUCCESS
  3106.  *  RADIO_NOT_AVAILABLE
  3107.  *  GENERIC_FAILURE
  3108.  */
  3109. #define RIL_REQUEST_QUERY_TTY_MODE 81
  3110.  
  3111. /**
  3112.  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
  3113.  *
  3114.  * Request to set the preferred voice privacy mode used in voice
  3115.  * scrambling
  3116.  *
  3117.  * "data" is int *
  3118.  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
  3119.  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
  3120.  *
  3121.  * "response" is NULL
  3122.  *
  3123.  * Valid errors:
  3124.  *  SUCCESS
  3125.  *  RADIO_NOT_AVAILABLE
  3126.  *  GENERIC_FAILURE
  3127.  */
  3128. #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
  3129.  
  3130. /**
  3131.  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
  3132.  *
  3133.  * Request the setting of preferred voice privacy mode
  3134.  *
  3135.  * "data" is NULL
  3136.  *
  3137.  * "response" is int *
  3138.  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
  3139.  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
  3140.  *
  3141.  * "response" is NULL
  3142.  *
  3143.  * Valid errors:
  3144.  *  SUCCESS
  3145.  *  RADIO_NOT_AVAILABLE
  3146.  *  GENERIC_FAILURE
  3147.  */
  3148. #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
  3149.  
  3150. /**
  3151.  * RIL_REQUEST_CDMA_FLASH
  3152.  *
  3153.  * Send FLASH
  3154.  *
  3155.  * "data" is const char *
  3156.  * ((const char *)data)[0] is a FLASH string
  3157.  *
  3158.  * "response" is NULL
  3159.  *
  3160.  * Valid errors:
  3161.  *  SUCCESS
  3162.  *  RADIO_NOT_AVAILABLE
  3163.  *  GENERIC_FAILURE
  3164.  *
  3165.  */
  3166. #define RIL_REQUEST_CDMA_FLASH 84
  3167.  
  3168. /**
  3169.  * RIL_REQUEST_CDMA_BURST_DTMF
  3170.  *
  3171.  * Send DTMF string
  3172.  *
  3173.  * "data" is const char **
  3174.  * ((const char **)data)[0] is a DTMF string
  3175.  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
  3176.  *                          default
  3177.  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
  3178.  *                          default
  3179.  *
  3180.  * "response" is NULL
  3181.  *
  3182.  * Valid errors:
  3183.  *  SUCCESS
  3184.  *  RADIO_NOT_AVAILABLE
  3185.  *  GENERIC_FAILURE
  3186.  *
  3187.  */
  3188. #define RIL_REQUEST_CDMA_BURST_DTMF 85
  3189.  
  3190. /**
  3191.  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
  3192.  *
  3193.  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
  3194.  * If the checksum is valid the 20 digit AKEY is written to NV,
  3195.  * replacing the existing AKEY no matter what it was before.
  3196.  *
  3197.  * "data" is const char *
  3198.  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
  3199.  *                         where the last 6 digits are a checksum of the
  3200.  *                         first 20, as specified in TR45.AHAG
  3201.  *                         "Common Cryptographic Algorithms, Revision D.1
  3202.  *                         Section 2.2"
  3203.  *
  3204.  * "response" is NULL
  3205.  *
  3206.  * Valid errors:
  3207.  *  SUCCESS
  3208.  *  RADIO_NOT_AVAILABLE
  3209.  *  GENERIC_FAILURE
  3210.  *
  3211.  */
  3212. #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
  3213.  
  3214. /**
  3215.  * RIL_REQUEST_CDMA_SEND_SMS
  3216.  *
  3217.  * Send a CDMA SMS message
  3218.  *
  3219.  * "data" is const RIL_CDMA_SMS_Message *
  3220.  *
  3221.  * "response" is a const RIL_SMS_Response *
  3222.  *
  3223.  * Based on the return error, caller decides to resend if sending sms
  3224.  * fails. The CDMA error class is derived as follows,
  3225.  * SUCCESS is error class 0 (no error)
  3226.  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
  3227.  * and GENERIC_FAILURE is error class 3 (permanent and no retry)
  3228.  *
  3229.  * Valid errors:
  3230.  *  SUCCESS
  3231.  *  RADIO_NOT_AVAILABLE
  3232.  *  SMS_SEND_FAIL_RETRY
  3233.  *  GENERIC_FAILURE
  3234.  *
  3235.  */
  3236. #define RIL_REQUEST_CDMA_SEND_SMS 87
  3237.  
  3238. /**
  3239.  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
  3240.  *
  3241.  * Acknowledge the success or failure in the receipt of SMS
  3242.  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
  3243.  *
  3244.  * "data" is const RIL_CDMA_SMS_Ack *
  3245.  *
  3246.  * "response" is NULL
  3247.  *
  3248.  * Valid errors:
  3249.  *  SUCCESS
  3250.  *  RADIO_NOT_AVAILABLE
  3251.  *  GENERIC_FAILURE
  3252.  *
  3253.  */
  3254. #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
  3255.  
  3256. /**
  3257.  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
  3258.  *
  3259.  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
  3260.  *
  3261.  * "data" is NULL
  3262.  *
  3263.  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
  3264.  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
  3265.  *
  3266.  * Valid errors:
  3267.  *  SUCCESS
  3268.  *  RADIO_NOT_AVAILABLE
  3269.  *  GENERIC_FAILURE
  3270.  *
  3271.  */
  3272. #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
  3273.  
  3274. /**
  3275.  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
  3276.  *
  3277.  * Set GSM/WCDMA Cell Broadcast SMS config
  3278.  *
  3279.  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
  3280.  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
  3281.  *
  3282.  * "response" is NULL
  3283.  *
  3284.  * Valid errors:
  3285.  *  SUCCESS
  3286.  *  RADIO_NOT_AVAILABLE
  3287.  *  GENERIC_FAILURE
  3288.  *
  3289.  */
  3290. #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
  3291.  
  3292. /**
  3293.  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
  3294.  *
  3295. * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
  3296.  *
  3297.  * "data" is const int *
  3298.  * (const int *)data[0] indicates to activate or turn off the
  3299.  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
  3300.  *                       0 - Activate, 1 - Turn off
  3301.  *
  3302.  * "response" is NULL
  3303.  *
  3304.  * Valid errors:
  3305.  *  SUCCESS
  3306.  *  RADIO_NOT_AVAILABLE
  3307.  *  GENERIC_FAILURE
  3308.  *
  3309.  */
  3310. #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
  3311.  
  3312. /**
  3313.  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
  3314.  *
  3315.  * Request the setting of CDMA Broadcast SMS config
  3316.  *
  3317.  * "data" is NULL
  3318.  *
  3319.  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
  3320.  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
  3321.  *
  3322.  * Valid errors:
  3323.  *  SUCCESS
  3324.  *  RADIO_NOT_AVAILABLE
  3325.  *  GENERIC_FAILURE
  3326.  *
  3327.  */
  3328. #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
  3329.  
  3330. /**
  3331.  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
  3332.  *
  3333.  * Set CDMA Broadcast SMS config
  3334.  *
  3335.  * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo **
  3336.  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
  3337.  *
  3338.  * "response" is NULL
  3339.  *
  3340.  * Valid errors:
  3341.  *  SUCCESS
  3342.  *  RADIO_NOT_AVAILABLE
  3343.  *  GENERIC_FAILURE
  3344.  *
  3345.  */
  3346. #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
  3347.  
  3348. /**
  3349.  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
  3350.  *
  3351.  * Enable or disable the reception of CDMA Broadcast SMS
  3352.  *
  3353.  * "data" is const int *
  3354.  * (const int *)data[0] indicates to activate or turn off the
  3355.  * reception of CDMA Broadcast SMS, 0-1,
  3356.  *                       0 - Activate, 1 - Turn off
  3357.  *
  3358.  * "response" is NULL
  3359.  *
  3360.  * Valid errors:
  3361.  *  SUCCESS
  3362.  *  RADIO_NOT_AVAILABLE
  3363.  *  GENERIC_FAILURE
  3364.  *
  3365.  */
  3366. #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
  3367.  
  3368. /**
  3369.  * RIL_REQUEST_CDMA_SUBSCRIPTION
  3370.  *
  3371.  * Request the device MDN / H_SID / H_NID.
  3372.  *
  3373.  * The request is only allowed when CDMA subscription is available.  When CDMA
  3374.  * subscription is changed, application layer should re-issue the request to
  3375.  * update the subscription information.
  3376.  *
  3377.  * If a NULL value is returned for any of the device id, it means that error
  3378.  * accessing the device.
  3379.  *
  3380.  * "response" is const char **
  3381.  * ((const char **)response)[0] is MDN if CDMA subscription is available
  3382.  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
  3383.  *                              CDMA subscription is available, in decimal format
  3384.  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
  3385.  *                              CDMA subscription is available, in decimal format
  3386.  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
  3387.  * ((const char **)response)[4] is PRL version if CDMA subscription is available
  3388.  *
  3389.  * Valid errors:
  3390.  *  SUCCESS
  3391.  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
  3392.  */
  3393.  
  3394. #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
  3395.  
  3396. /**
  3397.  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
  3398.  *
  3399.  * Stores a CDMA SMS message to RUIM memory.
  3400.  *
  3401.  * "data" is RIL_CDMA_SMS_WriteArgs *
  3402.  *
  3403.  * "response" is int *
  3404.  * ((const int *)response)[0] is the record index where the message is stored.
  3405.  *
  3406.  * Valid errors:
  3407.  *  SUCCESS
  3408.  *  RADIO_NOT_AVAILABLE
  3409.  *  GENERIC_FAILURE
  3410.  *
  3411.  */
  3412. #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
  3413.  
  3414. /**
  3415.  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
  3416.  *
  3417.  * Deletes a CDMA SMS message from RUIM memory.
  3418.  *
  3419.  * "data" is int  *
  3420.  * ((int *)data)[0] is the record index of the message to delete.
  3421.  *
  3422.  * "response" is NULL
  3423.  *
  3424.  * Valid errors:
  3425.  *  SUCCESS
  3426.  *  RADIO_NOT_AVAILABLE
  3427.  *  GENERIC_FAILURE
  3428.  *
  3429.  */
  3430. #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
  3431.  
  3432. /**
  3433.  * RIL_REQUEST_DEVICE_IDENTITY
  3434.  *
  3435.  * Request the device ESN / MEID / IMEI / IMEISV.
  3436.  *
  3437.  * The request is always allowed and contains GSM and CDMA device identity;
  3438.  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
  3439.  * RIL_REQUEST_GET_IMEISV.
  3440.  *
  3441.  * If a NULL value is returned for any of the device id, it means that error
  3442.  * accessing the device.
  3443.  *
  3444.  * When CDMA subscription is changed the ESN/MEID may change.  The application
  3445.  * layer should re-issue the request to update the device identity in this case.
  3446.  *
  3447.  * "response" is const char **
  3448.  * ((const char **)response)[0] is IMEI if GSM subscription is available
  3449.  * ((const char **)response)[1] is IMEISV if GSM subscription is available
  3450.  * ((const char **)response)[2] is ESN if CDMA subscription is available
  3451.  * ((const char **)response)[3] is MEID if CDMA subscription is available
  3452.  *
  3453.  * Valid errors:
  3454.  *  SUCCESS
  3455.  *  RADIO_NOT_AVAILABLE
  3456.  *  GENERIC_FAILURE
  3457.  */
  3458. #define RIL_REQUEST_DEVICE_IDENTITY 98
  3459.  
  3460. /**
  3461.  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
  3462.  *
  3463.  * Request the radio's system selection module to exit emergency
  3464.  * callback mode.  RIL will not respond with SUCCESS until the modem has
  3465.  * completely exited from Emergency Callback Mode.
  3466.  *
  3467.  * "data" is NULL
  3468.  *
  3469.  * "response" is NULL
  3470.  *
  3471.  * Valid errors:
  3472.  *  SUCCESS
  3473.  *  RADIO_NOT_AVAILABLE
  3474.  *  GENERIC_FAILURE
  3475.  *
  3476.  */
  3477. #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
  3478.  
  3479. /**
  3480.  * RIL_REQUEST_GET_SMSC_ADDRESS
  3481.  *
  3482.  * Queries the default Short Message Service Center address on the device.
  3483.  *
  3484.  * "data" is NULL
  3485.  *
  3486.  * "response" is const char * containing the SMSC address.
  3487.  *
  3488.  * Valid errors:
  3489.  *  SUCCESS
  3490.  *  RADIO_NOT_AVAILABLE
  3491.  *  GENERIC_FAILURE
  3492.  *
  3493.  */
  3494. #define RIL_REQUEST_GET_SMSC_ADDRESS 100
  3495.  
  3496. /**
  3497.  * RIL_REQUEST_SET_SMSC_ADDRESS
  3498.  *
  3499.  * Sets the default Short Message Service Center address on the device.
  3500.  *
  3501.  * "data" is const char * containing the SMSC address.
  3502.  *
  3503.  * "response" is NULL
  3504.  *
  3505.  * Valid errors:
  3506.  *  SUCCESS
  3507.  *  RADIO_NOT_AVAILABLE
  3508.  *  GENERIC_FAILURE
  3509.  *
  3510.  */
  3511. #define RIL_REQUEST_SET_SMSC_ADDRESS 101
  3512.  
  3513. /**
  3514.  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
  3515.  *
  3516.  * Indicates whether there is storage available for new SMS messages.
  3517.  *
  3518.  * "data" is int *
  3519.  * ((int *)data)[0] is 1 if memory is available for storing new messages
  3520.  *                  is 0 if memory capacity is exceeded
  3521.  *
  3522.  * "response" is NULL
  3523.  *
  3524.  * Valid errors:
  3525.  *  SUCCESS
  3526.  *  RADIO_NOT_AVAILABLE
  3527.  *  GENERIC_FAILURE
  3528.  *
  3529.  */
  3530. #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
  3531.  
  3532. /**
  3533.  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
  3534.  *
  3535.  * Indicates that the StkSerivce is running and is
  3536.  * ready to receive RIL_UNSOL_STK_XXXXX commands.
  3537.  *
  3538.  * "data" is NULL
  3539.  * "response" is NULL
  3540.  *
  3541.  * Valid errors:
  3542.  *  SUCCESS
  3543.  *  RADIO_NOT_AVAILABLE
  3544.  *  GENERIC_FAILURE
  3545.  *
  3546.  */
  3547. #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
  3548.  
  3549. /**
  3550.  * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
  3551.  *
  3552.  * Request to query the location where the CDMA subscription shall
  3553.  * be retrieved
  3554.  *
  3555.  * "data" is NULL
  3556.  *
  3557.  * "response" is int *
  3558.  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
  3559.  *
  3560.  * Valid errors:
  3561.  *  SUCCESS
  3562.  *  RADIO_NOT_AVAILABLE
  3563.  *  GENERIC_FAILURE
  3564.  *  SUBSCRIPTION_NOT_AVAILABLE
  3565.  *
  3566.  * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
  3567.  */
  3568. #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
  3569.  
  3570. /**
  3571.  * RIL_REQUEST_ISIM_AUTHENTICATION
  3572.  *
  3573.  * Request the ISIM application on the UICC to perform AKA
  3574.  * challenge/response algorithm for IMS authentication
  3575.  *
  3576.  * "data" is a const char * containing the challenge string in Base64 format
  3577.  * "response" is a const char * containing the response in Base64 format
  3578.  *
  3579.  * Valid errors:
  3580.  *  SUCCESS
  3581.  *  RADIO_NOT_AVAILABLE
  3582.  *  GENERIC_FAILURE
  3583.  */
  3584. #define RIL_REQUEST_ISIM_AUTHENTICATION 105
  3585.  
  3586. /**
  3587.  * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
  3588.  *
  3589.  * Acknowledge successful or failed receipt of SMS previously indicated
  3590.  * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
  3591.  * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
  3592.  *
  3593.  * "data" is const char **
  3594.  * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
  3595.  *                          is "0" on failed receipt (send RP-ERROR)
  3596.  * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
  3597.  *
  3598.  * "response" is NULL
  3599.  *
  3600.  * Valid errors:
  3601.  *  SUCCESS
  3602.  *  RADIO_NOT_AVAILABLE
  3603.  *  GENERIC_FAILURE
  3604.  */
  3605. #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
  3606.  
  3607. /**
  3608.  * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
  3609.  *
  3610.  * Requests to send a SAT/USAT envelope command to SIM.
  3611.  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
  3612.  *
  3613.  * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
  3614.  * the SW1 and SW2 status bytes from the UICC response are returned along with
  3615.  * the response data, using the same structure as RIL_REQUEST_SIM_IO.
  3616.  *
  3617.  * The RIL implementation shall perform the normal processing of a '91XX'
  3618.  * response in SW1/SW2 to retrieve the pending proactive command and send it
  3619.  * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
  3620.  *
  3621.  * "data" is a const char * containing the SAT/USAT command
  3622.  * in hexadecimal format starting with command tag
  3623.  *
  3624.  * "response" is a const RIL_SIM_IO_Response *
  3625.  *
  3626.  * Valid errors:
  3627.  *  RIL_E_SUCCESS
  3628.  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
  3629.  *  RIL_E_GENERIC_FAILURE
  3630.  */
  3631. #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
  3632.  
  3633. /**
  3634.  * RIL_REQUEST_VOICE_RADIO_TECH
  3635.  *
  3636.  * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
  3637.  * when radio state is RADIO_STATE_ON
  3638.  *
  3639.  * "data" is NULL
  3640.  * "response" is int *
  3641.  * ((int *) response)[0] is of type const RIL_RadioTechnology
  3642.  *
  3643.  * Valid errors:
  3644.  *  SUCCESS
  3645.  *  RADIO_NOT_AVAILABLE
  3646.  *  GENERIC_FAILURE
  3647.  */
  3648. #define RIL_REQUEST_VOICE_RADIO_TECH 108
  3649.  
  3650. /**
  3651.  * RIL_REQUEST_GET_CELL_INFO_LIST
  3652.  *
  3653.  * Request all of the current cell information known to the radio. The radio
  3654.  * must a list of all current cells, including the neighboring cells. If for a particular
  3655.  * cell information isn't known then the appropriate unknown value will be returned.
  3656.  * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST.
  3657.  *
  3658.  * "data" is NULL
  3659.  *
  3660.  * "response" is an array of  RIL_CellInfo.
  3661.  */
  3662. #define RIL_REQUEST_GET_CELL_INFO_LIST 109
  3663.  
  3664. /**
  3665.  * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
  3666.  *
  3667.  * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked.
  3668.  * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
  3669.  * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
  3670.  * a RIL_UNSOL_CELL_INFO_LIST.
  3671.  *
  3672.  * "data" is int *
  3673.  * ((int *)data)[0] is minimum time in milliseconds
  3674.  *
  3675.  * "response" is NULL
  3676.  *
  3677.  * Valid errors:
  3678.  *  SUCCESS
  3679.  *  RADIO_NOT_AVAILABLE
  3680.  *  GENERIC_FAILURE
  3681.  */
  3682. #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110
  3683.  
  3684. /**
  3685.  * RIL_REQUEST_SET_INITIAL_ATTACH_APN
  3686.  *
  3687.  * Set an apn to initial attach network
  3688.  * "response" is NULL
  3689.  *
  3690.  * Valid errors:
  3691.  *  SUCCESS
  3692.  *  RADIO_NOT_AVAILABLE (radio resetting)
  3693.  *  GENERIC_FAILURE
  3694.  *  SUBSCRIPTION_NOT_AVAILABLE
  3695.  */
  3696. #define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111
  3697.  
  3698. /**
  3699.  * RIL_REQUEST_IMS_REGISTRATION_STATE
  3700.  *
  3701.  * Request current IMS registration state
  3702.  *
  3703.  * "data" is NULL
  3704.  *
  3705.  * "response" is int *
  3706.  * ((int *)response)[0] is registration state:
  3707.  *              0 - Not registered
  3708.  *              1 - Registered
  3709.  *
  3710.  * If ((int*)response)[0] is = 1, then ((int *) response)[1]
  3711.  * must follow with IMS SMS format:
  3712.  *
  3713.  * ((int *) response)[1] is of type RIL_RadioTechnologyFamily
  3714.  *
  3715.  * Valid errors:
  3716.  *  SUCCESS
  3717.  *  RADIO_NOT_AVAILABLE
  3718.  *  GENERIC_FAILURE
  3719.  */
  3720. #define RIL_REQUEST_IMS_REGISTRATION_STATE 112
  3721.  
  3722. /**
  3723.  * RIL_REQUEST_IMS_SEND_SMS
  3724.  *
  3725.  * Send a SMS message over IMS
  3726.  *
  3727.  * "data" is const RIL_IMS_SMS_Message *
  3728.  *
  3729.  * "response" is a const RIL_SMS_Response *
  3730.  *
  3731.  * Based on the return error, caller decides to resend if sending sms
  3732.  * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
  3733.  * In case of retry, data is encoded based on Voice Technology available.
  3734.  *
  3735.  * Valid errors:
  3736.  *  SUCCESS
  3737.  *  RADIO_NOT_AVAILABLE
  3738.  *  SMS_SEND_FAIL_RETRY
  3739.  *  FDN_CHECK_FAILURE
  3740.  *  GENERIC_FAILURE
  3741.  *
  3742.  */
  3743. #define RIL_REQUEST_IMS_SEND_SMS 113
  3744.  
  3745. /**
  3746.  * RIL_REQUEST_GET_DATA_CALL_PROFILE
  3747.  *
  3748.  * Get the Data Call Profile for a particular app type
  3749.  *
  3750.  * "data" is const int*
  3751.  * (const int*)data[0] - App type. Value is specified the RUIM spec C.S0023-D
  3752.  *
  3753.  *
  3754.  * "response" is a const char * containing the count and the array of profiles
  3755.  * ((const int *)response)[0] Number RIL_DataCallProfileInfo structs(count)
  3756.  * ((const char *)response)[1] is the buffer that contains 'count' number of
  3757.  *                              RIL_DataCallProfileInfo structs.
  3758.  *
  3759.  * Valid errors:
  3760.  *  SUCCESS
  3761.  *  GENERIC_FAILURE
  3762.  *  RIL_E_DATA_CALL_PROFILE_ERROR
  3763.  *  RIL_E_DATA_CALL_PROFILE_NOT_AVAILABLE
  3764.  *
  3765.  */
  3766. #define RIL_REQUEST_GET_DATA_CALL_PROFILE 114
  3767.  
  3768. /**
  3769.  * RIL_REQUEST_SET_UICC_SUBSCRIPTION
  3770.  *
  3771.  * Selection/de-selection of a subscription from a SIM card
  3772.  * "data" is const  RIL_SelectUiccSub*
  3773.  
  3774.  *
  3775.  * "response" is NULL
  3776.  *
  3777.  *  Valid errors:
  3778.  *  SUCCESS
  3779.  *  RADIO_NOT_AVAILABLE (radio resetting)
  3780.  *  GENERIC_FAILURE
  3781.  *  SUBSCRIPTION_NOT_SUPPORTED
  3782.  *
  3783.  */
  3784. #define RIL_REQUEST_SET_UICC_SUBSCRIPTION  115
  3785.  
  3786. /**
  3787.  *  RIL_REQUEST_SET_DATA_SUBSCRIPTION
  3788.  *
  3789.  *  Selects a subscription for data call setup
  3790.  * "data" is NULL
  3791.  *
  3792.  * "response" is NULL
  3793.  *
  3794.  *  Valid errors:
  3795.  *
  3796.  *  SUCCESS
  3797.  *  RADIO_NOT_AVAILABLE (radio resetting)
  3798.  *  GENERIC_FAILURE
  3799.  *  SUBSCRIPTION_NOT_SUPPORTED
  3800.  *
  3801.  */
  3802. #define RIL_REQUEST_SET_DATA_SUBSCRIPTION  116
  3803.  
  3804. /***********************************************************************/
  3805.  
  3806.  
  3807. #define RIL_UNSOL_RESPONSE_BASE 1000
  3808.  
  3809. /**
  3810.  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
  3811.  *
  3812.  * Indicate when value of RIL_RadioState has changed.
  3813.  *
  3814.  * Callee will invoke RIL_RadioStateRequest method on main thread
  3815.  *
  3816.  * "data" is NULL
  3817.  */
  3818.  
  3819. #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
  3820.  
  3821.  
  3822. /**
  3823.  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
  3824.  *
  3825.  * Indicate when call state has changed
  3826.  *
  3827.  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
  3828.  *
  3829.  * "data" is NULL
  3830.  *
  3831.  * Response should be invoked on, for example,
  3832.  * "RING", "BUSY", "NO CARRIER", and also call state
  3833.  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
  3834.  *
  3835.  * Redundent or extraneous invocations are tolerated
  3836.  */
  3837. #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
  3838.  
  3839.  
  3840. /**
  3841.  * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
  3842.  *
  3843.  * Called when the voice network state changed
  3844.  *
  3845.  * Callee will invoke the following requests on main thread:
  3846.  *
  3847.  * RIL_REQUEST_VOICE_REGISTRATION_STATE
  3848.  * RIL_REQUEST_OPERATOR
  3849.  *
  3850.  * "data" is NULL
  3851.  *
  3852.  * FIXME should this happen when SIM records are loaded? (eg, for
  3853.  * EONS)
  3854.  */
  3855. #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
  3856.  
  3857. /**
  3858.  * RIL_UNSOL_RESPONSE_NEW_SMS
  3859.  *
  3860.  * Called when new SMS is received.
  3861.  *
  3862.  * "data" is const char *
  3863.  * This is a pointer to a string containing the PDU of an SMS-DELIVER
  3864.  * as an ascii string of hex digits. The PDU starts with the SMSC address
  3865.  * per TS 27.005 (+CMT:)
  3866.  *
  3867.  * Callee will subsequently confirm the receipt of thei SMS with a
  3868.  * RIL_REQUEST_SMS_ACKNOWLEDGE
  3869.  *
  3870.  * No new RIL_UNSOL_RESPONSE_NEW_SMS
  3871.  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
  3872.  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
  3873.  */
  3874.  
  3875. #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
  3876.  
  3877. /**
  3878.  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
  3879.  *
  3880.  * Called when new SMS Status Report is received.
  3881.  *
  3882.  * "data" is const char *
  3883.  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
  3884.  * as an ascii string of hex digits. The PDU starts with the SMSC address
  3885.  * per TS 27.005 (+CDS:).
  3886.  *
  3887.  * Callee will subsequently confirm the receipt of the SMS with a
  3888.  * RIL_REQUEST_SMS_ACKNOWLEDGE
  3889.  *
  3890.  * No new RIL_UNSOL_RESPONSE_NEW_SMS
  3891.  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
  3892.  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
  3893.  */
  3894.  
  3895. #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
  3896.  
  3897. /**
  3898.  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
  3899.  *
  3900.  * Called when new SMS has been stored on SIM card
  3901.  *
  3902.  * "data" is const int *
  3903.  * ((const int *)data)[0] contains the slot index on the SIM that contains
  3904.  * the new message
  3905.  */
  3906.  
  3907. #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
  3908.  
  3909. /**
  3910.  * RIL_UNSOL_ON_USSD
  3911.  *
  3912.  * Called when a new USSD message is received.
  3913.  *
  3914.  * "data" is const char **
  3915.  * ((const char **)data)[0] points to a type code, which is
  3916.  *  one of these string values:
  3917.  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
  3918.  *      "1"   USSD-Request -- text in ((const char **)data)[1]
  3919.  *      "2"   Session terminated by network
  3920.  *      "3"   other local client (eg, SIM Toolkit) has responded
  3921.  *      "4"   Operation not supported
  3922.  *      "5"   Network timeout
  3923.  *
  3924.  * The USSD session is assumed to persist if the type code is "1", otherwise
  3925.  * the current session (if any) is assumed to have terminated.
  3926.  *
  3927.  * ((const char **)data)[1] points to a message string if applicable, which
  3928.  * should always be in UTF-8.
  3929.  */
  3930. #define RIL_UNSOL_ON_USSD 1006
  3931. /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
  3932.  
  3933. /**
  3934.  * RIL_UNSOL_ON_USSD_REQUEST
  3935.  *
  3936.  * Obsolete. Send via RIL_UNSOL_ON_USSD
  3937.  */
  3938. #define RIL_UNSOL_ON_USSD_REQUEST 1007
  3939.  
  3940. /**
  3941.  * RIL_UNSOL_NITZ_TIME_RECEIVED
  3942.  *
  3943.  * Called when radio has received a NITZ time message
  3944.  *
  3945.  * "data" is const char * pointing to NITZ time string
  3946.  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
  3947.  */
  3948. #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
  3949.  
  3950. /**
  3951.  * RIL_UNSOL_SIGNAL_STRENGTH
  3952.  *
  3953.  * Radio may report signal strength rather han have it polled.
  3954.  *
  3955.  * "data" is a const RIL_SignalStrength *
  3956.  */
  3957. #define RIL_UNSOL_SIGNAL_STRENGTH  1009
  3958.  
  3959.  
  3960. /**
  3961.  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
  3962.  *
  3963.  * "data" is an array of RIL_Data_Call_Response_v6 identical to that
  3964.  * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
  3965.  * of current data contexts including new contexts that have been
  3966.  * activated. A data call is only removed from this list when the
  3967.  * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
  3968.  * is powered off/on.
  3969.  *
  3970.  * See also: RIL_REQUEST_DATA_CALL_LIST
  3971.  */
  3972.  
  3973. #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
  3974.  
  3975. /**
  3976.  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
  3977.  *
  3978.  * Reports supplementary service related notification from the network.
  3979.  *
  3980.  * "data" is a const RIL_SuppSvcNotification *
  3981.  *
  3982.  */
  3983.  
  3984. #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
  3985.  
  3986. /**
  3987.  * RIL_UNSOL_STK_SESSION_END
  3988.  *
  3989.  * Indicate when STK session is terminated by SIM.
  3990.  *
  3991.  * "data" is NULL
  3992.  */
  3993. #define RIL_UNSOL_STK_SESSION_END 1012
  3994.  
  3995. /**
  3996.  * RIL_UNSOL_STK_PROACTIVE_COMMAND
  3997.  *
  3998.  * Indicate when SIM issue a STK proactive command to applications
  3999.  *
  4000.  * "data" is a const char * containing SAT/USAT proactive command
  4001.  * in hexadecimal format string starting with command tag
  4002.  *
  4003.  */
  4004. #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
  4005.  
  4006. /**
  4007.  * RIL_UNSOL_STK_EVENT_NOTIFY
  4008.  *
  4009.  * Indicate when SIM notifies applcations some event happens.
  4010.  * Generally, application does not need to have any feedback to
  4011.  * SIM but shall be able to indicate appropriate messages to users.
  4012.  *
  4013.  * "data" is a const char * containing SAT/USAT commands or responses
  4014.  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
  4015.  * starting with first byte of response data or command tag
  4016.  *
  4017.  */
  4018. #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
  4019.  
  4020. /**
  4021.  * RIL_UNSOL_STK_CALL_SETUP
  4022.  *
  4023.  * Indicate when SIM wants application to setup a voice call.
  4024.  *
  4025.  * "data" is const int *
  4026.  * ((const int *)data)[0] contains timeout value (in milliseconds)
  4027.  */
  4028. #define RIL_UNSOL_STK_CALL_SETUP 1015
  4029.  
  4030. /**
  4031.  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
  4032.  *
  4033.  * Indicates that SMS storage on the SIM is full.  Sent when the network
  4034.  * attempts to deliver a new SMS message.  Messages cannot be saved on the
  4035.  * SIM until space is freed.  In particular, incoming Class 2 messages
  4036.  * cannot be stored.
  4037.  *
  4038.  * "data" is null
  4039.  *
  4040.  */
  4041. #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
  4042.  
  4043. /**
  4044.  * RIL_UNSOL_SIM_REFRESH
  4045.  *
  4046.  * Indicates that file(s) on the SIM have been updated, or the SIM
  4047.  * has been reinitialized.
  4048.  *
  4049.  * In the case where RIL is version 6 or older:
  4050.  * "data" is an int *
  4051.  * ((int *)data)[0] is a RIL_SimRefreshResult.
  4052.  * ((int *)data)[1] is the EFID of the updated file if the result is
  4053.  * SIM_FILE_UPDATE or NULL for any other result.
  4054.  *
  4055.  * In the case where RIL is version 7:
  4056.  * "data" is a RIL_SimRefreshResponse_v7 *
  4057.  *
  4058.  * Note: If the SIM state changes as a result of the SIM refresh (eg,
  4059.  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
  4060.  * should be sent.
  4061.  */
  4062. #define RIL_UNSOL_SIM_REFRESH 1017
  4063.  
  4064. /**
  4065.  * RIL_UNSOL_CALL_RING
  4066.  *
  4067.  * Ring indication for an incoming call (eg, RING or CRING event).
  4068.  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
  4069.  * of a call and sending multiple is optional. If the system property
  4070.  * ro.telephony.call_ring.multiple is false then the upper layers
  4071.  * will generate the multiple events internally. Otherwise the vendor
  4072.  * ril must generate multiple RIL_UNSOL_CALL_RING if
  4073.  * ro.telephony.call_ring.multiple is true or if it is absent.
  4074.  *
  4075.  * The rate of these events is controlled by ro.telephony.call_ring.delay
  4076.  * and has a default value of 3000 (3 seconds) if absent.
  4077.  *
  4078.  * "data" is null for GSM
  4079.  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
  4080.  */
  4081. #define RIL_UNSOL_CALL_RING 1018
  4082.  
  4083. /**
  4084.  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
  4085.  *
  4086.  * Indicates that SIM state changes.
  4087.  *
  4088.  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
  4089.  
  4090.  * "data" is null
  4091.  */
  4092. #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
  4093.  
  4094. /**
  4095.  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
  4096.  *
  4097.  * Called when new CDMA SMS is received
  4098.  *
  4099.  * "data" is const RIL_CDMA_SMS_Message *
  4100.  *
  4101.  * Callee will subsequently confirm the receipt of the SMS with
  4102.  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
  4103.  *
  4104.  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
  4105.  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
  4106.  *
  4107.  */
  4108. #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
  4109.  
  4110. /**
  4111.  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
  4112.  *
  4113.  * Called when new Broadcast SMS is received
  4114.  *
  4115.  * "data" can be one of the following:
  4116.  * If received from GSM network, "data" is const char of 88 bytes
  4117.  * which indicates each page of a CBS Message sent to the MS by the
  4118.  * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
  4119.  * If received from UMTS network, "data" is const char of 90 up to 1252
  4120.  * bytes which contain between 1 and 15 CBS Message pages sent as one
  4121.  * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
  4122.  *
  4123.  */
  4124. #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
  4125.  
  4126. /**
  4127.  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
  4128.  *
  4129.  * Indicates that SMS storage on the RUIM is full.  Messages
  4130.  * cannot be saved on the RUIM until space is freed.
  4131.  *
  4132.  * "data" is null
  4133.  *
  4134.  */
  4135. #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
  4136.  
  4137. /**
  4138.  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
  4139.  *
  4140.  * Indicates a restricted state change (eg, for Domain Specific Access Control).
  4141.  *
  4142.  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
  4143.  *
  4144.  * "data" is an int *
  4145.  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
  4146.  */
  4147. #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
  4148.  
  4149. /**
  4150.  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
  4151.  *
  4152.  * Indicates that the radio system selection module has
  4153.  * autonomously entered emergency callback mode.
  4154.  *
  4155.  * "data" is null
  4156.  *
  4157.  */
  4158. #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
  4159.  
  4160. /**
  4161.  * RIL_UNSOL_CDMA_CALL_WAITING
  4162.  *
  4163.  * Called when CDMA radio receives a call waiting indication.
  4164.  *
  4165.  * "data" is const RIL_CDMA_CallWaiting *
  4166.  *
  4167.  */
  4168. #define RIL_UNSOL_CDMA_CALL_WAITING 1025
  4169.  
  4170. /**
  4171.  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
  4172.  *
  4173.  * Called when CDMA radio receives an update of the progress of an
  4174.  * OTASP/OTAPA call.
  4175.  *
  4176.  * "data" is const int *
  4177.  *  For CDMA this is an integer OTASP/OTAPA status listed in
  4178.  *  RIL_CDMA_OTA_ProvisionStatus.
  4179.  *
  4180.  */
  4181. #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
  4182.  
  4183. /**
  4184.  * RIL_UNSOL_CDMA_INFO_REC
  4185.  *
  4186.  * Called when CDMA radio receives one or more info recs.
  4187.  *
  4188.  * "data" is const RIL_CDMA_InformationRecords *
  4189.  *
  4190.  */
  4191. #define RIL_UNSOL_CDMA_INFO_REC 1027
  4192.  
  4193. /**
  4194.  * RIL_UNSOL_OEM_HOOK_RAW
  4195.  *
  4196.  * This is for OEM specific use.
  4197.  *
  4198.  * "data" is a byte[]
  4199.  */
  4200. #define RIL_UNSOL_OEM_HOOK_RAW 1028
  4201.  
  4202. /**
  4203.  * RIL_UNSOL_RINGBACK_TONE
  4204.  *
  4205.  * Indicates that nework doesn't have in-band information,  need to
  4206.  * play out-band tone.
  4207.  *
  4208.  * "data" is an int *
  4209.  * ((int *)data)[0] == 0 for stop play ringback tone.
  4210.  * ((int *)data)[0] == 1 for start play ringback tone.
  4211.  */
  4212. #define RIL_UNSOL_RINGBACK_TONE 1029
  4213.  
  4214. /**
  4215.  * RIL_UNSOL_RESEND_INCALL_MUTE
  4216.  *
  4217.  * Indicates that framework/application need reset the uplink mute state.
  4218.  *
  4219.  * There may be situations where the mute state becomes out of sync
  4220.  * between the application and device in some GSM infrastructures.
  4221.  *
  4222.  * "data" is null
  4223.  */
  4224. #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
  4225.  
  4226. /**
  4227.  * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
  4228.  *
  4229.  * Called when CDMA subscription source changed.
  4230.  *
  4231.  * "data" is int *
  4232.  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
  4233.  */
  4234. #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
  4235.  
  4236. /**
  4237.  * RIL_UNSOL_CDMA_PRL_CHANGED
  4238.  *
  4239.  * Called when PRL (preferred roaming list) changes.
  4240.  *
  4241.  * "data" is int *
  4242.  * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
  4243.  */
  4244. #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
  4245.  
  4246. /**
  4247.  * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
  4248.  *
  4249.  * Called when Emergency Callback Mode Ends
  4250.  *
  4251.  * Indicates that the radio system selection module has
  4252.  * proactively exited emergency callback mode.
  4253.  *
  4254.  * "data" is NULL
  4255.  *
  4256.  */
  4257. #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
  4258.  
  4259. /**
  4260.  * RIL_UNSOL_RIL_CONNECTED
  4261.  *
  4262.  * Called the ril connects and returns the version
  4263.  *
  4264.  * "data" is int *
  4265.  * ((int *)data)[0] is RIL_VERSION
  4266.  */
  4267. #define RIL_UNSOL_RIL_CONNECTED 1034
  4268.  
  4269. /**
  4270.  * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
  4271.  *
  4272.  * Indicates that voice technology has changed. Contains new radio technology
  4273.  * as a data in the message.
  4274.  *
  4275.  * "data" is int *
  4276.  * ((int *)data)[0] is of type const RIL_RadioTechnology
  4277.  *
  4278.  */
  4279. #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
  4280.  
  4281. /**
  4282.  * RIL_UNSOL_CELL_INFO_LIST
  4283.  *
  4284.  * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned
  4285.  * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE.
  4286.  *
  4287.  * "data" is NULL
  4288.  *
  4289.  * "response" is an array of RIL_CellInfo.
  4290.  */
  4291. #define RIL_UNSOL_CELL_INFO_LIST 1036
  4292.  
  4293. /**
  4294.  * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED
  4295.  *
  4296.  * Called when IMS registration state has changed
  4297.  *
  4298.  * To get IMS registration state and IMS SMS format, callee needs to invoke the
  4299.  * following request on main thread:
  4300.  *
  4301.  * RIL_REQUEST_IMS_REGISTRATION_STATE
  4302.  *
  4303.  * "data" is NULL
  4304.  *
  4305.  */
  4306. #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037
  4307.  
  4308. /**
  4309.  * RIL_UNSOL_ON_SS
  4310.  *
  4311.  * Called when SS response is received when DIAL/USSD/SS is changed to SS by
  4312.  * call control.
  4313.  *
  4314.  * "data" is const RIL_StkCcUnsolSsResponse *
  4315.  *
  4316.  */
  4317. #define RIL_UNSOL_ON_SS 1039
  4318.  
  4319.  
  4320. /**
  4321.  * RIL_UNSOL_STK_CC_ALPHA_NOTIFY
  4322.  *
  4323.  * Called when there is an ALPHA from UICC during Call Control.
  4324.  *
  4325.  * "data" is const char * containing ALPHA string from UICC in UTF-8 format.
  4326.  *
  4327.  */
  4328. #define RIL_UNSOL_STK_CC_ALPHA_NOTIFY 1040
  4329.  
  4330. /**
  4331.  * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED
  4332.  *
  4333.  * Indicated when there is a change in subscription status.
  4334.  * This event will be sent in the following scenarios
  4335.  *  - subscription readiness at modem, which was selected by telephony layer
  4336.  *  - when subscription is deactivated by modem due to UICC card removal
  4337.  *  - When network invalidates the subscription i.e. attach reject due to authentication reject
  4338.  *
  4339.  * "data" is const int *
  4340.  * ((const int *)data)[0] == 0 for Subscription Deactivated
  4341.  * ((const int *)data)[0] == 1 for Subscription Activated
  4342.  *
  4343.  */
  4344. #define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1041
  4345. /***********************************************************************/
  4346.  
  4347. /* COMPATIBILITY WITH MAINLINE */
  4348. #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION RIL_REQUEST_ENTER_DEPERSONALIZATION_CODE
  4349.  
  4350. /**
  4351.  * RIL_Request Function pointer
  4352.  *
  4353.  * @param request is one of RIL_REQUEST_*
  4354.  * @param data is pointer to data defined for that RIL_REQUEST_*
  4355.  *        data is owned by caller, and should not be modified or freed by callee
  4356.  * @param t should be used in subsequent call to RIL_onResponse
  4357.  * @param datalen the length of data
  4358.  *
  4359.  */
  4360. typedef void (*RIL_RequestFunc) (int request, void *data,
  4361.                                     size_t datalen, RIL_Token t);
  4362.  
  4363. /**
  4364.  * This function should return the current radio state synchronously
  4365.  */
  4366. typedef RIL_RadioState (*RIL_RadioStateRequest)();
  4367.  
  4368. /**
  4369.  * This function returns "1" if the specified RIL_REQUEST code is
  4370.  * supported and 0 if it is not
  4371.  *
  4372.  * @param requestCode is one of RIL_REQUEST codes
  4373.  */
  4374.  
  4375. typedef int (*RIL_Supports)(int requestCode);
  4376.  
  4377. /**
  4378.  * This function is called from a separate thread--not the
  4379.  * thread that calls RIL_RequestFunc--and indicates that a pending
  4380.  * request should be cancelled.
  4381.  *
  4382.  * On cancel, the callee should do its best to abandon the request and
  4383.  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
  4384.  *
  4385.  * Subsequent calls to  RIL_onRequestComplete for this request with
  4386.  * other results will be tolerated but ignored. (That is, it is valid
  4387.  * to ignore the cancellation request)
  4388.  *
  4389.  * RIL_Cancel calls should return immediately, and not wait for cancellation
  4390.  *
  4391.  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
  4392.  * interface
  4393.  *
  4394.  * @param t token wants to be canceled
  4395.  */
  4396.  
  4397. typedef void (*RIL_Cancel)(RIL_Token t);
  4398.  
  4399. typedef void (*RIL_TimedCallback) (void *param);
  4400.  
  4401. /**
  4402.  * Return a version string for your RIL implementation
  4403.  */
  4404. typedef const char * (*RIL_GetVersion) (void);
  4405.  
  4406. typedef struct {
  4407.     int version;        /* set to RIL_VERSION */
  4408.     RIL_RequestFunc onRequest;
  4409.     RIL_RadioStateRequest onStateRequest;
  4410.     RIL_Supports supports;
  4411.     RIL_Cancel onCancel;
  4412.     RIL_GetVersion getVersion;
  4413. } RIL_RadioFunctions;
  4414.  
  4415. typedef struct {
  4416.     char *apn;
  4417.     char *protocol;
  4418.     int authtype;
  4419.     char *username;
  4420.     char *password;
  4421. } RIL_InitialAttachApn;
  4422.  
  4423. #ifdef RIL_SHLIB
  4424. struct RIL_Env {
  4425.     /**
  4426.      * "t" is parameter passed in on previous call to RIL_Notification
  4427.      * routine.
  4428.      *
  4429.      * If "e" != SUCCESS, then response can be null/is ignored
  4430.      *
  4431.      * "response" is owned by caller, and should not be modified or
  4432.      * freed by callee
  4433.      *
  4434.      * RIL_onRequestComplete will return as soon as possible
  4435.      */
  4436.     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
  4437.                            void *response, size_t responselen);
  4438.  
  4439.     /**
  4440.      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
  4441.      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
  4442.      *
  4443.      * "data" is owned by caller, and should not be modified or freed by callee
  4444.      */
  4445.  
  4446.     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data,
  4447.                                     size_t datalen);
  4448.  
  4449.     /**
  4450.      * Call user-specifed "callback" function on on the same thread that
  4451.      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
  4452.      * a relative time value at which the callback is invoked. If relativeTime is
  4453.      * NULL or points to a 0-filled structure, the callback will be invoked as
  4454.      * soon as possible
  4455.      */
  4456.  
  4457.     void (*RequestTimedCallback) (RIL_TimedCallback callback,
  4458.                                    void *param, const struct timeval *relativeTime);
  4459. };
  4460.  
  4461.  
  4462. /**
  4463.  *  RIL implementations must defined RIL_Init
  4464.  *  argc and argv will be command line arguments intended for the RIL implementation
  4465.  *  Return NULL on error
  4466.  *
  4467.  * @param env is environment point defined as RIL_Env
  4468.  * @param argc number of arguments
  4469.  * @param argv list fo arguments
  4470.  *
  4471.  */
  4472. const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
  4473.  
  4474. #else /* RIL_SHLIB */
  4475.  
  4476. /**
  4477.  * Call this once at startup to register notification routine
  4478.  *
  4479.  * @param callbacks user-specifed callback function
  4480.  */
  4481. void RIL_register (const RIL_RadioFunctions *callbacks);
  4482.  
  4483.  
  4484. /**
  4485.  *
  4486.  * RIL_onRequestComplete will return as soon as possible
  4487.  *
  4488.  * @param t is parameter passed in on previous call to RIL_Notification
  4489.  *          routine.
  4490.  * @param e error code
  4491.  *          if "e" != SUCCESS, then response can be null/is ignored
  4492.  * @param response is owned by caller, and should not be modified or
  4493.  *                 freed by callee
  4494.  * @param responselen the length of response in byte
  4495.  */
  4496. void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
  4497.                            void *response, size_t responselen);
  4498.  
  4499. /**
  4500.  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
  4501.  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
  4502.  *     "data" is owned by caller, and should not be modified or freed by callee
  4503.  * @param datalen the length of data in byte
  4504.  */
  4505.  
  4506. void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
  4507.                                 size_t datalen);
  4508.  
  4509.  
  4510. /**
  4511.  * Call user-specifed "callback" function on on the same thread that
  4512.  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
  4513.  * a relative time value at which the callback is invoked. If relativeTime is
  4514.  * NULL or points to a 0-filled structure, the callback will be invoked as
  4515.  * soon as possible
  4516.  *
  4517.  * @param callback user-specifed callback function
  4518.  * @param param parameter list
  4519.  * @param relativeTime a relative time value at which the callback is invoked
  4520.  */
  4521.  
  4522. void RIL_requestTimedCallback (RIL_TimedCallback callback,
  4523.                                void *param, const struct timeval *relativeTime);
  4524.  
  4525.  
  4526. #endif /* RIL_SHLIB */
  4527.  
  4528. #ifdef __cplusplus
  4529. }
  4530. #endif
  4531.  
  4532. #endif /*ANDROID_RIL_H*/
Add Comment
Please, Sign In to add comment