OSDN Git Service

Code drop from //branches/cupcake/...@124589
[android-x86/hardware-ril.git] / include / telephony / ril.h
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /*
18  * ISSUES:
19  * - SMS retransmit (specifying TP-Message-ID)
20  *
21  */
22
23 /**
24  * TODO
25  *
26  * Supp Service Notification (+CSSN)
27  * GPRS PDP context deactivate notification
28  *  
29  */
30
31
32 #ifndef ANDROID_RIL_H 
33 #define ANDROID_RIL_H 1
34
35 #include <stdlib.h>
36 #include <sys/time.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 #define RIL_VERSION 2
43
44 typedef void * RIL_Token;
45
46 typedef enum {
47     RIL_E_SUCCESS = 0,
48     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
49     RIL_E_GENERIC_FAILURE = 2,
50     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
51     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
52     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
53     RIL_E_REQUEST_NOT_SUPPORTED = 6,
54     RIL_E_CANCELLED = 7,
55     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
56                                                    call on a Class C GPRS device */
57     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
58                                                    registers in network */
59     RIL_E_SMS_SEND_FAIL_RETRY = 10              /* fail to send sms and need retry */   
60 } RIL_Errno;
61
62 typedef enum {
63     RIL_CALL_ACTIVE = 0,
64     RIL_CALL_HOLDING = 1,
65     RIL_CALL_DIALING = 2,    /* MO call only */
66     RIL_CALL_ALERTING = 3,   /* MO call only */
67     RIL_CALL_INCOMING = 4,   /* MT call only */
68     RIL_CALL_WAITING = 5     /* MT call only */
69 } RIL_CallState;
70
71 typedef enum {
72     RADIO_STATE_OFF = 0,          /* Radio explictly powered off (eg CFUN=0) */
73     RADIO_STATE_UNAVAILABLE = 1,  /* Radio unavailable (eg, resetting or not booted) */
74     RADIO_STATE_SIM_NOT_READY = 2,      /* Radio is on, but the SIM interface is not ready */
75     RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network 
76                                personalization locked, or SIM absent */
77     RADIO_STATE_SIM_READY = 4           /* Radio is on and SIM interface is available */
78 } RIL_RadioState;
79
80 typedef struct {
81     RIL_CallState   state;
82     int             index;      /* GSM Index for use with, eg, AT+CHLD */
83     int             toa;        /* type of address, eg 145 = intl */
84     char            isMpty;     /* nonzero if is mpty call */
85     char            isMT;       /* nonzero if call is mobile terminated */
86     char            als;        /* ALS line indicator if available 
87                                    (0 = line 1) */
88     char            isVoice;    /* nonzero if this is is a voice call */
89
90     char *          number;     /* phone number */
91 } RIL_Call;
92
93 typedef struct {
94     int             cid;        /* Context ID */
95     int             active;     /* nonzero if context is active */
96     char *          type;       /* X.25, IP, IPV6, etc. */
97     char *          apn;
98     char *          address;
99 } RIL_PDP_Context_Response;
100
101 typedef struct {
102     int messageRef;   /*TP-Message-Reference*/
103     char *ackPDU;     /* or NULL if n/a */
104 } RIL_SMS_Response;
105
106 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
107 typedef struct {
108     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
109                     /*      0 = "REC UNREAD"    */
110                     /*      1 = "REC READ"      */
111                     /*      2 = "STO UNSENT"    */
112                     /*      3 = "STO SENT"      */
113     char * pdu;     /* PDU of message to write, as a hex string. */
114     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
115                        (as expected by TS 27.005) or NULL for default SMSC */
116 } RIL_SMS_WriteArgs;
117
118 /** Used by RIL_REQUEST_DIAL */
119 typedef struct {
120     char * address;
121     int clir;
122             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
123              * clir == 0 on "use subscription default value"
124              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
125              * clir == 2 on "CLIR suppression" (allow CLI presentation)
126              */
127
128 } RIL_Dial;
129
130 typedef struct {
131     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
132     int fileid;     /* EF id */
133     char *path;     /* "pathid" from TS 27.007 +CRSM command.
134                        Path is in hex asciii format eg "7f205f70"
135                      */
136     int p1;
137     int p2;
138     int p3;
139     char *data;     /* May be NULL*/
140     char *pin2;     /* May be NULL*/
141 } RIL_SIM_IO;
142
143 typedef struct {
144     int sw1;
145     int sw2;
146     char *simResponse;  /* In hex string format ([a-fA-F0-9]*). */
147 } RIL_SIM_IO_Response;
148
149 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
150
151 typedef struct {
152     int             status;     /*
153                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
154                                  * status 1 = active, 0 = not active
155                                  *
156                                  * For RIL_REQUEST_SET_CALL_FORWARD:
157                                  * status is:
158                                  * 0 = disable
159                                  * 1 = enable
160                                  * 2 = interrogate
161                                  * 3 = registeration
162                                  * 4 = erasure
163                                  */
164
165     int             reason;     /* from TS 27.007 7.11 "reason" */
166     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
167                                     See table for Android mapping from
168                                     MMI service code 
169                                     0 means user doesn't input class */
170     int             toa;        /* "type" from TS 27.007 7.11 */
171     char *          number;     /* "number" from TS 27.007 7.11. May be NULL */
172     int             timeSeconds; /* for CF no reply only */
173 }RIL_CallForwardInfo;
174
175 typedef struct {
176    char * cid;         /* cell id in 2G,  Primary Scrambling Code in 3G
177                         * hexadecimal format.
178                         * Valid values are 0x00000000 - 0xffffffff.
179                         */
180    int    rssi;        /* Received RSSI in 2G,
181                         * Level index of CPICH Received Signal Code Power in 3G
182                         */
183 } RIL_NeighboringCell;
184
185 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
186 typedef enum {
187     CALL_FAIL_NORMAL = 16,
188     CALL_FAIL_BUSY = 17,
189     CALL_FAIL_CONGESTION = 34,
190     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
191     CALL_FAIL_CALL_BARRED = 240,
192     CALL_FAIL_FDN_BLOCKED = 241,
193     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
194 } RIL_LastCallFailCause;
195
196 /* See RIL_REQUEST_LAST_PDP_FAIL_CAUSE */
197 typedef enum {
198     PDP_FAIL_BARRED = 8,         /* no retry; prompt user */
199     PDP_FAIL_BAD_APN = 27,       /* no retry; prompt user */
200     PDP_FAIL_USER_AUTHENTICATION = 29, /* no retry; prompt user */
201     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 32,  /*no retry; prompt user */
202     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33, /*no retry; prompt user */
203     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff  /* This and all other cases: retry silently */
204 } RIL_LastPDPActivateFailCause;
205
206 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
207 typedef struct {
208     int     notificationType;   /*
209                                  * 0 = MO intermediate result code
210                                  * 1 = MT unsolicited result code
211                                  */
212     int     code;               /* See 27.007 7.17
213                                    "code1" for MO
214                                    "code2" for MT. */
215     int     index;              /* CUG index. See 27.007 7.17. */
216     int     type;               /* "type" from 27.007 7.17 (MT only). */
217     char *  number;             /* "number" from 27.007 7.17
218                                    (MT only, may be NULL). */
219 } RIL_SuppSvcNotification;
220
221 /* see RIL_REQUEST_GET_SIM_STATUS */
222 #define RIL_SIM_ABSENT                  0
223 #define RIL_SIM_NOT_READY               1
224 /* RIL_SIM_READY means that the radio state is RADIO_STATE_SIM_READY. 
225  * This is more
226  * than "+CPIN: READY". It also means the radio is ready for SIM I/O
227  */
228 #define RIL_SIM_READY                   2
229 #define RIL_SIM_PIN                     3
230 #define RIL_SIM_PUK                     4
231 #define RIL_SIM_NETWORK_PERSONALIZATION 5
232
233 /* The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH */
234 typedef enum {
235     /* A file on SIM has been updated.  data[1] contains the EFID. */
236     SIM_FILE_UPDATE = 0,
237     /* SIM initialized.  All files should be re-read. */
238     SIM_INIT = 1,
239     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
240     SIM_RESET = 2
241 } RIL_SimRefreshResult;
242
243 /** 
244  * RIL_REQUEST_GET_SIM_STATUS
245  *
246  * Requests status of the SIM interface and the SIM card
247  * 
248  * "data" is NULL
249  *
250  * "response" must be an int * pointing to RIL_SIM_* constant 
251  * This should always succeed (RIL_SUCCESS)
252  *
253  * If the radio is off or unavailable, return RIL_SIM_NOT_READY 
254  *
255  * Please note: RIL_SIM_READY means that the radio state 
256  * is RADIO_STATE_SIM_READY.   This is more than "+CPIN: READY". 
257  * It also means the radio is ready for SIM I/O
258  *
259  * Valid errors:
260  *  Must never fail
261  */
262 #define RIL_REQUEST_GET_SIM_STATUS 1
263
264 /**
265  * RIL_REQUEST_ENTER_SIM_PIN
266  *
267  * Supplies SIM PIN. Only called if SIM status is RIL_SIM_PIN
268  *
269  * "data" is const char **
270  * ((const char **)data)[0] is PIN value
271  *
272  * "response" must be NULL
273  *
274  * Valid errors:
275  *  
276  * SUCCESS 
277  * RADIO_NOT_AVAILABLE (radio resetting)
278  * GENERIC_FAILURE
279  * PASSWORD_INCORRECT
280  */
281
282 #define RIL_REQUEST_ENTER_SIM_PIN 2
283
284
285 /**
286  * RIL_REQUEST_ENTER_SIM_PUK
287  *
288  * Supplies SIM PUK and new PIN. 
289  *
290  * "data" is const char **
291  * ((const char **)data)[0] is PUK value
292  * ((const char **)data)[1] is new PIN value
293  *
294  * "response" must be NULL
295  *
296  * Valid errors:
297  *  
298  *  SUCCESS 
299  *  RADIO_NOT_AVAILABLE (radio resetting)
300  *  GENERIC_FAILURE
301  *  PASSWORD_INCORRECT
302  *     (PUK is invalid)
303  */
304
305 #define RIL_REQUEST_ENTER_SIM_PUK 3
306
307 /**
308  * RIL_REQUEST_ENTER_SIM_PIN2
309  *
310  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
311  * returned as a a failure from a previous operation.
312  *
313  * "data" is const char **
314  * ((const char **)data)[0] is PIN2 value
315  *
316  * "response" must be NULL
317  *
318  * Valid errors:
319  *  
320  *  SUCCESS 
321  *  RADIO_NOT_AVAILABLE (radio resetting)
322  *  GENERIC_FAILURE
323  *  PASSWORD_INCORRECT
324  */
325
326 #define RIL_REQUEST_ENTER_SIM_PIN2 4
327
328 /**
329  * RIL_REQUEST_ENTER_SIM_PUK2
330  *
331  * Supplies SIM PUK2 and new PIN2. 
332  *
333  * "data" is const char **
334  * ((const char **)data)[0] is PUK2 value
335  * ((const char **)data)[1] is new PIN2 value
336  *
337  * "response" must be NULL
338  *
339  * Valid errors:
340  *  
341  *  SUCCESS 
342  *  RADIO_NOT_AVAILABLE (radio resetting)
343  *  GENERIC_FAILURE
344  *  PASSWORD_INCORRECT
345  *     (PUK2 is invalid)
346  */
347
348 #define RIL_REQUEST_ENTER_SIM_PUK2 5
349
350 /**
351  * RIL_REQUEST_CHANGE_SIM_PIN
352  *
353  * Supplies old SIM PIN and new PIN. 
354  *
355  * "data" is const char **
356  * ((const char **)data)[0] is old PIN value
357  * ((const char **)data)[1] is new PIN value
358  *
359  * "response" must be NULL
360  *
361  * Valid errors:
362  *  
363  *  SUCCESS 
364  *  RADIO_NOT_AVAILABLE (radio resetting)
365  *  GENERIC_FAILURE
366  *  PASSWORD_INCORRECT
367  *     (old PIN is invalid)
368  *      
369  */
370
371 #define RIL_REQUEST_CHANGE_SIM_PIN 6
372
373
374 /**
375  * RIL_REQUEST_CHANGE_SIM_PIN2
376  *
377  * Supplies old SIM PIN2 and new PIN2. 
378  *
379  * "data" is const char **
380  * ((const char **)data)[0] is old PIN2 value
381  * ((const char **)data)[1] is new PIN2 value
382  *
383  * "response" must be NULL
384  *
385  * Valid errors:
386  *  
387  *  SUCCESS 
388  *  RADIO_NOT_AVAILABLE (radio resetting)
389  *  GENERIC_FAILURE
390  *  PASSWORD_INCORRECT
391  *     (old PIN2 is invalid)
392  *      
393  */
394
395 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
396
397 /**
398  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
399  *
400  * Requests that network personlization be deactivated
401  *
402  * "data" is const char **
403  * ((const char **)(data))[0]] is network depersonlization code
404  *
405  * "response" must be NULL
406  *
407  * Valid errors:
408  *  
409  *  SUCCESS 
410  *  RADIO_NOT_AVAILABLE (radio resetting)
411  *  GENERIC_FAILURE
412  *  PASSWORD_INCORRECT
413  *     (code is invalid)
414  */
415
416 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
417
418 /**
419  * RIL_REQUEST_GET_CURRENT_CALLS 
420  *
421  * Requests current call list
422  *
423  * "data" is NULL
424  *
425  * "response" must be a "const RIL_Call **"
426  * 
427  * Valid errors:
428  *  
429  *  SUCCESS 
430  *  RADIO_NOT_AVAILABLE (radio resetting)
431  *  GENERIC_FAILURE
432  *      (request will be made again in a few hundred msec)
433  */
434
435 #define RIL_REQUEST_GET_CURRENT_CALLS 9
436
437
438 /** 
439  * RIL_REQUEST_DIAL
440  *
441  * Initiate voice call
442  *
443  * "data" is const RIL_Dial *
444  * "response" is NULL
445  *  
446  * This method is never used for supplementary service codes
447  *
448  * Valid errors:
449  *  SUCCESS 
450  *  RADIO_NOT_AVAILABLE (radio resetting)
451  *  GENERIC_FAILURE
452  */
453 #define RIL_REQUEST_DIAL 10
454
455 /**
456  * RIL_REQUEST_GET_IMSI
457  *
458  * Get the SIM IMSI
459  *
460  * Only valid when radio state is "RADIO_STATE_SIM_READY"
461  *
462  * "data" is NULL
463  * "response" is a const char * containing the IMSI
464  *
465  * Valid errors:
466  *  SUCCESS 
467  *  RADIO_NOT_AVAILABLE (radio resetting)
468  *  GENERIC_FAILURE
469  */
470
471 #define RIL_REQUEST_GET_IMSI 11
472
473 /**
474  * RIL_REQUEST_HANGUP
475  *
476  * Hang up a specific line (like AT+CHLD=1x)
477  *
478  * "data" is an int * 
479  * (int *)data)[0] contains GSM call index (value of 'x' in CHLD above)
480  *
481  * "response" is NULL
482  *
483  * Valid errors:
484  *  SUCCESS 
485  *  RADIO_NOT_AVAILABLE (radio resetting)
486  *  GENERIC_FAILURE
487  */
488
489 #define RIL_REQUEST_HANGUP 12
490
491 /**
492  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
493  *
494  * Hang up waiting or held (like AT+CHLD=0)
495  *
496  * "data" is NULL
497  * "response" is NULL
498  *
499  * Valid errors:
500  *  SUCCESS 
501  *  RADIO_NOT_AVAILABLE (radio resetting)
502  *  GENERIC_FAILURE
503  */
504
505 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
506
507 /**
508  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
509  *
510  * Hang up waiting or held (like AT+CHLD=1)
511  *
512  * "data" is NULL
513  * "response" is NULL
514  *
515  * Valid errors:
516  *  SUCCESS 
517  *  RADIO_NOT_AVAILABLE (radio resetting)
518  *  GENERIC_FAILURE
519  */
520
521 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
522
523 /**
524  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
525  *
526  * Switch waiting or holding call and active call (like AT+CHLD=2)
527  *
528  * State transitions should be is follows:
529  *
530  * If call 1 is waiting and call 2 is active, then if this re
531  *
532  *   BEFORE                               AFTER
533  * Call 1   Call 2                 Call 1       Call 2
534  * ACTIVE   HOLDING                HOLDING     ACTIVE
535  * ACTIVE   WAITING                HOLDING     ACTIVE
536  * HOLDING  WAITING                HOLDING     ACTIVE
537  * ACTIVE   IDLE                   HOLDING     IDLE
538  * IDLE     IDLE                   IDLE        IDLE
539  *
540  * "data" is NULL
541  * "response" is NULL
542  *
543  * Valid errors:
544  *  SUCCESS 
545  *  RADIO_NOT_AVAILABLE (radio resetting)
546  *  GENERIC_FAILURE
547  */
548
549 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
550 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
551
552 /**
553  * RIL_REQUEST_CONFERENCE
554  *
555  * Conference holding and active (like AT+CHLD=3)
556
557  * "data" is NULL
558  * "response" is NULL
559  *
560  * Valid errors:
561  *  SUCCESS 
562  *  RADIO_NOT_AVAILABLE (radio resetting)
563  *  GENERIC_FAILURE
564  */
565 #define RIL_REQUEST_CONFERENCE 16
566
567 /**
568  * RIL_REQUEST_UDUB
569  *
570  * Send UDUB (user determined used busy) to ringing or 
571  * waiting call answer)(RIL_BasicRequest r);
572  *
573  * "data" is NULL
574  * "response" is NULL
575  *
576  * Valid errors:
577  *  SUCCESS 
578  *  RADIO_NOT_AVAILABLE (radio resetting)
579  *  GENERIC_FAILURE
580  */
581 #define RIL_REQUEST_UDUB 17
582
583 /**
584  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
585  *
586  * Requests the failure cause code for the most recently terminated call
587  *
588  * "data" is NULL
589  * "response" is a "int *"
590  * ((int *)response)[0] is an integer cause code defined in TS 24.008
591  *   Annex H or close approximation
592  *
593  * If the implementation does not have access to the exact cause codes,
594  * then it should return one of the values listed in RIL_LastCallFailCause,
595  * as the UI layer needs to distinguish these cases for tone generation or
596  * error notification.
597  *
598  * Valid errors:
599  *  SUCCESS
600  *  RADIO_NOT_AVAILABLE
601  *  GENERIC_FAILURE
602  *
603  * See also: RIL_REQUEST_LAST_PDP_FAIL_CAUSE
604  */
605 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
606
607 /**
608  * RIL_REQUEST_SIGNAL_STRENGTH
609  *
610  * Requests current signal strength and bit error rate
611  *
612  * Must succeed if radio is on.
613  *
614  * "data" is NULL
615  * "response" is an "int *"
616  * ((int *)response)[0] is received signal strength (0-31, 99)
617  * ((int *)response)[1] is bit error rate (0-7, 99)
618  *  as defined in TS 27.007 8.5
619  *  Other values (eg -1) are not legal
620  *
621  * Valid errors:
622  *  SUCCESS
623  *  RADIO_NOT_AVAILABLE
624  */
625
626 #define RIL_REQUEST_SIGNAL_STRENGTH 19
627 /**
628  * RIL_REQUEST_REGISTRATION_STATE
629  *
630  * Request current registration state
631  *
632  * "data" is NULL
633  * "response" is a "char **"
634  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2
635  * ((const char **)response)[1] is LAC if registered or NULL if not
636  * ((const char **)response)[2] is CID if registered or NULL if not
637  *
638  * LAC and CID are in hexadecimal format.
639  * valid LAC are 0x0000 - 0xffff
640  * valid CID are 0x00000000 - 0xffffffff
641  * 
642  * Please note that registration state 4 ("unknown") is treated 
643  * as "out of service" in the Android telephony system
644  *
645  * Valid errors:
646  *  SUCCESS
647  *  RADIO_NOT_AVAILABLE
648  *  GENERIC_FAILURE
649  */
650 #define RIL_REQUEST_REGISTRATION_STATE 20
651
652 /**
653  * RIL_REQUEST_GPRS_REGISTRATION_STATE
654  *
655  * Request current GPRS registration state
656  *
657  * "data" is NULL
658  * "response" is a "char **"
659  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2
660  * ((const char **)response)[1] is LAC if registered or NULL if not
661  * ((const char **)response)[2] is CID if registered or NULL if not
662  * ((const char **)response)[3] indicates the available radio technology, where:
663  *      0 == unknown
664  *      1 == GPRS only
665  *      2 == EDGE
666  *      3 == UMTS
667  *
668  * LAC and CID are in hexadecimal format.
669  * valid LAC are 0x0000 - 0xffff
670  * valid CID are 0x00000000 - 0xffffffff
671  * 
672  * Please note that registration state 4 ("unknown") is treated 
673  * as "out of service" in the Android telephony system
674  *
675  * Valid errors:
676  *  SUCCESS
677  *  RADIO_NOT_AVAILABLE
678  *  GENERIC_FAILURE
679  */
680 #define RIL_REQUEST_GPRS_REGISTRATION_STATE 21
681
682 /**
683  * RIL_REQUEST_OPERATOR
684  *
685  * Request current operator ONS or EONS
686  *
687  * "data" is NULL
688  * "response" is a "const char **"
689  * ((const char **)response)[0] is long alpha ONS or EONS 
690  *                                  or NULL if unregistered
691  *
692  * ((const char **)response)[1] is short alpha ONS or EONS 
693  *                                  or NULL if unregistered
694  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
695  *                                  or NULL if unregistered
696  *                                  
697  * Valid errors:
698  *  SUCCESS
699  *  RADIO_NOT_AVAILABLE
700  *  GENERIC_FAILURE
701  */
702 #define RIL_REQUEST_OPERATOR 22
703
704 /**
705  * RIL_REQUEST_RADIO_POWER
706  *
707  * Toggle radio on and off (for "airplane" mode)
708  * "data" is int *
709  * ((int *)data)[0] is > 0 for "Radio On"
710  * ((int *)data)[0] is == 0 for "Radio Off"
711  *
712  * "response" is NULL
713  *
714  * Turn radio on if "on" > 0
715  * Turn radio off if "on" == 0
716  *
717  * Valid errors:
718  *  SUCCESS
719  *  RADIO_NOT_AVAILABLE
720  *  GENERIC_FAILURE
721  */
722 #define RIL_REQUEST_RADIO_POWER 23
723
724 /**
725  * RIL_REQUEST_DTMF
726  *
727  * Send a DTMF tone
728  *
729  * If the implementation is currently playing a tone requested via
730  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
731  * should be played instead
732  *
733  * "data" is a char *
734  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
735  * ((char *)data)[1] is a single character with one of 3 values:
736  *    'S' -- tone should be played for a short time
737  *    'L' -- tone should be played for a long time
738  * "response" is NULL
739  * 
740  * FIXME should this block/mute microphone?
741  * How does this interact with local DTMF feedback?
742  *
743  * Valid errors:
744  *  SUCCESS
745  *  RADIO_NOT_AVAILABLE
746  *  GENERIC_FAILURE
747  *
748  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
749  *
750  */
751 #define RIL_REQUEST_DTMF 24
752
753 /**
754  * RIL_REQUEST_SEND_SMS
755  * 
756  * Send an SMS message
757  *
758  * "data" is const char **
759  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
760  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
761  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
762  *      less the SMSC address
763  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
764  *
765  * "response" is a const RIL_SMS_Response *
766  *
767  * Based on the return error, caller decides to resend if sending sms
768  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 
769  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
770  *
771  * Valid errors:
772  *  SUCCESS
773  *  RADIO_NOT_AVAILABLE
774  *  SMS_SEND_FAIL_RETRY
775  *  GENERIC_FAILURE
776  *
777  * FIXME how do we specify TP-Message-Reference if we need to resend?
778  */
779 #define RIL_REQUEST_SEND_SMS 25
780
781
782 /**
783  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
784  * 
785  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
786  * except that more messages are expected to be sent soon. If possible,
787  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
788  *
789  * "data" is const char **
790  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
791  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
792  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
793  *      less the SMSC address
794  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
795  *
796  * "response" is a const RIL_SMS_Response *
797  *
798  * Based on the return error, caller decides to resend if sending sms
799  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 
800  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
801  *
802  * Valid errors:
803  *  SUCCESS
804  *  RADIO_NOT_AVAILABLE
805  *  SMS_SEND_FAIL_RETRY
806  *  GENERIC_FAILURE
807  *
808  */
809 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
810
811
812 /**
813  * RIL_REQUEST_SETUP_DEFAULT_PDP
814  *
815  * Configure and activate PDP context (CID 1) for default IP connection 
816  *
817  * Android Telephony layer will start up pppd process on specified
818  * tty when this request responded to.
819  *
820  * "data" is a const char **
821  * ((const char **)data)[0] is the APN to connect to
822  * ((const char **)data)[1] is the username, or NULL
823  * ((const char **)data)[2] is the password, or NULL
824  *
825  * "response" is a char **
826  * ((char **)response)[0] indicating PDP CID, which is generated by RIL
827  * ((char **)response)[1] indicating the network interface name
828  * ((char **)response)[2] indicating the IP address for this interface
829  *
830  * FIXME may need way to configure QoS settings
831  *
832  * Valid errors:
833  *  SUCCESS
834  *  RADIO_NOT_AVAILABLE
835  *  GENERIC_FAILURE
836  *
837  * See also: RIL_REQUEST_DEACTIVATE_DEFAULT_PDP
838  */
839
840 #define RIL_REQUEST_SETUP_DEFAULT_PDP 27
841
842
843
844 /**
845  * RIL_REQUEST_SIM_IO
846  *
847  * Request SIM I/O operation.
848  * This is similar to the TS 27.007 "restricted SIM" operation
849  * where it assumes all of the EF selection will be done by the
850  * callee.
851  *
852  * "data" is a const RIL_SIM_IO *
853  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
854  * or may specify a PIN2 for operations that require a PIN2 (eg
855  * updating FDN records)
856  *
857  * "response" is a const RIL_SIM_IO_Response *
858  *
859  * Arguments and responses that are unused for certain
860  * values of "command" should be ignored or set to NULL
861  *
862  * Valid errors:
863  *  SUCCESS
864  *  RADIO_NOT_AVAILABLE
865  *  GENERIC_FAILURE
866  *  SIM_PIN2
867  *  SIM_PUK2
868  */
869 #define RIL_REQUEST_SIM_IO 28
870
871 /**
872  * RIL_REQUEST_SEND_USSD
873  *
874  * Send a USSD message
875  *
876  * If a USSD session already exists, the message should be sent in the
877  * context of that session. Otherwise, a new session should be created.
878  *
879  * The network reply should be reported via RIL_UNSOL_ON_USSD
880  *
881  * Only one USSD session may exist at a time, and the session is assumed
882  * to exist until:
883  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
884  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
885  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
886  *
887  * "data" is a const char * containing the USSD request in UTF-8 format
888  * "response" is NULL
889  *
890  * Valid errors:
891  *  SUCCESS
892  *  RADIO_NOT_AVAILABLE
893  *  GENERIC_FAILURE
894  *
895  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
896  */
897
898 #define RIL_REQUEST_SEND_USSD 29
899
900 /**
901  * RIL_REQUEST_CANCEL_USSD
902  * 
903  * Cancel the current USSD session if one exists
904  *
905  * "data" is null
906  * "response" is NULL
907  *
908  * Valid errors:
909  *  SUCCESS
910  *  RADIO_NOT_AVAILABLE
911  *  GENERIC_FAILURE 
912  */
913
914 #define RIL_REQUEST_CANCEL_USSD 30
915
916 /**  
917  * RIL_REQUEST_GET_CLIR
918  *
919  * Gets current CLIR status
920  * "data" is NULL
921  * "response" is int *
922  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
923  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
924  *
925  * Valid errors:
926  *  SUCCESS
927  *  RADIO_NOT_AVAILABLE
928  *  GENERIC_FAILURE
929  */
930 #define RIL_REQUEST_GET_CLIR 31
931
932 /**
933  * RIL_REQUEST_SET_CLIR
934  *
935  * "data" is int *
936  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
937  *
938  * "response" is NULL
939  *
940  * Valid errors:
941  *  SUCCESS
942  *  RADIO_NOT_AVAILABLE
943  *  GENERIC_FAILURE
944  */
945 #define RIL_REQUEST_SET_CLIR 32
946
947 /**
948  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
949  *
950  * "data" is const RIL_CallForwardInfo *
951  *
952  * "response" is const RIL_CallForwardInfo **
953  * "response" points to an array of RIL_CallForwardInfo *'s, one for
954  * each distinct registered phone number.
955  *
956  * For example, if data is forwarded to +18005551212 and voice is forwarded
957  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
958  * 
959  * If, however, both data and voice are forwarded to +18005551212, then
960  * a single RIL_CallForwardInfo can be returned with the service class
961  * set to "data + voice = 3")
962  *
963  * Valid errors:
964  *  SUCCESS
965  *  RADIO_NOT_AVAILABLE
966  *  GENERIC_FAILURE
967  */
968 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
969
970
971 /**
972  * RIL_REQUEST_SET_CALL_FORWARD
973  *
974  * Configure call forward rule
975  *
976  * "data" is const RIL_CallForwardInfo *
977  * "response" is NULL
978  *  
979  * Valid errors:
980  *  SUCCESS
981  *  RADIO_NOT_AVAILABLE
982  *  GENERIC_FAILURE
983  */
984 #define RIL_REQUEST_SET_CALL_FORWARD 34
985
986
987 /**
988  * RIL_REQUEST_QUERY_CALL_WAITING
989  *
990  * Query current call waiting state
991  *
992  * "data" is const int *
993  * ((const int *)data)[0] is the TS 27.007 service class to query.
994  * "response" is a const int *
995  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
996  *
997  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
998  * must follow, with the TS 27.007 service class bit vector of services
999  * for which call waiting is enabled.
1000  *
1001  * For example, if ((const int *)response)[0]  is 1 and 
1002  * ((const int *)response)[1] is 3, then call waiting is enabled for data
1003  * and voice and disabled for everything else
1004  *
1005  * Valid errors:
1006  *  SUCCESS
1007  *  RADIO_NOT_AVAILABLE
1008  *  GENERIC_FAILURE
1009  */
1010 #define RIL_REQUEST_QUERY_CALL_WAITING 35
1011
1012
1013 /**
1014  * RIL_REQUEST_SET_CALL_WAITING
1015  *
1016  * Configure current call waiting state
1017  *
1018  * "data" is const int *
1019  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
1020  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
1021  *                           services to modify
1022  * "response" is NULL
1023  *
1024  * Valid errors:
1025  *  SUCCESS
1026  *  RADIO_NOT_AVAILABLE
1027  *  GENERIC_FAILURE
1028  */
1029 #define RIL_REQUEST_SET_CALL_WAITING 36
1030
1031 /**
1032  * RIL_REQUEST_SMS_ACKNOWLEDGE
1033  *
1034  * Acknowledge successful or failed receipt of SMS previously indicated
1035  * via RIL_UNSOL_RESPONSE_NEW_SMS 
1036  *
1037  * "data" is int *
1038  * ((int *)data)[0] is "1" on successful receipt 
1039  *                  (basically, AT+CNMA=1 from TS 27.005
1040  * ((int *)data)[0] is "0" on failed receipt 
1041  *                  (basically, AT+CNMA=2 from TS 27.005)
1042  *
1043  * "response" is NULL
1044  *
1045  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
1046  *
1047  * Valid errors:
1048  *  SUCCESS
1049  *  RADIO_NOT_AVAILABLE
1050  *  GENERIC_FAILURE
1051  */
1052 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
1053
1054 /**
1055  * RIL_REQUEST_GET_IMEI
1056  *
1057  * Get the device IMEI, including check digit
1058  *
1059  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1060  *
1061  * "data" is NULL
1062  * "response" is a const char * containing the IMEI
1063  *
1064  * Valid errors:
1065  *  SUCCESS 
1066  *  RADIO_NOT_AVAILABLE (radio resetting)
1067  *  GENERIC_FAILURE
1068  */
1069
1070 #define RIL_REQUEST_GET_IMEI 38
1071
1072 /**
1073  * RIL_REQUEST_GET_IMEISV
1074  *
1075  * Get the device IMEISV, which should be two decimal digits
1076  *
1077  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1078  *
1079  * "data" is NULL
1080  * "response" is a const char * containing the IMEISV
1081  *
1082  * Valid errors:
1083  *  SUCCESS 
1084  *  RADIO_NOT_AVAILABLE (radio resetting)
1085  *  GENERIC_FAILURE
1086  */
1087
1088 #define RIL_REQUEST_GET_IMEISV 39
1089
1090
1091 /**
1092  * RIL_REQUEST_ANSWER
1093  *
1094  * Answer incoming call
1095  *
1096  * Will not be called for WAITING calls.
1097  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
1098  * instead
1099  *
1100  * "data" is NULL
1101  * "response" is NULL
1102  *
1103  * Valid errors:
1104  *  SUCCESS 
1105  *  RADIO_NOT_AVAILABLE (radio resetting)
1106  *  GENERIC_FAILURE
1107  */
1108
1109 #define RIL_REQUEST_ANSWER 40
1110
1111 /**
1112  * RIL_REQUEST_DEACTIVATE_DEFAULT_PDP
1113  *
1114  * Deactivate PDP context created by RIL_REQUEST_SETUP_DEFAULT_PDP
1115  *
1116  * "data" is const char **
1117  * ((char**)data)[0] indicating PDP CID
1118  * "response" is NULL
1119  *
1120  * Valid errors:
1121  *  SUCCESS
1122  *  RADIO_NOT_AVAILABLE
1123  *  GENERIC_FAILURE
1124  *
1125  * See also: RIL_REQUEST_SETUP_DEFAULT_PDP
1126  */
1127
1128 #define RIL_REQUEST_DEACTIVATE_DEFAULT_PDP 41
1129
1130 /**
1131  * RIL_REQUEST_QUERY_FACILITY_LOCK
1132  *
1133  * Query the status of a facility lock state
1134  *
1135  * "data" is const char **
1136  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4  
1137  *                      (eg "AO" for BAOC, "SC" for SIM lock)
1138  * ((const char **)data)[1] is the password, or "" if not required
1139  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
1140  *                           services to query
1141  *
1142  * "response" is an int *
1143  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
1144  *                           services for which the specified barring facility 
1145  *                           is active. "0" means "disabled for all"
1146  * 
1147  *
1148  * Valid errors:
1149  *  SUCCESS
1150  *  RADIO_NOT_AVAILABLE
1151  *  GENERIC_FAILURE
1152  *
1153  */
1154 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
1155
1156 /**
1157  * RIL_REQUEST_SET_FACILITY_LOCK
1158  *
1159  * Enable/disable one facility lock
1160  *
1161  * "data" is const char **
1162  *
1163  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1164  * (eg "AO" for BAOC)
1165  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
1166  * ((const char **)data)[2] = password
1167  * ((const char **)data)[3] = string representation of decimal TS 27.007
1168  *                            service class bit vector. Eg, the string
1169  *                            "1" means "set this facility for voice services"
1170  *
1171  * "response" is NULL 
1172  *
1173  * Valid errors:
1174  *  SUCCESS
1175  *  RADIO_NOT_AVAILABLE
1176  *  GENERIC_FAILURE
1177  *
1178  */
1179 #define RIL_REQUEST_SET_FACILITY_LOCK 43
1180
1181 /**
1182  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
1183  *
1184  * Change call barring facility password
1185  *
1186  * "data" is const char **
1187  *
1188  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1189  * (eg "AO" for BAOC)
1190  * ((const char **)data)[1] = old password
1191  * ((const char **)data)[2] = new password
1192  *
1193  * "response" is NULL 
1194  *
1195  * Valid errors:
1196  *  SUCCESS
1197  *  RADIO_NOT_AVAILABLE
1198  *  GENERIC_FAILURE
1199  *
1200  */
1201 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
1202
1203 /**
1204  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
1205  *
1206  * Query current network selectin mode
1207  *
1208  * "data" is NULL
1209  *
1210  * "response" is int *
1211  * ((const int *)response)[0] is
1212  *     0 for automatic selection
1213  *     1 for manual selection
1214  *
1215  * Valid errors:
1216  *  SUCCESS
1217  *  RADIO_NOT_AVAILABLE
1218  *  GENERIC_FAILURE
1219  *
1220  */
1221 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
1222
1223 /**
1224  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
1225  *
1226  * Specify that the network should be selected automatically
1227  *
1228  * "data" is NULL
1229  * "response" is NULL
1230  *
1231  * This request must not respond until the new operator is selected 
1232  * and registered
1233  *
1234  * Valid errors:
1235  *  SUCCESS
1236  *  RADIO_NOT_AVAILABLE
1237  *  GENERIC_FAILURE
1238  *
1239  */
1240 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
1241
1242 /**
1243  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
1244  *
1245  * Manually select a specified network.
1246  *
1247  * The radio baseband/RIL implementation is expected to fall back to 
1248  * automatic selection mode if the manually selected network should go
1249  * out of range in the future.
1250  *
1251  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
1252  * "response" is NULL
1253  *
1254  * This request must not respond until the new operator is selected 
1255  * and registered
1256  *
1257  * Valid errors:
1258  *  SUCCESS
1259  *  RADIO_NOT_AVAILABLE
1260  *  GENERIC_FAILURE
1261  *
1262  */
1263 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
1264
1265 /**
1266  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
1267  *
1268  * Scans for available networks
1269  *
1270  * "data" is NULL
1271  * "response" is const char ** that should be an array of n*4 strings, where
1272  *    n is the number of available networks
1273  * For each available network:
1274  *
1275  * ((const char **)response)[n+0] is long alpha ONS or EONS 
1276  * ((const char **)response)[n+1] is short alpha ONS or EONS 
1277  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
1278  * ((const char **)response)[n+3] is a string value of the status:
1279  *           "unknown"
1280  *           "available"
1281  *           "current"
1282  *           "forbidden"
1283  *
1284  * This request must not respond until the new operator is selected 
1285  * and registered
1286  *
1287  * Valid errors:
1288  *  SUCCESS
1289  *  RADIO_NOT_AVAILABLE
1290  *  GENERIC_FAILURE
1291  *
1292  */
1293 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
1294
1295 /**
1296  * RIL_REQUEST_DTMF_START
1297  *
1298  * Start playing a DTMF tone. Continue playing DTMF tone until 
1299  * RIL_REQUEST_DTMF_STOP is received 
1300  *
1301  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
1302  * it should cancel the previous tone and play the new one.
1303  * 
1304  * "data" is a char *
1305  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
1306  * "response" is NULL
1307  * 
1308  * Valid errors:
1309  *  SUCCESS
1310  *  RADIO_NOT_AVAILABLE
1311  *  GENERIC_FAILURE
1312  *
1313  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
1314  */
1315 #define RIL_REQUEST_DTMF_START 49
1316
1317 /**
1318  * RIL_REQUEST_DTMF_STOP
1319  *
1320  * Stop playing a currently playing DTMF tone.
1321  * 
1322  * "data" is NULL
1323  * "response" is NULL
1324  * 
1325  * Valid errors:
1326  *  SUCCESS
1327  *  RADIO_NOT_AVAILABLE
1328  *  GENERIC_FAILURE
1329  *
1330  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
1331  */
1332 #define RIL_REQUEST_DTMF_STOP 50
1333
1334 /**
1335  * RIL_REQUEST_BASEBAND_VERSION
1336  *
1337  * Return string value indicating baseband version, eg
1338  * response from AT+CGMR
1339  * 
1340  * "data" is NULL
1341  * "response" is const char * containing version string for log reporting
1342  * 
1343  * Valid errors:
1344  *  SUCCESS
1345  *  RADIO_NOT_AVAILABLE
1346  *  GENERIC_FAILURE
1347  *
1348  */
1349 #define RIL_REQUEST_BASEBAND_VERSION 51
1350
1351 /**
1352  * RIL_REQUEST_SEPARATE_CONNECTION
1353  *
1354  * Separate a party from a multiparty call placing the multiparty call
1355  * (less the specified party) on hold and leaving the specified party 
1356  * as the only other member of the current (active) call
1357  *
1358  * Like AT+CHLD=2x
1359  *
1360  * See TS 22.084 1.3.8.2 (iii)
1361  * TS 22.030 6.5.5 "Entering "2X followed by send"
1362  * TS 27.007 "AT+CHLD=2x"
1363  * 
1364  * "data" is an int * 
1365  * (int *)data)[0] contains GSM call index (value of 'x' in CHLD above)
1366  * "response" is NULL
1367  *
1368  * Valid errors:
1369  *  SUCCESS 
1370  *  RADIO_NOT_AVAILABLE (radio resetting)
1371  *  GENERIC_FAILURE
1372  */
1373 #define RIL_REQUEST_SEPARATE_CONNECTION 52
1374
1375
1376 /**
1377  * RIL_REQUEST_SET_MUTE
1378  *
1379  * Turn on or off uplink (microphone) mute.
1380  *
1381  * Will only be sent while voice call is active.
1382  * Will always be reset to "disable mute" when a new voice call is initiated
1383  *
1384  * "data" is an int *
1385  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
1386  *
1387  * "response" is NULL
1388  *
1389  * Valid errors:
1390  *  SUCCESS 
1391  *  RADIO_NOT_AVAILABLE (radio resetting)
1392  *  GENERIC_FAILURE
1393  */
1394
1395 #define RIL_REQUEST_SET_MUTE 53
1396
1397 /**
1398  * RIL_REQUEST_GET_MUTE
1399  *
1400  * Queries the current state of the uplink mute setting
1401  *
1402  * "data" is NULL
1403  * "response" is an int *
1404  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
1405  *
1406  * Valid errors:
1407  *  SUCCESS 
1408  *  RADIO_NOT_AVAILABLE (radio resetting)
1409  *  GENERIC_FAILURE
1410  */
1411
1412 #define RIL_REQUEST_GET_MUTE 54
1413
1414 /**
1415  * RIL_REQUEST_QUERY_CLIP
1416  *
1417  * Queries the status of the CLIP supplementary service
1418  *
1419  * (for MMI code "*#30#")
1420  *
1421  * "data" is NULL
1422  * "response" is an int *
1423  * (int *)response)[0] is 1 for "CLIP provisioned" 
1424  *                           and 0 for "CLIP not provisioned"
1425  *                           and 2 for "unknown, e.g. no network etc" 
1426  *
1427  * Valid errors:
1428  *  SUCCESS 
1429  *  RADIO_NOT_AVAILABLE (radio resetting)
1430  *  GENERIC_FAILURE
1431  */
1432
1433 #define RIL_REQUEST_QUERY_CLIP 55
1434
1435 /**
1436  * RIL_REQUEST_LAST_PDP_FAIL_CAUSE
1437  * 
1438  * Requests the failure cause code for the most recently failed PDP 
1439  * context activate
1440  *
1441  * "data" is NULL
1442  *
1443  * "response" is a "int *"
1444  * ((int *)response)[0] is an integer cause code defined in TS 24.008
1445  *   section 6.1.3.1.3 or close approximation
1446  *
1447  * If the implementation does not have access to the exact cause codes,
1448  * then it should return one of the values listed in 
1449  * RIL_LastPDPActivateFailCause, as the UI layer needs to distinguish these 
1450  * cases for error notification
1451  * and potential retries.
1452  *
1453  * Valid errors:
1454  *  SUCCESS
1455  *  RADIO_NOT_AVAILABLE
1456  *  GENERIC_FAILURE
1457  *
1458  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
1459  *  
1460  */ 
1461
1462 #define RIL_REQUEST_LAST_PDP_FAIL_CAUSE 56
1463
1464 /**
1465  * RIL_REQUEST_PDP_CONTEXT_LIST
1466  *
1467  * Queries the status of PDP contexts, returning for each
1468  * its CID, whether or not it is active, and its PDP type,
1469  * APN, and PDP adddress.
1470  *
1471  * "data" is NULL
1472  * "response" is an array of RIL_PDP_Context_Response
1473  *
1474  * Valid errors:
1475  *  SUCCESS 
1476  *  RADIO_NOT_AVAILABLE (radio resetting)
1477  *  GENERIC_FAILURE
1478  */
1479
1480 #define RIL_REQUEST_PDP_CONTEXT_LIST 57
1481
1482 /**
1483  * RIL_REQUEST_RESET_RADIO
1484  *
1485  * Request a radio reset. The RIL implementation may postpone
1486  * the reset until after this request is responded to if the baseband
1487  * is presently busy.
1488  *
1489  * "data" is NULL
1490  * "response" is NULL
1491  *
1492  * The reset action could be delayed for a while
1493  * in case baseband modem is just busy.
1494  *
1495  * Valid errors:
1496  *  SUCCESS 
1497  *  RADIO_NOT_AVAILABLE (radio resetting)
1498  *  GENERIC_FAILURE
1499  */
1500
1501 #define RIL_REQUEST_RESET_RADIO 58
1502
1503 /**
1504  * RIL_REQUEST_OEM_HOOK_RAW
1505  *
1506  * This request reserved for OEM-specific uses. It passes raw byte arrays
1507  * back and forth.
1508  *
1509  * It can be invoked on the Java side from 
1510  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
1511  *
1512  * "data" is a char * of bytes copied from the byte[] data argument in java
1513  * "response" is a char * of bytes that will returned via the
1514  * caller's "response" Message here: 
1515  * (byte[])(((AsyncResult)response.obj).result)
1516  *
1517  * An error response here will result in 
1518  * (((AsyncResult)response.obj).result) == null and 
1519  * (((AsyncResult)response.obj).exception) being an instance of
1520  * com.android.internal.telephony.gsm.CommandException
1521  *
1522  * Valid errors:
1523  *  All
1524  */
1525
1526 #define RIL_REQUEST_OEM_HOOK_RAW 59
1527
1528 /**
1529  * RIL_REQUEST_OEM_HOOK_STRINGS
1530  *
1531  * This request reserved for OEM-specific uses. It passes strings
1532  * back and forth.
1533  *
1534  * It can be invoked on the Java side from 
1535  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
1536  *
1537  * "data" is a const char **, representing an array of null-terminated UTF-8
1538  * strings copied from the "String[] strings" argument to
1539  * invokeOemRilRequestStrings()
1540  *
1541  * "response" is a const char **, representing an array of null-terminated UTF-8
1542  * stings that will be returned via the caller's response message here:
1543  *
1544  * (String[])(((AsyncResult)response.obj).result)
1545  *
1546  * An error response here will result in 
1547  * (((AsyncResult)response.obj).result) == null and 
1548  * (((AsyncResult)response.obj).exception) being an instance of
1549  * com.android.internal.telephony.gsm.CommandException
1550  *
1551  * Valid errors:
1552  *  All
1553  */
1554
1555 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
1556
1557 /**
1558  * RIL_REQUEST_SCREEN_STATE
1559  *
1560  * Indicates the current state of the screen.  When the screen is off, the
1561  * RIL should notify the baseband to suppress certain notifications (eg,
1562  * signal strength and changes in LAC or CID) in an effort to conserve power.
1563  * These notifications should resume when the screen is on.
1564  *
1565  * "data" is int *
1566  * ((int *)data)[0] is == 1 for "Screen On"
1567  * ((int *)data)[0] is == 0 for "Screen Off"
1568  *
1569  * "response" is NULL
1570  *
1571  * Valid errors:
1572  *  SUCCESS
1573  *  GENERIC_FAILURE
1574  */
1575 #define RIL_REQUEST_SCREEN_STATE 61
1576
1577
1578 /**
1579  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
1580  *
1581  * Enables/disables supplementary service related notifications
1582  * from the network.
1583  *
1584  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
1585  *
1586  * "data" is int *
1587  * ((int *)data)[0] is == 1 for notifications enabled
1588  * ((int *)data)[0] is == 0 for notifications disabled
1589  *
1590  * "response" is NULL
1591  *
1592  * Valid errors:
1593  *  SUCCESS
1594  *  RADIO_NOT_AVAILABLE
1595  *  GENERIC_FAILURE
1596  *
1597  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
1598  */
1599 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
1600
1601 /**
1602  * RIL_REQUEST_WRITE_SMS_TO_SIM
1603  *
1604  * Stores a SMS message to SIM memory.
1605  *
1606  * "data" is RIL_SMS_WriteArgs *
1607  *
1608  * "response" is int *
1609  * ((const int *)response)[0] is the record index where the message is stored.
1610  *
1611  * Valid errors:
1612  *  SUCCESS
1613  *  GENERIC_FAILURE
1614  *
1615  */
1616 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
1617
1618 /**
1619  * RIL_REQUEST_DELETE_SMS_ON_SIM
1620  *
1621  * Deletes a SMS message from SIM memory.
1622  *
1623  * "data" is int  *
1624  * ((int *)data)[0] is the record index of the message to delete.
1625  *
1626  * "response" is NULL
1627  *
1628  * Valid errors:
1629  *  SUCCESS
1630  *  GENERIC_FAILURE
1631  *
1632  */
1633 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
1634
1635 /**
1636  * RIL_REQUEST_SET_BAND_MODE
1637  *
1638  * Assign a specified band for RF configuration.
1639  *
1640  * "data" is int *
1641  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
1642  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
1643  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
1644  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
1645  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
1646  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
1647  *
1648  * "response" is NULL
1649  *
1650  * Valid errors:
1651  *  SUCCESS
1652  *  RADIO_NOT_AVAILABLE
1653  *  GENERIC_FAILURE
1654  */
1655 #define RIL_REQUEST_SET_BAND_MODE 65
1656
1657 /**
1658  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
1659  *
1660  * Query the list of band mode supported by RF.
1661  *
1662  * "data" is NULL
1663  *
1664  * "response" is int *
1665  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
1666  * each available band mode.
1667  *
1668  *  0 for "unspecified" (selected by baseband automatically)
1669  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
1670  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
1671  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
1672  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
1673  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
1674  *
1675  * Valid errors:
1676  *  SUCCESS
1677  *  RADIO_NOT_AVAILABLE
1678  *  GENERIC_FAILURE
1679  *
1680  * See also: RIL_REQUEST_SET_BAND_MODE
1681  */
1682 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
1683
1684 /**
1685  * RIL_REQUEST_STK_GET_PROFILE
1686  *
1687  * Requests the profile of SIM tool kit.
1688  * The profile indicates the SAT/USAT features supported by ME.
1689  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
1690  *
1691  * "data" is NULL
1692  *
1693  * "response" is a const char * containing SAT/USAT profile
1694  * in hexadecimal format string starting with first byte of terminal profile
1695  *
1696  * Valid errors:
1697  *  RIL_E_SUCCESS
1698  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1699  *  RIL_E_GENERIC_FAILURE
1700  */
1701 #define RIL_REQUEST_STK_GET_PROFILE 67
1702
1703 /**
1704  * RIL_REQUEST_STK_SET_PROFILE
1705  *
1706  * Download the STK terminal profile as part of SIM initialization
1707  * procedure
1708  *
1709  * "data" is a const char * containing SAT/USAT profile
1710  * in hexadecimal format string starting with first byte of terminal profile
1711  *
1712  * "response" is NULL
1713  *
1714  * Valid errors:
1715  *  RIL_E_SUCCESS
1716  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1717  *  RIL_E_GENERIC_FAILURE
1718  */
1719 #define RIL_REQUEST_STK_SET_PROFILE 68
1720
1721 /**
1722  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
1723  *
1724  * Requests to send a SAT/USAT envelope command to SIM.
1725  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
1726  *
1727  * "data" is a const char * containing SAT/USAT command
1728  * in hexadecimal format string starting with command tag
1729  *
1730  * "response" is a const char * containing SAT/USAT response
1731  * in hexadecimal format string starting with first byte of response
1732  * (May be NULL)
1733  *
1734  * Valid errors:
1735  *  RIL_E_SUCCESS
1736  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1737  *  RIL_E_GENERIC_FAILURE
1738  */
1739 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
1740
1741 /**
1742  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
1743  *
1744  * Requests to send a terminal response to SIM for a received
1745  * proactive command
1746  *
1747  * "data" is a const char * containing SAT/USAT response
1748  * in hexadecimal format string starting with first byte of response data
1749  *
1750  * "response" is NULL
1751  *
1752  * Valid errors:
1753  *  RIL_E_SUCCESS
1754  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1755  *  RIL_E_GENERIC_FAILURE
1756  */
1757 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
1758
1759 /**
1760  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
1761  *
1762  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
1763  * been initialized by ME already. (We could see the call has been in the 'call
1764  * list') So, STK application needs to accept/reject the call according as user
1765  * operations.
1766  *
1767  * "data" is int *
1768  * ((int *)data)[0] is > 0 for "accept" the call setup
1769  * ((int *)data)[0] is == 0 for "reject" the call setup
1770  *
1771  * "response" is NULL
1772  *
1773  * Valid errors:
1774  *  RIL_E_SUCCESS
1775  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1776  *  RIL_E_GENERIC_FAILURE
1777  */
1778 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
1779
1780 /**
1781  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
1782  *
1783  * Connects the two calls and disconnects the subscriber from both calls.
1784  * 
1785  * "data" is NULL
1786  * "response" is NULL
1787  *
1788  * Valid errors:
1789  *  SUCCESS 
1790  *  RADIO_NOT_AVAILABLE (radio resetting)
1791  *  GENERIC_FAILURE
1792  */
1793 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
1794
1795 /**
1796  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
1797  *
1798  * Requests to set the preferred network type for searching and registering
1799  * (CS/PS domain, RAT, and operation mode)
1800  *
1801  * "data" is int *
1802  * ((int *)data)[0] is == 0 for WCDMA preferred (auto mode)
1803  * ((int *)data)[0] is == 1 for GSM only
1804  * ((int *)data)[0] is == 2 for WCDMA only
1805  *
1806  * "response" is NULL
1807  *
1808  * Valid errors:
1809  *  RIL_E_SUCCESS
1810  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1811  *  RIL_E_GENERIC_FAILURE
1812  */
1813 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
1814
1815 /**
1816  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
1817  *
1818  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
1819  * for searching and registering
1820  *
1821  * "data" is NULL
1822  *
1823  * "response" is int *
1824  * ((int *)response)[0] is == 0 for WCDMA preferred (auto mode)
1825  * ((int *)response)[0] is == 1 for GSM only
1826  * ((int *)response)[0] is == 2 for WCDMA only
1827  *
1828  * Valid errors:
1829  *  SUCCESS
1830  *  RADIO_NOT_AVAILABLE
1831  *  GENERIC_FAILURE
1832  *
1833  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
1834  */
1835 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
1836
1837 /**
1838  * RIL_REQUEST_NEIGHBORING_CELL_IDS
1839  *
1840  * Request neighboring cell id in GSM network
1841  *
1842  * "data" is NULL
1843  * "response" must be a " const RIL_NeighboringCell** "
1844  *
1845  * Valid errors:
1846  *  SUCCESS
1847  *  RADIO_NOT_AVAILABLE
1848  *  GENERIC_FAILURE
1849  */
1850 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
1851
1852 /**
1853  * RIL_REQUEST_SET_LOCATION_UPDATES
1854  *
1855  * Enables/disables network state change notifications due to changes in
1856  * LAC and/or CID (basically, +CREG=2 vs. +CREG=1).  
1857  *
1858  * Note:  The RIL implementation should default to "updates enabled"
1859  * when the screen is on and "updates disabled" when the screen is off.
1860  *
1861  * "data" is int *
1862  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
1863  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
1864  *
1865  * "response" is NULL
1866  *
1867  * Valid errors:
1868  *  SUCCESS
1869  *  RADIO_NOT_AVAILABLE
1870  *  GENERIC_FAILURE
1871  *
1872  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
1873  */
1874 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
1875
1876 /***********************************************************************/
1877
1878 #define RIL_UNSOL_RESPONSE_BASE 1000
1879
1880 /**
1881  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
1882  *
1883  * Indicate when value of RIL_RadioState has changed.
1884  *
1885  * Callee will invoke RIL_RadioStateRequest method on main thread
1886  *
1887  * "data" is NULL
1888  */
1889
1890 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
1891
1892
1893 /**
1894  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
1895  *
1896  * Indicate when call state has changed
1897  *
1898  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
1899  *
1900  * "data" is NULL
1901  *
1902  * Response should be invoked on, for example, 
1903  * "RING", "BUSY", "NO CARRIER", and also call state
1904  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
1905  *
1906  * Redundent or extraneous invocations are tolerated
1907  */
1908 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
1909
1910
1911 /**
1912  * RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 
1913  *
1914  * Called when network state, operator name, or GPRS state has changed
1915  * Basically on, +CREG and +CGREG
1916  *
1917  * Callee will invoke the following requests on main thread:
1918  *
1919  * RIL_REQUEST_REGISTRATION_STATE
1920  * RIL_REQUEST_GPRS_REGISTRATION_STATE
1921  * RIL_REQUEST_OPERATOR
1922  *
1923  * "data" is NULL
1924  *
1925  * FIXME should this happen when SIM records are loaded? (eg, for
1926  * EONS)
1927  */
1928 #define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1002
1929
1930 /**
1931  * RIL_UNSOL_RESPONSE_NEW_SMS
1932  *
1933  * Called when new SMS is received.
1934  * 
1935  * "data" is const char *
1936  * This is a pointer to a string containing the PDU of an SMS-DELIVER
1937  * as an ascii string of hex digits. The PDU starts with the SMSC address
1938  * per TS 27.005 (+CMT:)
1939  *
1940  * Callee will subsequently confirm the receipt of thei SMS with a
1941  * RIL_REQUEST_SMS_ACKNOWLEDGE
1942  *
1943  * No new RIL_UNSOL_RESPONSE_NEW_SMS 
1944  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
1945  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
1946  */
1947
1948 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
1949
1950 /**
1951  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
1952  *
1953  * Called when new SMS Status Report is received.
1954  * 
1955  * "data" is const char *
1956  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
1957  * as an ascii string of hex digits. The PDU starts with the SMSC address
1958  * per TS 27.005 (+CDS:).
1959  *
1960  * Callee will subsequently confirm the receipt of the SMS with a
1961  * RIL_REQUEST_SMS_ACKNOWLEDGE
1962  *
1963  * No new RIL_UNSOL_RESPONSE_NEW_SMS 
1964  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
1965  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
1966  */
1967
1968 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
1969
1970 /**
1971  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
1972  *
1973  * Called when new SMS has been stored on SIM card
1974  * 
1975  * "data" is const int *
1976  * ((const int *)data)[0] contains the slot index on the SIM that contains
1977  * the new message
1978  */
1979
1980 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
1981
1982 /**
1983  * RIL_UNSOL_ON_USSD
1984  *
1985  * Called when a new USSD message is received.
1986  *
1987  * "data" is const char **
1988  * ((const char **)data)[0] points to a type code, which is 
1989  *  one of these string values:
1990  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
1991  *      "1"   USSD-Request -- text in ((const char **)data)[1]
1992  *      "2"   Session terminated by network
1993  *      "3"   other local client (eg, SIM Toolkit) has responded
1994  *      "4"   Operation not supported
1995  *      "5"   Network timeout
1996  *
1997  * The USSD session is assumed to persist if the type code is "1", otherwise
1998  * the current session (if any) is assumed to have terminated.
1999  *
2000  * ((const char **)data)[1] points to a message string if applicable, which
2001  * should always be in UTF-8.
2002  */
2003 #define RIL_UNSOL_ON_USSD 1006
2004 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
2005
2006 /**
2007  * RIL_UNSOL_ON_USSD_REQUEST
2008  *
2009  * Obsolete. Send via RIL_UNSOL_ON_USSD
2010  */
2011 #define RIL_UNSOL_ON_USSD_REQUEST 1007 
2012
2013
2014 /**
2015  * RIL_UNSOL_NITZ_TIME_RECEIVED
2016  *
2017  * Called when radio has received a NITZ time message
2018  *
2019  * "data" is const char * pointing to NITZ time string
2020  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
2021  */
2022 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
2023
2024 /**
2025  * RIL_UNSOL_SIGNAL_STRENGTH
2026  *
2027  * Radio may report signal strength rather han have it polled.
2028  *
2029  * "data" is an "int *"
2030  * ((int *)response)[0] is received signal strength (0-31, 99)
2031  * ((int *)response)[1] is bit error rate (0-7, 99)
2032  *  as defined in TS 27.007 8.5
2033  *  Other values (eg -1) are not legal
2034  */
2035 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
2036
2037
2038 /**
2039  * RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED
2040  *
2041  * Indicate a PDP context state has changed, or a new context
2042  * has been activated or deactivated
2043  *
2044  * "data" is an array of RIL_PDP_Context_Response identical to that
2045  * returned by RIL_REQUEST_PDP_CONTEXT_LIST
2046  *
2047  * See also: RIL_REQUEST_PDP_CONTEXT_LIST
2048  */
2049
2050 #define RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED 1010
2051
2052 /**
2053  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
2054  *
2055  * Reports supplementary service related notification from the network.
2056  *
2057  * "data" is a const RIL_SuppSvcNotification *
2058  *
2059  */
2060
2061 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
2062
2063 /**
2064  * RIL_UNSOL_STK_SESSION_END
2065  *
2066  * Indicate when STK session is terminated by SIM.
2067  *
2068  * "data" is NULL
2069  */
2070 #define RIL_UNSOL_STK_SESSION_END 1012
2071
2072 /**
2073  * RIL_UNSOL_STK_PROACTIVE_COMMAND
2074  *
2075  * Indicate when SIM issue a STK proactive command to applications
2076  *
2077  * "data" is a const char * containing SAT/USAT proactive command
2078  * in hexadecimal format string starting with command tag
2079  *
2080  */
2081 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
2082
2083 /**
2084  * RIL_UNSOL_STK_EVENT_NOTIFY
2085  *
2086  * Indicate when SIM notifies applcations some event happens.
2087  * Generally, application does not need to have any feedback to
2088  * SIM but shall be able to indicate appropriate messages to users.
2089  *
2090  * "data" is a const char * containing SAT/USAT commands or responses
2091  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
2092  * starting with first byte of response data or command tag
2093  *
2094  */
2095 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
2096
2097 /**
2098  * RIL_UNSOL_STK_CALL_SETUP
2099  *
2100  * Indicate when SIM wants application to setup a voice call.
2101  *
2102  * "data" is const int *
2103  * ((const int *)data)[0] contains timeout value (in milliseconds)
2104  */
2105 #define RIL_UNSOL_STK_CALL_SETUP 1015
2106
2107 /**
2108  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
2109  *
2110  * Indicates that SMS storage on the SIM is full.  Sent when the network
2111  * attempts to deliver a new SMS message.  Messages cannot be saved on the
2112  * SIM until space is freed.  In particular, incoming Class 2 messages
2113  * cannot be stored.
2114  *
2115  * "data" is null
2116  *
2117  */
2118 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
2119
2120 /**
2121  * RIL_UNSOL_SIM_REFRESH
2122  *
2123  * Indicates that file(s) on the SIM have been updated, or the SIM
2124  * has been reinitialized.
2125  *
2126  * "data" is an int *
2127  * ((int *)data)[0] is a RIL_SimRefreshResult.
2128  * ((int *)data)[1] is the EFID of the updated file if the result is
2129  * SIM_FILE_UPDATE or NULL for any other result.
2130  *
2131  * Note: If the radio state changes as a result of the SIM refresh (eg,
2132  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
2133  * should be sent.
2134  */
2135 #define RIL_UNSOL_SIM_REFRESH 1017
2136
2137 /**
2138  * RIL_UNSOL_CALL_RING
2139  *
2140  * Ring indication for an incoming call (eg, RING or CRING event).
2141  *
2142  * "data" is null
2143  */
2144 #define RIL_UNSOL_CALL_RING 1018
2145
2146 /***********************************************************************/
2147
2148
2149 /**
2150  * RIL_Request Function pointer
2151  *
2152  * @param request is one of RIL_REQUEST_*
2153  * @param data is pointer to data defined for that RIL_REQUEST_*
2154  *        data is owned by caller, and should not be modified or freed by callee
2155  * @param t should be used in subsequent call to RIL_onResponse
2156  * @param datalen the length of data
2157  *
2158  */
2159 typedef void (*RIL_RequestFunc) (int request, void *data, 
2160                                     size_t datalen, RIL_Token t);
2161
2162 /**
2163  * This function should return the current radio state synchronously
2164  */
2165 typedef RIL_RadioState (*RIL_RadioStateRequest)();
2166
2167 /**
2168  * This function returns "1" if the specified RIL_REQUEST code is
2169  * supported and 0 if it is not
2170  *
2171  * @param requestCode is one of RIL_REQUEST codes
2172  */
2173
2174 typedef int (*RIL_Supports)(int requestCode);
2175
2176 /**
2177  * This function is called from a separate thread--not the 
2178  * thread that calls RIL_RequestFunc--and indicates that a pending
2179  * request should be cancelled.
2180  * 
2181  * On cancel, the callee should do its best to abandon the request and
2182  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
2183  *
2184  * Subsequent calls to  RIL_onRequestComplete for this request with
2185  * other results will be tolerated but ignored. (That is, it is valid
2186  * to ignore the cancellation request)
2187  *
2188  * RIL_Cancel calls should return immediately, and not wait for cancellation
2189  *
2190  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007 
2191  * interface
2192  *
2193  * @param t token wants to be canceled
2194  */
2195
2196 typedef void (*RIL_Cancel)(RIL_Token t);
2197
2198 typedef void (*RIL_TimedCallback) (void *param);
2199
2200 /**
2201  * Return a version string for your RIL implementation
2202  */
2203 typedef const char * (*RIL_GetVersion) (void);
2204
2205 typedef struct {
2206     int version;        /* set to RIL_VERSION */
2207     RIL_RequestFunc onRequest;
2208     RIL_RadioStateRequest onStateRequest;
2209     RIL_Supports supports;
2210     RIL_Cancel onCancel;
2211     RIL_GetVersion getVersion;
2212 } RIL_RadioFunctions;
2213
2214 #ifdef RIL_SHLIB
2215 struct RIL_Env {
2216     /**
2217      * "t" is parameter passed in on previous call to RIL_Notification
2218      * routine.
2219      *
2220      * If "e" != SUCCESS, then response can be null/is ignored
2221      *
2222      * "response" is owned by caller, and should not be modified or 
2223      * freed by callee
2224      *
2225      * RIL_onRequestComplete will return as soon as possible
2226      */
2227     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e, 
2228                            void *response, size_t responselen);
2229
2230     /**
2231      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
2232      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
2233      *
2234      * "data" is owned by caller, and should not be modified or freed by callee
2235      */
2236
2237     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, 
2238                                     size_t datalen);
2239
2240     /**
2241      * Call user-specifed "callback" function on on the same thread that 
2242      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
2243      * a relative time value at which the callback is invoked. If relativeTime is
2244      * NULL or points to a 0-filled structure, the callback will be invoked as
2245      * soon as possible
2246      */
2247
2248     void (*RequestTimedCallback) (RIL_TimedCallback callback, 
2249                                    void *param, const struct timeval *relativeTime);   
2250 };
2251
2252
2253 /** 
2254  *  RIL implementations must defined RIL_Init 
2255  *  argc and argv will be command line arguments intended for the RIL implementation
2256  *  Return NULL on error
2257  *
2258  * @param env is environment point defined as RIL_Env
2259  * @param argc number of arguments
2260  * @param argv list fo arguments
2261  *
2262  */
2263 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
2264
2265 #else /* RIL_SHLIB */
2266
2267 /**
2268  * Call this once at startup to register notification routine
2269  *
2270  * @param callbacks user-specifed callback function
2271  */
2272 void RIL_register (const RIL_RadioFunctions *callbacks);
2273
2274
2275 /**
2276  *
2277  * RIL_onRequestComplete will return as soon as possible
2278  *
2279  * @param t is parameter passed in on previous call to RIL_Notification
2280  *          routine.
2281  * @param e error code
2282  *          if "e" != SUCCESS, then response can be null/is ignored
2283  * @param response is owned by caller, and should not be modified or
2284  *                 freed by callee
2285  * @param responselen the length of response in byte
2286  */
2287 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e, 
2288                            void *response, size_t responselen);
2289
2290 /**
2291  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
2292  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
2293  *     "data" is owned by caller, and should not be modified or freed by callee
2294  * @param datalen the length of data in byte
2295  */
2296
2297 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, 
2298                                 size_t datalen);
2299
2300
2301 /**
2302  * Call user-specifed "callback" function on on the same thread that 
2303  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
2304  * a relative time value at which the callback is invoked. If relativeTime is
2305  * NULL or points to a 0-filled structure, the callback will be invoked as
2306  * soon as possible
2307  *
2308  * @param callback user-specifed callback function
2309  * @param param parameter list
2310  * @param relativeTime a relative time value at which the callback is invoked
2311  */
2312
2313 void RIL_requestTimedCallback (RIL_TimedCallback callback, 
2314                                void *param, const struct timeval *relativeTime);
2315
2316
2317 #endif /* RIL_SHLIB */
2318
2319 #ifdef __cplusplus
2320 }
2321 #endif
2322
2323 #endif /*ANDROID_RIL_H*/
2324