blob: 5f5f5c160f681f1da77b35ca9ddd90a34568c743 [file] [log] [blame]
Jayachandran C262b6062020-07-22 15:53:58 -07001/*
2 * Copyright (C) 2020 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
17package android.hardware.radio@1.6;
18
allenwtsu1c3dcd32020-09-25 17:58:01 +080019
20import @1.0::CdmaSmsMessage;
21import @1.0::GsmSmsMessage;
Jayachandran C9bc276b2020-07-24 00:46:58 -070022import @1.2::DataRequestReason;
Jayachandran C262b6062020-07-22 15:53:58 -070023import @1.5::IRadio;
Jayachandran C9bc276b2020-07-24 00:46:58 -070024import @1.5::AccessNetwork;
25import @1.5::DataProfileInfo;
26import @1.5::LinkAddress;
Jayachandran C262b6062020-07-22 15:53:58 -070027
28/**
29 * This interface is used by telephony and telecom to talk to cellular radio.
30 * All the functions have minimum one parameter:
31 * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
32 * duration of a method call. If clients provide colliding serials (including passing the same
33 * serial to different methods), multiple responses (one for each method call) must still be served.
Jayachandran C9bc276b2020-07-24 00:46:58 -070034 * setResponseFunctions must work with @1.6::IRadioResponse and @1.6::IRadioIndication.
Jayachandran C262b6062020-07-22 15:53:58 -070035 */
36interface IRadio extends @1.5::IRadio {
Jayachandran C9bc276b2020-07-24 00:46:58 -070037 /**
Tim Line29df602020-09-26 22:43:24 +080038 * Toggle radio on and off (for "airplane" mode)
39 * If the radio is turned off/on the radio modem subsystem
40 * is expected return to an initialized state. For instance,
41 * any voice and data calls must be terminated and all associated
42 * lists emptied.
43 *
44 * When setting radio power on to exit from airplane mode to place an emergency call on this
45 * logical modem, powerOn, forEmergencyCall and preferredForEmergencyCall must be true. In
46 * this case, this modem is optimized to scan only emergency call bands, until:
47 * 1) Emergency call is completed; or
48 * 2) Another setRadioPower_1_5 is issued with forEmergencyCall being false or
49 * preferredForEmergencyCall being false; or
50 * 3) Timeout after 30 seconds if dial or emergencyDial is not called.
51 * Once one of these conditions is reached, the modem should move into normal operation.
52 *
53 * @param serial Serial number of request.
54 * @param powerOn To turn on radio -> on = true, to turn off radio -> on = false.
55 * @param forEmergencyCall To indication to radio if this request is due to emergency call.
56 * No effect if powerOn is false.
57 * @param preferredForEmergencyCall indicate whether the following emergency call will be sent
58 * on this modem or not. No effect if forEmergencyCall is false, or powerOn is false.
59 *
60 * Response callback is IRadioConfigResponse. setRadioPowerResponse_1_6.
61
62 * Note this API is the same as the 1.5
63 */
64 oneway setRadioPower_1_6(int32_t serial, bool powerOn, bool forEmergencyCall,
65 bool preferredForEmergencyCall);
66
67 /**
Jayachandran C9bc276b2020-07-24 00:46:58 -070068 * Returns the data call list. An entry is added when a setupDataCall() is issued and removed
69 * on a deactivateDataCall(). The list is emptied when setRadioPower() off/on issued or when
70 * the vendor HAL or modem crashes.
71 *
72 * @param serial Serial number of request.
73 *
74 * Response function is IRadioResponse.getDataCallListResponse_1_6()
75 */
76 oneway getDataCallList_1_6(int32_t serial);
77
78 /**
79 * Setup a packet data connection. If DataCallResponse.status returns DataCallFailCause:NONE,
80 * the data connection must be added to data calls and a unsolDataCallListChanged() must be
81 * sent. The call remains until removed by subsequent unsolDataCallIstChanged(). It may be
82 * lost due to many factors, including deactivateDataCall() being issued, the radio powered
83 * off, reception lost or even transient factors like congestion. This data call list is
84 * returned by getDataCallList() and dataCallListChanged().
85 *
86 * The Radio is expected to:
87 * - Create one data call context.
88 * - Create and configure a dedicated interface for the context.
89 * - The interface must be point to point.
90 * - The interface is configured with one or more addresses and is capable of sending and
91 * receiving packets. The format is IP address with optional "/" prefix length
92 * (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3",
93 * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If
94 * the prefix length is absent, then the addresses are assumed to be point to point with
95 * IPv4 with prefix length 32 or IPv6 with prefix length 128.
96 * - Must not modify routing configuration related to this interface; routing management is
97 * exclusively within the purview of the Android OS.
98 * - Support simultaneous data call contexts up to DataRegStateResult.maxDataCalls specified
99 * in the response of getDataRegistrationState.
100 *
101 * @param serial Serial number of request.
102 * @param accessNetwork The access network to setup the data call. If the data connection cannot
103 * be established on the specified access network then it should be responded with an error.
104 * @param dataProfileInfo Data profile info.
105 * @param roamingAllowed Indicates whether or not data roaming is allowed by the user.
106 * @param reason The request reason. Must be DataRequestReason:NORMAL or
107 * DataRequestReason:HANDOVER.
108 * @param addresses If the reason is DataRequestReason:HANDOVER, this indicates the list of link
109 * addresses of the existing data connection. This parameter must be ignored unless reason
110 * is DataRequestReason:HANDOVER.
111 * @param dnses If the reason is DataRequestReason:HANDOVER, this indicates the list of DNS
112 * addresses of the existing data connection. The format is defined in RFC-4291 section 2.2.
113 * For example, "192.0.1.3" or "2001:db8::1". This parameter must be ignored unless reason
114 * is DataRequestReason:HANDOVER.
115 *
116 * Response function is IRadioResponse.setupDataCallResponse_1_6()
117 *
118 * Note this API is the same as the 1.5
119 */
120 oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork,
121 DataProfileInfo dataProfileInfo, bool roamingAllowed,
122 DataRequestReason reason, vec<LinkAddress> addresses, vec<string> dnses);
allenwtsu1c3dcd32020-09-25 17:58:01 +0800123
124 /**
125 * Send an SMS message
126 *
127 * @param serial Serial number of request.
128 * @param message GsmSmsMessage as defined in types.hal
129 *
130 * Response function is IRadioResponse.sendSmsResponse_1_6()
131 *
132 * Note this API is the same as the 1.0
133 *
134 * Based on the return error, caller decides to resend if sending sms
135 * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
136 * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
137 */
138 oneway sendSms_1_6(int32_t serial, GsmSmsMessage message);
139
140 /**
141 * Send an SMS message. Identical to sendSms_1_6,
142 * except that more messages are expected to be sent soon. If possible,
143 * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
144 *
145 * @param serial Serial number of request.
146 * @param message GsmSmsMessage as defined in types.hal
147 *
148 * Response function is IRadioResponse.sendSMSExpectMoreResponse_1_6()
149 *
150 * Note this API is the same as the 1.0
151 *
152 * Based on the return error, caller decides to resend if sending sms
153 * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
154 * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500)
155 */
156 oneway sendSMSExpectMore_1_6(int32_t serial, GsmSmsMessage message);
157
158 /**
159 * Send a CDMA SMS message
160 *
161 * @param serial Serial number of request.
162 * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal
163 *
164 * Response callback is IRadioResponse.sendCdmaSmsResponse_1_6()
165 *
166 * Note this API is the same as the 1.0
167 *
168 */
169 oneway sendCdmaSms_1_6(int32_t serial, CdmaSmsMessage sms);
170
171 /**
172 * Send an SMS message. Identical to sendCdmaSms_1_6,
173 * except that more messages are expected to be sent soon.
174 *
175 * @param serial Serial number of request.
176 * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal
177 *
178 * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse_1_6()
179 *
180 * Note this API is the same as the 1.5
181 *
182 */
183 oneway sendCdmaSmsExpectMore_1_6(int32_t serial, CdmaSmsMessage sms);
Jayachandran C262b6062020-07-22 15:53:58 -0700184};