shell: remove unused function shell_command_add

This function is not used at all.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2020-12-07 16:04:25 +01:00 committed by Carles Cufí
commit 0738e1f04d
2 changed files with 0 additions and 30 deletions

View file

@ -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)
{

View file

@ -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);