diff --git a/subsys/shell/shell_utils.c b/subsys/shell/shell_utils.c index f6e2be2ead4..1464c0e0327 100644 --- a/subsys/shell/shell_utils.c +++ b/subsys/shell/shell_utils.c @@ -357,35 +357,8 @@ int shell_set_root_cmd(const char *cmd) return 0; } -int shell_command_add(char *buff, uint16_t *buff_len, - const char *new_cmd, const char *pattern) -{ - uint16_t cmd_len = shell_strlen(new_cmd); - char *cmd_source_addr; - uint16_t shift; - /* +1 for space */ - if ((*buff_len + cmd_len + 1) > CONFIG_SHELL_CMD_BUFF_SIZE) { - return -ENOMEM; - } - cmd_source_addr = strstr(buff, pattern); - - if (!cmd_source_addr) { - return -EINVAL; - } - - shift = shell_strlen(cmd_source_addr); - - /* make place for new command: + 1 for space + 1 for EOS */ - memmove(cmd_source_addr + cmd_len + 1, cmd_source_addr, shift + 1); - memcpy(cmd_source_addr, new_cmd, cmd_len); - cmd_source_addr[cmd_len] = ' '; - - *buff_len += cmd_len + 1; /* + 1 for space */ - - return 0; -} void shell_spaces_trim(char *str) { diff --git a/subsys/shell/shell_utils.h b/subsys/shell/shell_utils.h index f9c22150802..009f98bd519 100644 --- a/subsys/shell/shell_utils.h +++ b/subsys/shell/shell_utils.h @@ -77,9 +77,6 @@ const struct shell_static_entry *shell_get_last_command( struct shell_static_entry *dloc, bool only_static); -int shell_command_add(char *buff, uint16_t *buff_len, - const char *new_cmd, const char *pattern); - const struct shell_static_entry *shell_root_cmd_find(const char *syntax); void shell_spaces_trim(char *str);