INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
gbxgarminacfr/driver.h00001 /* 00002 * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics 00003 * http://gearbox.sf.net/ 00004 * Copyright (c) 2004-2010 Duncan Mercer, Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This distribution is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef GBXGARMINACFR_DRIVER_H 00012 #define GBXGARMINACFR_DRIVER_H 00013 00014 #include <gbxserialacfr/serial.h> 00015 #include <gbxutilacfr/tracer.h> 00016 #include <gbxutilacfr/status.h> 00017 #include <memory> 00018 #include <gbxgarminacfr/nmeamessages.h> 00019 00020 namespace gbxgarminacfr { 00021 00023 class Config 00024 { 00025 public: 00026 Config() : 00027 protocol("Garmin"), 00028 readGga(true), 00029 readVtg(true), 00030 readRme(true), 00031 readRmc(false), 00032 ignoreUnknown(false) {}; 00033 00035 bool isValid( std::string &reason ) const; 00036 00038 std::string toString() const; 00039 00041 std::string device; 00042 00044 std::string protocol; 00045 00047 bool readGga; 00049 bool readVtg; 00051 bool readRme; 00053 bool readRmc; 00054 00058 bool ignoreUnknown; 00059 }; 00060 00087 class Driver 00088 { 00089 00090 public: 00091 00097 Driver( const Config &config, 00098 gbxutilacfr::Tracer &tracer, 00099 gbxutilacfr::Status &status, 00100 int serialDebugLevel = 0 ); 00101 00102 ~Driver(); 00103 00120 std::auto_ptr<GenericData> read(); 00121 00122 private: 00123 00124 void init(); 00125 void enableDevice(); 00126 void disableDevice(); 00127 00128 std::auto_ptr<gbxserialacfr::Serial> serial_; 00129 00130 Config config_; 00131 gbxutilacfr::Tracer& tracer_; 00132 gbxutilacfr::Status& status_; 00133 }; 00134 00135 } // namespace 00136 00137 #endif |