gpsd.ex.h

Go to the documentation of this file.
00001 /*
00002     This file is part of Kismet
00003     And convert to pure C by Poggi Jérôme
00004 
00005     Kismet is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     Kismet is distributed in the hope that it will be useful,
00011       but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with Kismet; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 #ifndef __GPSD_H__
00021 #define __GPSD_H__
00022 
00023 #include <config.h>
00024 
00025 #include <sys/types.h>
00026 #include <sys/socket.h>
00027 #include <netinet/in.h>
00028 #include <arpa/inet.h>
00029 #include <unistd.h>
00030 #include <netdb.h>
00031 #include <stdio.h>
00032 #include <errno.h>
00033 #include <string.h>
00034 #include <fcntl.h>
00035 #include <math.h>
00036 #ifdef HAVE_INTTYPES_H
00037 #include <inttypes.h>
00038 #endif
00039 
00040 #ifdef HAVE_GPS
00041 
00042 // Options
00043 #define GPSD_OPT_FORCEMODE    1
00044 
00045     // Open gpsd on host, port
00046 int OpenGPSD(void);
00047     // Close it
00048 int CloseGPSD(void);
00049 
00050     // Set options
00051 void SetOptions(uint32_t in_opt);
00052 
00053     // Get our file descriptor
00054 int FetchDescriptor(void);
00055 
00056     // Scan the GPSD so we can return instantly when someone asks for it
00057 int ScanGPSD(void);
00058 
00059     // Fetch a location
00060 int FetchLoc(float *in_lat, float *in_lon, float *in_alt, float *in_spd,
00061              float *in_hed, int *mode);
00062 
00063     // Fetch mode
00064 int FetchMode(void);
00065 
00066 #else
00067 
00068     // Open gpsd on host, port
00069 int OpenGPSD()
00070 {
00071   return -1;
00072 }
00073 
00074     // Close it
00075 int CloseGPSD()
00076 {
00077   return 0;
00078 }
00079 
00080 void SetOptions(uint32_t)
00081 {
00082   return;
00083 }
00084 
00085     // Scan the GPSD so we can return instantly when someone asks for it
00086 int Scan()
00087 {
00088   return -1;
00089 }
00090 
00091     // Fetch a location
00092 int FetchLoc(float *in_lat, float *in_lon, float *in_alt, float *in_spd,
00093              float *in_hed, int *mode)
00094 {
00095   return -1;
00096 }
00097 
00098     // Fetch mode
00099 int FetchMode()
00100 {
00101   return 0;
00102 }
00103 
00104 #endif                          // HAVE_GPS
00105 
00106 #endif                          // __GPSD_H__

Generated on Fri Jul 25 17:10:33 2008 for WifiScanner by  doxygen 1.5.5