72 void parse_in(
const std::string& in, std::map<std::string, std::string>* out);
74 void set_popoto_value(
const std::string& key,
int val)
76 send_popoto_command(
"SetValue", key +
" int " + std::to_string(val));
78 void set_popoto_value(
const std::string& key,
float val)
80 send_popoto_command(
"SetValue", key +
" float " + std::to_string(val));
83 void get_popoto_value(
const std::string& key) { send_popoto_command(
"GetValue", key); }
85 void send_popoto_command(
const std::string& command)
88 send_popoto_command(command,
" Unused Arguments");
90 void send_popoto_command(
const std::string& command,
const nlohmann::json& args);
92 std::uint8_t create_goby_header(
const protobuf::ModemTransmission& m);
93 void decode_goby_header(std::uint8_t header, protobuf::ModemTransmission& m);
94 void decode_popoto_header(std::vector<uint8_t> data, protobuf::ModemTransmission& m);
95 void process_popoto_json(
const std::string& message, protobuf::ModemTransmission& modem_msg);
97 const popoto::protobuf::Config& popoto_driver_cfg()
const
102 static std::string json_to_binary(
const nlohmann::json& element)
105 for (
auto& subel : element) { output.append(1, (
char)((uint8_t)subel)); }
110 static std::string clean_popoto_string(std::string in, std::string p)
112 std::string out = std::move(in);
113 std::string::size_type n = p.length();
114 for (std::string::size_type i = out.find(p); i != std::string::npos; i = out.find(p))
121 protobuf::DriverConfig driver_cfg_;
124 std::uint32_t next_frame_{0};
126 protobuf::ModemTransmission modem_msg_;
127 bool modem_msg_complete_ =
false;
129 int application_type_;
131 static constexpr int DEFAULT_BAUD{115200};
132 static constexpr int DEFAULT_MTU_BYTES{1024};
133 static constexpr int POPOTO_BROADCAST_ID{255};
136 std::vector<std::string> rate_to_speed{
"setRate80",
"setRate640",
"setRate1280",
137 "setRate2560",
"setRate5120",
"setRate10240"};
139 bool startup_done_{
false};
extern ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::PROTOBUF_NAMESPACE_ID::MessageOptions, ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::goby::GobyMessageOptions >, 11, false > msg