29#ifndef __LOGWRITERPORT_H
30#define __LOGWRITERPORT_H
83 ssize_t
Read (
void *
const buffer,
size_t count);
85 ssize_t
ReadFull (
void *
const buffer,
size_t count);
87 ssize_t
Skip (
size_t count);
90 ssize_t
SkipUntil (uint8_t terminator,
unsigned int count);
96 ssize_t
Write (
const void *
const buffer,
size_t count);
115 std::string _logFileName;
117 void CheckPort (
bool read);
Logging implementation of the Port class.
void Open()
Open the port.
void SetTimeout(Timeout timeout)
Set the timeout value in milliseconds.
std::string GetStatus() const
Get the status of the port (type, device, etc).
void SetCanRead(bool canRead)
Set the read permissions of the port.
void Drain()
Drain the port's input and output buffers.
bool IsOpen() const
Check if the port is open.
void Flush()
Flush the port's input and output buffers, discarding all data.
ssize_t BytesAvailable()
Get the number of bytes waiting to be read at the port. Returns immediatly.
void Close()
Close the port.
ssize_t BytesAvailableWait()
Get the number of bytes waiting after blocking for the timeout.
ssize_t Read(void *const buffer, size_t count)
Read from the port.
ssize_t SkipUntil(uint8_t terminator, unsigned int count)
Read and dump data until the specified termination character has been seen count times.
ssize_t Write(const void *const buffer, size_t count)
Write data to the port.
void SetCanWrite(bool canWrite)
Set the write permissions of the port.
ssize_t ReadFull(void *const buffer, size_t count)
Read the requested quantity of data from the port.
ssize_t Skip(size_t count)
Dump data until the specified number of bytes have been read.
LogWriterPort(std::map< std::string, std::string > options)
An object used to represent timeouts.