| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| <title>Doxygen-Generated Content</title> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| <style type="text/css"> |
| <!-- |
| .navigation { |
| display: none; |
| } |
| --> |
| </style> |
| </head> |
| <body> |
| <!-- Generated by Doxygen 1.5.6 --> |
| <div class="navigation" id="top"> |
| <div class="tabs"> |
| <ul> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li><a href="annotated.html"><span>Data Structures</span></a></li> |
| <li class="current"><a href="files.html"><span>Files</span></a></li> |
| </ul> |
| </div> |
| </div> |
| <h1>gps.h</h1><a href="gps_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> |
| <a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2008 The Android Open Source Project</span> |
| <a name="l00003"></a>00003 <span class="comment"> *</span> |
| <a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span> |
| <a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span> |
| <a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span> |
| <a name="l00007"></a>00007 <span class="comment"> *</span> |
| <a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> |
| <a name="l00009"></a>00009 <span class="comment"> *</span> |
| <a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> |
| <a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> |
| <a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> |
| <a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span> |
| <a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span> |
| <a name="l00015"></a>00015 <span class="comment"> */</span> |
| <a name="l00016"></a>00016 |
| <a name="l00017"></a>00017 <span class="preprocessor">#ifndef _HARDWARE_GPS_H</span> |
| <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _HARDWARE_GPS_H</span> |
| <a name="l00019"></a>00019 <span class="preprocessor"></span> |
| <a name="l00020"></a>00020 <span class="preprocessor">#include <stdint.h></span> |
| <a name="l00021"></a>00021 |
| <a name="l00022"></a>00022 <span class="preprocessor">#if __cplusplus</span> |
| <a name="l00023"></a>00023 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { |
| <a name="l00024"></a>00024 <span class="preprocessor">#endif</span> |
| <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00026"></a>00026 <span class="comment">/** Milliseconds since January 1, 1970 */</span> |
| <a name="l00027"></a><a class="code" href="gps_8h.html#f2b0ea531a44c010f81a4abd27504c15">00027</a> <span class="keyword">typedef</span> int64_t <a class="code" href="gps_8h.html#f2b0ea531a44c010f81a4abd27504c15" title="Milliseconds since January 1, 1970.">GpsUtcTime</a>; |
| <a name="l00028"></a>00028 <span class="comment"></span> |
| <a name="l00029"></a>00029 <span class="comment">/** Maximum number of SVs for gps_sv_status_callback(). */</span> |
| <a name="l00030"></a>00030 <span class="preprocessor">#define GPS_MAX_SVS 32</span> |
| <a name="l00031"></a>00031 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00032"></a>00032 <span class="comment">/** Requested mode for GPS operation. */</span> |
| <a name="l00033"></a><a class="code" href="gps_8h.html#2461a6f0dd56a1f7dc94e93207a1f740">00033</a> <span class="keyword">typedef</span> uint16_t <a class="code" href="gps_8h.html#2461a6f0dd56a1f7dc94e93207a1f740" title="Requested mode for GPS operation.">GpsPositionMode</a>; |
| <a name="l00034"></a>00034 <span class="comment">// IMPORTANT: Note that the following values must match</span> |
| <a name="l00035"></a>00035 <span class="comment">// constants in GpsLocationProvider.java.</span><span class="comment"></span> |
| <a name="l00036"></a>00036 <span class="comment">/** Mode for running GPS standalone (no assistance). */</span> |
| <a name="l00037"></a>00037 <span class="preprocessor">#define GPS_POSITION_MODE_STANDALONE 0</span> |
| <a name="l00038"></a>00038 <span class="preprocessor"></span><span class="comment">/** SUPL MS-Based mode. */</span> |
| <a name="l00039"></a>00039 <span class="preprocessor">#define GPS_POSITION_MODE_MS_BASED 1</span> |
| <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="comment">/** SUPL MS-Assisted mode. */</span> |
| <a name="l00041"></a>00041 <span class="preprocessor">#define GPS_POSITION_MODE_MS_ASSISTED 2</span> |
| <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00043"></a>00043 <span class="comment">/** GPS status event values. */</span> |
| <a name="l00044"></a><a class="code" href="gps_8h.html#de8fa0020d3aa1748a8e26759b768ec5">00044</a> <span class="keyword">typedef</span> uint16_t <a class="code" href="gps_8h.html#de8fa0020d3aa1748a8e26759b768ec5" title="GPS status event values.">GpsStatusValue</a>; |
| <a name="l00045"></a>00045 <span class="comment">// IMPORTANT: Note that the following values must match</span> |
| <a name="l00046"></a>00046 <span class="comment">// constants in GpsLocationProvider.java.</span><span class="comment"></span> |
| <a name="l00047"></a>00047 <span class="comment">/** GPS status unknown. */</span> |
| <a name="l00048"></a>00048 <span class="preprocessor">#define GPS_STATUS_NONE 0</span> |
| <a name="l00049"></a>00049 <span class="preprocessor"></span><span class="comment">/** GPS has begun navigating. */</span> |
| <a name="l00050"></a>00050 <span class="preprocessor">#define GPS_STATUS_SESSION_BEGIN 1</span> |
| <a name="l00051"></a>00051 <span class="preprocessor"></span><span class="comment">/** GPS has stopped navigating. */</span> |
| <a name="l00052"></a>00052 <span class="preprocessor">#define GPS_STATUS_SESSION_END 2</span> |
| <a name="l00053"></a>00053 <span class="preprocessor"></span><span class="comment">/** GPS has powered on but is not navigating. */</span> |
| <a name="l00054"></a>00054 <span class="preprocessor">#define GPS_STATUS_ENGINE_ON 3</span> |
| <a name="l00055"></a>00055 <span class="preprocessor"></span><span class="comment">/** GPS is powered off. */</span> |
| <a name="l00056"></a>00056 <span class="preprocessor">#define GPS_STATUS_ENGINE_OFF 4</span> |
| <a name="l00057"></a>00057 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00058"></a>00058 <span class="comment">/** Flags to indicate which values are valid in a GpsLocation. */</span> |
| <a name="l00059"></a><a class="code" href="gps_8h.html#4ae31616d5e232ad7a346a2d4e723e31">00059</a> <span class="keyword">typedef</span> uint16_t <a class="code" href="gps_8h.html#4ae31616d5e232ad7a346a2d4e723e31" title="Flags to indicate which values are valid in a GpsLocation.">GpsLocationFlags</a>; |
| <a name="l00060"></a>00060 <span class="comment">// IMPORTANT: Note that the following values must match</span> |
| <a name="l00061"></a>00061 <span class="comment">// constants in GpsLocationProvider.java.</span><span class="comment"></span> |
| <a name="l00062"></a>00062 <span class="comment">/** GpsLocation has valid latitude and longitude. */</span> |
| <a name="l00063"></a>00063 <span class="preprocessor">#define GPS_LOCATION_HAS_LAT_LONG 0x0001</span> |
| <a name="l00064"></a>00064 <span class="preprocessor"></span><span class="comment">/** GpsLocation has valid altitude. */</span> |
| <a name="l00065"></a>00065 <span class="preprocessor">#define GPS_LOCATION_HAS_ALTITUDE 0x0002</span> |
| <a name="l00066"></a>00066 <span class="preprocessor"></span><span class="comment">/** GpsLocation has valid speed. */</span> |
| <a name="l00067"></a>00067 <span class="preprocessor">#define GPS_LOCATION_HAS_SPEED 0x0004</span> |
| <a name="l00068"></a>00068 <span class="preprocessor"></span><span class="comment">/** GpsLocation has valid bearing. */</span> |
| <a name="l00069"></a>00069 <span class="preprocessor">#define GPS_LOCATION_HAS_BEARING 0x0008</span> |
| <a name="l00070"></a>00070 <span class="preprocessor"></span><span class="comment">/** GpsLocation has valid accuracy. */</span> |
| <a name="l00071"></a>00071 <span class="preprocessor">#define GPS_LOCATION_HAS_ACCURACY 0x0010</span> |
| <a name="l00072"></a>00072 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00073"></a>00073 <span class="comment">/** Flags used to specify which aiding data to delete</span> |
| <a name="l00074"></a>00074 <span class="comment"> when calling delete_aiding_data(). */</span> |
| <a name="l00075"></a><a class="code" href="gps_8h.html#93f0283aeabd20211499991a29db7377">00075</a> <span class="keyword">typedef</span> uint16_t <a class="code" href="gps_8h.html#93f0283aeabd20211499991a29db7377" title="Flags used to specify which aiding data to delete when calling delete_aiding_data()...">GpsAidingData</a>; |
| <a name="l00076"></a>00076 <span class="comment">// IMPORTANT: Note that the following values must match</span> |
| <a name="l00077"></a>00077 <span class="comment">// constants in GpsLocationProvider.java.</span> |
| <a name="l00078"></a>00078 <span class="preprocessor">#define GPS_DELETE_EPHEMERIS 0x0001</span> |
| <a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_ALMANAC 0x0002</span> |
| <a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_POSITION 0x0004</span> |
| <a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_TIME 0x0008</span> |
| <a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_IONO 0x0010</span> |
| <a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_UTC 0x0020</span> |
| <a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_HEALTH 0x0040</span> |
| <a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_SVDIR 0x0080</span> |
| <a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_SVSTEER 0x0100</span> |
| <a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_SADATA 0x0200</span> |
| <a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_RTI 0x0400</span> |
| <a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_CELLDB_INFO 0x8000</span> |
| <a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define GPS_DELETE_ALL 0xFFFF</span> |
| <a name="l00091"></a>00091 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00092"></a>00092 <span class="comment">/**</span> |
| <a name="l00093"></a>00093 <span class="comment"> * Name for the GPS XTRA interface.</span> |
| <a name="l00094"></a>00094 <span class="comment"> */</span> |
| <a name="l00095"></a>00095 <span class="preprocessor">#define GPS_XTRA_INTERFACE "gps-xtra"</span> |
| <a name="l00096"></a>00096 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00097"></a>00097 <span class="comment">/**</span> |
| <a name="l00098"></a>00098 <span class="comment"> * Name for the GPS SUPL interface.</span> |
| <a name="l00099"></a>00099 <span class="comment"> */</span> |
| <a name="l00100"></a>00100 <span class="preprocessor">#define GPS_SUPL_INTERFACE "gps-supl"</span> |
| <a name="l00101"></a>00101 <span class="preprocessor"></span><span class="comment"></span> |
| <a name="l00102"></a>00102 <span class="comment">/** Represents a location. */</span> |
| <a name="l00103"></a><a class="code" href="struct_gps_location.html">00103</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span> |
| <a name="l00104"></a>00104 <span class="comment"> /** Contains GpsLocationFlags bits. */</span> |
| <a name="l00105"></a><a class="code" href="struct_gps_location.html#07d55fee34dc28cff50062e9ac42c717">00105</a> uint16_t flags;<span class="comment"></span> |
| <a name="l00106"></a>00106 <span class="comment"> /** Represents latitude in degrees. */</span> |
| <a name="l00107"></a><a class="code" href="struct_gps_location.html#3a7da06efae47c66428fa2815a3eb4bd">00107</a> <span class="keywordtype">double</span> latitude;<span class="comment"></span> |
| <a name="l00108"></a>00108 <span class="comment"> /** Represents longitude in degrees. */</span> |
| <a name="l00109"></a><a class="code" href="struct_gps_location.html#3672d2d19087d62d7ea9b0b71418da40">00109</a> <span class="keywordtype">double</span> longitude;<span class="comment"></span> |
| <a name="l00110"></a>00110 <span class="comment"> /** Represents altitude in meters above the WGS 84 reference</span> |
| <a name="l00111"></a>00111 <span class="comment"> * ellipsoid. */</span> |
| <a name="l00112"></a><a class="code" href="struct_gps_location.html#cb3cc5ad378a6a3864e47ae67df38778">00112</a> <span class="keywordtype">double</span> altitude;<span class="comment"></span> |
| <a name="l00113"></a>00113 <span class="comment"> /** Represents speed in meters per second. */</span> |
| <a name="l00114"></a><a class="code" href="struct_gps_location.html#38ae20b9c5e7be995513dce25ed87016">00114</a> <span class="keywordtype">float</span> speed;<span class="comment"></span> |
| <a name="l00115"></a>00115 <span class="comment"> /** Represents heading in degrees. */</span> |
| <a name="l00116"></a><a class="code" href="struct_gps_location.html#b71bf9b61cf55f10ffcf34ba1654d082">00116</a> <span class="keywordtype">float</span> bearing;<span class="comment"></span> |
| <a name="l00117"></a>00117 <span class="comment"> /** Represents expected accuracy in meters. */</span> |
| <a name="l00118"></a><a class="code" href="struct_gps_location.html#801ec0db8ee69fa263a63528876d773b">00118</a> <span class="keywordtype">float</span> accuracy;<span class="comment"></span> |
| <a name="l00119"></a>00119 <span class="comment"> /** Timestamp for the location fix. */</span> |
| <a name="l00120"></a><a class="code" href="struct_gps_location.html#3e16861f64869d6f0e15e4300bb2658b">00120</a> GpsUtcTime timestamp; |
| <a name="l00121"></a>00121 } <a class="code" href="struct_gps_location.html" title="Represents a location.">GpsLocation</a>; |
| <a name="l00122"></a>00122 <span class="comment"></span> |
| <a name="l00123"></a>00123 <span class="comment">/** Represents the status. */</span> |
| <a name="l00124"></a><a class="code" href="struct_gps_status.html">00124</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ |
| <a name="l00125"></a><a class="code" href="struct_gps_status.html#64c9e8cd609d97533bee5c5e8ca78608">00125</a> GpsStatusValue status; |
| <a name="l00126"></a>00126 } <a class="code" href="struct_gps_status.html" title="Represents the status.">GpsStatus</a>; |
| <a name="l00127"></a>00127 <span class="comment"></span> |
| <a name="l00128"></a>00128 <span class="comment">/** Represents SV information. */</span> |
| <a name="l00129"></a><a class="code" href="struct_gps_sv_info.html">00129</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span> |
| <a name="l00130"></a>00130 <span class="comment"> /** Pseudo-random number for the SV. */</span> |
| <a name="l00131"></a><a class="code" href="struct_gps_sv_info.html#5c94e86f2efc3ed08fb5a40735a2440b">00131</a> <span class="keywordtype">int</span> prn;<span class="comment"></span> |
| <a name="l00132"></a>00132 <span class="comment"> /** Signal to noise ratio. */</span> |
| <a name="l00133"></a><a class="code" href="struct_gps_sv_info.html#eebf16140beb95390733529bd5e7db58">00133</a> <span class="keywordtype">float</span> snr;<span class="comment"></span> |
| <a name="l00134"></a>00134 <span class="comment"> /** Elevation of SV in degrees. */</span> |
| <a name="l00135"></a><a class="code" href="struct_gps_sv_info.html#0634009d0476b2f06f27568b0722a04d">00135</a> <span class="keywordtype">float</span> elevation;<span class="comment"></span> |
| <a name="l00136"></a>00136 <span class="comment"> /** Azimuth of SV in degrees. */</span> |
| <a name="l00137"></a><a class="code" href="struct_gps_sv_info.html#94755ad36e31a012269459d5a4ef0594">00137</a> <span class="keywordtype">float</span> azimuth; |
| <a name="l00138"></a>00138 } <a class="code" href="struct_gps_sv_info.html" title="Represents SV information.">GpsSvInfo</a>; |
| <a name="l00139"></a>00139 <span class="comment"></span> |
| <a name="l00140"></a>00140 <span class="comment">/** Represents SV status. */</span> |
| <a name="l00141"></a><a class="code" href="struct_gps_sv_status.html">00141</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span> |
| <a name="l00142"></a>00142 <span class="comment"> /** Number of SVs currently visible. */</span> |
| <a name="l00143"></a><a class="code" href="struct_gps_sv_status.html#b90eb63a499039de996c95d98afad545">00143</a> <span class="keywordtype">int</span> num_svs; |
| <a name="l00144"></a>00144 <span class="comment"></span> |
| <a name="l00145"></a>00145 <span class="comment"> /** Contains an array of SV information. */</span> |
| <a name="l00146"></a><a class="code" href="struct_gps_sv_status.html#7a3fe2114e7a603b96fd9675adf0c5b5">00146</a> <a class="code" href="struct_gps_sv_info.html" title="Represents SV information.">GpsSvInfo</a> sv_list[GPS_MAX_SVS]; |
| <a name="l00147"></a>00147 <span class="comment"></span> |
| <a name="l00148"></a>00148 <span class="comment"> /** Represents a bit mask indicating which SVs</span> |
| <a name="l00149"></a>00149 <span class="comment"> * have ephemeris data.</span> |
| <a name="l00150"></a>00150 <span class="comment"> */</span> |
| <a name="l00151"></a><a class="code" href="struct_gps_sv_status.html#4751f70f8e275241dece99db0df4ab5b">00151</a> uint32_t ephemeris_mask; |
| <a name="l00152"></a>00152 <span class="comment"></span> |
| <a name="l00153"></a>00153 <span class="comment"> /** Represents a bit mask indicating which SVs</span> |
| <a name="l00154"></a>00154 <span class="comment"> * have almanac data.</span> |
| <a name="l00155"></a>00155 <span class="comment"> */</span> |
| <a name="l00156"></a><a class="code" href="struct_gps_sv_status.html#6ed4b741a9882ecc2852e94e8ad60310">00156</a> uint32_t almanac_mask; |
| <a name="l00157"></a>00157 <span class="comment"></span> |
| <a name="l00158"></a>00158 <span class="comment"> /**</span> |
| <a name="l00159"></a>00159 <span class="comment"> * Represents a bit mask indicating which SVs</span> |
| <a name="l00160"></a>00160 <span class="comment"> * were used for computing the most recent position fix.</span> |
| <a name="l00161"></a>00161 <span class="comment"> */</span> |
| <a name="l00162"></a><a class="code" href="struct_gps_sv_status.html#9090a26639d97eec2b59bcd0446659c0">00162</a> uint32_t used_in_fix_mask; |
| <a name="l00163"></a>00163 } <a class="code" href="struct_gps_sv_status.html" title="Represents SV status.">GpsSvStatus</a>; |
| <a name="l00164"></a>00164 <span class="comment"></span> |
| <a name="l00165"></a>00165 <span class="comment">/** Callback with location information. */</span> |
| <a name="l00166"></a><a class="code" href="gps_8h.html#88f19d3da70dc0e951b51091ce0631ae">00166</a> <span class="keyword">typedef</span> void (* <a class="code" href="gps_8h.html#88f19d3da70dc0e951b51091ce0631ae" title="Callback with location information.">gps_location_callback</a>)(<a class="code" href="struct_gps_location.html" title="Represents a location.">GpsLocation</a>* location); |
| <a name="l00167"></a>00167 <span class="comment"></span> |
| <a name="l00168"></a>00168 <span class="comment">/** Callback with status information. */</span> |
| <a name="l00169"></a><a class="code" href="gps_8h.html#1d9ef60ab0b91f7c106867a6aa1e4412">00169</a> <span class="keyword">typedef</span> void (* <a class="code" href="gps_8h.html#1d9ef60ab0b91f7c106867a6aa1e4412" title="Callback with status information.">gps_status_callback</a>)(<a class="code" href="struct_gps_status.html" title="Represents the status.">GpsStatus</a>* status); |
| <a name="l00170"></a>00170 <span class="comment"></span> |
| <a name="l00171"></a>00171 <span class="comment">/** Callback with SV status information. */</span> |
| <a name="l00172"></a><a class="code" href="gps_8h.html#67274e784834c6c2547f4b5344fc4ea9">00172</a> <span class="keyword">typedef</span> void (* <a class="code" href="gps_8h.html#67274e784834c6c2547f4b5344fc4ea9" title="Callback with SV status information.">gps_sv_status_callback</a>)(<a class="code" href="struct_gps_sv_status.html" title="Represents SV status.">GpsSvStatus</a>* sv_info); |
| <a name="l00173"></a>00173 <span class="comment"></span> |
| <a name="l00174"></a>00174 <span class="comment">/** GPS callback structure. */</span> |
| <a name="l00175"></a><a class="code" href="struct_gps_callbacks.html">00175</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ |
| <a name="l00176"></a><a class="code" href="struct_gps_callbacks.html#1f59b4f8eeaca50620f94761536dabd3">00176</a> <a class="code" href="gps_8h.html#88f19d3da70dc0e951b51091ce0631ae" title="Callback with location information.">gps_location_callback</a> location_cb; |
| <a name="l00177"></a><a class="code" href="struct_gps_callbacks.html#7b15a1bf4f9b989677fef84f4d8141df">00177</a> <a class="code" href="gps_8h.html#1d9ef60ab0b91f7c106867a6aa1e4412" title="Callback with status information.">gps_status_callback</a> status_cb; |
| <a name="l00178"></a><a class="code" href="struct_gps_callbacks.html#fb34f60ad58e80de5c04790b107bb93d">00178</a> <a class="code" href="gps_8h.html#67274e784834c6c2547f4b5344fc4ea9" title="Callback with SV status information.">gps_sv_status_callback</a> sv_status_cb; |
| <a name="l00179"></a>00179 } <a class="code" href="struct_gps_callbacks.html" title="GPS callback structure.">GpsCallbacks</a>; |
| <a name="l00180"></a>00180 |
| <a name="l00181"></a>00181 <span class="comment"></span> |
| <a name="l00182"></a>00182 <span class="comment">/** Represents the standard GPS interface. */</span> |
| <a name="l00183"></a><a class="code" href="struct_gps_interface.html">00183</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span> |
| <a name="l00184"></a>00184 <span class="comment"> /**</span> |
| <a name="l00185"></a>00185 <span class="comment"> * Opens the interface and provides the callback routines</span> |
| <a name="l00186"></a>00186 <span class="comment"> * to the implemenation of this interface.</span> |
| <a name="l00187"></a>00187 <span class="comment"> */</span> |
| <a name="l00188"></a>00188 int (*init)( <a class="code" href="struct_gps_callbacks.html" title="GPS callback structure.">GpsCallbacks</a>* callbacks ); |
| <a name="l00189"></a>00189 <span class="comment"></span> |
| <a name="l00190"></a>00190 <span class="comment"> /** Starts navigating. */</span> |
| <a name="l00191"></a>00191 int (*start)( void ); |
| <a name="l00192"></a>00192 <span class="comment"></span> |
| <a name="l00193"></a>00193 <span class="comment"> /** Stops navigating. */</span> |
| <a name="l00194"></a>00194 int (*stop)( void ); |
| <a name="l00195"></a>00195 <span class="comment"></span> |
| <a name="l00196"></a>00196 <span class="comment"> /** Sets requested frequency of fixes in seconds. */</span> |
| <a name="l00197"></a>00197 void (*set_fix_frequency)( <span class="keywordtype">int</span> frequency ); |
| <a name="l00198"></a>00198 <span class="comment"></span> |
| <a name="l00199"></a>00199 <span class="comment"> /** Closes the interface. */</span> |
| <a name="l00200"></a>00200 void (*cleanup)( void ); |
| <a name="l00201"></a>00201 <span class="comment"></span> |
| <a name="l00202"></a>00202 <span class="comment"> /** Injects the current time. */</span> |
| <a name="l00203"></a>00203 int (*inject_time)(GpsUtcTime time, int64_t timeReference, |
| <a name="l00204"></a>00204 <span class="keywordtype">int</span> uncertainty); |
| <a name="l00205"></a>00205 <span class="comment"></span> |
| <a name="l00206"></a>00206 <span class="comment"> /**</span> |
| <a name="l00207"></a>00207 <span class="comment"> * Specifies that the next call to start will not use the</span> |
| <a name="l00208"></a>00208 <span class="comment"> * information defined in the flags. GPS_DELETE_ALL is passed for</span> |
| <a name="l00209"></a>00209 <span class="comment"> * a cold start.</span> |
| <a name="l00210"></a>00210 <span class="comment"> */</span> |
| <a name="l00211"></a>00211 void (*delete_aiding_data)(GpsAidingData flags); |
| <a name="l00212"></a>00212 <span class="comment"></span> |
| <a name="l00213"></a>00213 <span class="comment"> /**</span> |
| <a name="l00214"></a>00214 <span class="comment"> * fix_frequency represents the time between fixes in seconds.</span> |
| <a name="l00215"></a>00215 <span class="comment"> * Set fix_frequency to zero for a single-shot fix.</span> |
| <a name="l00216"></a>00216 <span class="comment"> */</span> |
| <a name="l00217"></a>00217 int (*set_position_mode)(GpsPositionMode mode, <span class="keywordtype">int</span> fix_frequency); |
| <a name="l00218"></a>00218 <span class="comment"></span> |
| <a name="l00219"></a>00219 <span class="comment"> /** Get a pointer to extension information. */</span> |
| <a name="l00220"></a>00220 <span class="keyword">const</span> <span class="keywordtype">void</span>* (*get_extension)(<span class="keyword">const</span> <span class="keywordtype">char</span>* name); |
| <a name="l00221"></a>00221 } <a class="code" href="struct_gps_interface.html" title="Represents the standard GPS interface.">GpsInterface</a>; |
| <a name="l00222"></a>00222 <span class="comment"></span> |
| <a name="l00223"></a>00223 <span class="comment">/** Callback to request the client to download XTRA data.</span> |
| <a name="l00224"></a>00224 <span class="comment"> The client should download XTRA data and inject it by calling</span> |
| <a name="l00225"></a>00225 <span class="comment"> inject_xtra_data(). */</span> |
| <a name="l00226"></a><a class="code" href="gps_8h.html#08fcfb3f85c2ac3008c9c73cf9136515">00226</a> <span class="keyword">typedef</span> void (* <a class="code" href="gps_8h.html#08fcfb3f85c2ac3008c9c73cf9136515" title="Callback to request the client to download XTRA data.">gps_xtra_download_request</a>)(); |
| <a name="l00227"></a>00227 <span class="comment"></span> |
| <a name="l00228"></a>00228 <span class="comment">/** Callback structure for the XTRA interface. */</span> |
| <a name="l00229"></a><a class="code" href="struct_gps_xtra_callbacks.html">00229</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ |
| <a name="l00230"></a><a class="code" href="struct_gps_xtra_callbacks.html#7e879ba4c3e32c52eaa0fb04fb9c226f">00230</a> <a class="code" href="gps_8h.html#08fcfb3f85c2ac3008c9c73cf9136515" title="Callback to request the client to download XTRA data.">gps_xtra_download_request</a> download_request_cb; |
| <a name="l00231"></a>00231 } <a class="code" href="struct_gps_xtra_callbacks.html" title="Callback structure for the XTRA interface.">GpsXtraCallbacks</a>; |
| <a name="l00232"></a>00232 <span class="comment"></span> |
| <a name="l00233"></a>00233 <span class="comment">/** Extended interface for XTRA support. */</span> |
| <a name="l00234"></a><a class="code" href="struct_gps_xtra_interface.html">00234</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span> |
| <a name="l00235"></a>00235 <span class="comment"> /**</span> |
| <a name="l00236"></a>00236 <span class="comment"> * Opens the XTRA interface and provides the callback routines</span> |
| <a name="l00237"></a>00237 <span class="comment"> * to the implemenation of this interface.</span> |
| <a name="l00238"></a>00238 <span class="comment"> */</span> |
| <a name="l00239"></a>00239 int (*init)( <a class="code" href="struct_gps_xtra_callbacks.html" title="Callback structure for the XTRA interface.">GpsXtraCallbacks</a>* callbacks );<span class="comment"></span> |
| <a name="l00240"></a>00240 <span class="comment"> /** Injects XTRA data into the GPS. */</span> |
| <a name="l00241"></a>00241 int (*inject_xtra_data)( <span class="keywordtype">char</span>* data, <span class="keywordtype">int</span> length ); |
| <a name="l00242"></a>00242 } <a class="code" href="struct_gps_xtra_interface.html" title="Extended interface for XTRA support.">GpsXtraInterface</a>; |
| <a name="l00243"></a>00243 <span class="comment"></span> |
| <a name="l00244"></a>00244 <span class="comment">/** Extended interface for SUPL support. */</span> |
| <a name="l00245"></a><a class="code" href="struct_gps_supl_interface.html">00245</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span> |
| <a name="l00246"></a>00246 <span class="comment"> /**</span> |
| <a name="l00247"></a>00247 <span class="comment"> * Sets the name of the APN to be used for SUPL.</span> |
| <a name="l00248"></a>00248 <span class="comment"> */</span> |
| <a name="l00249"></a>00249 int (*set_apn)( <span class="keyword">const</span> <span class="keywordtype">char</span>* apn ); |
| <a name="l00250"></a>00250 } <a class="code" href="struct_gps_supl_interface.html" title="Extended interface for SUPL support.">GpsSuplInterface</a>; |
| <a name="l00251"></a>00251 <span class="comment"></span> |
| <a name="l00252"></a>00252 <span class="comment">/** Returns the hardware GPS interface. */</span> |
| <a name="l00253"></a>00253 <span class="keyword">const</span> <a class="code" href="struct_gps_interface.html" title="Represents the standard GPS interface.">GpsInterface</a>* <a class="code" href="gps_8h.html#6d15bb02f1f91dd760e3e172bd7711a1" title="Returns the hardware GPS interface.">gps_get_hardware_interface</a>(); |
| <a name="l00254"></a>00254 <span class="comment"></span> |
| <a name="l00255"></a>00255 <span class="comment">/**</span> |
| <a name="l00256"></a>00256 <span class="comment"> * Returns the qemu emulated GPS interface.</span> |
| <a name="l00257"></a>00257 <span class="comment"> */</span> |
| <a name="l00258"></a>00258 <span class="keyword">const</span> <a class="code" href="struct_gps_interface.html" title="Represents the standard GPS interface.">GpsInterface</a>* <a class="code" href="gps_8h.html#f73f4a220fb97545e81d82fbff54b47e" title="Returns the qemu emulated GPS interface.">gps_get_qemu_interface</a>(); |
| <a name="l00259"></a>00259 <span class="comment"></span> |
| <a name="l00260"></a>00260 <span class="comment">/**</span> |
| <a name="l00261"></a>00261 <span class="comment"> * Returns the default GPS interface.</span> |
| <a name="l00262"></a>00262 <span class="comment"> */</span> |
| <a name="l00263"></a>00263 <span class="keyword">const</span> <a class="code" href="struct_gps_interface.html" title="Represents the standard GPS interface.">GpsInterface</a>* <a class="code" href="gps_8h.html#b582931ddf4bafa2cc5044963be66987" title="Returns the default GPS interface.">gps_get_interface</a>(); |
| <a name="l00264"></a>00264 |
| <a name="l00265"></a>00265 <span class="preprocessor">#if __cplusplus</span> |
| <a name="l00266"></a>00266 <span class="preprocessor"></span>} <span class="comment">// extern "C"</span> |
| <a name="l00267"></a>00267 <span class="preprocessor">#endif</span> |
| <a name="l00268"></a>00268 <span class="preprocessor"></span> |
| <a name="l00269"></a>00269 <span class="preprocessor">#endif // _HARDWARE_GPS_H</span> |
| </pre></div></div> |
| </body> |
| </html> |