/
ril.h
3505 lines (3216 loc) · 99.8 KB
/
ril.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* ISSUES:
* - SMS retransmit (specifying TP-Message-ID)
*
*/
/**
* TODO
*
* Supp Service Notification (+CSSN)
* GPRS PDP context deactivate notification
*
*/
#ifndef ANDROID_RIL_H
#define ANDROID_RIL_H 1
#include <stdlib.h>
#ifndef FEATURE_UNIT_TEST
#include <sys/time.h>
#endif /* !FEATURE_UNIT_TEST */
#ifdef __cplusplus
extern "C" {
#endif
#define RIL_VERSION 2
#define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
#define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
typedef void * RIL_Token;
typedef enum {
RIL_E_SUCCESS = 0,
RIL_E_RADIO_NOT_AVAILABLE = 1, /* If radio did not start or is resetting */
RIL_E_GENERIC_FAILURE = 2,
RIL_E_PASSWORD_INCORRECT = 3, /* for PIN/PIN2 methods only! */
RIL_E_SIM_PIN2 = 4, /* Operation requires SIM PIN2 to be entered */
RIL_E_SIM_PUK2 = 5, /* Operation requires SIM PIN2 to be entered */
RIL_E_REQUEST_NOT_SUPPORTED = 6,
RIL_E_CANCELLED = 7,
RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
call on a Class C GPRS device */
RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, /* data ops are not allowed before device
registers in network */
RIL_E_SMS_SEND_FAIL_RETRY = 10, /* fail to send sms and need retry */
RIL_E_SIM_ABSENT = 11, /* fail to set the location where CDMA subscription
shall be retrieved because of SIM or RUIM
card absent */
RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12, /* fail to find CDMA subscription from specified
location */
RIL_E_MODE_NOT_SUPPORTED = 13, /* HW does not support preferred network type */
RIL_E_FDN_CHECK_FAILURE = 14 /* command failed because recipient is not on FDN list */
} RIL_Errno;
typedef enum {
RIL_CALL_ACTIVE = 0,
RIL_CALL_HOLDING = 1,
RIL_CALL_DIALING = 2, /* MO call only */
RIL_CALL_ALERTING = 3, /* MO call only */
RIL_CALL_INCOMING = 4, /* MT call only */
RIL_CALL_WAITING = 5 /* MT call only */
} RIL_CallState;
typedef enum {
RADIO_STATE_OFF = 0, /* Radio explictly powered off (eg CFUN=0) */
RADIO_STATE_UNAVAILABLE = 1, /* Radio unavailable (eg, resetting or not booted) */
RADIO_STATE_SIM_NOT_READY = 2, /* Radio is on, but the SIM interface is not ready */
RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network
personalization locked, or SIM absent */
RADIO_STATE_SIM_READY = 4, /* Radio is on and SIM interface is available */
RADIO_STATE_RUIM_NOT_READY = 5, /* Radio is on, but the RUIM interface is not ready */
RADIO_STATE_RUIM_READY = 6, /* Radio is on and the RUIM interface is available */
RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
personalization locked, or RUIM absent */
RADIO_STATE_NV_NOT_READY = 8, /* Radio is on, but the NV interface is not available */
RADIO_STATE_NV_READY = 9 /* Radio is on and the NV interface is available */
} RIL_RadioState;
/* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
typedef struct {
char isPresent; /* non-zero if signal information record is present */
char signalType; /* as defined 3.7.5.5-1 */
char alertPitch; /* as defined 3.7.5.5-2 */
char signal; /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
} RIL_CDMA_SignalInfoRecord;
typedef struct {
RIL_CallState state;
int index; /* Connection Index for use with, eg, AT+CHLD */
int toa; /* type of address, eg 145 = intl */
char isMpty; /* nonzero if is mpty call */
char isMT; /* nonzero if call is mobile terminated */
char als; /* ALS line indicator if available
(0 = line 1) */
char isVoice; /* nonzero if this is is a voice call */
char isVoicePrivacy; /* nonzero if CDMA voice privacy mode is active */
char * number; /* Remote party number */
int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
char * name; /* Remote party name */
int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
} RIL_Call;
typedef struct {
int cid; /* Context ID */
int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
char * type; /* X.25, IP, IPV6, etc. */
char * apn;
char * address;
} RIL_Data_Call_Response;
typedef struct {
int messageRef; /* TP-Message-Reference for GSM,
and BearerData MessageId for CDMA
(See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
char *ackPDU; /* or NULL if n/a */
int errorCode; /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
-1 if unknown or not applicable*/
} RIL_SMS_Response;
/** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
typedef struct {
int status; /* Status of message. See TS 27.005 3.1, "<stat>": */
/* 0 = "REC UNREAD" */
/* 1 = "REC READ" */
/* 2 = "STO UNSENT" */
/* 3 = "STO SENT" */
char * pdu; /* PDU of message to write, as an ASCII hex string less the SMSC address,
the TP-layer length is "strlen(pdu)/2". */
char * smsc; /* SMSC address in GSM BCD format prefixed by a length byte
(as expected by TS 27.005) or NULL for default SMSC */
} RIL_SMS_WriteArgs;
/** Used by RIL_REQUEST_DIAL */
typedef struct {
char * address;
int clir;
/* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
* clir == 0 on "use subscription default value"
* clir == 1 on "CLIR invocation" (restrict CLI presentation)
* clir == 2 on "CLIR suppression" (allow CLI presentation)
*/
} RIL_Dial;
typedef struct {
int command; /* one of the commands listed for TS 27.007 +CRSM*/
int fileid; /* EF id */
char *path; /* "pathid" from TS 27.007 +CRSM command.
Path is in hex asciii format eg "7f205f70"
Path must always be provided.
*/
int p1;
int p2;
int p3;
char *data; /* May be NULL*/
char *pin2; /* May be NULL*/
} RIL_SIM_IO;
typedef struct {
int sw1;
int sw2;
char *simResponse; /* In hex string format ([a-fA-F0-9]*). */
} RIL_SIM_IO_Response;
/* See also com.android.internal.telephony.gsm.CallForwardInfo */
typedef struct {
int status; /*
* For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
* status 1 = active, 0 = not active
*
* For RIL_REQUEST_SET_CALL_FORWARD:
* status is:
* 0 = disable
* 1 = enable
* 2 = interrogate
* 3 = registeration
* 4 = erasure
*/
int reason; /* from TS 27.007 7.11 "reason" */
int serviceClass;/* From 27.007 +CCFC/+CLCK "class"
See table for Android mapping from
MMI service code
0 means user doesn't input class */
int toa; /* "type" from TS 27.007 7.11 */
char * number; /* "number" from TS 27.007 7.11. May be NULL */
int timeSeconds; /* for CF no reply only */
}RIL_CallForwardInfo;
typedef struct {
char * cid; /* Combination of LAC and Cell Id in 32 bits in GSM.
* Upper 16 bits is LAC and lower 16 bits
* is CID (as described in TS 27.005)
* Primary Scrambling Code (as described in TS 25.331)
* in 9 bits in UMTS
* Valid values are hexadecimal 0x0000 - 0xffffffff.
*/
int rssi; /* Received RSSI in GSM,
* Level index of CPICH Received Signal Code Power in UMTS
*/
} RIL_NeighboringCell;
/* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
typedef enum {
CALL_FAIL_NORMAL = 16,
CALL_FAIL_BUSY = 17,
CALL_FAIL_CONGESTION = 34,
CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
CALL_FAIL_CALL_BARRED = 240,
CALL_FAIL_FDN_BLOCKED = 241,
CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
CALL_FAIL_CDMA_DROP = 1001,
CALL_FAIL_CDMA_INTERCEPT = 1002,
CALL_FAIL_CDMA_REORDER = 1003,
CALL_FAIL_CDMA_SO_REJECT = 1004,
CALL_FAIL_CDMA_RETRY_ORDER = 1005,
CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
CALL_FAIL_CDMA_PREEMPTED = 1007,
CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
during emergency callback mode */
CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
} RIL_LastCallFailCause;
/* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
typedef enum {
PDP_FAIL_OPERATOR_BARRED = 0x08, /* no retry */
PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
PDP_FAIL_MISSING_UKNOWN_APN = 0x1B, /* no retry */
PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, /* no retry */
PDP_FAIL_USER_AUTHENTICATION = 0x1D, /* no retry */
PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E, /* no retry */
PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20, /* no retry */
PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
PDP_FAIL_NSAPI_IN_USE = 0x23, /* no retry */
PDP_FAIL_PROTOCOL_ERRORS = 0x6F, /* no retry */
PDP_FAIL_ERROR_UNSPECIFIED = 0xffff, /* This and all other cases: retry silently */
/* Not mentioned in the specification */
PDP_FAIL_REGISTRATION_FAIL = -1,
PDP_FAIL_GPRS_REGISTRATION_FAIL = -2,
} RIL_LastDataCallActivateFailCause;
/* See RIL_REQUEST_SETUP_DATA_CALL */
typedef enum {
RIL_DATA_PROFILE_DEFAULT = 0,
RIL_DATA_PROFILE_TETHERED = 1,
RIL_DATA_PROFILE_OEM_BASE = 1000 /* Start of OEM-specific profiles */
} RIL_DataProfile;
/* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
typedef struct {
int notificationType; /*
* 0 = MO intermediate result code
* 1 = MT unsolicited result code
*/
int code; /* See 27.007 7.17
"code1" for MO
"code2" for MT. */
int index; /* CUG index. See 27.007 7.17. */
int type; /* "type" from 27.007 7.17 (MT only). */
char * number; /* "number" from 27.007 7.17
(MT only, may be NULL). */
} RIL_SuppSvcNotification;
#define RIL_CARD_MAX_APPS 8
typedef enum {
RIL_CARDSTATE_ABSENT = 0,
RIL_CARDSTATE_PRESENT = 1,
RIL_CARDSTATE_ERROR = 2
} RIL_CardState;
typedef enum {
RIL_PERSOSUBSTATE_UNKNOWN = 0, /* initial state */
RIL_PERSOSUBSTATE_IN_PROGRESS = 1, /* in between each lock transition */
RIL_PERSOSUBSTATE_READY = 2, /* when either SIM or RUIM Perso is finished
since each app can only have 1 active perso
involved */
RIL_PERSOSUBSTATE_SIM_NETWORK = 3,
RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4,
RIL_PERSOSUBSTATE_SIM_CORPORATE = 5,
RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6,
RIL_PERSOSUBSTATE_SIM_SIM = 7,
RIL_PERSOSUBSTATE_SIM_NETWORK_PUK = 8, /* The corresponding perso lock is blocked */
RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9,
RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10,
RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11,
RIL_PERSOSUBSTATE_SIM_SIM_PUK = 12,
RIL_PERSOSUBSTATE_RUIM_NETWORK1 = 13,
RIL_PERSOSUBSTATE_RUIM_NETWORK2 = 14,
RIL_PERSOSUBSTATE_RUIM_HRPD = 15,
RIL_PERSOSUBSTATE_RUIM_CORPORATE = 16,
RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17,
RIL_PERSOSUBSTATE_RUIM_RUIM = 18,
RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19, /* The corresponding perso lock is blocked */
RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20,
RIL_PERSOSUBSTATE_RUIM_HRPD_PUK = 21,
RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22,
RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
RIL_PERSOSUBSTATE_RUIM_RUIM_PUK = 24
} RIL_PersoSubstate;
typedef enum {
RIL_APPSTATE_UNKNOWN = 0,
RIL_APPSTATE_DETECTED = 1,
RIL_APPSTATE_PIN = 2, /* If PIN1 or UPin is required */
RIL_APPSTATE_PUK = 3, /* If PUK1 or Puk for UPin is required */
RIL_APPSTATE_SUBSCRIPTION_PERSO = 4, /* perso_substate should be look at
when app_state is assigned to this value */
RIL_APPSTATE_READY = 5
} RIL_AppState;
typedef enum {
RIL_PINSTATE_UNKNOWN = 0,
RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
RIL_PINSTATE_ENABLED_VERIFIED = 2,
RIL_PINSTATE_DISABLED = 3,
RIL_PINSTATE_ENABLED_BLOCKED = 4,
RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
} RIL_PinState;
typedef enum {
RIL_APPTYPE_UNKNOWN = 0,
RIL_APPTYPE_SIM = 1,
RIL_APPTYPE_USIM = 2,
RIL_APPTYPE_RUIM = 3,
RIL_APPTYPE_CSIM = 4
} RIL_AppType;
typedef struct
{
RIL_AppType app_type;
RIL_AppState app_state;
RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
RIL_APPSTATE_SUBSCRIPTION_PERSO */
char *aid_ptr; /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
0x30, 0x30, 0x30 */
char *app_label_ptr; /* null terminated string */
int pin1_replaced; /* applicable to USIM and CSIM */
RIL_PinState pin1;
RIL_PinState pin2;
} RIL_AppStatus;
typedef struct
{
RIL_CardState card_state;
RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS */
int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS */
int num_applications; /* value <= RIL_CARD_MAX_APPS */
RIL_AppStatus applications[RIL_CARD_MAX_APPS];
} RIL_CardStatus;
/* The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH */
typedef enum {
/* A file on SIM has been updated. data[1] contains the EFID. */
SIM_FILE_UPDATE = 0,
/* SIM initialized. All files should be re-read. */
SIM_INIT = 1,
/* SIM reset. SIM power required, SIM may be locked and all files should be re-read. */
SIM_RESET = 2
} RIL_SimRefreshResult;
typedef struct {
char * number; /* Remote party number */
int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
char * name; /* Remote party name */
RIL_CDMA_SignalInfoRecord signalInfoRecord;
} RIL_CDMA_CallWaiting;
/**
* Which types of Cell Broadcast Message (CBM) are to be received by the ME
*
* uFromServiceID - uToServiceID defines a range of CBM message identifiers
* whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
* and 9.4.4.2.2 for UMTS. All other values can be treated as empty
* CBM message ID.
*
* uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
* whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
* and 9.4.4.2.3 for UMTS.
* All other values can be treated as empty CBM data coding scheme.
*
* selected 0 means message types specified in <fromServiceId, toServiceId>
* and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
*
* Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
* RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
*/
typedef struct {
int fromServiceId;
int toServiceId;
int fromCodeScheme;
int toCodeScheme;
unsigned char selected;
} RIL_GSM_BroadcastSmsConfigInfo;
/* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
#define RIL_RESTRICTED_STATE_NONE 0x00
/* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
#define RIL_RESTRICTED_STATE_CS_EMERGENCY 0x01
/* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
#define RIL_RESTRICTED_STATE_CS_NORMAL 0x02
/* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
#define RIL_RESTRICTED_STATE_CS_ALL 0x04
/* Block packet data access due to restriction. */
#define RIL_RESTRICTED_STATE_PS_ALL 0x10
/* The status for an OTASP/OTAPA session */
typedef enum {
CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
CDMA_OTA_PROVISION_STATUS_COMMITTED,
CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
} RIL_CDMA_OTA_ProvisionStatus;
typedef struct {
int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
} RIL_GW_SignalStrength;
typedef struct {
int dbm; /* Valid values are positive integers. This value is the actual RSSI value
* multiplied by -1. Example: If the actual RSSI is -75, then this response
* value will be 75.
*/
int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied
* by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value
* will be 125.
*/
} RIL_CDMA_SignalStrength;
typedef struct {
int dbm; /* Valid values are positive integers. This value is the actual RSSI value
* multiplied by -1. Example: If the actual RSSI is -75, then this response
* value will be 75.
*/
int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied
* by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value
* will be 125.
*/
int signalNoiseRatio; /* Valid values are 0-8. 8 is the highest signal to noise ratio. */
} RIL_EVDO_SignalStrength;
typedef struct {
RIL_GW_SignalStrength GW_SignalStrength;
RIL_CDMA_SignalStrength CDMA_SignalStrength;
RIL_EVDO_SignalStrength EVDO_SignalStrength;
} RIL_SignalStrength;
/* Names of the CDMA info records (C.S0005 section 3.7.5) */
typedef enum {
RIL_CDMA_DISPLAY_INFO_REC,
RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
RIL_CDMA_SIGNAL_INFO_REC,
RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
RIL_CDMA_LINE_CONTROL_INFO_REC,
RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
RIL_CDMA_T53_CLIR_INFO_REC,
RIL_CDMA_T53_RELEASE_INFO_REC,
RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
} RIL_CDMA_InfoRecName;
/* Display Info Rec as defined in C.S0005 section 3.7.5.1
Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
Note: the Extended Display info rec contains multiple records of the
form: display_tag, display_len, and display_len occurrences of the
chari field if the display_tag is not 10000000 or 10000001.
To save space, the records are stored consecutively in a byte buffer.
The display_tag, display_len and chari fields are all 1 byte.
*/
typedef struct {
char alpha_len;
char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
} RIL_CDMA_DisplayInfoRecord;
/* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
*/
typedef struct {
char len;
char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
char number_type;
char number_plan;
char pi;
char si;
} RIL_CDMA_NumberInfoRecord;
/* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
typedef enum {
RIL_REDIRECTING_REASON_UNKNOWN = 0,
RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
RIL_REDIRECTING_REASON_RESERVED
} RIL_CDMA_RedirectingReason;
typedef struct {
RIL_CDMA_NumberInfoRecord redirectingNumber;
/* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
RIL_CDMA_RedirectingReason redirectingReason;
} RIL_CDMA_RedirectingNumberInfoRecord;
/* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
typedef struct {
char lineCtrlPolarityIncluded;
char lineCtrlToggle;
char lineCtrlReverse;
char lineCtrlPowerDenial;
} RIL_CDMA_LineControlInfoRecord;
/* T53 CLIR Information Record */
typedef struct {
char cause;
} RIL_CDMA_T53_CLIRInfoRecord;
/* T53 Audio Control Information Record */
typedef struct {
char upLink;
char downLink;
} RIL_CDMA_T53_AudioControlInfoRecord;
typedef struct {
RIL_CDMA_InfoRecName name;
union {
/* Display and Extended Display Info Rec */
RIL_CDMA_DisplayInfoRecord display;
/* Called Party Number, Calling Party Number, Connected Number Info Rec */
RIL_CDMA_NumberInfoRecord number;
/* Signal Info Rec */
RIL_CDMA_SignalInfoRecord signal;
/* Redirecting Number Info Rec */
RIL_CDMA_RedirectingNumberInfoRecord redir;
/* Line Control Info Rec */
RIL_CDMA_LineControlInfoRecord lineCtrl;
/* T53 CLIR Info Rec */
RIL_CDMA_T53_CLIRInfoRecord clir;
/* T53 Audio Control Info Rec */
RIL_CDMA_T53_AudioControlInfoRecord audioCtrl;
} rec;
} RIL_CDMA_InformationRecord;
#define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
typedef struct {
char numberOfInfoRecs;
RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
} RIL_CDMA_InformationRecords;
/**
* RIL_REQUEST_GET_SIM_STATUS
*
* Requests status of the SIM interface and the SIM card
*
* "data" is NULL
*
* "response" is const RIL_CardStatus *
*
* Valid errors:
* Must never fail
*/
#define RIL_REQUEST_GET_SIM_STATUS 1
/**
* RIL_REQUEST_ENTER_SIM_PIN
*
* Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
*
* "data" is const char **
* ((const char **)data)[0] is PIN value
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
*/
#define RIL_REQUEST_ENTER_SIM_PIN 2
/**
* RIL_REQUEST_ENTER_SIM_PUK
*
* Supplies SIM PUK and new PIN.
*
* "data" is const char **
* ((const char **)data)[0] is PUK value
* ((const char **)data)[1] is new PIN value
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
* (PUK is invalid)
*/
#define RIL_REQUEST_ENTER_SIM_PUK 3
/**
* RIL_REQUEST_ENTER_SIM_PIN2
*
* Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
* returned as a a failure from a previous operation.
*
* "data" is const char **
* ((const char **)data)[0] is PIN2 value
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
*/
#define RIL_REQUEST_ENTER_SIM_PIN2 4
/**
* RIL_REQUEST_ENTER_SIM_PUK2
*
* Supplies SIM PUK2 and new PIN2.
*
* "data" is const char **
* ((const char **)data)[0] is PUK2 value
* ((const char **)data)[1] is new PIN2 value
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
* (PUK2 is invalid)
*/
#define RIL_REQUEST_ENTER_SIM_PUK2 5
/**
* RIL_REQUEST_CHANGE_SIM_PIN
*
* Supplies old SIM PIN and new PIN.
*
* "data" is const char **
* ((const char **)data)[0] is old PIN value
* ((const char **)data)[1] is new PIN value
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
* (old PIN is invalid)
*
*/
#define RIL_REQUEST_CHANGE_SIM_PIN 6
/**
* RIL_REQUEST_CHANGE_SIM_PIN2
*
* Supplies old SIM PIN2 and new PIN2.
*
* "data" is const char **
* ((const char **)data)[0] is old PIN2 value
* ((const char **)data)[1] is new PIN2 value
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
* (old PIN2 is invalid)
*
*/
#define RIL_REQUEST_CHANGE_SIM_PIN2 7
/**
* RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
*
* Requests that network personlization be deactivated
*
* "data" is const char **
* ((const char **)(data))[0]] is network depersonlization code
*
* "response" is int *
* ((int *)response)[0] is the number of retries remaining, or -1 if unknown
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* PASSWORD_INCORRECT
* (code is invalid)
*/
#define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
/**
* RIL_REQUEST_GET_CURRENT_CALLS
*
* Requests current call list
*
* "data" is NULL
*
* "response" must be a "const RIL_Call **"
*
* Valid errors:
*
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
* (request will be made again in a few hundred msec)
*/
#define RIL_REQUEST_GET_CURRENT_CALLS 9
/**
* RIL_REQUEST_DIAL
*
* Initiate voice call
*
* "data" is const RIL_Dial *
* "response" is NULL
*
* This method is never used for supplementary service codes
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_DIAL 10
/**
* RIL_REQUEST_GET_IMSI
*
* Get the SIM IMSI
*
* Only valid when radio state is "RADIO_STATE_SIM_READY"
*
* "data" is NULL
* "response" is a const char * containing the IMSI
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_GET_IMSI 11
/**
* RIL_REQUEST_HANGUP
*
* Hang up a specific line (like AT+CHLD=1x)
*
* "data" is an int *
* (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
*
* "response" is NULL
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_HANGUP 12
/**
* RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
*
* Hang up waiting or held (like AT+CHLD=0)
*
* "data" is NULL
* "response" is NULL
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
/**
* RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
*
* Hang up waiting or held (like AT+CHLD=1)
*
* "data" is NULL
* "response" is NULL
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
/**
* RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
*
* Switch waiting or holding call and active call (like AT+CHLD=2)
*
* State transitions should be is follows:
*
* If call 1 is waiting and call 2 is active, then if this re
*
* BEFORE AFTER
* Call 1 Call 2 Call 1 Call 2
* ACTIVE HOLDING HOLDING ACTIVE
* ACTIVE WAITING HOLDING ACTIVE
* HOLDING WAITING HOLDING ACTIVE
* ACTIVE IDLE HOLDING IDLE
* IDLE IDLE IDLE IDLE
*
* "data" is NULL
* "response" is NULL
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
#define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
/**
* RIL_REQUEST_CONFERENCE
*
* Conference holding and active (like AT+CHLD=3)
* "data" is NULL
* "response" is NULL
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_CONFERENCE 16
/**
* RIL_REQUEST_UDUB
*
* Send UDUB (user determined used busy) to ringing or
* waiting call answer)(RIL_BasicRequest r);
*
* "data" is NULL
* "response" is NULL
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE (radio resetting)
* GENERIC_FAILURE
*/
#define RIL_REQUEST_UDUB 17
/**
* RIL_REQUEST_LAST_CALL_FAIL_CAUSE
*
* Requests the failure cause code for the most recently terminated call
*
* "data" is NULL
* "response" is a "int *"
* ((int *)response)[0] is RIL_LastCallFailCause. GSM failure reasons are
* mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
* failure reasons are derived from the possible call failure scenarios
* described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
*
* The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
* MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
*
* If the implementation does not have access to the exact cause codes,
* then it should return one of the values listed in RIL_LastCallFailCause,
* as the UI layer needs to distinguish these cases for tone generation or
* error notification.
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE
* GENERIC_FAILURE
*
* See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
*/
#define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
/**
* RIL_REQUEST_SIGNAL_STRENGTH
*
* Requests current signal strength and associated information
*
* Must succeed if radio is on.
*
* "data" is NULL
*
* "response" is a const RIL_SignalStrength *
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE
*/
#define RIL_REQUEST_SIGNAL_STRENGTH 19
/**
* RIL_REQUEST_REGISTRATION_STATE
*
* Request current registration state
*
* "data" is NULL
* "response" is a "char **"
* ((const char **)response)[0] is registration state 0-6,
* 0 - Not registered, MT is not currently searching
* a new operator to register
* 1 - Registered, home network
* 2 - Not registered, but MT is currently searching
* a new operator to register
* 3 - Registration denied
* 4 - Unknown
* 5 - Registered, roaming