OSDN Git Service

c86f4871f10652a637a1188d9e47481454d39876
[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 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
176 typedef enum {
177     CALL_FAIL_NORMAL = 16,
178     CALL_FAIL_BUSY = 17,
179     CALL_FAIL_CONGESTION = 34,
180     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
181     CALL_FAIL_CALL_BARRED = 240,
182     CALL_FAIL_FDN_BLOCKED = 241,
183     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
184 } RIL_LastCallFailCause;
185
186 /* See RIL_REQUEST_LAST_PDP_FAIL_CAUSE */
187 typedef enum {
188     PDP_FAIL_BARRED = 8,         /* no retry; prompt user */
189     PDP_FAIL_BAD_APN = 27,       /* no retry; prompt user */
190     PDP_FAIL_USER_AUTHENTICATION = 29, /* no retry; prompt user */
191     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 32,  /*no retry; prompt user */
192     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33, /*no retry; prompt user */
193     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff  /* This and all other cases: retry silently */
194 } RIL_LastPDPActivateFailCause;
195
196 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
197 typedef struct {
198     int     notificationType;   /*
199                                  * 0 = MO intermediate result code
200                                  * 1 = MT unsolicited result code
201                                  */
202     int     code;               /* See 27.007 7.17
203                                    "code1" for MO
204                                    "code2" for MT. */
205     int     index;              /* CUG index. See 27.007 7.17. */
206     int     type;               /* "type" from 27.007 7.17 (MT only). */
207     char *  number;             /* "number" from 27.007 7.17
208                                    (MT only, may be NULL). */
209 } RIL_SuppSvcNotification;
210
211 /* see RIL_REQUEST_GET_SIM_STATUS */
212 #define RIL_SIM_ABSENT                  0
213 #define RIL_SIM_NOT_READY               1
214 /* RIL_SIM_READY means that the radio state is RADIO_STATE_SIM_READY. 
215  * This is more
216  * than "+CPIN: READY". It also means the radio is ready for SIM I/O
217  */
218 #define RIL_SIM_READY                   2
219 #define RIL_SIM_PIN                     3
220 #define RIL_SIM_PUK                     4
221 #define RIL_SIM_NETWORK_PERSONALIZATION 5
222
223 /* The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH */
224 typedef enum {
225     /* A file on SIM has been updated.  data[1] contains the EFID. */
226     SIM_FILE_UPDATE = 0,
227     /* SIM initialized.  All files should be re-read. */
228     SIM_INIT = 1,
229     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
230     SIM_RESET = 2
231 } RIL_SimRefreshResult;
232
233 /** 
234  * RIL_REQUEST_GET_SIM_STATUS
235  *
236  * Requests status of the SIM interface and the SIM card
237  * 
238  * "data" is NULL
239  *
240  * "response" must be an int * pointing to RIL_SIM_* constant 
241  * This should always succeed (RIL_SUCCESS)
242  *
243  * If the radio is off or unavailable, return RIL_SIM_NOT_READY 
244  *
245  * Please note: RIL_SIM_READY means that the radio state 
246  * is RADIO_STATE_SIM_READY.   This is more than "+CPIN: READY". 
247  * It also means the radio is ready for SIM I/O
248  *
249  * Valid errors:
250  *  Must never fail
251  */
252 #define RIL_REQUEST_GET_SIM_STATUS 1
253
254 /**
255  * RIL_REQUEST_ENTER_SIM_PIN
256  *
257  * Supplies SIM PIN. Only called if SIM status is RIL_SIM_PIN
258  *
259  * "data" is const char **
260  * ((const char **)data)[0] is PIN value
261  *
262  * "response" must be NULL
263  *
264  * Valid errors:
265  *  
266  * SUCCESS 
267  * RADIO_NOT_AVAILABLE (radio resetting)
268  * GENERIC_FAILURE
269  * PASSWORD_INCORRECT
270  */
271
272 #define RIL_REQUEST_ENTER_SIM_PIN 2
273
274
275 /**
276  * RIL_REQUEST_ENTER_SIM_PUK
277  *
278  * Supplies SIM PUK and new PIN. 
279  *
280  * "data" is const char **
281  * ((const char **)data)[0] is PUK value
282  * ((const char **)data)[1] is new PIN value
283  *
284  * "response" must be NULL
285  *
286  * Valid errors:
287  *  
288  *  SUCCESS 
289  *  RADIO_NOT_AVAILABLE (radio resetting)
290  *  GENERIC_FAILURE
291  *  PASSWORD_INCORRECT
292  *     (PUK is invalid)
293  */
294
295 #define RIL_REQUEST_ENTER_SIM_PUK 3
296
297 /**
298  * RIL_REQUEST_ENTER_SIM_PIN2
299  *
300  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
301  * returned as a a failure from a previous operation.
302  *
303  * "data" is const char **
304  * ((const char **)data)[0] is PIN2 value
305  *
306  * "response" must be NULL
307  *
308  * Valid errors:
309  *  
310  *  SUCCESS 
311  *  RADIO_NOT_AVAILABLE (radio resetting)
312  *  GENERIC_FAILURE
313  *  PASSWORD_INCORRECT
314  */
315
316 #define RIL_REQUEST_ENTER_SIM_PIN2 4
317
318 /**
319  * RIL_REQUEST_ENTER_SIM_PUK2
320  *
321  * Supplies SIM PUK2 and new PIN2. 
322  *
323  * "data" is const char **
324  * ((const char **)data)[0] is PUK2 value
325  * ((const char **)data)[1] is new PIN2 value
326  *
327  * "response" must be NULL
328  *
329  * Valid errors:
330  *  
331  *  SUCCESS 
332  *  RADIO_NOT_AVAILABLE (radio resetting)
333  *  GENERIC_FAILURE
334  *  PASSWORD_INCORRECT
335  *     (PUK2 is invalid)
336  */
337
338 #define RIL_REQUEST_ENTER_SIM_PUK2 5
339
340 /**
341  * RIL_REQUEST_CHANGE_SIM_PIN
342  *
343  * Supplies old SIM PIN and new PIN. 
344  *
345  * "data" is const char **
346  * ((const char **)data)[0] is old PIN value
347  * ((const char **)data)[1] is new PIN value
348  *
349  * "response" must be NULL
350  *
351  * Valid errors:
352  *  
353  *  SUCCESS 
354  *  RADIO_NOT_AVAILABLE (radio resetting)
355  *  GENERIC_FAILURE
356  *  PASSWORD_INCORRECT
357  *     (old PIN is invalid)
358  *      
359  */
360
361 #define RIL_REQUEST_CHANGE_SIM_PIN 6
362
363
364 /**
365  * RIL_REQUEST_CHANGE_SIM_PIN2
366  *
367  * Supplies old SIM PIN2 and new PIN2. 
368  *
369  * "data" is const char **
370  * ((const char **)data)[0] is old PIN2 value
371  * ((const char **)data)[1] is new PIN2 value
372  *
373  * "response" must be NULL
374  *
375  * Valid errors:
376  *  
377  *  SUCCESS 
378  *  RADIO_NOT_AVAILABLE (radio resetting)
379  *  GENERIC_FAILURE
380  *  PASSWORD_INCORRECT
381  *     (old PIN2 is invalid)
382  *      
383  */
384
385 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
386
387 /**
388  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
389  *
390  * Requests that network personlization be deactivated
391  *
392  * "data" is const char **
393  * ((const char **)(data))[0]] is network depersonlization code
394  *
395  * "response" must be NULL
396  *
397  * Valid errors:
398  *  
399  *  SUCCESS 
400  *  RADIO_NOT_AVAILABLE (radio resetting)
401  *  GENERIC_FAILURE
402  *  PASSWORD_INCORRECT
403  *     (code is invalid)
404  */
405
406 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
407
408 /**
409  * RIL_REQUEST_GET_CURRENT_CALLS 
410  *
411  * Requests current call list
412  *
413  * "data" is NULL
414  *
415  * "response" must be a "const RIL_Call **"
416  * 
417  * Valid errors:
418  *  
419  *  SUCCESS 
420  *  RADIO_NOT_AVAILABLE (radio resetting)
421  *  GENERIC_FAILURE
422  *      (request will be made again in a few hundred msec)
423  */
424
425 #define RIL_REQUEST_GET_CURRENT_CALLS 9
426
427
428 /** 
429  * RIL_REQUEST_DIAL
430  *
431  * Initiate voice call
432  *
433  * "data" is const RIL_Dial *
434  * "response" is NULL
435  *  
436  * This method is never used for supplementary service codes
437  *
438  * Valid errors:
439  *  SUCCESS 
440  *  RADIO_NOT_AVAILABLE (radio resetting)
441  *  GENERIC_FAILURE
442  */
443 #define RIL_REQUEST_DIAL 10
444
445 /**
446  * RIL_REQUEST_GET_IMSI
447  *
448  * Get the SIM IMSI
449  *
450  * Only valid when radio state is "RADIO_STATE_SIM_READY"
451  *
452  * "data" is NULL
453  * "response" is a const char * containing the IMSI
454  *
455  * Valid errors:
456  *  SUCCESS 
457  *  RADIO_NOT_AVAILABLE (radio resetting)
458  *  GENERIC_FAILURE
459  */
460
461 #define RIL_REQUEST_GET_IMSI 11
462
463 /**
464  * RIL_REQUEST_HANGUP
465  *
466  * Hang up a specific line (like AT+CHLD=1x)
467  *
468  * "data" is an int * 
469  * (int *)data)[0] contains GSM call index (value of 'x' in CHLD above)
470  *
471  * "response" is NULL
472  *
473  * Valid errors:
474  *  SUCCESS 
475  *  RADIO_NOT_AVAILABLE (radio resetting)
476  *  GENERIC_FAILURE
477  */
478
479 #define RIL_REQUEST_HANGUP 12
480
481 /**
482  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
483  *
484  * Hang up waiting or held (like AT+CHLD=0)
485  *
486  * "data" is NULL
487  * "response" is NULL
488  *
489  * Valid errors:
490  *  SUCCESS 
491  *  RADIO_NOT_AVAILABLE (radio resetting)
492  *  GENERIC_FAILURE
493  */
494
495 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
496
497 /**
498  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
499  *
500  * Hang up waiting or held (like AT+CHLD=1)
501  *
502  * "data" is NULL
503  * "response" is NULL
504  *
505  * Valid errors:
506  *  SUCCESS 
507  *  RADIO_NOT_AVAILABLE (radio resetting)
508  *  GENERIC_FAILURE
509  */
510
511 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
512
513 /**
514  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
515  *
516  * Switch waiting or holding call and active call (like AT+CHLD=2)
517  *
518  * State transitions should be is follows:
519  *
520  * If call 1 is waiting and call 2 is active, then if this re
521  *
522  *   BEFORE                               AFTER
523  * Call 1   Call 2                 Call 1       Call 2
524  * ACTIVE   HOLDING                HOLDING     ACTIVE
525  * ACTIVE   WAITING                HOLDING     ACTIVE
526  * HOLDING  WAITING                HOLDING     ACTIVE
527  * ACTIVE   IDLE                   HOLDING     IDLE
528  * IDLE     IDLE                   IDLE        IDLE
529  *
530  * "data" is NULL
531  * "response" is NULL
532  *
533  * Valid errors:
534  *  SUCCESS 
535  *  RADIO_NOT_AVAILABLE (radio resetting)
536  *  GENERIC_FAILURE
537  */
538
539 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
540 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
541
542 /**
543  * RIL_REQUEST_CONFERENCE
544  *
545  * Conference holding and active (like AT+CHLD=3)
546
547  * "data" is NULL
548  * "response" is NULL
549  *
550  * Valid errors:
551  *  SUCCESS 
552  *  RADIO_NOT_AVAILABLE (radio resetting)
553  *  GENERIC_FAILURE
554  */
555 #define RIL_REQUEST_CONFERENCE 16
556
557 /**
558  * RIL_REQUEST_UDUB
559  *
560  * Send UDUB (user determined used busy) to ringing or 
561  * waiting call answer)(RIL_BasicRequest r);
562  *
563  * "data" is NULL
564  * "response" is NULL
565  *
566  * Valid errors:
567  *  SUCCESS 
568  *  RADIO_NOT_AVAILABLE (radio resetting)
569  *  GENERIC_FAILURE
570  */
571 #define RIL_REQUEST_UDUB 17
572
573 /**
574  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
575  *
576  * Requests the failure cause code for the most recently terminated call
577  *
578  * "data" is NULL
579  * "response" is a "int *"
580  * ((int *)response)[0] is an integer cause code defined in TS 24.008
581  *   Annex H or close approximation
582  *
583  * If the implementation does not have access to the exact cause codes,
584  * then it should return one of the values listed in RIL_LastCallFailCause,
585  * as the UI layer needs to distinguish these cases for tone generation or
586  * error notification.
587  *
588  * Valid errors:
589  *  SUCCESS
590  *  RADIO_NOT_AVAILABLE
591  *  GENERIC_FAILURE
592  *
593  * See also: RIL_REQUEST_LAST_PDP_FAIL_CAUSE
594  */
595 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
596
597 /**
598  * RIL_REQUEST_SIGNAL_STRENGTH
599  *
600  * Requests current signal strength and bit error rate
601  *
602  * Must succeed if radio is on.
603  *
604  * "data" is NULL
605  * "response" is an "int *"
606  * ((int *)response)[0] is received signal strength (0-31, 99)
607  * ((int *)response)[1] is bit error rate (0-7, 99)
608  *  as defined in TS 27.007 8.5
609  *  Other values (eg -1) are not legal
610  *
611  * Valid errors:
612  *  SUCCESS
613  *  RADIO_NOT_AVAILABLE
614  */
615
616 #define RIL_REQUEST_SIGNAL_STRENGTH 19
617 /**
618  * RIL_REQUEST_REGISTRATION_STATE
619  *
620  * Request current registration state
621  *
622  * "data" is NULL
623  * "response" is a "char **"
624  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2
625  * ((const char **)response)[1] is LAC if registered or NULL if not
626  * ((const char **)response)[2] is CID if registered or NULL if not
627  *
628  * LAC and CID are in hexadecimal format.
629  * valid LAC are 0x0000 - 0xffff
630  * valid CID are 0x00000000 - 0xffffffff
631  * 
632  * Please note that registration state 4 ("unknown") is treated 
633  * as "out of service" in the Android telephony system
634  *
635  * Valid errors:
636  *  SUCCESS
637  *  RADIO_NOT_AVAILABLE
638  *  GENERIC_FAILURE
639  */
640 #define RIL_REQUEST_REGISTRATION_STATE 20
641
642 /**
643  * RIL_REQUEST_GPRS_REGISTRATION_STATE
644  *
645  * Request current GPRS registration state
646  *
647  * "data" is NULL
648  * "response" is a "char **"
649  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 7.2
650  * ((const char **)response)[1] is LAC if registered or NULL if not
651  * ((const char **)response)[2] is CID if registered or NULL if not
652  * ((const char **)response)[3] indicates the available radio technology, where:
653  *      0 == unknown
654  *      1 == GPRS only
655  *      2 == EDGE
656  *      3 == UMTS
657  *
658  * LAC and CID are in hexadecimal format.
659  * valid LAC are 0x0000 - 0xffff
660  * valid CID are 0x00000000 - 0xffffffff
661  * 
662  * Please note that registration state 4 ("unknown") is treated 
663  * as "out of service" in the Android telephony system
664  *
665  * Valid errors:
666  *  SUCCESS
667  *  RADIO_NOT_AVAILABLE
668  *  GENERIC_FAILURE
669  */
670 #define RIL_REQUEST_GPRS_REGISTRATION_STATE 21
671
672 /**
673  * RIL_REQUEST_OPERATOR
674  *
675  * Request current operator ONS or EONS
676  *
677  * "data" is NULL
678  * "response" is a "const char **"
679  * ((const char **)response)[0] is long alpha ONS or EONS 
680  *                                  or NULL if unregistered
681  *
682  * ((const char **)response)[1] is short alpha ONS or EONS 
683  *                                  or NULL if unregistered
684  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
685  *                                  or NULL if unregistered
686  *                                  
687  * Valid errors:
688  *  SUCCESS
689  *  RADIO_NOT_AVAILABLE
690  *  GENERIC_FAILURE
691  */
692 #define RIL_REQUEST_OPERATOR 22
693
694 /**
695  * RIL_REQUEST_RADIO_POWER
696  *
697  * Toggle radio on and off (for "airplane" mode)
698  * "data" is int *
699  * ((int *)data)[0] is > 0 for "Radio On"
700  * ((int *)data)[0] is == 0 for "Radio Off"
701  *
702  * "response" is NULL
703  *
704  * Turn radio on if "on" > 0
705  * Turn radio off if "on" == 0
706  *
707  * Valid errors:
708  *  SUCCESS
709  *  RADIO_NOT_AVAILABLE
710  *  GENERIC_FAILURE
711  */
712 #define RIL_REQUEST_RADIO_POWER 23
713
714 /**
715  * RIL_REQUEST_DTMF
716  *
717  * Send a DTMF tone
718  *
719  * If the implementation is currently playing a tone requested via
720  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
721  * should be played instead
722  *
723  * "data" is a char *
724  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
725  * ((char *)data)[1] is a single character with one of 3 values:
726  *    'S' -- tone should be played for a short time
727  *    'L' -- tone should be played for a long time
728  * "response" is NULL
729  * 
730  * FIXME should this block/mute microphone?
731  * How does this interact with local DTMF feedback?
732  *
733  * Valid errors:
734  *  SUCCESS
735  *  RADIO_NOT_AVAILABLE
736  *  GENERIC_FAILURE
737  *
738  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
739  *
740  */
741 #define RIL_REQUEST_DTMF 24
742
743 /**
744  * RIL_REQUEST_SEND_SMS
745  * 
746  * Send an SMS message
747  *
748  * "data" is const char **
749  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
750  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
751  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
752  *      less the SMSC address
753  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
754  *
755  * "response" is a const RIL_SMS_Response *
756  *
757  * Based on the return error, caller decides to resend if sending sms
758  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 
759  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
760  *
761  * Valid errors:
762  *  SUCCESS
763  *  RADIO_NOT_AVAILABLE
764  *  SMS_SEND_FAIL_RETRY
765  *  GENERIC_FAILURE
766  *
767  * FIXME how do we specify TP-Message-Reference if we need to resend?
768  */
769 #define RIL_REQUEST_SEND_SMS 25
770
771
772 /**
773  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
774  * 
775  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
776  * except that more messages are expected to be sent soon. If possible,
777  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
778  *
779  * "data" is const char **
780  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
781  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
782  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
783  *      less the SMSC address
784  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
785  *
786  * "response" is a const RIL_SMS_Response *
787  *
788  * Based on the return error, caller decides to resend if sending sms
789  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) 
790  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
791  *
792  * Valid errors:
793  *  SUCCESS
794  *  RADIO_NOT_AVAILABLE
795  *  SMS_SEND_FAIL_RETRY
796  *  GENERIC_FAILURE
797  *
798  */
799 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
800
801
802 /**
803  * RIL_REQUEST_SETUP_DEFAULT_PDP
804  *
805  * Configure and activate PDP context (CID 1) for default IP connection 
806  *
807  * Android Telephony layer will start up pppd process on specified
808  * tty when this request responded to.
809  *
810  * "data" is a const char **
811  * ((const char **)data)[0] is the APN to connect to
812  * ((const char **)data)[1] is the username, or NULL
813  * ((const char **)data)[2] is the password, or NULL
814  *
815  * "response" is a char **
816  * ((char **)response)[0] indicating PDP CID, which is generated by RIL
817  * ((char **)response)[1] indicating the network interface name
818  * ((char **)response)[2] indicating the IP address for this interface
819  *
820  * FIXME may need way to configure QoS settings
821  *
822  * Valid errors:
823  *  SUCCESS
824  *  RADIO_NOT_AVAILABLE
825  *  GENERIC_FAILURE
826  *
827  * See also: RIL_REQUEST_DEACTIVATE_DEFAULT_PDP
828  */
829
830 #define RIL_REQUEST_SETUP_DEFAULT_PDP 27
831
832
833
834 /**
835  * RIL_REQUEST_SIM_IO
836  *
837  * Request SIM I/O operation.
838  * This is similar to the TS 27.007 "restricted SIM" operation
839  * where it assumes all of the EF selection will be done by the
840  * callee.
841  *
842  * "data" is a const RIL_SIM_IO *
843  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
844  * or may specify a PIN2 for operations that require a PIN2 (eg
845  * updating FDN records)
846  *
847  * "response" is a const RIL_SIM_IO_Response *
848  *
849  * Arguments and responses that are unused for certain
850  * values of "command" should be ignored or set to NULL
851  *
852  * Valid errors:
853  *  SUCCESS
854  *  RADIO_NOT_AVAILABLE
855  *  GENERIC_FAILURE
856  *  SIM_PIN2
857  *  SIM_PUK2
858  */
859 #define RIL_REQUEST_SIM_IO 28
860
861 /**
862  * RIL_REQUEST_SEND_USSD
863  *
864  * Send a USSD message
865  *
866  * If a USSD session already exists, the message should be sent in the
867  * context of that session. Otherwise, a new session should be created.
868  *
869  * The network reply should be reported via RIL_UNSOL_ON_USSD
870  *
871  * Only one USSD session may exist at a time, and the session is assumed
872  * to exist until:
873  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
874  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
875  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
876  *
877  * "data" is a const char * containing the USSD request in UTF-8 format
878  * "response" is NULL
879  *
880  * Valid errors:
881  *  SUCCESS
882  *  RADIO_NOT_AVAILABLE
883  *  GENERIC_FAILURE
884  *
885  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
886  */
887
888 #define RIL_REQUEST_SEND_USSD 29
889
890 /**
891  * RIL_REQUEST_CANCEL_USSD
892  * 
893  * Cancel the current USSD session if one exists
894  *
895  * "data" is null
896  * "response" is NULL
897  *
898  * Valid errors:
899  *  SUCCESS
900  *  RADIO_NOT_AVAILABLE
901  *  GENERIC_FAILURE 
902  */
903
904 #define RIL_REQUEST_CANCEL_USSD 30
905
906 /**  
907  * RIL_REQUEST_GET_CLIR
908  *
909  * Gets current CLIR status
910  * "data" is NULL
911  * "response" is int *
912  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
913  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
914  *
915  * Valid errors:
916  *  SUCCESS
917  *  RADIO_NOT_AVAILABLE
918  *  GENERIC_FAILURE
919  */
920 #define RIL_REQUEST_GET_CLIR 31
921
922 /**
923  * RIL_REQUEST_SET_CLIR
924  *
925  * "data" is int *
926  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
927  *
928  * "response" is NULL
929  *
930  * Valid errors:
931  *  SUCCESS
932  *  RADIO_NOT_AVAILABLE
933  *  GENERIC_FAILURE
934  */
935 #define RIL_REQUEST_SET_CLIR 32
936
937 /**
938  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
939  *
940  * "data" is const RIL_CallForwardInfo *
941  *
942  * "response" is const RIL_CallForwardInfo **
943  * "response" points to an array of RIL_CallForwardInfo *'s, one for
944  * each distinct registered phone number.
945  *
946  * For example, if data is forwarded to +18005551212 and voice is forwarded
947  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
948  * 
949  * If, however, both data and voice are forwarded to +18005551212, then
950  * a single RIL_CallForwardInfo can be returned with the service class
951  * set to "data + voice = 3")
952  *
953  * Valid errors:
954  *  SUCCESS
955  *  RADIO_NOT_AVAILABLE
956  *  GENERIC_FAILURE
957  */
958 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
959
960
961 /**
962  * RIL_REQUEST_SET_CALL_FORWARD
963  *
964  * Configure call forward rule
965  *
966  * "data" is const RIL_CallForwardInfo *
967  * "response" is NULL
968  *  
969  * Valid errors:
970  *  SUCCESS
971  *  RADIO_NOT_AVAILABLE
972  *  GENERIC_FAILURE
973  */
974 #define RIL_REQUEST_SET_CALL_FORWARD 34
975
976
977 /**
978  * RIL_REQUEST_QUERY_CALL_WAITING
979  *
980  * Query current call waiting state
981  *
982  * "data" is const int *
983  * ((const int *)data)[0] is the TS 27.007 service class to query.
984  * "response" is a const int *
985  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
986  *
987  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
988  * must follow, with the TS 27.007 service class bit vector of services
989  * for which call waiting is enabled.
990  *
991  * For example, if ((const int *)response)[0]  is 1 and 
992  * ((const int *)response)[1] is 3, then call waiting is enabled for data
993  * and voice and disabled for everything else
994  *
995  * Valid errors:
996  *  SUCCESS
997  *  RADIO_NOT_AVAILABLE
998  *  GENERIC_FAILURE
999  */
1000 #define RIL_REQUEST_QUERY_CALL_WAITING 35
1001
1002
1003 /**
1004  * RIL_REQUEST_SET_CALL_WAITING
1005  *
1006  * Configure current call waiting state
1007  *
1008  * "data" is const int *
1009  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
1010  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
1011  *                           services to modify
1012  * "response" is NULL
1013  *
1014  * Valid errors:
1015  *  SUCCESS
1016  *  RADIO_NOT_AVAILABLE
1017  *  GENERIC_FAILURE
1018  */
1019 #define RIL_REQUEST_SET_CALL_WAITING 36
1020
1021 /**
1022  * RIL_REQUEST_SMS_ACKNOWLEDGE
1023  *
1024  * Acknowledge successful or failed receipt of SMS previously indicated
1025  * via RIL_UNSOL_RESPONSE_NEW_SMS 
1026  *
1027  * "data" is int *
1028  * ((int *)data)[0] is "1" on successful receipt 
1029  *                  (basically, AT+CNMA=1 from TS 27.005
1030  * ((int *)data)[0] is "0" on failed receipt 
1031  *                  (basically, AT+CNMA=2 from TS 27.005)
1032  *
1033  * "response" is NULL
1034  *
1035  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
1036  *
1037  * Valid errors:
1038  *  SUCCESS
1039  *  RADIO_NOT_AVAILABLE
1040  *  GENERIC_FAILURE
1041  */
1042 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
1043
1044 /**
1045  * RIL_REQUEST_GET_IMEI
1046  *
1047  * Get the device IMEI, including check digit
1048  *
1049  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1050  *
1051  * "data" is NULL
1052  * "response" is a const char * containing the IMEI
1053  *
1054  * Valid errors:
1055  *  SUCCESS 
1056  *  RADIO_NOT_AVAILABLE (radio resetting)
1057  *  GENERIC_FAILURE
1058  */
1059
1060 #define RIL_REQUEST_GET_IMEI 38
1061
1062 /**
1063  * RIL_REQUEST_GET_IMEISV
1064  *
1065  * Get the device IMEISV, which should be two decimal digits
1066  *
1067  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
1068  *
1069  * "data" is NULL
1070  * "response" is a const char * containing the IMEISV
1071  *
1072  * Valid errors:
1073  *  SUCCESS 
1074  *  RADIO_NOT_AVAILABLE (radio resetting)
1075  *  GENERIC_FAILURE
1076  */
1077
1078 #define RIL_REQUEST_GET_IMEISV 39
1079
1080
1081 /**
1082  * RIL_REQUEST_ANSWER
1083  *
1084  * Answer incoming call
1085  *
1086  * Will not be called for WAITING calls.
1087  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
1088  * instead
1089  *
1090  * "data" is NULL
1091  * "response" is NULL
1092  *
1093  * Valid errors:
1094  *  SUCCESS 
1095  *  RADIO_NOT_AVAILABLE (radio resetting)
1096  *  GENERIC_FAILURE
1097  */
1098
1099 #define RIL_REQUEST_ANSWER 40
1100
1101 /**
1102  * RIL_REQUEST_DEACTIVATE_DEFAULT_PDP
1103  *
1104  * Deactivate PDP context created by RIL_REQUEST_SETUP_DEFAULT_PDP
1105  *
1106  * "data" is const char **
1107  * ((char**)data)[0] indicating PDP CID
1108  * "response" is NULL
1109  *
1110  * Valid errors:
1111  *  SUCCESS
1112  *  RADIO_NOT_AVAILABLE
1113  *  GENERIC_FAILURE
1114  *
1115  * See also: RIL_REQUEST_SETUP_DEFAULT_PDP
1116  */
1117
1118 #define RIL_REQUEST_DEACTIVATE_DEFAULT_PDP 41
1119
1120 /**
1121  * RIL_REQUEST_QUERY_FACILITY_LOCK
1122  *
1123  * Query the status of a facility lock state
1124  *
1125  * "data" is const char **
1126  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4  
1127  *                      (eg "AO" for BAOC, "SC" for SIM lock)
1128  * ((const char **)data)[1] is the password, or "" if not required
1129  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
1130  *                           services to query
1131  *
1132  * "response" is an int *
1133  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
1134  *                           services for which the specified barring facility 
1135  *                           is active. "0" means "disabled for all"
1136  * 
1137  *
1138  * Valid errors:
1139  *  SUCCESS
1140  *  RADIO_NOT_AVAILABLE
1141  *  GENERIC_FAILURE
1142  *
1143  */
1144 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
1145
1146 /**
1147  * RIL_REQUEST_SET_FACILITY_LOCK
1148  *
1149  * Enable/disable one facility lock
1150  *
1151  * "data" is const char **
1152  *
1153  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1154  * (eg "AO" for BAOC)
1155  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
1156  * ((const char **)data)[2] = password
1157  * ((const char **)data)[3] = string representation of decimal TS 27.007
1158  *                            service class bit vector. Eg, the string
1159  *                            "1" means "set this facility for voice services"
1160  *
1161  * "response" is NULL 
1162  *
1163  * Valid errors:
1164  *  SUCCESS
1165  *  RADIO_NOT_AVAILABLE
1166  *  GENERIC_FAILURE
1167  *
1168  */
1169 #define RIL_REQUEST_SET_FACILITY_LOCK 43
1170
1171 /**
1172  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
1173  *
1174  * Change call barring facility password
1175  *
1176  * "data" is const char **
1177  *
1178  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
1179  * (eg "AO" for BAOC)
1180  * ((const char **)data)[1] = old password
1181  * ((const char **)data)[2] = new password
1182  *
1183  * "response" is NULL 
1184  *
1185  * Valid errors:
1186  *  SUCCESS
1187  *  RADIO_NOT_AVAILABLE
1188  *  GENERIC_FAILURE
1189  *
1190  */
1191 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
1192
1193 /**
1194  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
1195  *
1196  * Query current network selectin mode
1197  *
1198  * "data" is NULL
1199  *
1200  * "response" is int *
1201  * ((const int *)response)[0] is
1202  *     0 for automatic selection
1203  *     1 for manual selection
1204  *
1205  * Valid errors:
1206  *  SUCCESS
1207  *  RADIO_NOT_AVAILABLE
1208  *  GENERIC_FAILURE
1209  *
1210  */
1211 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
1212
1213 /**
1214  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
1215  *
1216  * Specify that the network should be selected automatically
1217  *
1218  * "data" is NULL
1219  * "response" is NULL
1220  *
1221  * This request must not respond until the new operator is selected 
1222  * and registered
1223  *
1224  * Valid errors:
1225  *  SUCCESS
1226  *  RADIO_NOT_AVAILABLE
1227  *  GENERIC_FAILURE
1228  *
1229  */
1230 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
1231
1232 /**
1233  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
1234  *
1235  * Manually select a specified network.
1236  *
1237  * The radio baseband/RIL implementation is expected to fall back to 
1238  * automatic selection mode if the manually selected network should go
1239  * out of range in the future.
1240  *
1241  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
1242  * "response" is NULL
1243  *
1244  * This request must not respond until the new operator is selected 
1245  * and registered
1246  *
1247  * Valid errors:
1248  *  SUCCESS
1249  *  RADIO_NOT_AVAILABLE
1250  *  GENERIC_FAILURE
1251  *
1252  */
1253 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
1254
1255 /**
1256  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
1257  *
1258  * Scans for available networks
1259  *
1260  * "data" is NULL
1261  * "response" is const char ** that should be an array of n*4 strings, where
1262  *    n is the number of available networks
1263  * For each available network:
1264  *
1265  * ((const char **)response)[n+0] is long alpha ONS or EONS 
1266  * ((const char **)response)[n+1] is short alpha ONS or EONS 
1267  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
1268  * ((const char **)response)[n+3] is a string value of the status:
1269  *           "unknown"
1270  *           "available"
1271  *           "current"
1272  *           "forbidden"
1273  *
1274  * This request must not respond until the new operator is selected 
1275  * and registered
1276  *
1277  * Valid errors:
1278  *  SUCCESS
1279  *  RADIO_NOT_AVAILABLE
1280  *  GENERIC_FAILURE
1281  *
1282  */
1283 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
1284
1285 /**
1286  * RIL_REQUEST_DTMF_START
1287  *
1288  * Start playing a DTMF tone. Continue playing DTMF tone until 
1289  * RIL_REQUEST_DTMF_STOP is received 
1290  *
1291  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
1292  * it should cancel the previous tone and play the new one.
1293  * 
1294  * "data" is a char *
1295  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
1296  * "response" is NULL
1297  * 
1298  * Valid errors:
1299  *  SUCCESS
1300  *  RADIO_NOT_AVAILABLE
1301  *  GENERIC_FAILURE
1302  *
1303  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
1304  */
1305 #define RIL_REQUEST_DTMF_START 49
1306
1307 /**
1308  * RIL_REQUEST_DTMF_STOP
1309  *
1310  * Stop playing a currently playing DTMF tone.
1311  * 
1312  * "data" is NULL
1313  * "response" is NULL
1314  * 
1315  * Valid errors:
1316  *  SUCCESS
1317  *  RADIO_NOT_AVAILABLE
1318  *  GENERIC_FAILURE
1319  *
1320  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
1321  */
1322 #define RIL_REQUEST_DTMF_STOP 50
1323
1324 /**
1325  * RIL_REQUEST_BASEBAND_VERSION
1326  *
1327  * Return string value indicating baseband version, eg
1328  * response from AT+CGMR
1329  * 
1330  * "data" is NULL
1331  * "response" is const char * containing version string for log reporting
1332  * 
1333  * Valid errors:
1334  *  SUCCESS
1335  *  RADIO_NOT_AVAILABLE
1336  *  GENERIC_FAILURE
1337  *
1338  */
1339 #define RIL_REQUEST_BASEBAND_VERSION 51
1340
1341 /**
1342  * RIL_REQUEST_SEPARATE_CONNECTION
1343  *
1344  * Separate a party from a multiparty call placing the multiparty call
1345  * (less the specified party) on hold and leaving the specified party 
1346  * as the only other member of the current (active) call
1347  *
1348  * Like AT+CHLD=2x
1349  *
1350  * See TS 22.084 1.3.8.2 (iii)
1351  * TS 22.030 6.5.5 "Entering "2X followed by send"
1352  * TS 27.007 "AT+CHLD=2x"
1353  * 
1354  * "data" is an int * 
1355  * (int *)data)[0] contains GSM call index (value of 'x' in CHLD above)
1356  * "response" is NULL
1357  *
1358  * Valid errors:
1359  *  SUCCESS 
1360  *  RADIO_NOT_AVAILABLE (radio resetting)
1361  *  GENERIC_FAILURE
1362  */
1363 #define RIL_REQUEST_SEPARATE_CONNECTION 52
1364
1365
1366 /**
1367  * RIL_REQUEST_SET_MUTE
1368  *
1369  * Turn on or off uplink (microphone) mute.
1370  *
1371  * Will only be sent while voice call is active.
1372  * Will always be reset to "disable mute" when a new voice call is initiated
1373  *
1374  * "data" is an int *
1375  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
1376  *
1377  * "response" is NULL
1378  *
1379  * Valid errors:
1380  *  SUCCESS 
1381  *  RADIO_NOT_AVAILABLE (radio resetting)
1382  *  GENERIC_FAILURE
1383  */
1384
1385 #define RIL_REQUEST_SET_MUTE 53
1386
1387 /**
1388  * RIL_REQUEST_GET_MUTE
1389  *
1390  * Queries the current state of the uplink mute setting
1391  *
1392  * "data" is NULL
1393  * "response" is an int *
1394  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
1395  *
1396  * Valid errors:
1397  *  SUCCESS 
1398  *  RADIO_NOT_AVAILABLE (radio resetting)
1399  *  GENERIC_FAILURE
1400  */
1401
1402 #define RIL_REQUEST_GET_MUTE 54
1403
1404 /**
1405  * RIL_REQUEST_QUERY_CLIP
1406  *
1407  * Queries the status of the CLIP supplementary service
1408  *
1409  * (for MMI code "*#30#")
1410  *
1411  * "data" is NULL
1412  * "response" is an int *
1413  * (int *)response)[0] is 1 for "CLIP provisioned" 
1414  *                           and 0 for "CLIP not provisioned"
1415  *                           and 2 for "unknown, e.g. no network etc" 
1416  *
1417  * Valid errors:
1418  *  SUCCESS 
1419  *  RADIO_NOT_AVAILABLE (radio resetting)
1420  *  GENERIC_FAILURE
1421  */
1422
1423 #define RIL_REQUEST_QUERY_CLIP 55
1424
1425 /**
1426  * RIL_REQUEST_LAST_PDP_FAIL_CAUSE
1427  * 
1428  * Requests the failure cause code for the most recently failed PDP 
1429  * context activate
1430  *
1431  * "data" is NULL
1432  *
1433  * "response" is a "int *"
1434  * ((int *)response)[0] is an integer cause code defined in TS 24.008
1435  *   section 6.1.3.1.3 or close approximation
1436  *
1437  * If the implementation does not have access to the exact cause codes,
1438  * then it should return one of the values listed in 
1439  * RIL_LastPDPActivateFailCause, as the UI layer needs to distinguish these 
1440  * cases for error notification
1441  * and potential retries.
1442  *
1443  * Valid errors:
1444  *  SUCCESS
1445  *  RADIO_NOT_AVAILABLE
1446  *  GENERIC_FAILURE
1447  *
1448  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
1449  *  
1450  */ 
1451
1452 #define RIL_REQUEST_LAST_PDP_FAIL_CAUSE 56
1453
1454 /**
1455  * RIL_REQUEST_PDP_CONTEXT_LIST
1456  *
1457  * Queries the status of PDP contexts, returning for each
1458  * its CID, whether or not it is active, and its PDP type,
1459  * APN, and PDP adddress.
1460  *
1461  * "data" is NULL
1462  * "response" is an array of RIL_PDP_Context_Response
1463  *
1464  * Valid errors:
1465  *  SUCCESS 
1466  *  RADIO_NOT_AVAILABLE (radio resetting)
1467  *  GENERIC_FAILURE
1468  */
1469
1470 #define RIL_REQUEST_PDP_CONTEXT_LIST 57
1471
1472 /**
1473  * RIL_REQUEST_RESET_RADIO
1474  *
1475  * Request a radio reset. The RIL implementation may postpone
1476  * the reset until after this request is responded to if the baseband
1477  * is presently busy.
1478  *
1479  * "data" is NULL
1480  * "response" is NULL
1481  *
1482  * The reset action could be delayed for a while
1483  * in case baseband modem is just busy.
1484  *
1485  * Valid errors:
1486  *  SUCCESS 
1487  *  RADIO_NOT_AVAILABLE (radio resetting)
1488  *  GENERIC_FAILURE
1489  */
1490
1491 #define RIL_REQUEST_RESET_RADIO 58
1492
1493 /**
1494  * RIL_REQUEST_OEM_HOOK_RAW
1495  *
1496  * This request reserved for OEM-specific uses. It passes raw byte arrays
1497  * back and forth.
1498  *
1499  * It can be invoked on the Java side from 
1500  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
1501  *
1502  * "data" is a char * of bytes copied from the byte[] data argument in java
1503  * "response" is a char * of bytes that will returned via the
1504  * caller's "response" Message here: 
1505  * (byte[])(((AsyncResult)response.obj).result)
1506  *
1507  * An error response here will result in 
1508  * (((AsyncResult)response.obj).result) == null and 
1509  * (((AsyncResult)response.obj).exception) being an instance of
1510  * com.android.internal.telephony.gsm.CommandException
1511  *
1512  * Valid errors:
1513  *  All
1514  */
1515
1516 #define RIL_REQUEST_OEM_HOOK_RAW 59
1517
1518 /**
1519  * RIL_REQUEST_OEM_HOOK_STRINGS
1520  *
1521  * This request reserved for OEM-specific uses. It passes strings
1522  * back and forth.
1523  *
1524  * It can be invoked on the Java side from 
1525  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
1526  *
1527  * "data" is a const char **, representing an array of null-terminated UTF-8
1528  * strings copied from the "String[] strings" argument to
1529  * invokeOemRilRequestStrings()
1530  *
1531  * "response" is a const char **, representing an array of null-terminated UTF-8
1532  * stings that will be returned via the caller's response message here:
1533  *
1534  * (String[])(((AsyncResult)response.obj).result)
1535  *
1536  * An error response here will result in 
1537  * (((AsyncResult)response.obj).result) == null and 
1538  * (((AsyncResult)response.obj).exception) being an instance of
1539  * com.android.internal.telephony.gsm.CommandException
1540  *
1541  * Valid errors:
1542  *  All
1543  */
1544
1545 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
1546
1547 /**
1548  * RIL_REQUEST_SCREEN_STATE
1549  *
1550  * Indicates the current state of the screen.  When the screen is off, the
1551  * RIL should notify the baseband to suppress certain notifications (eg,
1552  * signal strength and changes in LAC or CID) in an effort to conserve power.
1553  * These notifications should resume when the screen is on.
1554  *
1555  * "data" is int *
1556  * ((int *)data)[0] is == 1 for "Screen On"
1557  * ((int *)data)[0] is == 0 for "Screen Off"
1558  *
1559  * "response" is NULL
1560  *
1561  * Valid errors:
1562  *  SUCCESS
1563  *  GENERIC_FAILURE
1564  */
1565 #define RIL_REQUEST_SCREEN_STATE 61
1566
1567
1568 /**
1569  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
1570  *
1571  * Enables/disables supplementary service related notifications
1572  * from the network.
1573  *
1574  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
1575  *
1576  * "data" is int *
1577  * ((int *)data)[0] is == 1 for notifications enabled
1578  * ((int *)data)[0] is == 0 for notifications disabled
1579  *
1580  * "response" is NULL
1581  *
1582  * Valid errors:
1583  *  SUCCESS
1584  *  RADIO_NOT_AVAILABLE
1585  *  GENERIC_FAILURE
1586  *
1587  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
1588  */
1589 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
1590
1591 /**
1592  * RIL_REQUEST_WRITE_SMS_TO_SIM
1593  *
1594  * Stores a SMS message to SIM memory.
1595  *
1596  * "data" is RIL_SMS_WriteArgs *
1597  *
1598  * "response" is int *
1599  * ((const int *)response)[0] is the record index where the message is stored.
1600  *
1601  * Valid errors:
1602  *  SUCCESS
1603  *  GENERIC_FAILURE
1604  *
1605  */
1606 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
1607
1608 /**
1609  * RIL_REQUEST_DELETE_SMS_ON_SIM
1610  *
1611  * Deletes a SMS message from SIM memory.
1612  *
1613  * "data" is int  *
1614  * ((int *)data)[0] is the record index of the message to delete.
1615  *
1616  * "response" is NULL
1617  *
1618  * Valid errors:
1619  *  SUCCESS
1620  *  GENERIC_FAILURE
1621  *
1622  */
1623 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
1624
1625 /**
1626  * RIL_REQUEST_SET_BAND_MODE
1627  *
1628  * Assign a specified band for RF configuration.
1629  *
1630  * "data" is int *
1631  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
1632  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
1633  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
1634  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
1635  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
1636  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
1637  *
1638  * "response" is NULL
1639  *
1640  * Valid errors:
1641  *  SUCCESS
1642  *  RADIO_NOT_AVAILABLE
1643  *  GENERIC_FAILURE
1644  */
1645 #define RIL_REQUEST_SET_BAND_MODE 65
1646
1647 /**
1648  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
1649  *
1650  * Query the list of band mode supported by RF.
1651  *
1652  * "data" is NULL
1653  *
1654  * "response" is int *
1655  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
1656  * each available band mode.
1657  *
1658  *  0 for "unspecified" (selected by baseband automatically)
1659  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
1660  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
1661  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
1662  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
1663  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
1664  *
1665  * Valid errors:
1666  *  SUCCESS
1667  *  RADIO_NOT_AVAILABLE
1668  *  GENERIC_FAILURE
1669  *
1670  * See also: RIL_REQUEST_SET_BAND_MODE
1671  */
1672 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
1673
1674 /**
1675  * RIL_REQUEST_STK_GET_PROFILE
1676  *
1677  * Requests the profile of SIM tool kit.
1678  * The profile indicates the SAT/USAT features supported by ME.
1679  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
1680  *
1681  * "data" is NULL
1682  *
1683  * "response" is a const char * containing SAT/USAT profile
1684  * in hexadecimal format string starting with first byte of terminal profile
1685  *
1686  * Valid errors:
1687  *  RIL_E_SUCCESS
1688  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1689  *  RIL_E_GENERIC_FAILURE
1690  */
1691 #define RIL_REQUEST_STK_GET_PROFILE 67
1692
1693 /**
1694  * RIL_REQUEST_STK_SET_PROFILE
1695  *
1696  * Download the STK terminal profile as part of SIM initialization
1697  * procedure
1698  *
1699  * "data" is a const char * containing SAT/USAT profile
1700  * in hexadecimal format string starting with first byte of terminal profile
1701  *
1702  * "response" is NULL
1703  *
1704  * Valid errors:
1705  *  RIL_E_SUCCESS
1706  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1707  *  RIL_E_GENERIC_FAILURE
1708  */
1709 #define RIL_REQUEST_STK_SET_PROFILE 68
1710
1711 /**
1712  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
1713  *
1714  * Requests to send a SAT/USAT envelope command to SIM.
1715  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
1716  *
1717  * "data" is a const char * containing SAT/USAT command
1718  * in hexadecimal format string starting with command tag
1719  *
1720  * "response" is a const char * containing SAT/USAT response
1721  * in hexadecimal format string starting with first byte of response
1722  * (May be NULL)
1723  *
1724  * Valid errors:
1725  *  RIL_E_SUCCESS
1726  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1727  *  RIL_E_GENERIC_FAILURE
1728  */
1729 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
1730
1731 /**
1732  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
1733  *
1734  * Requests to send a terminal response to SIM for a received
1735  * proactive command
1736  *
1737  * "data" is a const char * containing SAT/USAT response
1738  * in hexadecimal format string starting with first byte of response data
1739  *
1740  * "response" is NULL
1741  *
1742  * Valid errors:
1743  *  RIL_E_SUCCESS
1744  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1745  *  RIL_E_GENERIC_FAILURE
1746  */
1747 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
1748
1749 /**
1750  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
1751  *
1752  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
1753  * been initialized by ME already. (We could see the call has been in the 'call
1754  * list') So, STK application needs to accept/reject the call according as user
1755  * operations.
1756  *
1757  * "data" is int *
1758  * ((int *)data)[0] is > 0 for "accept" the call setup
1759  * ((int *)data)[0] is == 0 for "reject" the call setup
1760  *
1761  * "response" is NULL
1762  *
1763  * Valid errors:
1764  *  RIL_E_SUCCESS
1765  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1766  *  RIL_E_GENERIC_FAILURE
1767  */
1768 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
1769
1770 /**
1771  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
1772  *
1773  * Connects the two calls and disconnects the subscriber from both calls.
1774  * 
1775  * "data" is NULL
1776  * "response" is NULL
1777  *
1778  * Valid errors:
1779  *  SUCCESS 
1780  *  RADIO_NOT_AVAILABLE (radio resetting)
1781  *  GENERIC_FAILURE
1782  */
1783 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
1784
1785 /**
1786  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
1787  *
1788  * Requests to set the preferred network type for searching and registering
1789  * (CS/PS domain, RAT, and operation mode)
1790  *
1791  * "data" is int *
1792  * ((int *)data)[0] is == 0 for WCDMA preferred (auto mode)
1793  * ((int *)data)[0] is == 1 for GSM only
1794  * ((int *)data)[0] is == 2 for WCDMA only
1795  *
1796  * "response" is NULL
1797  *
1798  * Valid errors:
1799  *  RIL_E_SUCCESS
1800  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
1801  *  RIL_E_GENERIC_FAILURE
1802  */
1803 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
1804
1805 /**
1806  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
1807  *
1808  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
1809  * for searching and registering
1810  *
1811  * "data" is NULL
1812  *
1813  * "response" is int *
1814  * ((int *)response)[0] is == 0 for WCDMA preferred (auto mode)
1815  * ((int *)response)[0] is == 1 for GSM only
1816  * ((int *)response)[0] is == 2 for WCDMA only
1817  *
1818  * Valid errors:
1819  *  SUCCESS
1820  *  RADIO_NOT_AVAILABLE
1821  *  GENERIC_FAILURE
1822  *
1823  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
1824  */
1825 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
1826
1827 /**
1828  * RIL_REQUEST_NEIGHBORING_CELL_IDS
1829  *
1830  * Request neighboring cell id in GSM network
1831  *
1832  * "data" is NULL
1833  * "response" is a char **
1834  * ((char *)response)[0] is the number of available cell ids, range from 0 to 6
1835  * ((char *)response)[1] is CID[0] if available or NULL if not
1836  * ((char *)response)[2] is CID[1] if available or NULL if not
1837  * ((char *)response)[3] is CID[2] if available or NULL if not
1838  * ((char *)response)[4] is CID[3] if available or NULL if not
1839  * ((char *)response)[5] is CID[4] if available or NULL if not
1840  * ((char *)response)[6] is CID[5] if available or NULL if not
1841  *
1842  * CIDs are in hexadecimal format.  Valid values are 0x00000000 - 0xffffffff.
1843  *
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