Skip to content

Conversation

dnltz
Copy link
Contributor

@dnltz dnltz commented Jun 25, 2025

Suppress success and error messages when sending the CAN message. These messages may appear after the shell prompt returns.

Suppress success and error messages when sending the CAN message.
These messages may appear after the shell prompt returns.

Signed-off-by: Daniel Schultz <[email protected]>
Copy link

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

What is the issue with regard to scripting (i.e. pytest scripting) in that the message comes after the prompt? I have tests that depend on the message being printed (which are currently using CONFIG_CAN_SHELL_SCRIPTING_FRIENDLY=y). Also, wouldn't the msgq just run full with this change?

@dnltz
Copy link
Contributor Author

dnltz commented Jun 25, 2025

What is the issue with regard to scripting (i.e. pytest scripting) in that the message comes after the prompt? I have tests that depend on the message being printed (which are currently using CONFIG_CAN_SHELL_SCRIPTING_FRIENDLY=y). Also, wouldn't the msgq just run full with this change?

That's actually my problem. I'm using Labgrid with pytest to run CAN commands. My driver parses the console and reads something like:

uart:~$ can send ....
enqueuing CAN frame...
uart:~$ CAN frame X successfully sent

Do you have vt100 commands enabled in our setup?

BTW: I'm also fine with disabling this message in our downstream repo for testing purposes...

@henrikbrixandersen
Copy link
Member

That's actually my problem. I'm using Labgrid with pytest to run CAN commands. My driver parses the console and reads something like:

uart:$ can send ....
enqueuing CAN frame...
uart:
$ CAN frame X successfully sent
Do you have vt100 commands enabled in our setup?

You should be able to use a regex for matching this. See e.g. https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/can/host/pytest/can_shell.py where this is used (and which relies on the message, you are masking out, to appear).

@henrikbrixandersen
Copy link
Member

Please reopen for discussion if the solution described in #92162 (comment) does not work for you. The PR in it's current form cannot be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants