-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Shell autocreate shell instance #10511
Shell autocreate shell instance #10511
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10511 +/- ##
==========================================
+ Coverage 53.18% 53.34% +0.15%
==========================================
Files 210 210
Lines 25816 25816
Branches 5682 5682
==========================================
+ Hits 13731 13772 +41
+ Misses 9780 9733 -47
- Partials 2305 2311 +6
Continue to review full report at Codecov.
|
tests/bluetooth/shell/src/main.c
Outdated
@@ -26,17 +26,13 @@ | |||
|
|||
#include <gatt/hrs.h> | |||
|
|||
#define print(_sh, _ft, ...) \ | |||
#define print_sh(_sh, _ft, ...) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHy is this rename needed as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was affraid that print
and printk
are too similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's an issue. Can you remove that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this will block your approval I can do it ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well yes, because it's unrelated to this particular problem you are solving with the PR here
119e7a0
to
60cdad2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this support. I tested this with multiple networking related shells and things work now as expected.
print(&uart_shell, "Type \"help\" for supported commands."); | ||
print(&uart_shell, "Before any Bluetooth commands you must `bt init`" | ||
" to initialize the stack."); | ||
printk("Type \"help\" for supported commands."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this from print
to printk
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shell_fprintf must be used only in the scope of the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print
is a macro, in fact it is a function shell_fprintf
. This function shall not be used outside of command context what is a case here. I was trying to print this welcome message by Logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is more you do not have access to uart_shell any more because it is created in shell_uart.c file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that makes sense.
If user will enable shell than for each backend shell instance will be created automatically. Update all shell examples according to the new initialization procedure. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
User do not need to initialize shell instance manually now and this change has been reflected in the documentation. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
60cdad2
to
35a6eac
Compare
With this PR user will not have to bother creating shell backend. All that is required from the user is to enable particular shell backend in the Kconfig file. For each enabled backend shell instance will be created automatically.
Next step is to add console backend to the shell. Once this will be in place it will be enough to activate shell commands to start default shell instance: console.
Fixes #10480