Home | History | Annotate | Download | only in 1.0
      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 /** Callback structure for the AGNSS interface. */
     20 interface 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     @export(name="", value_prefix="GPS_")
     46     struct AGnssStatusIpV4 {
     47         AGnssType type;
     48         AGnssStatusValue status;
     49         /**
     50          * 32-bit IPv4 address.
     51          */
     52         uint32_t ipV4Addr;
     53     };
     54 
     55     /**
     56      * Represents the status of AGNSS augmented to support IPv6.
     57      */
     58     struct AGnssStatusIpV6 {
     59         AGnssType type;
     60         AGnssStatusValue status;
     61         /**
     62          * 128-bit IPv6 address.
     63          */
     64         uint8_t[16] ipV6Addr;
     65     };
     66 
     67     /**
     68      * Callback with AGNSS(IpV4) status information.
     69      *
     70      * @param status Will be of type AGnssStatusIpV4.
     71      */
     72     agnssStatusIpV4Cb(AGnssStatusIpV4 status);
     73 
     74     /**
     75      * Callback with AGNSS(IpV6) status information.
     76      *
     77      * @param status Will be of type AGnssStatusIpV6.
     78      */
     79     agnssStatusIpV6Cb(AGnssStatusIpV6 status);
     80 
     81 };
     82