Skip to content

Commit

Permalink
bluetooth: shell: refactor shell print for Bluetooth-specific context
Browse files Browse the repository at this point in the history
This commit aims to reduce the Bluetooth shell code footprint with
the following changes:
- Introduced `bt_shell_private.c` and `bt_shell_private.h` to provide
  common functions for the Bluetooth shell.
- For now, equivalent function to `shell_info`, `shell_print`,
  `shell_warn ` and `shell_error`, but without `sh` as Bluetooth shell
  relies on `ctx_shell` when there is no `sh` from outside.

The cost of newly added `bt_shell_info_impl` ... `bt_shell_error_impl`
will be insignificant if we have many individual calls that need to
pass both `sh` and `color` parameter each time.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
  • Loading branch information
ndrs-pst committed Jun 21, 2024
1 parent e1c51f9 commit 1f6268c
Show file tree
Hide file tree
Showing 4 changed files with 560 additions and 441 deletions.
1 change: 1 addition & 0 deletions subsys/bluetooth/shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
zephyr_library()
zephyr_library_sources(
bt.c
bt_shell_private.c
hci.c
)
zephyr_library_sources_ifdef(
Expand Down
Loading

0 comments on commit 1f6268c

Please sign in to comment.