Skip to content

SerialPortAPI ​

cpp
#include <VAmiga.h>
cpp
class SerialPortAPI

Defined in VAmiga.h:1873

API of the serial port.

Public Methods ​

ReturnNameDescription
const SerialPortConfig &getConfig constReturns the component's current configuration.
const SerialPortInfo &getInfo constReturns the component's current state.
const SerialPortInfo &getCachedInfo constReturns the most recent state snapshot recorded by the emulator thread (see getInfo()).
intreadIncomingPrintableByte constReads a printable character from the serial port buffers.
intreadOutgoingPrintableByte constReads a character from the data the port has sent (see readIncomingPrintableByte()).

getConfig ​

const

cpp
const SerialPortConfig & getConfig() const

Defined in VAmiga.h:1883

Returns the component's current configuration.


getInfo ​

const

cpp
const SerialPortInfo & getInfo() const

Defined in VAmiga.h:1894

Returns the component's current state.

getInfo() reads the live state on the calling thread. The result is only consistent if the emulator is paused or suspended. getCachedInfo() returns the snapshot the emulator thread has recorded most recently, which is the one to use while the emulator runs. Both return references that can be overwritten by a later call or by the emulator thread, so copy the data if you need to keep it.


getCachedInfo ​

const

cpp
const SerialPortInfo & getCachedInfo() const

Defined in VAmiga.h:1896

Returns the most recent state snapshot recorded by the emulator thread (see getInfo()).


readIncomingPrintableByte ​

const

cpp
int readIncomingPrintableByte() const

Defined in VAmiga.h:1907

Reads a printable character from the serial port buffers.

readIncomingPrintableByte() reads from the data the port has received, readOutgoingPrintableByte() from the data it has sent. The byte is removed from the buffer. Characters that are neither printable nor a line feed are skipped.

Returns ​

The character, or -1 if the buffer is empty.


readOutgoingPrintableByte ​

const

cpp
int readOutgoingPrintableByte() const

Defined in VAmiga.h:1909

Reads a character from the data the port has sent (see readIncomingPrintableByte()).