/* Remove white chars from beginning and end of command buffer.  */
static void buffer_trim(char *buff, uint16_t *buff_len)
/* Remove white chars from beginning and end of command buffer.  */
static void buffer_trim(char *buff, uint16_t *buff_len)
{
	uint16_t i = 0U;
	if (buff[0] == '\0') {
		return;
	}
	while (isspace((int) buff[*buff_len - 1U]) != 0) {
		*buff_len -= 1U;
		if (*buff_len == 0U) {
			buff[0] = '\0';
			return;
		}
	}
	buff[*buff_len] = '\0';
	while (isspace((int) buff[i++]) != 0) {
	}
	if (--i > 0) {
		memmove(buff, buff + i, (*buff_len + 1U) - i);
		*buff_len = *buff_len - i;
	}
}