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

examples: migrate to XFA SHELL_COMMAND #21171

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

mguetschow
Copy link
Contributor

Contribution description

Migrate all remaining examples to using the XFA SHELL_COMMAND instead of the statically allocated list (often with extern function declarations) in main.c.

Testing procedure

CI should find bugs.

@github-actions github-actions bot added the Area: examples Area: Example Applications label Jan 28, 2025
@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 28, 2025
@riot-ci
Copy link

riot-ci commented Jan 28, 2025

Murdock results

✔️ PASSED

8f5f268 examples: migrate to XFA SHELL_COMMAND

Success Failures Total Runtime
292 0 292 02m:46s

Artifacts

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this one :) Thx!

Some comments inline. Feel free to squash at will and hit merge.

examples/dtls-echo/dtls-server.c Outdated Show resolved Hide resolved
examples/dtls-echo/dtls-client.c Outdated Show resolved Hide resolved
examples/dtls-sock/dtls-client.c Outdated Show resolved Hide resolved
examples/dtls-sock/dtls-server.c Outdated Show resolved Hide resolved
examples/dtls-wolfssl/dtls-client.c Outdated Show resolved Hide resolved
examples/gnrc_networking_mac/udp.c Outdated Show resolved Hide resolved
examples/lwm2m/lwm2m_cli.c Outdated Show resolved Hide resolved
examples/posix_sockets/udp.c Outdated Show resolved Hide resolved
examples/twr_aloha/twr_shell.c Show resolved Hide resolved
examples/twr_aloha/twr_shell.c Show resolved Hide resolved
@mguetschow mguetschow added the CI: no fast fail don't abort PR build after first error label Jan 29, 2025
@mguetschow
Copy link
Contributor Author

Oh, this one is interesting:

In file included from main.c:27:
main.c:91:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
   91 | SHELL_COMMAND(riotboot-hdr, "Print current slot header", cmd_print_riotboot_hdr);

So using SHELL_COMMAND here would actually require changing the command name. I guess that would be fine for an example?

@maribu
Copy link
Member

maribu commented Jan 29, 2025

Yes, it was brought up that SHELL_COMMAND() would limit shell cmd names to names that after being prefixed end up as valid C identifier names, unless we add an extra parameters to SHELL_COMMAND() to explicitly specify the C identifier in addition to the shell cmd name. There was widespread support for the easier interface, even if we have to convert e.g. every minus to an underscore.

@mguetschow
Copy link
Contributor Author

Okay, changed the functions to static, changed the two shell command names, and squashed. Thanks for your review!

@mguetschow mguetschow added this pull request to the merge queue Jan 30, 2025
Merged via the queue into RIOT-OS:master with commit 287324c Jan 30, 2025
25 checks passed
@mguetschow mguetschow deleted the shell-commands-xfa branch January 30, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: examples Area: Example Applications CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants