extended uart com if

This commit is contained in:
2021-06-16 19:19:45 +02:00
parent c0287eb4a6
commit 78e996b2be
4 changed files with 144 additions and 62 deletions

View File

@ -56,6 +56,22 @@ public:
uint8_t getBitsPerWord() const;
StopBits getStopBits() const;
UartModes getUartMode() const;
/**
* The UART ComIF will only perform a specified number of read cycles for the canonical mode.
* The user can specify how many of those read cycles are performed for one device handler
* communication cycle. An example use-case would be to read all available GPS NMEA strings
* at once.
* @param readCycles
*/
void setReadCycles(uint8_t readCycles);
uint8_t getReadCycles() const;
/**
* Allows to flush the data which was received but has not been read yet. This is useful
* to discard obsolete data at software startup.
*/
void setToFlushInput(bool enable);
bool getInputShouldBeFlushed();
/**
* Functions two enable parity checking.
@ -78,10 +94,12 @@ private:
std::string deviceFile;
const UartModes uartMode;
bool flushInput = false;
uint32_t baudrate;
size_t maxReplyLen = 0;
Parity parity = Parity::NONE;
uint8_t bitsPerWord = 8;
uint8_t readCycles = 1;
StopBits stopBits = StopBits::ONE_STOP_BIT;
};