![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This concrete template class provide a basic implementation of the Frame::Decoder interface that uses Cpl::Io::Input stream as the input source. More...
This concrete template class provide a basic implementation of the Frame::Decoder interface that uses Cpl::Io::Input stream as the input source.
In addition, this class only accepts ASCII characters within the the frame.
Template args: BUFSIZE Size of the internal buffer to use when reading raw characters from the Input stream.
#include <AsciiDecoder.h>
Public Member Functions | |
| AsciiDecoder (char startOfFrame, char endOfFrame, char escapeChar, bool restrict=true, Cpl::Io::Input *inputSource=0, bool blocking=true) | |
| Constructor. | |
Public Member Functions inherited from Cpl::Text::Frame::StreamDecoder | |
| void | setInput (Cpl::Io::Input &newInFd) noexcept |
| This method allows the Application/consumer to change/Set the Input Stream handle. | |
Public Member Functions inherited from Cpl::Text::Frame::Decoder_ | |
| Decoder_ (char rawInputBuffer[], size_t sizeOfRawInputBuffer) | |
| Constructor. | |
| bool | scan (size_t maxSizeOfFrame, char *frame, size_t &frameSize) noexcept |
| See Cpl::Text::Frame::Decoder. | |
| bool | scan (size_t maxSizeOfFrame, char *frame, size_t &frameSize, bool &isEof) noexcept |
| See Cpl::Text::Frame::Decoder. | |
| bool | oobRead (void *buffer, int numBytes, int &bytesRead) noexcept |
| See Cpl::Text::Frame::Decoder. | |
Public Member Functions inherited from Cpl::Text::Frame::Decoder | |
| virtual | ~Decoder () |
| Virtual Destructor. | |
Protected Member Functions | |
| bool | isStartOfFrame () noexcept |
| See Cpl::Text::Frame::Decoder_. | |
| bool | isEofOfFrame () noexcept |
| See Cpl::Text::Frame::Decoder_. | |
| bool | isEscapeChar () noexcept |
| See Cpl::Text::Frame::Decoder_. | |
| bool | isLegalCharacter () noexcept |
| See Cpl::Text::Frame::Decoder_. | |
Protected Member Functions inherited from Cpl::Text::Frame::StreamDecoder | |
| StreamDecoder (char rawInputBuffer[], size_t sizeOfRawInputBuffer, Cpl::Io::Input *inputSource=0, bool blocking=true) | |
| Constructor. | |
| bool | read (void *buffer, int numBytes, int &bytesRead) |
| See Cpl::Text::Frame::Decoder_. | |
Protected Member Functions inherited from Cpl::Text::Frame::Decoder_ | |
| virtual char | decodeEscapedChar (char escapedChar) |
| Returns the un-encoded value for the specified escaped character. | |
| virtual void | initializeFrame () noexcept |
| Helper method to initialize frame processing. | |
Protected Attributes | |
| const char | m_sof |
| SOF character. | |
| const char | m_eof |
| EOF character. | |
| const char | m_esc |
| Escape character. | |
| const bool | m_restricted |
| Remember printable ASCII characters ONLY option. | |
| char | m_buffer [BUFSIZE] |
| Raw input buffer for reading characters in 'chunks' from my Input stream (i.e. minimize the calls to read()) | |
Protected Attributes inherited from Cpl::Text::Frame::StreamDecoder | |
| Cpl::Io::Input *volatile | m_srcPtr |
| Input stream. | |
| bool | m_blocking |
| Block semantics. | |
Protected Attributes inherited from Cpl::Text::Frame::Decoder_ | |
| int | m_dataLen |
| Current number of characters remaining in my raw input buffer. | |
| char * | m_dataPtr |
| Pointer to the next unprocessed character in my raw input buffer. | |
| char * | m_buffer |
| Raw input buffer for reading characters in 'chunks' from my Input stream (i.e. minimize the calls to read()) | |
| size_t | m_bufSize |
| Size of my raw input buffer. | |
| bool | m_inFrame |
| Flag: I am currently in a Frame. | |
| bool | m_escaping |
| Flag: the next character is an escape character. | |
| char * | m_framePtr |
| Pointer to the next decoded frame character. | |
| size_t | m_frameSize |
| Number of bytes current decoded for the frame. | |
|
inline |
Constructor.
If 'restrict' is set to true ONLY printable ASCII characters (0x20-0x7E) are accepted inside a frame. If false, then all ASCII characters (0x00-0x7F) are accepted inside a frame. When a illegal character is detected, it causes the Decoder's state machine to reset and begin searching/looking-for the next start-of-frame character.
|
inlineprotectedvirtualnoexcept |
See Cpl::Text::Frame::Decoder_.
Implements Cpl::Text::Frame::Decoder_.
|
inlineprotectedvirtualnoexcept |
See Cpl::Text::Frame::Decoder_.
Implements Cpl::Text::Frame::Decoder_.
|
inlineprotectedvirtualnoexcept |
See Cpl::Text::Frame::Decoder_.
Implements Cpl::Text::Frame::Decoder_.
|
inlineprotectedvirtualnoexcept |
See Cpl::Text::Frame::Decoder_.
Implements Cpl::Text::Frame::Decoder_.
|
protected |
Raw input buffer for reading characters in 'chunks' from my Input stream (i.e. minimize the calls to read())
|
protected |
EOF character.
|
protected |
Escape character.
|
protected |
Remember printable ASCII characters ONLY option.
|
protected |
SOF character.