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

[Telink] Add shell commands support #23796

Merged
merged 5 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ CONFIG_DYNAMIC_INTERRUPTS=y
# nvs_sector_size = flash_page_size * mult = 256 * 8 = 2048
CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=8

# Shall settings
# Shell settings
CONFIG_SHELL=n
CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255
18 changes: 18 additions & 0 deletions examples/lighting-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@

#include <algorithm>

#ifdef CONFIG_CHIP_LIB_SHELL
#include <zephyr/shell/shell.h>

static int cmd_telink_factoryreset(const struct shell * shell, size_t argc, char ** argv)
{
ARG_UNUSED(argc);
ARG_UNUSED(argv);

shell_print(shell, "Performing factoryreset ...");
chip::Server::GetInstance().ScheduleFactoryReset();
return 0;
}

SHELL_STATIC_SUBCMD_SET_CREATE(sub_demo, SHELL_CMD(factoryreset, NULL, "Reset NVS partition command.", cmd_telink_factoryreset),
SHELL_SUBCMD_SET_END);
SHELL_CMD_REGISTER(matter, &sub_demo, "Telink Matter commands", NULL);
#endif

LOG_MODULE_DECLARE(app);

using namespace ::chip;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/shell/MainLoopZephyr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <init.h>
#include <shell/shell.h>
#include <zephyr/init.h>
#include <zephyr/shell/shell.h>

#include <lib/core/CHIPError.h>
#include <lib/shell/Engine.h>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/shell/streamer_zephyr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include <cassert>

#include <shell/shell.h>
#include <shell/shell_uart.h>
#include <zephyr/shell/shell.h>
#include <zephyr/shell/shell_uart.h>

namespace chip {
namespace Shell {
Expand Down