blob: 75aee7ce73b505729960b4d2e515080a06a46d8f [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
Andreas Huber40d3a9b2017-03-28 16:19:16 -070019/**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070020 * Interface for passing GNSS configuration info from platform to HAL.
21 */
22interface IGnssConfiguration {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070023 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070024 * Enum which holds the bit masks for SUPL_MODE configuration parameter.
25 */
26 enum SuplMode : uint8_t {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070027 /** Mobile Station Based */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070028 MSB = 0x01,
29
Andreas Huber40d3a9b2017-03-28 16:19:16 -070030 /** Mobile Station Assisted */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070031 MSA = 0x02
32 };
33
Andreas Huber40d3a9b2017-03-28 16:19:16 -070034 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070035 * Enum which holds the bit masks for GPS_LOCK configuration parameter.
36 */
37 enum GpsLock : uint8_t {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070038 /** Lock Mobile Originated GPS functionalitues. */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070039 MO = 0x01,
40
Andreas Huber40d3a9b2017-03-28 16:19:16 -070041 /** Lock Network initiated GPS functionalities. */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070042 NI = 0x02
43 };
44
Andreas Huber40d3a9b2017-03-28 16:19:16 -070045 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070046 * 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 {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070051 /** Enable LTE Positioning Protocol user plane */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070052 USER_PLANE = 0x01,
53
Andreas Huber40d3a9b2017-03-28 16:19:16 -070054 /** Enable LTE Positioning Protocol Control plane */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070055 CONTROL_PLANE = 0x02
56 };
57
Andreas Huber40d3a9b2017-03-28 16:19:16 -070058 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070059 * Enum which holds the bit masks for A_GLONASS_POS_PROTOCOL_SELECT
60 * configuration parameter.
61 */
62 enum GlonassPosProtocol : uint8_t {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070063 /** Radio Resource Control(RRC) control-plane. */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070064 RRC_CPLANE = 0x01,
65
Andreas Huber40d3a9b2017-03-28 16:19:16 -070066 /** Radio Resource Location user-plane. */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070067 RRLP_CPLANE = 0x02,
68
Andreas Huber40d3a9b2017-03-28 16:19:16 -070069 /** LTE Positioning Protocol User plane */
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070070 LPP_UPLANE = 0x04
71 };
72
Andreas Huber40d3a9b2017-03-28 16:19:16 -070073 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070074 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -070080 /**
Wyatt Riley60534752017-10-06 12:59:45 -070081 * This method enables or disables NI emergency SUPL restrictions.
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070082 *
Wyatt Riley60534752017-10-06 12:59:45 -070083 * @param enabled True if the device must only accept NI Emergency SUPL requests when the
84 * device is truly in emergency mode (e.g. the user has dialed 911, 112,
85 * etc...)
86 * False if the device must accept NI Emergency SUPL any time they are
87 * received
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070088 *
89 * @return success True if operation was successful.
90 */
91 setSuplEs(bool enabled) generates (bool success);
92
Andreas Huber40d3a9b2017-03-28 16:19:16 -070093 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070094 * This method sets the SUPL version requested by Carrier. The GNSS HAL
95 * must use this version of the SUPL protocol if supported.
96 *
97 * @param version SUPL version requested by carrier. This is a bit mask
98 * with bits 0:7 representing a service indicator field, bits 8:15
99 * representing the minor version and bits 16:23 representing the
100 * major version.
101 *
102 * @return success True if operation was successful.
103 */
104 setSuplVersion(uint32_t version) generates (bool success);
105
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700106 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700107 * This method sets the SUPL mode.
108 *
109 * @param mode Bit mask that specifies the SUPL mode which is set with the SuplMode enum.
110 *
111 * @return success True if operation was successful.
112 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800113 setSuplMode(bitfield<SuplMode> mode) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700114
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700115 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700116 * This setting configures how GPS functionalities should be locked when
117 * user turns off GPS On setting.
118 *
119 * @param lock Bitmask that specifies the GPS functionalities to be be
120 * locked as per the GpsLock enum.
121 *
122 * @return success True if operation was successful.
123 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800124 setGpsLock(bitfield<GpsLock> lock) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700125
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700126 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700127 * This method sets the LTE Positioning Profile configuration.
128 *
129 * @param lppProfile Bitmask that specifies the LTE Positioning Profile
130 * configuration to be set as per the LppProfile enum.
131 *
132 * @return success True if operation was successful.
133 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800134 setLppProfile(bitfield<LppProfile> lppProfile) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700135
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700136 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700137 * This method selects positioning protocol on A-Glonass system.
138 *
139 * @param protocol Bitmask that specifies the positioning protocol to be
Yifan Hong7037fdb2016-12-05 17:16:09 -0800140 * set as per GlonassPosProtocol enum.
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700141 *
142 * @return success True if operation was successful.
143 */
Yifan Hong7037fdb2016-12-05 17:16:09 -0800144 setGlonassPositioningProtocol(bitfield<GlonassPosProtocol> protocol) generates (bool success);
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700145
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700146 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700147 * This method configures which PDN to use.
148 *
149 * @param enable Use emergency PDN if true and regular PDN if false.
150 * @return success True if operation was successful.
151 */
152 setEmergencySuplPdn(bool enable) generates (bool success);
153};