blob: 51296482c8e68daa04c1f11151c8ffeeb8b5e185 [file] [log] [blame]
Amit Mahajaned12ec82016-10-23 16:24:54 -07001/*
2 * Copyright (C) 2016 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.0;
18
19interface ISapCallback {
20 /**
21 * CONNECT_RESP from SAP 1.1 spec 5.1.2
22 *
23 * @param token Id to match req-resp. Value must match the one in req.
24 * @param sapConnectRsp Connection Status
25 * @param maxMsgSize MaxMsgSize supported by server if request cannot be fulfilled.
26 * Valid only if connectResponse is SapConnectResponse:MSG_SIZE_TOO_LARGE.
27 */
28 oneway connectResponse(int32_t token, SapConnectRsp sapConnectRsp, int32_t maxMsgSize);
29
30 /**
31 * DISCONNECT_RESP from SAP 1.1 spec 5.1.4
32 *
33 * @param token Id to match req-resp. Value must match the one in req.
34 */
35 oneway disconnectResponse(int32_t token);
36
37 /**
38 * DISCONNECT_IND from SAP 1.1 spec 5.1.5
39 *
40 * @param token Id to match req-resp. Value must match the one in req.
41 * @param disconnectType Disconnect Type to indicate if shutdown is graceful or immediate
42 */
43 oneway disconnectIndication(int32_t token, SapDisconnectType disconnectType);
44
45 /**
46 * TRANSFER_APDU_RESP from SAP 1.1 spec 5.1.7
47 *
48 * @param token Id to match req-resp. Value must match the one in req.
49 * @param type APDU command type
50 * @param resultCode ResultCode to indicate if command was processed correctly
51 * Possible values:
52 * SapResultCode:SUCCESS,
53 * SapResultCode:GENERIC_FAILURE,
54 * SapResultCode:CARD_NOT_ACCESSSIBLE,
55 * SapResultCode:CARD_ALREADY_POWERED_OFF,
56 * SapResultCode:CARD_REMOVED
57 * @param apduRsp APDU Response. Valid only if command was processed correctly and no error
58 * occurred.
59 */
60 oneway apduResponse(int32_t token,
61 SapApduType type,
62 SapResultCode resultCode,
63 vec<uint8_t> apduRsp);
64
65 /**
66 * TRANSFER_ATR_RESP from SAP 1.1 spec 5.1.9
67 *
68 * @param token Id to match req-resp. Value must match the one in req.
69 * @param resultCode ResultCode to indicate if command was processed correctly
70 * Possible values:
71 * SapResultCode:SUCCESS,
72 * SapResultCode:GENERIC_FAILURE,
73 * SapResultCode:CARD_ALREADY_POWERED_OFF,
74 * SapResultCode:CARD_REMOVED,
75 * SapResultCode:DATA_NOT_AVAILABLE
76 * @param atr Answer to Reset from the subscription module. Included only if no error occurred,
77 * otherwise empty.
78 */
79 oneway transferAtrResponse(int32_t token, SapResultCode resultCode, vec<uint8_t> atr);
80
81 /**
82 * POWER_SIM_OFF_RESP and POWER_SIM_ON_RESP from SAP 1.1 spec 5.1.11 + 5.1.13
83 *
84 * @param token Id to match req-resp. Value must match the one in req.
85 * @param resultCode ResultCode to indicate if command was processed correctly
86 * Possible values:
87 * SapResultCode:SUCCESS,
88 * SapResultCode:GENERIC_FAILURE,
89 * SapResultCode:CARD_NOT_ACCESSSIBLE, (possible only for power on req)
90 * SapResultCode:CARD_ALREADY_POWERED_OFF, (possible only for power off req)
91 * SapResultCode:CARD_REMOVED,
92 * SapResultCode:CARD_ALREADY_POWERED_ON (possible only for power on req)
93 */
94 oneway powerResponse(int32_t token, SapResultCode resultCode);
95
96 /**
97 * RESET_SIM_RESP from SAP 1.1 spec 5.1.15
98 *
99 * @param token Id to match req-resp. Value must match the one in req.
100 * @param resultCode ResultCode to indicate if command was processed correctly
101 * Possible values:
102 * SapResultCode:SUCCESS,
103 * SapResultCode:GENERIC_FAILURE,
104 * SapResultCode:CARD_NOT_ACCESSSIBLE,
105 * SapResultCode:CARD_ALREADY_POWERED_OFF,
106 * SapResultCode:CARD_REMOVED
107 */
108 oneway resetSimResponse(int32_t token, SapResultCode resultCode);
109
110 /**
111 * STATUS_IND from SAP 1.1 spec 5.1.16
112 *
113 * @param token Id to match req-resp. Value must match the one in req.
114 * @param status Parameter to indicate reason for the status change.
115 */
116 oneway statusIndication(int32_t token, SapStatus status);
117
118 /**
119 * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.18
120 *
121 * @param token Id to match req-resp. Value must match the one in req.
122 * @param resultCode ResultCode to indicate if command was processed correctly
123 * Possible values:
124 * SapResultCode:SUCCESS,
125 * SapResultCode:GENERIC_FAILURE
126 * SapResultCode:CARD_ALREADY_POWERED_ON
127 * @param cardReaderStatus Card Reader Status coded as described in 3GPP TS 11.14 Section 12.33
128 * and TS 31.111 Section 8.33
129 */
130 oneway transferCardReaderStatusResponse(int32_t token,
131 SapResultCode resultCode,
132 int32_t cardReaderStatus);
133
134 /**
135 * ERROR_RESP from SAP 1.1 spec 5.1.19
136 *
137 * @param token Id to match req-resp. Value must match the one in req.
138 */
139 oneway errorResponse(int32_t token);
140
141 /**
142 * SET_TRANSPORT_PROTOCOL_RESP from SAP 1.1 spec 5.1.21
143 *
144 * @param token Id to match req-resp. Value must match the one in req.
145 * @param resultCode ResultCode to indicate if command was processed correctly
146 * Possible values:
147 * SapResultCode:SUCCESS
148 * SapResultCode:NOT_SUPPORTED
149 */
150 oneway transferProtocolResponse(int32_t token, SapResultCode resultCode);
151};