blob: 2fb6e4e21575a4eb7d0419c0b2b62727453df594 [file] [log] [blame]
Hridya Valsaraju273c6d22016-11-02 10:04:35 -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.gnss@1.0;
18
19/*
20 * Interface for passing GNSS configuration info from platform to HAL.
21 */
22interface IGnssConfiguration {
23 /*
24 * Enum which holds the bit masks for SUPL_MODE configuration parameter.
25 */
26 enum SuplMode : uint8_t {
27 /* Mobile Station Based */
28 MSB = 0x01,
29
30 /* Mobile Station Assisted */
31 MSA = 0x02
32 };
33
34 /*
35 * Enum which holds the bit masks for GPS_LOCK configuration parameter.
36 */
37 enum GpsLock : uint8_t {
38 /* Lock Mobile Originated GPS functionalitues. */
39 MO = 0x01,
40
41 /* Lock Network initiated GPS functionalities. */
42 NI = 0x02
43 };
44
45 /*
46 * Enum that hold the bit masks for various LTE Positioning Profile settings (LPP_PROFILE
47 * configuration parameter). If none of the bits in the enum are set, the default setting is
48 * Radio Resource Location Protocol(RRLP).
49 */
50 enum LppProfile : uint8_t {
51 /* Enable LTE Positioning Protocol user plane */
52 USER_PLANE = 0x01,
53
54 /* Enable LTE Positioning Protocol Control plane */
55 CONTROL_PLANE = 0x02
56 };
57
58 /*
59 * Enum which holds the bit masks for A_GLONASS_POS_PROTOCOL_SELECT
60 * configuration parameter.
61 */
62 enum GlonassPosProtocol : uint8_t {
63 /* Radio Resource Control(RRC) control-plane. */
64 RRC_CPLANE = 0x01,
65
66 /* Radio Resource Location user-plane. */
67 RRLP_CPLANE = 0x02,
68
69 /* LTE Positioning Protocol User plane */
70 LPP_UPLANE = 0x04
71 };
72
73 /*
74 * IMPORTANT: GNSS HAL must expect the below methods to be called multiple
75 * times. They can be called even when GnssLocationProvider is already
76 * constructed and enabled. GNSS HAL must maintain the existing requests
77 * for various callbacks regardless the change in configuration data.
78 */
79
80 /*
81 * This method enables or disables emergency SUPL.
82 *
83 * @param enabled True if emergency SUPL is to be enabled.
84 *
85 * @return success True if operation was successful.
86 */
87 setSuplEs(bool enabled) generates (bool success);
88
89 /*
90 * This method sets the SUPL version requested by Carrier. The GNSS HAL
91 * must use this version of the SUPL protocol if supported.
92 *
93 * @param version SUPL version requested by carrier. This is a bit mask
94 * with bits 0:7 representing a service indicator field, bits 8:15
95 * representing the minor version and bits 16:23 representing the
96 * major version.
97 *
98 * @return success True if operation was successful.
99 */
100 setSuplVersion(uint32_t version) generates (bool success);
101
102 /*
103 * This method sets the SUPL mode.
104 *
105 * @param mode Bit mask that specifies the SUPL mode which is set with the SuplMode enum.
106 *
107 * @return success True if operation was successful.
108 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800109 setSuplMode(bitfield<SuplMode> mode) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700110
111 /*
112 * This setting configures how GPS functionalities should be locked when
113 * user turns off GPS On setting.
114 *
115 * @param lock Bitmask that specifies the GPS functionalities to be be
116 * locked as per the GpsLock enum.
117 *
118 * @return success True if operation was successful.
119 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800120 setGpsLock(bitfield<GpsLock> lock) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700121
122 /*
123 * This method sets the LTE Positioning Profile configuration.
124 *
125 * @param lppProfile Bitmask that specifies the LTE Positioning Profile
126 * configuration to be set as per the LppProfile enum.
127 *
128 * @return success True if operation was successful.
129 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800130 setLppProfile(bitfield<LppProfile> lppProfile) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700131
132 /*
133 * This method selects positioning protocol on A-Glonass system.
134 *
135 * @param protocol Bitmask that specifies the positioning protocol to be
Yifan Hong7037fdb2016-12-05 17:16:09 -0800136 * set as per GlonassPosProtocol enum.
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700137 *
138 * @return success True if operation was successful.
139 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800140 setGlonassPositioningProtocol(bitfield<GlonassPosProtocol> protocol) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700141
142 /*
143 * This method configures which PDN to use.
144 *
145 * @param enable Use emergency PDN if true and regular PDN if false.
146 * @return success True if operation was successful.
147 */
148 setEmergencySuplPdn(bool enable) generates (bool success);
149};