23 #ifndef Modem20091211H 24 #define Modem20091211H 28 #include "goby/common/time.h" 30 #include "driver_base.h" 31 #include "goby/acomms/acomms_helpers.h" 32 #include "goby/acomms/protobuf/mm_driver.pb.h" 68 bool is_started()
const {
return startup_done_; }
70 static unsigned packet_frame_count(
int rate) {
return PACKET_FRAME_COUNT[rate]; }
72 static unsigned packet_size(
int rate) {
return PACKET_SIZE[rate]; }
74 void set_silent(
bool silent);
75 void write_single_cfg(
const std::string& s);
80 SENTENCE_NOT_DEFINED = 0,
137 void initialize_talkers();
140 void query_all_cfg();
141 void set_hydroid_gateway_prefix(
int id);
162 void increment_present_fail();
163 void present_fail_exceeds_retries();
166 void process_receive(
210 void set_rts(
bool state);
228 MAX_FAILS_BEFORE_DEAD = 5
237 ROUGH_SPEED_OF_SOUND = 1500
241 static const boost::posix_time::time_duration MODEM_WAIT;
243 static const boost::posix_time::time_duration WAIT_AFTER_REBOOT;
245 static const int ALLOWED_MS_DIFF;
247 static const std::string SERIAL_DELIMITER;
249 static const unsigned PACKET_FRAME_COUNT[];
251 static const unsigned PACKET_SIZE[];
258 std::deque<util::NMEASentence> out_;
261 boost::posix_time::ptime last_write_time_;
264 bool waiting_for_modem_;
271 unsigned global_fail_count_;
275 unsigned present_fail_count_;
278 micromodem::protobuf::ClockMode clk_mode_;
285 TALKER_NOT_DEFINED = 0,
292 std::map<std::string, TalkerIDs> talker_id_map_;
293 std::map<std::string, SentenceIDs> sentence_id_map_;
294 std::map<std::string, std::string> description_map_;
295 std::map<std::string, std::string> cfg_map_;
304 HYDROID_GATEWAY_PREFIX_LENGTH = 3
307 static const boost::posix_time::time_duration HYDROID_GATEWAY_GPS_REQUEST_INTERVAL;
308 boost::posix_time::ptime last_hydroid_gateway_gps_request_;
309 bool is_hydroid_gateway_;
310 std::string hydroid_gateway_modem_prefix_;
311 std::string hydroid_gateway_gps_request_;
314 std::map<std::string, int> nvram_cfg_;
318 expected_remaining_caxst_;
322 expected_remaining_cacst_;
327 std::set<unsigned> frames_waiting_for_ack_;
331 unsigned expected_ack_destination_;
333 std::set<unsigned> frames_waiting_to_receive_;
339 micromodem::protobuf::TransmissionType last_lbl_type_;
341 double last_keep_alive_time_;
345 MMRevision() : mm_major(0), mm_minor(0), mm_patch(0) {}
350 MMRevision revision_;
352 bool using_application_acks_;
353 int application_ack_max_frames_;
357 std::map<unsigned, std::set<unsigned> > frames_to_ack_;
void shutdown()
Stops the driver.
MMDriver()
Default constructor.
int clk_mode()
Current clock mode of the modem, necessary for synchronous navigation.
google::protobuf::uint32 uint32
an unsigned 32 bit integer
void handle_initiate_transmission(const protobuf::ModemTransmission &m)
See ModemDriverBase::handle_initiate_transmission()
provides an API to the WHOI Micro-Modem driver
void do_work()
See ModemDriverBase::do_work()
The global namespace for the Goby project.
provides an abstract base class for acoustic modem drivers. This is subclassed by the various drivers...
void startup(const protobuf::DriverConfig &cfg)
Starts the driver.
void update_cfg(const protobuf::DriverConfig &cfg)
Update configuration while running (not required to be implemented)