mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-10-08 08:41:52 +00:00
Expose usage of Protocol Buffers to the configuration
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
#include <sstream>
|
||||
|
||||
|
||||
Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t& port) : socket{io_service}
|
||||
Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t& port, bool protobuf_enabled) : socket{io_service}
|
||||
{
|
||||
for (const auto& address : addresses)
|
||||
{
|
||||
@@ -71,14 +71,18 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, c
|
||||
monitor_pvt.hdop = 0.0;
|
||||
monitor_pvt.vdop = 0.0;
|
||||
|
||||
serdes = Serdes_Monitor_Pvt();
|
||||
use_protobuf = protobuf_enabled;
|
||||
if (use_protobuf)
|
||||
{
|
||||
serdes = Serdes_Monitor_Pvt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt& monitor_pvt, bool protobuf)
|
||||
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt& monitor_pvt)
|
||||
{
|
||||
std::string outbound_data;
|
||||
if (protobuf == false)
|
||||
if (use_protobuf == false)
|
||||
{
|
||||
std::ostringstream archive_stream;
|
||||
boost::archive::binary_oarchive oa{archive_stream};
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
class Monitor_Pvt_Udp_Sink
|
||||
{
|
||||
public:
|
||||
Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t &port);
|
||||
bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt, bool protobuf = false);
|
||||
Monitor_Pvt_Udp_Sink(std::vector<std::string> addresses, const uint16_t &port, bool protobuf_enabled);
|
||||
bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt);
|
||||
|
||||
private:
|
||||
boost::asio::io_service io_service;
|
||||
@@ -49,6 +49,7 @@ private:
|
||||
std::vector<boost::asio::ip::udp::endpoint> endpoints;
|
||||
Monitor_Pvt monitor_pvt;
|
||||
Serdes_Monitor_Pvt serdes;
|
||||
bool use_protobuf;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ Pvt_Conf::Pvt_Conf()
|
||||
rtcm_output_file_path = std::string(".");
|
||||
|
||||
monitor_enabled = false;
|
||||
protobuf_enabled = true;
|
||||
udp_port = 0;
|
||||
|
||||
show_local_time_zone = false;
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
std::string rtcm_output_file_path;
|
||||
|
||||
bool monitor_enabled;
|
||||
bool protobuf_enabled;
|
||||
std::string udp_addresses;
|
||||
int udp_port;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user