mirror of
https://github.com/espressif/openthread.git
synced 2026-07-10 14:20:29 +00:00
Add simple command prompt '>'. (#117)
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
namespace Thread {
|
||||
namespace Cli {
|
||||
|
||||
static const char sCommandPrompt[] = {'>', ' '};
|
||||
static const char sEraseString[] = {'\b', ' ', '\b'};
|
||||
static const char CRNL[] = {'\r', '\n'};
|
||||
static Serial *sServer;
|
||||
@@ -93,14 +94,15 @@ void Serial::ReceiveTask(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
ProcessCommand();
|
||||
}
|
||||
|
||||
Output(sCommandPrompt, sizeof(sCommandPrompt));
|
||||
|
||||
break;
|
||||
|
||||
case '\b':
|
||||
case 127:
|
||||
Output(sEraseString, sizeof(sEraseString));
|
||||
|
||||
if (mRxLength > 0)
|
||||
{
|
||||
Output(sEraseString, sizeof(sEraseString));
|
||||
mRxBuffer[--mRxLength] = '\0';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user