Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output of param show -q XXX on NuttX shell #23793

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Oct 9, 2024

Solved Problem

When using e.g. param show -q SYS_AUTOSTART on the NuttX shell I found that it actually doesn't output anything. After looking into the code it prints the same way as other params show variants but without any newline.

Solution

  1. Adding a newline makes it work. So the assumption was that without a newline there's no flush to the output console until the task ends. @dagar confirmed that when we talked today and we tried to add fflush(stdout); instead of a newline which also works. But adding the newline should be ok since the standard says trailing newlines get stripped from shell substitutions so we stick with the newline.
  2. While at it @dagar suggested removing the legacy PARAM_PRINT defines.

Changelog Entry

Fix output of param show -q XXX on NuttX shell

Test coverage

I tested on fmu-v5x and the parameters show on the MAVLink shell.

SITL SIH still loads, the startup script uses the substitution:

for f in ${R}etc/init.d-posix/airframes/"$(param show -q SYS_AUTOSTART)"_*

Otherwise the output doesn't get flushed and doesn't show.
We're not carrying platform defines in applications.
@MaEtUgR MaEtUgR added NuttX (OS) Tools Sub-tools used within PX4 ecosystem (scripts, etc) labels Oct 9, 2024
@MaEtUgR MaEtUgR requested a review from dagar October 9, 2024 17:02
@MaEtUgR MaEtUgR self-assigned this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NuttX (OS) Tools Sub-tools used within PX4 ecosystem (scripts, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant