MCPcopy Create free account
hub / github.com/SmingHub/Sming / process

Method process

Sming/Libraries/CommandProcessing/src/CommandProcessing/Handler.cpp:26–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26size_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
64String Handler::processNow(const char* buffer, size_t size)
65{

Callers 2

processTelnetInputFunction · 0.45
enableFunction · 0.45

Calls 5

processKeyMethod · 0.80
printlnMethod · 0.80
StringClass · 0.50
printMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected