Merge "Ignore the first IMU reading in ADIS16470"
diff --git a/aos/aos_dump.cc b/aos/aos_dump.cc
index 78df645..45168b2 100644
--- a/aos/aos_dump.cc
+++ b/aos/aos_dump.cc
@@ -95,6 +95,9 @@
[channel, &str_builder, &cli_info, &message_count, &next_send_time](
const aos::Context &context, const void * /*message*/) {
if (context.monotonic_event_time > next_send_time) {
+ if (FLAGS_count > 0 && message_count >= FLAGS_count) {
+ return;
+ }
PrintMessage(channel, context, &str_builder);
++message_count;
next_send_time = context.monotonic_event_time +
diff --git a/aos/events/event_loop.h b/aos/events/event_loop.h
index cc5a356..d23314e 100644
--- a/aos/events/event_loop.h
+++ b/aos/events/event_loop.h
@@ -269,7 +269,7 @@
const T *operator->() const { return get(); }
// Returns true if this fetcher is valid and connected to a channel.
- operator bool() const { return static_cast<bool>(fetcher_); }
+ bool valid() const { return static_cast<bool>(fetcher_); }
// Copies the current flatbuffer into a FlatbufferVector.
FlatbufferVector<T> CopyFlatBuffer() const {
diff --git a/aos/starter/starter_rpc_lib.cc b/aos/starter/starter_rpc_lib.cc
index 67b3fb2..7b86c0a 100644
--- a/aos/starter/starter_rpc_lib.cc
+++ b/aos/starter/starter_rpc_lib.cc
@@ -30,7 +30,7 @@
const aos::Configuration *config) {
std::string_view app_name = name;
for (const auto app : *config->applications()) {
- if (app->executable_name() != nullptr &&
+ if (app->has_executable_name() &&
app->executable_name()->string_view() == name) {
app_name = app->name()->string_view();
break;
@@ -74,7 +74,7 @@
event_loop.MakeFetcher<aos::starter::Status>("/aos");
initial_status_fetcher.Fetch();
auto initial_status =
- initial_status_fetcher
+ initial_status_fetcher.get()
? FindApplicationStatus(*initial_status_fetcher, name)
: nullptr;
@@ -133,8 +133,9 @@
auto status_fetcher = event_loop.MakeFetcher<aos::starter::Status>("/aos");
status_fetcher.Fetch();
- auto status =
- status_fetcher ? FindApplicationStatus(*status_fetcher, name) : nullptr;
+ auto status = status_fetcher.get()
+ ? FindApplicationStatus(*status_fetcher, name)
+ : nullptr;
return status ? aos::CopyFlatBuffer(status)
: FlatbufferDetachedBuffer<
aos::starter::ApplicationStatus>::Empty();
@@ -147,8 +148,9 @@
auto status_fetcher = event_loop.MakeFetcher<aos::starter::Status>("/aos");
status_fetcher.Fetch();
- return (status_fetcher ? std::make_optional(status_fetcher.CopyFlatBuffer())
- : std::nullopt);
+ return (status_fetcher.get()
+ ? std::make_optional(status_fetcher.CopyFlatBuffer())
+ : std::nullopt);
}
} // namespace starter