Goby v2
pb_modem_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 PBModemDriver20120404H
24 #define PBModemDriver20120404H
25 
26 #include "goby/common/time.h"
27 
28 #include "goby/acomms/modemdriver/driver_base.h"
29 #include "goby/acomms/protobuf/store_server.pb.h"
30 #include "goby/common/zeromq_service.h"
31 #include "goby/pb/protobuf/pb_modem_driver.pb.h"
32 #include "goby/pb/protobuf_node.h"
33 
34 namespace goby
35 {
36 namespace pb
37 {
39 {
40  public:
41  PBDriver(goby::common::ZeroMQService* zeromq_service);
42  void startup(const acomms::protobuf::DriverConfig& cfg);
43  void shutdown();
44  void do_work();
46 
47  private:
48  void handle_response(const acomms::protobuf::StoreServerResponse& response);
49 
50  private:
51  goby::common::ZeroMQService* zeromq_service_;
55  uint64 last_send_time_;
56  int request_socket_id_;
57  double query_interval_seconds_;
58  double reset_interval_seconds_;
59  bool waiting_for_reply_;
60  goby::uint32 next_frame_;
61 };
62 } // namespace pb
63 } // namespace goby
64 #endif
void startup(const acomms::protobuf::DriverConfig &cfg)
Starts the modem driver. Must be called before poll().
void do_work()
Allows the modem driver to do its work.
google::protobuf::uint32 uint32
an unsigned 32 bit integer
void handle_initiate_transmission(const acomms::protobuf::ModemTransmission &m)
Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission...
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
google::protobuf::uint64 uint64
an unsigned 64 bit integer
void shutdown()
Shuts down the modem driver.