29#ifndef __LOGREADERPORT_H
30#define __LOGREADERPORT_H
93 ssize_t
Read (
void *
const buffer,
size_t count);
95 ssize_t
ReadFull (
void *
const buffer,
size_t count);
101 ssize_t
Write (
const void *
const buffer,
size_t count);
119 std::string _logFileName;
120 unsigned int _strictness;
125 bool ProcessOption (
const std::string &option,
const std::string &value);
126 void CheckPort (
bool read);
Simulated port using a log file.
void Drain()
Drain the port's input and output buffers.
ssize_t Read(void *const buffer, size_t count)
Read from the port.
ssize_t ReadFull(void *const buffer, size_t count)
Read the requested quantity of data from the port.
ssize_t BytesAvailableWait()
Get the number of bytes waiting after blocking for the timeout.
void SetCanRead(bool canRead)
Set the read permissions of the port.
ssize_t BytesAvailable()
Get the number of bytes waiting to be read at the port. Returns immediatly.
LogReaderPort(std::map< std::string, std::string > options)
std::string GetStatus() const
Get the status of the port (type, device, etc).
ssize_t Write(const void *const buffer, size_t count)
Write data to the port.
void Open()
Open the port.
bool IsOpen() const
Check if the port is open.
void Close()
Close the port.
void Flush()
Flush the port's input and output buffers, discarding all data.
void SetTimeout(Timeout timeout)
Set the timeout value in milliseconds.
void SetCanWrite(bool canWrite)
Set the write permissions of the port.
An object used to represent timeouts.