|
|
/home/brennan/n-sim/OrbisQuartus/server/gps_sensor.hGo to the documentation of this file.00001 00014 /* 00015 * Copyright 2007. Los Alamos National Security, LLC. This material 00016 * was produced under U.S. Government contract DE-AC52-06NA25396 for 00017 * Los Alamos National Laboratory (LANL), which is operated by Los 00018 * Alamos National Security, LLC, for the Department of Energy. The 00019 * U.S. Government has rights to use, reproduce, and distribute this 00020 * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, 00021 * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL 00022 * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to 00023 * produce derivative works, such modified software should be clearly 00024 * marked, so as not to confuse it with the version available from LANL. 00025 * 00026 * Additionally, this program is free software; you can redistribute 00027 * it and/or modify it under the terms of the GNU General Public 00028 * License as published by the Free Software Foundation; version 2 of 00029 * the License. Accordingly, this program is distributed in the hope 00030 * it will be useful, but WITHOUT ANY WARRANTY; without even the 00031 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00032 * PURPOSE. See the GNU General Public License for more details. 00033 */ 00034 00035 #ifndef _GPS_SENSOR_H_ 00036 #define _GPS_SENSOR_H_ 00037 00038 #include "sensor_node.h" 00039 #include "sensor_device.h" 00040 00041 00042 enum NMEA_sentence { 00043 NMEA_GGA = 0, 00044 NMEA_GLL, 00045 NMEA_GSA, 00046 NMEA_GSV, 00047 NMEA_RMC, 00048 }; 00049 00050 00051 class GPS_sensor : public Sensor_device { 00052 unsigned int satellites; 00053 double h_dilution, v_dilution; 00054 00055 char *_nmea_gga(Sensor_node *node); 00056 char *_nmea_gll(Sensor_node *node); 00057 char *_nmea_gsa(Sensor_node *node); 00058 char *_nmea_gsv(Sensor_node *node); 00059 char *_nmea_rmc(Sensor_node *node); 00060 00061 public: 00062 enum NMEA_sentence sentence; 00063 00064 GPS_sensor(unsigned int ident, char *type); 00065 GPS_sensor(unsigned int ident, char *type, 00066 unsigned int sats, double h, double v); 00067 00068 char *nmea_sentence(Sensor_node *node, Signal unused); 00069 inline char *transduce(Sensor_node *node, Signal unused) { 00070 return nmea_sentence(node, unused); 00071 }; 00072 }; 00073 00074 00075 #endif // _GPS_SENSOR_H_ |