1/*
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
21/**
22 * Extended interface for AGNSS support.
23 */
24interface IAGnss {
25    @export(name="", value_prefix="APN_IP_")
26    enum ApnIpType : uint8_t {
27        INVALID  = 0,
28        IPV4     = 1,
29        IPV6     = 2,
30        IPV4V6   = 3
31    };
32
33    /**
34     * 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
41    /**
42     * 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
48    /**
49     * 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
55    /**
56     * 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
67    /**
68     * 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     */
76    dataConnOpen(string apn, ApnIpType apnIpType)
77        generates (bool success);
78};
79