Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame^] | 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 | |
| 17 | package android.hardware.gnss@1.0; |
| 18 | |
| 19 | import IAGnssCallback; |
| 20 | |
| 21 | /* |
| 22 | * Extended interface for AGNSS support. |
| 23 | */ |
| 24 | interface IAGnss { |
| 25 | enum ApnIpType : uint16_t { |
| 26 | INVALID = 0, |
| 27 | IPV4 = 1, |
| 28 | IPV6 = 2, |
| 29 | IPV4V6 = 3 |
| 30 | }; |
| 31 | |
| 32 | /* |
| 33 | * Opens the AGNSS interface and provides the callback routines to the |
| 34 | * implementation of this interface. |
| 35 | * |
| 36 | * @param callback Handle to the AGNSS status callback interface. |
| 37 | */ |
| 38 | setCallback(IAGnssCallback callback); |
| 39 | |
| 40 | /* |
| 41 | * Notifies that the AGNSS data connection has been closed. |
| 42 | * |
| 43 | * @return success True if the operation is successful. |
| 44 | */ |
| 45 | dataConnClosed() generates (bool success); |
| 46 | |
| 47 | /* |
| 48 | * Notifies that a data connection is not available for AGNSS. |
| 49 | * |
| 50 | * @return success True if the operation is successful. |
| 51 | */ |
| 52 | dataConnFailed() generates (bool success); |
| 53 | |
| 54 | /* |
| 55 | * Sets the hostname and port for the AGNSS server. |
| 56 | * |
| 57 | * @param type Specifies if SUPL or C2K. |
| 58 | * @param hostname Hostname of the AGNSS server. |
| 59 | * @param port Port number associated with the server. |
| 60 | * |
| 61 | * @return success True if the operation is successful. |
| 62 | */ |
| 63 | setServer(AGnssType type, string hostname, int32_t port) |
| 64 | generates (bool success); |
| 65 | |
| 66 | /* |
| 67 | * Notifies that a data connection is available and sets the name of the |
| 68 | * APN, and its IP type, to be used for SUPL connections. |
| 69 | * |
| 70 | * @param apn Access Point Name(follows regular APN naming convention). |
| 71 | * @param apnIpType Specifies if SUPL or C2K. |
| 72 | * |
| 73 | * @return success True if the operation is successful. |
| 74 | */ |
| 75 | dataConnOpenWithApnIpType(string apn, ApnIpType apnIpType) |
| 76 | generates (bool success); |
| 77 | }; |