2 * Copyright (C) 2006, 2007 John Costigan.
4 * POI and GPS-Info code originally written by Cezary Jackiewicz.
6 * Default map data provided by http://www.openstreetmap.org/
8 * This file is part of Maemo Mapper.
10 * Maemo Mapper is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * Maemo Mapper is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Maemo Mapper. If not, see <http://www.gnu.org/licenses/>.
25 # include "/usr/include/gpsbt.h"
29 GPS BT management API. The API is used by those applications that
30 wish to use services provided by gps daemon i.e., they wish to receive
31 GPS data from the daemon. See README file for more details.
33 Copyright (C) 2006 Nokia Corporation. All rights reserved.
35 Author: Jukka Rissanen <jukka.rissanen@nokia.com>
37 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
39 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
40 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.
41 The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
43 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
51 #include <sys/types.h>
56 #ifndef gpsbt_included
57 #define gpsbt_included
59 /* Internal context information */
62 char **rfcomms; /* what devices where found (null terminated array),
63 * not used if compiled with USE_AUTOMATIC_DISCONNECT
64 * (see gpsbt.c for details)
66 int timeout; /* timeout for dbus messages */
70 /* Start function finds out the available GPS BT devices and starts
71 * the gpsd if it is not running. If no GPS BT devices are found, then
72 * an error is returned.
76 * BT address of the GPS device, normally this is left
77 * to null but if this API cannot find a suitable GPS
78 * BT device, the application can ask the BT device
79 * from the user and supply the address here.
82 * debug level (set to 0 to use the default)
85 * gpsd debug level (set to 0 to use the default)
88 * gpsd port (set to 0 to use the default (2947))
91 * user supplied error buffer (optional), if there is an error
92 * the API puts error message to this buffer
95 * max length of the error buffer, set to 0 if error
96 * message is not needed in caller program
99 * timeout (in ms) when waiting dbus replies, set to 0 to use
100 * the library default (5 seconds), if set to <0 then use
101 * the dbus default (whatever that is).
104 * caller must allocate and clear this struct before call
107 * <0 : error, check errno for more details
111 * The default call would be
112 * gpsbt_start(NULL, 0, 0, 0, &ctx);
114 * If the GPSD_PROG environment variable is defined, then it is used
115 * when starting the program, otherwise "gpsd" will be used as a program
116 * name. This way you can override the program name and/or path if necessary.
118 * If the GPSD_CTRL_SOCK environment variable is defined, then it is used
119 * as a location to gpsd control socket, otherwise the default control socket
120 * is /tmp/.gpsd_ctrl_sock
123 extern int gpsbt_start(char *bda,
125 int gpsd_debug_level,
128 int error_buf_max_len,
133 /* Stop function stops the gpsd if it was running and nobody
137 * ctx : context returned by gpsbt_start()
140 * <0 : error, check errno for more details
145 extern int gpsbt_stop(gpsbt_t *ctx);
147 #endif /* gpsbt_included */