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 Oct 4, 2024
1 parent 7773fe8 commit 45075db
Show file tree
Hide file tree
Showing 4 changed files with 562 additions and 444 deletions.
5 changes: 4 additions & 1 deletion subsys/bluetooth/host/shell/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources(bt.c)
zephyr_library_sources(
bt.c
bt_shell_private.c
)
zephyr_library_sources_ifdef(CONFIG_BT_CONN gatt.c)
zephyr_library_sources_ifdef(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL l2cap.c)
zephyr_library_sources_ifdef(CONFIG_BT_ISO iso.c)
Expand Down
Loading

0 comments on commit 45075db

Please sign in to comment.