Skip to content

Commit

Permalink
listener fix incorrect "never published" cases (PX4#13006)
Browse files Browse the repository at this point in the history
- fixes PX4#12955
  • Loading branch information
dagar authored and julianoes committed Sep 25, 2019
1 parent bc8781d commit b6db872
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/systemcmds/topic_listener/listener_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@ void listener(listener_print_topic_cb cb, const orb_id_t &id, unsigned num_msgs,
}
}

if (instances == 0) {
PX4_INFO_RAW("never published\n");
}

} else {
// default to the first instance if not specified
if (topic_instance == -1) {
topic_instance = 0;
}

if (orb_exists(id, topic_instance) != 0) {
PX4_INFO_RAW("never published\n");
return;
Expand Down

0 comments on commit b6db872

Please sign in to comment.