blob: fb0f606fb4679b1bccd550d897bf06956658e93a [file] [log] [blame]
Hridya Valsarajue596a712016-09-22 14:07:22 -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
19import IAGnssCallback;
20
Andreas Huber40d3a9b2017-03-28 16:19:16 -070021/**
Hridya Valsarajue596a712016-09-22 14:07:22 -070022 * Extended interface for AGNSS support.
23 */
24interface IAGnss {
Hridya Valsaraju529331c2016-11-22 08:17:23 -080025 @export(name="", value_prefix="APN_IP_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070026 enum ApnIpType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070027 INVALID = 0,
28 IPV4 = 1,
29 IPV6 = 2,
30 IPV4V6 = 3
31 };
32
Andreas Huber40d3a9b2017-03-28 16:19:16 -070033 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070034 * Opens the AGNSS interface and provides the callback routines to the
35 * implementation of this interface.
36 *
37 * @param callback Handle to the AGNSS status callback interface.
38 */
39 setCallback(IAGnssCallback callback);
40
Andreas Huber40d3a9b2017-03-28 16:19:16 -070041 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070042 * Notifies that the AGNSS data connection has been closed.
43 *
44 * @return success True if the operation is successful.
45 */
46 dataConnClosed() generates (bool success);
47
Andreas Huber40d3a9b2017-03-28 16:19:16 -070048 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070049 * Notifies that a data connection is not available for AGNSS.
50 *
51 * @return success True if the operation is successful.
52 */
53 dataConnFailed() generates (bool success);
54
Andreas Huber40d3a9b2017-03-28 16:19:16 -070055 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070056 * Sets the hostname and port for the AGNSS server.
57 *
58 * @param type Specifies if SUPL or C2K.
59 * @param hostname Hostname of the AGNSS server.
60 * @param port Port number associated with the server.
61 *
62 * @return success True if the operation is successful.
63 */
64 setServer(AGnssType type, string hostname, int32_t port)
65 generates (bool success);
66
Andreas Huber40d3a9b2017-03-28 16:19:16 -070067 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070068 * Notifies that a data connection is available and sets the name of the
69 * APN, and its IP type, to be used for SUPL connections.
70 *
71 * @param apn Access Point Name(follows regular APN naming convention).
72 * @param apnIpType Specifies if SUPL or C2K.
73 *
74 * @return success True if the operation is successful.
75 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070076 dataConnOpen(string apn, ApnIpType apnIpType)
Hridya Valsarajue596a712016-09-22 14:07:22 -070077 generates (bool success);
78};