24 #ifndef GOBY_ACOMMS_MODEMDRIVER_IRIDIUM_SHORE_DRIVER_H
25 #define GOBY_ACOMMS_MODEMDRIVER_IRIDIUM_SHORE_DRIVER_H
32 #include <boost/asio/io_service.hpp>
33 #include <boost/bimap.hpp>
34 #include <boost/circular_buffer.hpp>
47 class RUDICSConnection;
79 typedef unsigned ModemId;
88 void receive_sbd_mo();
91 void send_sbd_mt(
const std::string& bytes,
const std::string& imei);
93 void rudics_send(
const std::string& data, ModemId
id);
94 void rudics_disconnect(
const std::shared_ptr<RUDICSConnection>& connection);
95 void rudics_line(
const std::string& line,
const std::shared_ptr<RUDICSConnection>& connection);
96 void rudics_connect(
const std::shared_ptr<RUDICSConnection>& connection);
110 void receive_sbd_mo_directip();
111 void send_sbd_mt_directip(
const std::string& bytes,
const std::string& imei);
115 void receive_sbd_mo_rockblock();
116 void send_sbd_mt_rockblock(
const std::string& bytes,
const std::string& imei);
123 std::uint32_t next_frame_{0};
129 DATA_BUFFER_CAPACITY = 30
131 RemoteNode() : data_out(DATA_BUFFER_CAPACITY) {}
133 std::shared_ptr<OnCallBase> on_call;
134 boost::circular_buffer<protobuf::ModemTransmission> data_out;
137 std::map<ModemId, RemoteNode> remote_;
139 std::unique_ptr<boost::asio::io_service> rudics_io_;
140 std::unique_ptr<RUDICSServer> rudics_server_;
141 std::unique_ptr<boost::asio::io_service> sbd_io_;
142 std::unique_ptr<directip::SBDServer> directip_mo_sbd_server_;
145 boost::bimap<ModemId, std::shared_ptr<RUDICSConnection>> clients_;
147 using IMEI = std::string;
148 std::map<ModemId, IMEI> modem_id_to_imei_;
150 struct RockblockHTTPMessage
152 enum class MessageState
158 MessageState state{MessageState::HEADER};
159 std::map<std::string, std::string> header;
163 std::unique_ptr<RockblockHTTPMessage> rb_msg_;