Goby Underwater Autonomy Project
Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
|
00001 // copyright 2011 t. schneider tes@mit.edu 00002 // 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This software is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this software. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #ifndef Modem20110225H 00018 #define Modem20110225H 00019 00020 #include "goby/util/time.h" 00021 00022 #include "driver_base.h" 00023 #include "goby/protobuf/abc_driver.pb.h" 00024 #include "goby/acomms/acomms_helpers.h" 00025 00026 namespace goby 00027 { 00028 namespace acomms 00029 { 00033 class ABCDriver : public ModemDriverBase 00034 { 00035 public: 00037 ABCDriver(std::ostream* log = 0); 00038 void startup(const protobuf::DriverConfig& cfg); 00039 void shutdown(); 00040 void do_work(); 00041 void handle_initiate_transmission(protobuf::ModemMsgBase* m); 00042 00043 private: 00044 void parse_in(const std::string& in, 00045 std::map<std::string, std::string>* out); 00046 void signal_and_write(const std::string& raw, 00047 protobuf::ModemMsgBase* base_msg = 0); 00048 00049 private: 00050 enum { DEFAULT_BAUD = 4800 }; 00051 00052 00053 protobuf::DriverConfig driver_cfg_; // configuration given to you at launch 00054 std::ostream* log_; // place to log all human readable debugging messages 00055 // rest is up to you! 00056 }; 00057 } 00058 } 00059 #endif