Home | History | Annotate | Download | only in inc-3200
      1 /******************************************************************************
      2   @file:  loc_api_fixup.h
      3   @brief:  Loc API Android RPC amendment header
      4 
      5   DESCRIPTION
      6      Loc API Android RPC amendment header
      7 
      8   INITIALIZATION AND SEQUENCING REQUIREMENTS
      9 
     10   -----------------------------------------------------------------------------
     11 Copyright (c) 2009, QUALCOMM USA, INC.
     12 
     13 All rights reserved.
     14 
     15 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
     16 
     17          Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
     18 
     19          Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
     20 
     21          Neither the name of the QUALCOMM USA, INC.  nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
     22 
     23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     24   -----------------------------------------------------------------------------
     25  ******************************************************************************/
     26 
     27 #ifndef  LOC_API_FIXUP_H
     28 #define LOC_API_FIXUP_H
     29 
     30 #ifdef __cplusplus
     31 extern "C"
     32 {
     33 #endif
     34 
     35 #ifndef NULLPROC
     36 #define NULLPROC 0
     37 #endif /* NULLPROC */
     38 
     39 #ifdef ADD_XDR_FLOAT
     40 
     41 extern bool_t xdr_float (XDR *__xdrs, float *__fp);
     42 extern bool_t xdr_double (XDR *__xdrs, double *__dp);
     43 
     44 #endif /* ADD_XDR_FLOAT */
     45 
     46 #ifdef ADD_XDR_BOOL
     47 extern bool_t xdr_bool(XDR *__xdrs, int *__bp);
     48 #endif /* ADD_XDR_BOOL */
     49 
     50 #define RPC_LOC_API_MAJOR_VERSION_NUMBER   1
     51 #define RPC_LOC_API_MINOR_VERSION_NUMBER   0
     52 
     53 // Return value for loc_open in case of failure.
     54 #define RPC_LOC_CLIENT_HANDLE_INVALID     -1
     55 
     56 // Return value of loc api calls for loc_close, loc_start_fix, loc_stop_fix and loc_ioctl
     57 // These are also the status for the ioctl callback
     58 #define RPC_LOC_API_SUCCESS           0
     59 #define RPC_LOC_API_GENERAL_FAILURE   1
     60 #define RPC_LOC_API_UNSUPPORTED       2
     61 #define RPC_LOC_API_INVALID_HANDLE    4
     62 #define RPC_LOC_API_INVALID_PARAMETER 5
     63 #define RPC_LOC_API_ENGINE_BUSY       6
     64 #define RPC_LOC_API_PHONE_OFFLINE     7
     65 #define RPC_LOC_API_TIMEOUT           8
     66 
     67 // Special return value for loc api calls in case of RCP failure
     68 #define RPC_LOC_API_RPC_FAILURE       (-1234)
     69 
     70 #define RPC_LOC_API_MAX_SV_COUNT                      80
     71 #define RPC_LOC_API_MAX_NMEA_STRING_LENGTH            1200
     72 
     73 // Maximum server address that will be used in location API
     74 #define RPC_LOC_API_MAX_SERVER_ADDR_LENGTH            256
     75 #define RPC_LOC_API_MAX_NUM_PREDICTED_ORBITS_SERVERS  3
     76 #define RPC_LOC_API_MAX_NUM_NTP_SERVERS               3
     77 
     78 #define RPC_LOC_EVENT_PARSED_POSITION_REPORT             0x00000001 // Position report comes in loc_parsed_position_s_type
     79 #define RPC_LOC_EVENT_SATELLITE_REPORT                   0x00000002 // Satellite in view report
     80 #define RPC_LOC_EVENT_NMEA_1HZ_REPORT                    0x00000004 // NMEA report at 1HZ rate
     81 #define RPC_LOC_EVENT_NMEA_POSITION_REPORT               0x00000008 // NMEA report at position report rate
     82 #define RPC_LOC_EVENT_NI_NOTIFY_VERIFY_REQUEST           0x00000010 // NI notification/verification request
     83 #define RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST            0x00000020 // Assistance data, eg: time, predicted orbits request
     84 #define RPC_LOC_EVENT_LOCATION_SERVER_REQUEST            0x00000040 // Request for location server
     85 #define RPC_LOC_EVENT_IOCTL_REPORT                       0x00000080 // Callback report for loc_ioctl
     86 #define RPC_LOC_EVENT_STATUS_REPORT                      0x00000100 // Misc status report: eg, engine state
     87 
     88 
     89 #define RPC_LOC_POS_VALID_SESSION_STATUS                 0x00000001
     90 #define RPC_LOC_POS_VALID_TIMESTAMP_CALENDAR             0x00000002
     91 #define RPC_LOC_POS_VALID_TIMESTAMP_UTC                  0x00000004
     92 #define RPC_LOC_POS_VALID_LEAP_SECONDS                   0x00000008
     93 #define RPC_LOC_POS_VALID_TIME_UNC                       0x00000010
     94 #define RPC_LOC_POS_VALID_LATITUDE                       0x00000020
     95 #define RPC_LOC_POS_VALID_LONGITUDE                      0x00000040
     96 #define RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID         0x00000080
     97 #define RPC_LOC_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL    0x00000100
     98 #define RPC_LOC_POS_VALID_SPEED_HORIZONTAL               0x00000200
     99 #define RPC_LOC_POS_VALID_SPEED_VERTICAL                 0x00000400
    100 #define RPC_LOC_POS_VALID_HEADING                        0x00000800
    101 #define RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR               0x00001000
    102 #define RPC_LOC_POS_VALID_HOR_UNC_ELLI_SEMI_MAJ          0x00002000
    103 #define RPC_LOC_POS_VALID_HOR_UNC_ELLI_SEMI_MIN          0x00004000
    104 #define RPC_LOC_POS_VALID_HOR_UNC_ELLI_ORIENT_AZIMUTH    0x00008000
    105 #define RPC_LOC_POS_VALID_VERTICAL_UNC                   0x00010000
    106 #define RPC_LOC_POS_VALID_SPEED_UNC                      0x00020000
    107 #define RPC_LOC_POS_VALID_HEADING_UNC                    0x00040000
    108 #define RPC_LOC_POS_VALID_CONFIDENCE_HORIZONTAL          0x00080000
    109 #define RPC_LOC_POS_VALID_CONFIDENCE_VERTICAL            0x00100000
    110 #define RPC_LOC_POS_VALID_MAGNETIC_VARIATION             0x00200000
    111 #define RPC_LOC_POS_VALID_TECHNOLOGY_MASK                0x00400000
    112 
    113 #define RPC_LOC_POS_TECH_SATELLITE 0x00000001
    114 #define RPC_LOC_POS_TECH_CELLID    0x00000002
    115 #define RPC_LOC_POS_TECH_WIFI      0x00000004
    116 
    117 #define RPC_LOC_SV_INFO_VALID_SYSTEM         0x00000001
    118 #define RPC_LOC_SV_INFO_VALID_PRN            0x00000002
    119 #define RPC_LOC_SV_INFO_VALID_HEALTH_STATUS  0x00000004
    120 #define RPC_LOC_SV_INFO_VALID_PROCESS_STATUS 0x00000008
    121 #define RPC_LOC_SV_INFO_VALID_HAS_EPH        0x00000010
    122 #define RPC_LOC_SV_INFO_VALID_HAS_ALM        0x00000020
    123 #define RPC_LOC_SV_INFO_VALID_ELEVATION      0x00000040
    124 #define RPC_LOC_SV_INFO_VALID_AZIMUTH        0x00000080
    125 #define RPC_LOC_SV_INFO_VALID_SNR            0x00000100
    126 
    127 #define RPC_LOC_GNSS_INFO_VALID_POS_DOP           0x00000001
    128 #define RPC_LOC_GNSS_INFO_VALID_HOR_DOP           0x00000002
    129 #define RPC_LOC_GNSS_INFO_VALID_VERT_DOP          0x00000004
    130 #define RPC_LOC_GNSS_INFO_VALID_ALTITUDE_ASSUMED  0x00000008
    131 #define RPC_LOC_GNSS_INFO_VALID_SV_COUNT          0x00000010
    132 #define RPC_LOC_GNSS_INFO_VALID_SV_LIST           0x00000020
    133 
    134 #define RPC_LOC_NI_MAX_REQUESTOR_ID_LENGTH          200
    135 #define RPC_LOC_NI_SUPL_HASH_LENGTH                 8
    136 #define RPC_LOC_NI_SUPL_SLP_SESSION_ID_BYTE_LENGTH  4
    137 #define RPC_LOC_NI_MAX_CLIENT_NAME_LENGTH           64
    138 #define RPC_LOC_NI_MAX_EXT_CLIENT_ADDRESS           20
    139 #define RPC_LOC_NI_CODEWORD_LENGTH                  20
    140 
    141 #define RPC_LOC_NI_SUPL_QOP_VALID         0x01
    142 #define RPC_LOC_NI_SUPL_QOP_VERACC_VALID  0x02
    143 #define RPC_LOC_NI_SUPL_QOP_MAXAGE_VALID  0x04
    144 #define RPC_LOC_NI_SUPL_QOP_DELAY_VALID   0x08
    145 
    146 #define RPC_LOC_FIX_CRIT_VALID_RECURRENCE_TYPE                  0x00000001
    147 #define RPC_LOC_FIX_CRIT_VALID_PREFERRED_OPERATION_MODE         0x00000002
    148 #define RPC_LOC_FIX_CRIT_VALID_PREFERRED_ACCURACY               0x00000004
    149 #define RPC_LOC_FIX_CRIT_VALID_PREFERRED_RESPONSE_TIME          0x00000008
    150 #define RPC_LOC_FIX_CRIT_VALID_INTERMEDIATE_POS_REPORT_ENABLED  0x00000010
    151 #define RPC_LOC_FIX_CRIT_VALID_NOTIFY_TYPE                      0x00000020
    152 #define RPC_LOC_FIX_CRIT_VALID_MIN_INTERVAL                     0x00000040
    153 #define RPC_LOC_FIX_CRIT_VALID_MIN_DISTANCE                     0x00000080
    154 #define RPC_LOC_FIX_CRIT_VALID_MIN_DIST_SAMPLE_INTERVAL         0x00000100
    155 
    156 #define RPC_LOC_ASSIST_POS_VALID_TIMESTAMP_UTC                0x00000001
    157 #define RPC_LOC_ASSIST_POS_VALID_LATITUDE                     0x00000002
    158 #define RPC_LOC_ASSIST_POS_VALID_LONGITUDE                    0x00000004
    159 #define RPC_LOC_ASSIST_POS_VALID_ALTITUDE_WRT_ELLIPSOID       0x00000008
    160 #define RPC_LOC_ASSIST_POS_VALID_ALTITUDE_WRT_MEAN_SEA_LEVEL  0x00000010
    161 #define RPC_LOC_ASSIST_POS_VALID_HOR_UNC_CIRCULAR             0x00000020
    162 #define RPC_LOC_ASSIST_POS_VALID_VERT_UNC                     0x00000040
    163 #define RPC_LOC_ASSIST_POS_VALID_CONFIDENCE_HORIZONTAL        0x00000080
    164 #define RPC_LOC_ASSIST_POS_VALID_CONFIDENCE_VERTICAL          0x00000100
    165 
    166 #define RPC_LOC_ASSIST_DATA_ALL         0xFFFFFFFF
    167 
    168 #define RPC_LOC_NMEA_MASK_ALL    0xffff
    169 #define RPC_LOC_NMEA_MASK_GGA    0x0001
    170 #define RPC_LOC_NMEA_MASK_RMC    0x0002
    171 #define RPC_LOC_NMEA_MASK_GSV    0x0004
    172 #define RPC_LOC_NMEA_MASK_GSA    0x0008
    173 #define RPC_LOC_NMEA_MASK_VTG    0x0010
    174 
    175 /* flags for notification */
    176 #define  RPC_LOC_NI_CLIENT_NAME_PRESENT             0x0001
    177 #define  RPC_LOC_NI_CLIENT_EXTADDR_PRESENT          0x0002
    178 #define  RPC_LOC_NI_DEF_LOCATION_TYPE_PRESENT       0x0010
    179 #define  RPC_LOC_NI_REQUESTOR_ID_PRESENT            0x0020
    180 #define  RPC_LOC_NI_CODEWORD_PRESENT                0x0040
    181 #define  RPC_LOC_NI_SERVICE_TYPE_ID_PRESENT         0x0080
    182 #define  RPC_LOC_NI_ENCODING_TYPE_PRESENT           0x0100
    183 
    184 #ifdef __cplusplus
    185 }
    186 #endif
    187 
    188 #endif /* LOC_API_FIXUP_H */
    189