Skip to content

Commit

Permalink
Remove shell cmd_ping/cmd_send that were obsolete (#19987)
Browse files Browse the repository at this point in the history
* Remove shell cmd_ping/cmd_send that were obsolete

- Both cmd_send and cmd_ping used pre-spec internal test-level
  APIs which have grown stale and no longer function. They showed API
  usage that was both incorrect and dangerous. They are were also
  no longer used.

Fixes #19889
Fixes #6293

This PR removes these stale commands, which already had become
empty in a prior PR since the way they used FabricTable was
also incorrect (and this had been corrected at the time).

Testing done:
- Unit tests still pass
- Integration tests still pass

* Remove more unused commands
  • Loading branch information
tcarmelveilleux authored and pull[bot] committed Jan 23, 2024
1 parent 8b5bf53 commit 2384760
Show file tree
Hide file tree
Showing 21 changed files with 2 additions and 92 deletions.
2 changes: 0 additions & 2 deletions examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,6 @@ void ShellCLIMain(void * pvParameter)

cmd_misc_init();
// cmd_otcli_init();
// cmd_ping_init();
// cmd_send_init();

ChipLogDetail(Shell, "Run CHIP shell Task: %d", rc);
PRINTF("call mcuInitPower() \r\n");
Expand Down
2 changes: 0 additions & 2 deletions examples/chef/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ static void chip_shell_task(void * args)
{

cmd_misc_init();
cmd_ping_init();
cmd_send_init();

Engine::Root().RunMainLoop();
}
Expand Down
2 changes: 0 additions & 2 deletions examples/chef/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ int main(int argc, char * argv[])

cmd_misc_init();
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();
#if CHIP_SHELL_ENABLE_CMD_SERVER
cmd_app_server_init();
#endif
Expand Down
2 changes: 0 additions & 2 deletions examples/chef/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ if (CONFIG_ENABLE_CHIP_SHELL)
${CHEF}/shell_common/globals.cpp
${CHEF}/shell_common/cmd_misc.cpp
${CHEF}/shell_common/cmd_otcli.cpp
${CHEF}/shell_common/cmd_ping.cpp
${CHEF}/shell_common/cmd_send.cpp
)

target_include_directories(app PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions examples/chef/nrfconnect/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ CHIP_ERROR main()

cmd_misc_init();
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();
#endif

#if CHIP_SHELL_ENABLE_CMD_SERVER
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/cyw30739/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ APPLICATION_START()
{
printf("ERROR Shell Init %d\n", ret);
}
cmd_ping_init();
RegisterAppShellCommands();
Engine::Root().RunMainLoop();

Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/cyw30739/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ APPLICATION_START()
{
printf("ERROR Shell Init %d\n", ret);
}
cmd_ping_init();
RegisterAppShellCommands();
Engine::Root().RunMainLoop();

Expand Down
1 change: 0 additions & 1 deletion examples/ota-requestor-app/cyw30739/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ APPLICATION_START()
{
printf("ERROR Shell Init %d\n", ret);
}
cmd_ping_init();
Engine::Root().RunMainLoop();

assert(!wiced_rtos_check_for_stack_overflow());
Expand Down
2 changes: 0 additions & 2 deletions examples/platform/efr32/matter_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ void startShellTask()
// TODO move at least OTCLI to default commands in lib/shell/commands
cmd_misc_init();
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();

shellTaskHandle = xTaskCreateStatic(MatterShellTask, "matter_cli", ArraySize(shellStack), NULL, SHELL_TASK_PRIORITY, shellStack,
&shellTaskStruct);
Expand Down
10 changes: 0 additions & 10 deletions examples/platform/qpg/shell_common/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ StaticTask_t shellTaskStruct;

ShellTask ShellTask::sShellTask;

/* required by cmd_send.cpp:ProcessCommand */
extern "C" unsigned int sleep(unsigned int seconds)
{
const TickType_t xDelay = 1000 * seconds / portTICK_PERIOD_MS;
vTaskDelay(xDelay);
return 0;
}

// using namespace ::chip;

int ShellTask::Init(void)
Expand All @@ -60,8 +52,6 @@ int ShellTask::Init(void)

cmd_misc_init();
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();
#if CHIP_SHELL_ENABLE_CMD_SERVER
cmd_app_server_init();
#endif // CHIP_SHELL_ENABLE_CMD_SERVER
Expand Down
2 changes: 0 additions & 2 deletions examples/shell/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ set(CHIP_SHELL_DIR "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/she

idf_component_register(SRCS main.cpp
"${CHIP_SHELL_DIR}/shell_common/globals.cpp"
"${CHIP_SHELL_DIR}/shell_common/cmd_ping.cpp"
"${CHIP_SHELL_DIR}/shell_common/cmd_send.cpp"
PRIV_INCLUDE_DIRS
"${CHIP_SHELL_DIR}/shell_common/include"
PRIV_REQUIRES chip nvs_flash bt console esp32_mbedtls)
1 change: 0 additions & 1 deletion examples/shell/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ extern "C" void app_main(void)
int ret = Engine::Root().Init();
VerifyOrDie(ret == 0);

cmd_ping_init();
xTaskCreate(&chip_shell_task, "chip_shell", 2048, NULL, 5, NULL);
}
4 changes: 1 addition & 3 deletions examples/shell/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(APP_TYPE STREQUAL "boot" OR APP_TYPE STREQUAL "upgrade")
endif()

include(${MBED_PATH}/tools/cmake/app.cmake)
if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W" AND BOOT_ENABLED)
if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W" AND BOOT_ENABLED)
list(REMOVE_ITEM MBED_TARGET_LABELS CM0P_SLEEP)
list(REMOVE_ITEM MBED_TARGET_DEFINITIONS COMPONENT_CM0P_SLEEP=1)
endif()
Expand Down Expand Up @@ -57,8 +57,6 @@ target_sources(${APP_TARGET} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main/main.cpp
${SHELL_COMMON}/cmd_misc.cpp
${SHELL_COMMON}/cmd_otcli.cpp
${SHELL_COMMON}/cmd_ping.cpp
${SHELL_COMMON}/cmd_send.cpp
${SHELL_COMMON}/cmd_server.cpp
${SHELL_COMMON}/globals.cpp
${MBED_COMMON}/util/DFUManager.cpp
Expand Down
2 changes: 0 additions & 2 deletions examples/shell/mbed/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ int main()

cmd_misc_init();
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();
cmd_app_server_init();

ChipLogProgress(NotSpecified, "Mbed shell example application run");
Expand Down
4 changes: 1 addition & 3 deletions examples/shell/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ target_compile_options(app PRIVATE -Werror -Wno-error=maybe-uninitialized)

target_include_directories(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common
${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common
${APP_ROOT}/shell_common/include)

target_sources(app PRIVATE
${APP_ROOT}/shell_common/globals.cpp
${APP_ROOT}/shell_common/cmd_misc.cpp
${APP_ROOT}/shell_common/cmd_otcli.cpp
${APP_ROOT}/shell_common/cmd_ping.cpp
${APP_ROOT}/shell_common/cmd_send.cpp
${APP_ROOT}/standalone/main.cpp
)

Expand Down
2 changes: 0 additions & 2 deletions examples/shell/nxp/k32w/k32w0/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ extern "C" void main_task(void const * argument)
}

// cmd_otcli_init();
cmd_ping_init();
cmd_send_init();

shellTaskHandle = xTaskCreate(shell_task, "shell_task", shell_task_size / sizeof(StackType_t), NULL, shell_task_priority, NULL);
if (!shellTaskHandle)
Expand Down
2 changes: 0 additions & 2 deletions examples/shell/shell_common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ static_library("shell_common") {
sources = [
"cmd_misc.cpp",
"cmd_otcli.cpp",
"cmd_ping.cpp",
"cmd_send.cpp",
"globals.cpp",
]

Expand Down
24 changes: 0 additions & 24 deletions examples/shell/shell_common/cmd_ping.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions examples/shell/shell_common/cmd_send.cpp

This file was deleted.

2 changes: 0 additions & 2 deletions examples/shell/shell_common/include/ChipShellCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@
// A list of shell commands provided by ChipShell
void cmd_misc_init(void);
void cmd_otcli_init(void);
void cmd_ping_init(void);
void cmd_send_init(void);
void cmd_app_server_init(void);
2 changes: 0 additions & 2 deletions examples/shell/standalone/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ int main()

cmd_misc_init();
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();
#if CHIP_SHELL_ENABLE_CMD_SERVER
cmd_app_server_init();
#endif
Expand Down

0 comments on commit 2384760

Please sign in to comment.