74class UDPDriver :
public goby::acomms::ModemDriverBase
80 void startup(
const goby::acomms::protobuf::DriverConfig& cfg)
override;
89 bool clear_existing =
false);
91 void start_send(
const goby::acomms::protobuf::ModemTransmission& msg);
92 void send_complete(
const boost::system::error_code& error, std::size_t bytes_transferred);
94 void receive_complete(
const boost::system::error_code& error, std::size_t bytes_transferred);
95 void receive_message(
const goby::acomms::protobuf::ModemTransmission& m);
103 void update_active_hub(
int hub_id, goby::acomms::protobuf::ModemTransmission* msg);
104 void set_active_hub_peer(
int hub_id);
107 goby::acomms::protobuf::DriverConfig driver_cfg_;
108 boost::asio::io_context io_context_;
109 std::unique_ptr<boost::asio::ip::udp::socket> socket_;
111 std::multimap<int, boost::asio::ip::udp::endpoint> receivers_;
112 boost::asio::ip::udp::endpoint sender_;
115 static constexpr size_t UDP_MAX_PACKET_SIZE = 65507;
117 std::array<char, UDP_MAX_PACKET_SIZE> receive_buffer_;
120 std::set<unsigned> application_ack_ids_;
122 std::uint32_t next_frame_{0};
124 bool have_active_hub_{
false};
125 int active_hub_id_{-1};
126 int hub_wifi_base_modem_id_{-1};
127 int hub_wifi_modem_id_{-1};
129 std::map<int, jaiabot::udp::protobuf::Config::EndPoint> hub_endpoints_;