Goby v2
iridium_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 IridiumModemDriver20130823H
24 #define IridiumModemDriver20130823H
25 
26 #include "goby/common/time.h"
27 
28 #include "goby/util/linebasedcomms/tcp_client.h"
29 
30 #include "goby/acomms/modemdriver/driver_base.h"
31 #include "goby/acomms/protobuf/iridium_driver.pb.h"
32 #include "goby/acomms/protobuf/rudics_shore.pb.h"
33 
34 #include "iridium_driver_fsm.h"
35 
36 namespace goby
37 {
38 namespace acomms
39 {
41 {
42  public:
43  IridiumDriver();
44  ~IridiumDriver();
45  void startup(const protobuf::DriverConfig& cfg);
46 
47  void modem_init();
48 
49  void shutdown();
50  void do_work();
51 
53  void process_transmission(protobuf::ModemTransmission msg, bool dial);
54 
55  private:
56  void receive(const protobuf::ModemTransmission& msg);
57  void send(const protobuf::ModemTransmission& msg);
58 
59  void try_serial_tx();
60  void display_state_cfg(std::ostream* os);
61 
62  void hangup();
63  void set_dtr(bool state);
64  bool query_dtr();
65 
66  private:
68  protobuf::DriverConfig driver_cfg_;
69 
70  boost::shared_ptr<goby::util::TCPClient> debug_client_;
71 
72  double last_triple_plus_time_;
73  enum
74  {
75  TRIPLE_PLUS_WAIT = 2
76  };
77 
78  protobuf::ModemTransmission rudics_mac_msg_;
79 
80  int serial_fd_;
81 
82  goby::uint32 next_frame_;
83 };
84 } // namespace acomms
85 } // namespace goby
86 #endif
google::protobuf::uint32 uint32
an unsigned 32 bit integer
void shutdown()
Shuts down the modem driver.
void startup(const protobuf::DriverConfig &cfg)
Starts the modem driver. Must be called before poll().
void do_work()
Allows the modem driver to do its work.
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 handle_initiate_transmission(const protobuf::ModemTransmission &m)
Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission...