Generic FSM based UART CLI parser