INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
flexiport::Port Class ReferenceBase Port class. More...
Inherited by flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, flexiport::UDPPort, and PortWrap.
Detailed DescriptionBase Port class.This provides the base object from which specific port type implementations inherit. All functions may throw exceptions of type PortException.
Member Function Documentation
Get the number of bytes waiting to be read at the port. Returns immediatly.
Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::BytesAvailable().
Get the number of bytes waiting after blocking for the timeout. Unlike BytesAvailable, this function will wait for the timeout to occur if no data is available straight away.
Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::BytesAvailableWait(), and ReadString().
Drain the port's output buffers. Waits until timeout for the port to finish transmitting data in its output buffer. Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::Drain().
Read from the port. Reads up to count bytes from the port into buffer. The exact behaviour of this function depends on the value of _timeout.
Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::Read(), ReadString(), ReadStringUntil(), ReadUntil(), Skip(), and SkipUntil().
Read the requested quantity of data from the port. Reads count bytes from the port into buffer. Similar to Read, but with the important difference that, rather than returning as soon as any data is received, it will continue trying to receive data until buffer is full or an error occurs. This function ignores the timeout setting and blocks anyway.
Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::ReadFull().
Read a new-line terminated string of data. A convenience function that reads until a newline character (\n, 0x0A) is received and stores the received data in a string, . Good for text-based protocols that use newlines as message terminators.
Read a new-line terminated string of data. A convenience function that reads until a newline character (\n, 0x0A) is received and stores the received data in a caller-provided buffer, buffer. Good for text-based protocols that use newlines as message terminators. Will not read more than count bytes. buffer should include space for a NULL byte. count should reflect this. e.g. if you are expecting to receive a string "abcd\n", you should send a buffer that is 6 bytes long and make count = 6. This function will take into account the need for a NULL terminator when it receives data, receiving at most one less than count bytes. This NULL byte will not be included in the length of the received string returned from this function (just like strlen ()).
References ReadUntil().
Read a string. A convenience function that reads data from the port and returns it in a string. Behaves the same as Read.
References BytesAvailableWait(), and Read().
Read a string until the specified termination character is received. A convenience function that is similar to ReadUntil. The result is stored in a string. The terminator character is included in the returned string. Good for text-based protocols with a known message termination character.
Reimplemented in flexiport::UDPPort. References IsBlocking(), and Read().
Read data until a specified termination byte is received. Reads up to count bytes from the port into buffer, stopping when a byte matching terminator is received (included in the returned data). Otherwise behaves the same as Read.
Reimplemented in flexiport::UDPPort. References IsBlocking(), and Read(). Referenced by ReadLine().
Set the timeout value. Set seconds to -1 to disable timeouts and block forever.
Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::SetTimeout().
Dump data until the specified number of bytes have been read.
Reimplemented in flexiport::LogWriterPort, and flexiport::UDPPort. References IsBlocking(), and Read().
Read and dump data until the specified termination character has been seen count times.
Reimplemented in flexiport::LogWriterPort, and flexiport::UDPPort. References IsBlocking(), and Read().
Write data to the port. Simply writes count bytes of data from buffer to the port. If the port is blocking, this will block until it can write more when the port's output buffer is full, or until a timeout occurs. The buffer may become full during the write, in which case less than count bytes may be written.
Implemented in flexiport::LogReaderPort, flexiport::LogWriterPort, flexiport::SerialPort, flexiport::TCPPort, and flexiport::UDPPort. Referenced by flexiport::LogWriterPort::Write(), WriteFull(), and WriteString().
Write a string to the port. A convenience function that writes a null-terminated string to the port. Behaves identically to Write. The NULL-terminator is *not* written to the port. If you want one, use write to send the whole string, or use this function followed by a call to write to write the NULL terminator.
References Write().
The documentation for this class was generated from the following files:
|