semf
arrowcontrol.h
Go to the documentation of this file.
1
10#ifndef SEMF_COMMUNICATION_ESH_ARROWCONTROL_H_
11#define SEMF_COMMUNICATION_ESH_ARROWCONTROL_H_
12
16
17namespace semf::esh
18{
23{
24public:
28 enum class ErrorCode : uint8_t
29 {
30 Start_IsBusy = 0,
31 OnSecondChar_UnexpectedChar,
32 OnThirdChar_UnexpectedChar,
33 };
40 ArrowControl(Printer& printer, const int& count, bool echo);
41 ArrowControl(const ArrowControl& other) = delete;
42 virtual ~ArrowControl() = default;
50 void start();
57
58private:
63 void onSecondChar(char c);
68 void onThirdChar(char c);
70 void onCleared();
71
73 Printer& m_printer;
75 const int& m_count;
77 const bool m_echo;
79 bool m_busy;
81 char m_c;
83 SEMF_SLOT(m_onSecondCharSlot, ArrowControl, *this, onSecondChar, char);
85 SEMF_SLOT(m_onThirdCharSlot, ArrowControl, *this, onThirdChar, char);
87 SEMF_SLOT(m_onCleared, ArrowControl, *this, onCleared);
89 static constexpr Error::ClassID kSemfClassId = Error::ClassID::ArrowControl;
90};
91
92} // namespace semf::esh
93#endif // SEMF_COMMUNICATION_ESH_ARROWCONTROL_H_
Class for representing errors. Every error should have a unique source code. As a user feel encourage...
Definition: error.h:22
ClassID
Semf class IDs.
Definition: error.h:28
Detect up-arrow and down-arrow key strokes via the Printer.
Definition: arrowcontrol.h:23
SEMF_SIGNAL(error, Error)
ArrowControl(const ArrowControl &other)=delete
void start()
Starts the reading process.
virtual ~ArrowControl()=default
ArrowControl(Printer &printer, const int &count, bool echo)
Constructor.
ErrorCode
Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring...
Definition: arrowcontrol.h:29
Class for string related UART communication. Using this class outside of an esh-context can make sens...
Definition: printer.h:25