25#ifndef GOBY_ACOMMS_AMAC_MAC_MANAGER_H
26#define GOBY_ACOMMS_AMAC_MAC_MANAGER_H
28#include <boost/signals2/signal.hpp>
29#include <boost/smart_ptr/shared_ptr.hpp>
50class MACManager :
public std::list<protobuf::ModemTransmission>
101 unsigned cycle_count() {
return std::list<protobuf::ModemTransmission>::size(); }
110 void increment_slot();
112 void restart_timer();
115 unsigned cycle_sum();
116 void position_blank();
126 protobuf::MACConfig cfg_;
133 std::list<protobuf::ModemTransmission>::iterator current_slot_;
135 unsigned cycles_since_reference_;
137 bool started_up_{
false};
139 std::string glog_mac_group_;
147 return a.SerializeAsString() == b.SerializeAsString();
provides an API to the goby-acomms MAC library. MACManager is essentially a std::list<protobuf::Modem...
void startup(const protobuf::MACConfig &cfg)
Starts the MAC with given configuration.
void update()
You must call this after any change to the underlying list that would invalidate iterators or change ...
boost::signals2::signal< void(const protobuf::ModemTransmission &m)> signal_slot_start
Signals the start of all transmissions (even when we don't transmit)
void do_work()
Allows the MAC timer to do its work. Does not block.
time::SystemClock::duration cycle_duration()
boost::signals2::signal< void(const protobuf::ModemTransmission &m)> signal_initiate_transmission
Signals when it is time for this platform to begin transmission of an acoustic message at the start o...
const std::string & glog_mac_group() const
void restart()
Restarts the MAC with original configuration.
MACManager()
Default constructor.
void shutdown()
Shutdown the MAC.
std::ostream & operator<<(std::ostream &os, const MACManager &mac)
The global namespace for the Goby project.
std::chrono::time_point< SystemClock > time_point
std::chrono::microseconds duration
Duration type.