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 19/** Callback structure for the AGNSS interface. */ 20interface IAGnssCallback { 21 /** AGNSS type **/ 22 @export(name="", value_prefix="AGPS_") 23 enum AGnssType : uint8_t { 24 TYPE_SUPL = 1, 25 TYPE_C2K = 2 26 }; 27 28 @export(name="", value_prefix="GNSS_") 29 enum AGnssStatusValue : uint8_t { 30 /** GNSS requests data connection for AGNSS. */ 31 REQUEST_AGNSS_DATA_CONN = 1, 32 /** GNSS releases the AGNSS data connection. */ 33 RELEASE_AGNSS_DATA_CONN = 2, 34 /** AGNSS data connection initiated */ 35 AGNSS_DATA_CONNECTED = 3, 36 /** AGNSS data connection completed */ 37 AGNSS_DATA_CONN_DONE = 4, 38 /** AGNSS data connection failed */ 39 AGNSS_DATA_CONN_FAILED = 5 40 }; 41 42 /** 43 * Represents the status of AGNSS augmented to support IPv4. 44 */ 45 struct AGnssStatusIpV4 { 46 AGnssType type; 47 AGnssStatusValue status; 48 /** 49 * 32-bit IPv4 address. 50 */ 51 uint32_t ipV4Addr; 52 }; 53 54 /** 55 * Represents the status of AGNSS augmented to support IPv6. 56 */ 57 struct AGnssStatusIpV6 { 58 AGnssType type; 59 AGnssStatusValue status; 60 /** 61 * 128-bit IPv6 address. 62 */ 63 uint8_t[16] ipV6Addr; 64 }; 65 66 /** 67 * Callback with AGNSS(IpV4) status information. 68 * 69 * @param status Will be of type AGnssStatusIpV4. 70 */ 71 agnssStatusIpV4Cb(AGnssStatusIpV4 status); 72 73 /** 74 * Callback with AGNSS(IpV6) status information. 75 * 76 * @param status Will be of type AGnssStatusIpV6. 77 */ 78 agnssStatusIpV6Cb(AGnssStatusIpV6 status); 79 80}; 81