Goby v2
moos_ufield_sim_driver.h
1 // Copyright 2009-2018 Toby Schneider (http://gobysoft.org/index.wt/people/toby)
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 //
6 //
7 // This file is part of the Goby Underwater Autonomy Project Libraries
8 // ("The Goby Libraries").
9 //
10 // The Goby Libraries are free software: you can redistribute them and/or modify
11 // them under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 2.1 of the License, or
13 // (at your option) any later version.
14 //
15 // The Goby Libraries are distributed in the hope that they 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 Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
22 
23 #ifndef UFieldSimDriver20120214H
24 #define UFieldSimDriver20120214H
25 
26 #include "goby/moos/moos_header.h"
27 
28 //#include <boost/bimap.hpp>
29 
30 #include "goby/common/time.h"
31 
32 #include "goby/acomms/acomms_helpers.h"
33 #include "goby/acomms/modemdriver/driver_base.h"
34 
35 #include "goby/moos/modem_id_convert.h"
36 
37 namespace goby
38 {
39 namespace moos
40 {
45 {
46  public:
47  UFldDriver();
49  void shutdown();
50  void do_work();
52 
53  private:
54  void send_message(const goby::acomms::protobuf::ModemTransmission& msg);
55  void receive_message(const goby::acomms::protobuf::ModemTransmission& msg);
56 
57  // MicroModem special feature mimics
58  void ccmpc(const goby::acomms::protobuf::ModemTransmission& msg);
59 
60  private:
61  enum
62  {
63  DEFAULT_PACKET_SIZE = 64
64  };
65  enum
66  {
67  NOMINAL_SPEED_OF_SOUND = 1500
68  };
69  CMOOSCommClient moos_client_;
70  goby::acomms::protobuf::DriverConfig driver_cfg_; // configuration given to you at launch
71 
72  //boost::bimap<int, std::string> modem_id2name_;
73  goby::moos::ModemIdConvert modem_lookup_;
74 
75  int last_ccmpc_dest_;
76 };
77 } // namespace moos
78 } // namespace goby
79 
80 #endif
void do_work()
Allows the modem driver to do its work.
void shutdown()
Shuts down the modem driver.
void startup(const goby::acomms::protobuf::DriverConfig &cfg)
Starts the modem driver. Must be called before poll().
void handle_initiate_transmission(const goby::acomms::protobuf::ModemTransmission &m)
Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission...
The global namespace for the Goby project.
provides an simulator driver to the uFldNodeComms MOOS module: http://oceanai.mit.edu/moos-ivp/pmwiki/pmwiki.php?n=Modules.UFldNodeComms
provides an abstract base class for acoustic modem drivers. This is subclassed by the various drivers...
Definition: driver_base.h:47