Goby v2
moos_bluefin_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 BluefinCommsDriver20130412H
24 #define BluefinCommsDriver20130412H
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/amac.h"
34 #include "goby/acomms/modemdriver/driver_base.h"
35 
36 #include "goby/moos/modem_id_convert.h"
37 
38 namespace goby
39 {
40 namespace moos
41 {
46 {
47  public:
50  void shutdown();
51  void do_work();
53 
54  private:
55  std::string unix_time2nmea_time(double time);
56  void bfcma(const goby::util::NMEASentence& nmea);
57  void bfcps(const goby::util::NMEASentence& nmea);
58  void bfcpr(const goby::util::NMEASentence& nmea);
59 
60  private:
61  CMOOSCommClient moos_client_;
62  goby::acomms::protobuf::DriverConfig driver_cfg_; // configuration given to you at launch
63  std::string current_modem_;
64  double end_of_mac_window_;
65 
66  // modem name to map of rate to bytes
67  std::map<std::string, std::map<int, int> > modem_to_rate_to_bytes_;
68 
69  // maps goby modem id to bluefin modem id
70  boost::bimap<int, int> goby_to_bluefin_id_;
71 
73 
74  int last_request_id_;
76 };
77 } // namespace moos
78 } // namespace goby
79 
80 #endif
provides a driver for the Bluefin Huxley communications infrastructure (initially uses SonarDyne as u...
void handle_initiate_transmission(const goby::acomms::protobuf::ModemTransmission &m)
Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission...
provides an API to the goby-acomms MAC library. MACManager is essentially a std::list<protobuf::Modem...
Definition: mac_manager.h:51
The global namespace for the Goby project.
provides an abstract base class for acoustic modem drivers. This is subclassed by the various drivers...
Definition: driver_base.h:47
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().