| 24 | } |
| 25 | |
| 26 | size_t Handler::process(char recvChar) |
| 27 | { |
| 28 | auto& output = getOutputStream(); |
| 29 | |
| 30 | using Action = LineBufferBase::Action; |
| 31 | switch(commandBuf.processKey(recvChar)) { |
| 32 | case Action::clear: |
| 33 | if(isVerbose()) { |
| 34 | output.println(); |
| 35 | output.print(getCommandPrompt()); |
| 36 | } |
| 37 | break; |
| 38 | case Action::submit: |
| 39 | if(isVerbose()) { |
| 40 | output.println(); |
| 41 | } |
| 42 | processCommandLine(String(commandBuf)); |
| 43 | commandBuf.clear(); |
| 44 | if(isVerbose()) { |
| 45 | outputStream->print(getCommandPrompt()); |
| 46 | } |
| 47 | break; |
| 48 | case Action::backspace: |
| 49 | if(isVerbose()) { |
| 50 | output.print("\b \b"); |
| 51 | } |
| 52 | break; |
| 53 | case Action::echo: |
| 54 | if(isVerbose()) { |
| 55 | output.print(recvChar); |
| 56 | } |
| 57 | break; |
| 58 | case Action::none: |
| 59 | break; |
| 60 | } |
| 61 | return 1; |
| 62 | } |
| 63 | |
| 64 | String Handler::processNow(const char* buffer, size_t size) |
| 65 | { |
no test coverage detected