Go to the documentation of this file.
24 #ifndef GOBY_ACOMMS_MODEMDRIVER_IRIDIUM_DRIVER_COMMON_H
25 #define GOBY_ACOMMS_MODEMDRIVER_IRIDIUM_DRIVER_COMMON_H
27 #include <dccl/codec.h>
28 #include <dccl/field_codec_fixed.h>
29 #include <dccl/field_codec_manager.h>
57 : last_tx_time_(
time::SystemClock::now().time_since_epoch() / std::chrono::seconds(1)),
84 total_bytes_sent_ += i;
92 int total_bytes_sent_;
102 virtual unsigned size() {
return 0; }
109 auto iridium_id_name =
"iridium_header_id";
110 #ifdef DCCL_VERSION_4_1_OR_NEWER
113 dccl::FieldCodecManager::add<IridiumHeaderIdentifierCodec>(iridium_id_name);
169 goby::Exception(
"Must use device = DEVICE_VOICE_ENABLED_ISU for RUDICS support."));
182 const auto overhead_bytes = head_bytes + crc_bytes;
208 default:
throw(
goby::Exception(
"Invalid direction for the Iridium driver"));
bool has_ack_requested() const
std::shared_ptr< dccl::Codec > iridium_header_dccl_
unsigned iridium_rate_to_bytes(int rate, iridium::protobuf::DeviceType device, Direction direction)
void set_type(::goby::acomms::protobuf::ModemTransmission_TransmissionType value)
void add_acked_frame(::google::protobuf::int32 value)
double last_rx_tx_time() const
void set_last_tx_time(double d)
The global namespace for the Goby project.
double last_tx_time() const
@ DIRECTION_MOBILE_TERMINATED
void parse_iridium_modem_message(std::string in, goby::acomms::protobuf::ModemTransmission *out)
void set_bye_received(bool b)
bool bye_received() const
@ DEVICE_IRIDIUM_9602_9603
const ::std::string & frame(int index) const
void serialize_iridium_modem_message(std::string *out, const goby::acomms::protobuf::ModemTransmission &in)
constexpr int IRIDIUM_SBD_CRC_BYTE_SIZE
int last_bytes_sent() const
void set_last_bytes_sent(int i)
void set_src(::google::protobuf::int32 value)
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions, ::google::protobuf::internal::MessageTypeTraits< ::goby::GobyMessageOptions >, 11, false > msg
int acked_frame_size() const
void set_frame_start(::google::protobuf::uint32 value)
void set_dest(::google::protobuf::int32 value)
@ DIRECTION_MOBILE_ORIGINATED
void set_last_rx_time(double d)
unit< time_dimension, si::system > time
@ DEVICE_VOICE_ENABLED_ISU
simple exception class for goby applications
::google::protobuf::int32 acked_frame(int index) const
bool has_frame_start() const
::std::string * add_frame()
::goby::acomms::protobuf::ModemTransmission_TransmissionType type() const
::google::protobuf::int32 rate() const
bool ack_requested() const
::google::protobuf::int32 src() const
int total_bytes_sent() const
::google::protobuf::int32 dest() const
double last_rx_time() const
void set_rate(::google::protobuf::int32 value)
void set_ack_requested(bool value)
::google::protobuf::uint32 frame_start() const
void set_bye_sent(bool b)