blob: e31528658a2e4f860b7f11656c9034d4ac5e73d3 [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 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070081 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -070089 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070090 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700102 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700103 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700111 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700112 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700122 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700123 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700132 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700133 * 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
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700142 /**
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700143 * 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};