Respect application names in starter_client
We were looking for binary names, and finding the wrong applications on
the roboRIO when 2 applications were pointing to the same binary.
If there's an exact application match, use that instead. This makes it
so we can stop message_bridge_client again...
Change-Id: I51d72bfb3a62f69295f38a47fbbd8d7f17a9419b
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/starter_rpc_lib.cc b/aos/starter/starter_rpc_lib.cc
index e373e6b..884367d 100644
--- a/aos/starter/starter_rpc_lib.cc
+++ b/aos/starter/starter_rpc_lib.cc
@@ -41,10 +41,15 @@
return *search;
}
-std::string_view FindApplication(const std::string_view &name,
+std::string_view FindApplication(const std::string_view name,
const aos::Configuration *config) {
std::string_view app_name = name;
for (const auto app : *config->applications()) {
+ if (app->name()->string_view() == name) {
+ return name;
+ }
+ }
+ for (const auto app : *config->applications()) {
if (app->has_executable_name() &&
app->executable_name()->string_view() == name) {
app_name = app->name()->string_view();