The Network class.
More...
#include <Serial.h>
The Network class.
Serial Studio "driver" class to interact with serial port devices.
◆ Serial() [1/3]
IO::DataSources::Serial::Serial |
( |
| ) |
|
|
explicitprivate |
◆ Serial() [2/3]
IO::DataSources::Serial::Serial |
( |
Serial && |
| ) |
|
|
privatedelete |
◆ Serial() [3/3]
IO::DataSources::Serial::Serial |
( |
const Serial & |
| ) |
|
|
privatedelete |
◆ ~Serial()
IO::DataSources::Serial::~Serial |
( |
| ) |
|
|
private |
Destructor function, closes the serial port before exiting the application and saves the user's baud rate list settings.
◆ appendBaudRate
void IO::DataSources::Serial::appendBaudRate |
( |
const QString & |
baudRate | ) |
|
|
slot |
Registers the new baud rate to the list
◆ autoReconnect()
bool IO::DataSources::Serial::autoReconnect |
( |
| ) |
const |
Returns true
if auto-reconnect is enabled
◆ autoReconnectChanged
void IO::DataSources::Serial::autoReconnectChanged |
( |
| ) |
|
|
signal |
◆ availablePortsChanged
void IO::DataSources::Serial::availablePortsChanged |
( |
| ) |
|
|
signal |
◆ baudRate()
qint32 IO::DataSources::Serial::baudRate |
( |
| ) |
const |
Returns the current baud rate configuration used by the serial port handler object.
◆ baudRateChanged
void IO::DataSources::Serial::baudRateChanged |
( |
| ) |
|
|
signal |
◆ baudRateIndexChanged
void IO::DataSources::Serial::baudRateIndexChanged |
( |
| ) |
|
|
signal |
◆ baudRateList()
StringList IO::DataSources::Serial::baudRateList |
( |
| ) |
const |
Returns a list with the available baud rate configurations. This function can be used with a combo-box to build UIs.
◆ baudRateListChanged
void IO::DataSources::Serial::baudRateListChanged |
( |
| ) |
|
|
signal |
◆ configurationOk()
bool IO::DataSources::Serial::configurationOk |
( |
| ) |
const |
Returns true
if the user selects the appropiate controls & options to be able to connect to a serial device
◆ connectionError
void IO::DataSources::Serial::connectionError |
( |
const QString & |
name | ) |
|
|
signal |
◆ dataBits()
QSerialPort::DataBits IO::DataSources::Serial::dataBits |
( |
| ) |
const |
Returns the current data bits configuration used by the serial port handler object.
◆ dataBitsChanged
void IO::DataSources::Serial::dataBitsChanged |
( |
| ) |
|
|
signal |
◆ dataBitsIndex()
quint8 IO::DataSources::Serial::dataBitsIndex |
( |
| ) |
const |
Returns the correspoding index of the data bits configuration in relation to the StringList
returned by the dataBitsList()
function.
◆ dataBitsList()
StringList IO::DataSources::Serial::dataBitsList |
( |
| ) |
const |
Returns a list with the available data bits configurations. This function can be used with a combo-box to build UIs.
◆ disconnectDevice
void IO::DataSources::Serial::disconnectDevice |
( |
| ) |
|
|
slot |
Disconnects from the current serial device and clears temp. data
◆ displayMode()
quint8 IO::DataSources::Serial::displayMode |
( |
| ) |
const |
◆ flowControl()
QSerialPort::FlowControl IO::DataSources::Serial::flowControl |
( |
| ) |
const |
Returns the current flow control configuration used by the serial port handler object.
◆ flowControlChanged
void IO::DataSources::Serial::flowControlChanged |
( |
| ) |
|
|
signal |
◆ flowControlIndex()
quint8 IO::DataSources::Serial::flowControlIndex |
( |
| ) |
const |
Returns the correspoding index of the flow control config. in relation to the StringList
returned by the flowControlList()
function.
◆ flowControlList()
StringList IO::DataSources::Serial::flowControlList |
( |
| ) |
const |
Returns a list with the available flow control configurations. This function can be used with a combo-box to build UIs.
◆ handleError
void IO::DataSources::Serial::handleError |
( |
QSerialPort::SerialPortError |
error | ) |
|
|
privateslot |
◆ instance()
Returns the only instance of the class
◆ openSerialPort()
QSerialPort * IO::DataSources::Serial::openSerialPort |
( |
| ) |
|
Tries to open the serial port with the current configuration
◆ operator=() [1/2]
Serial & IO::DataSources::Serial::operator= |
( |
const Serial & |
| ) |
|
|
privatedelete |
◆ operator=() [2/2]
◆ parity()
QSerialPort::Parity IO::DataSources::Serial::parity |
( |
| ) |
const |
Returns the current parity configuration used by the serial port handler object.
◆ parityChanged
void IO::DataSources::Serial::parityChanged |
( |
| ) |
|
|
signal |
◆ parityIndex()
quint8 IO::DataSources::Serial::parityIndex |
( |
| ) |
const |
Returns the correspoding index of the parity configuration in relation to the StringList
returned by the parityList()
function.
◆ parityList()
StringList IO::DataSources::Serial::parityList |
( |
| ) |
const |
Returns a list with the available parity configurations. This function can be used with a combo-box to build UIs.
◆ port()
QSerialPort * IO::DataSources::Serial::port |
( |
| ) |
const |
Returns the pointer to the current serial port handler
◆ portChanged
void IO::DataSources::Serial::portChanged |
( |
| ) |
|
|
signal |
◆ portIndex()
quint8 IO::DataSources::Serial::portIndex |
( |
| ) |
const |
Returns the index of the current serial device selected by the program.
◆ portIndexChanged
void IO::DataSources::Serial::portIndexChanged |
( |
| ) |
|
|
signal |
◆ portList()
StringList IO::DataSources::Serial::portList |
( |
| ) |
const |
Returns a list with the available serial devices/ports to use. This function can be used with a combo box to build nice UIs.
- Note
- The first item of the list will be invalid, since it's value will be "Select Serial Device". This is inteded to make the user interface a little more friendly.
◆ portName()
QString IO::DataSources::Serial::portName |
( |
| ) |
const |
Returns the name of the current serial port device
◆ readSettings
void IO::DataSources::Serial::readSettings |
( |
| ) |
|
|
privateslot |
Read saved settings (if any)
◆ refreshSerialDevices
void IO::DataSources::Serial::refreshSerialDevices |
( |
| ) |
|
|
privateslot |
Scans for new serial ports available & generates a StringList with current serial ports.
◆ setAutoReconnect
void IO::DataSources::Serial::setAutoReconnect |
( |
const bool |
autoreconnect | ) |
|
|
slot |
Enables or disables the auto-reconnect feature
◆ setBaudRate
void IO::DataSources::Serial::setBaudRate |
( |
const qint32 |
rate | ) |
|
|
slot |
Changes the baud rate of the serial port
◆ setDataBits
void IO::DataSources::Serial::setDataBits |
( |
const quint8 |
dataBitsIndex | ) |
|
|
slot |
Changes the data bits of the serial port.
- Note
- This function is meant to be used with a combobox in the QML interface
◆ setFlowControl
void IO::DataSources::Serial::setFlowControl |
( |
const quint8 |
flowControlIndex | ) |
|
|
slot |
Changes the flow control option of the serial port.
- Note
- This function is meant to be used with a combobox in the QML interface
◆ setParity
void IO::DataSources::Serial::setParity |
( |
const quint8 |
parityIndex | ) |
|
|
slot |
◆ setPortIndex
void IO::DataSources::Serial::setPortIndex |
( |
const quint8 |
portIndex | ) |
|
|
slot |
Changes the port index value, this value is later used by the openSerialPort()
function.
◆ setStopBits
void IO::DataSources::Serial::setStopBits |
( |
const quint8 |
stopBitsIndex | ) |
|
|
slot |
Changes the stop bits of the serial port.
- Note
- This function is meant to be used with a combobox in the QML interface
◆ stopBits()
QSerialPort::StopBits IO::DataSources::Serial::stopBits |
( |
| ) |
const |
Returns the current stop bits configuration used by the serial port handler object.
◆ stopBitsChanged
void IO::DataSources::Serial::stopBitsChanged |
( |
| ) |
|
|
signal |
◆ stopBitsIndex()
quint8 IO::DataSources::Serial::stopBitsIndex |
( |
| ) |
const |
Returns the correspoding index of the stop bits configuration in relation to the StringList
returned by the stopBitsList()
function.
◆ stopBitsList()
StringList IO::DataSources::Serial::stopBitsList |
( |
| ) |
const |
Returns a list with the available stop bits configurations. This function can be used with a combo-box to build UIs.
◆ validPorts()
QVector< QSerialPortInfo > IO::DataSources::Serial::validPorts |
( |
| ) |
const |
|
private |
Returns a list with all the valid serial port objects
◆ writeSettings
void IO::DataSources::Serial::writeSettings |
( |
| ) |
|
|
privateslot |
Save settings between application runs
◆ m_autoReconnect
bool IO::DataSources::Serial::m_autoReconnect |
|
private |
◆ m_baudRate
qint32 IO::DataSources::Serial::m_baudRate |
|
private |
◆ m_baudRateList
StringList IO::DataSources::Serial::m_baudRateList |
|
private |
◆ m_dataBits
QSerialPort::DataBits IO::DataSources::Serial::m_dataBits |
|
private |
◆ m_dataBitsIndex
quint8 IO::DataSources::Serial::m_dataBitsIndex |
|
private |
◆ m_flowControl
QSerialPort::FlowControl IO::DataSources::Serial::m_flowControl |
|
private |
◆ m_flowControlIndex
quint8 IO::DataSources::Serial::m_flowControlIndex |
|
private |
◆ m_lastSerialDeviceIndex
int IO::DataSources::Serial::m_lastSerialDeviceIndex |
|
private |
◆ m_parity
QSerialPort::Parity IO::DataSources::Serial::m_parity |
|
private |
◆ m_parityIndex
quint8 IO::DataSources::Serial::m_parityIndex |
|
private |
◆ m_port
QSerialPort* IO::DataSources::Serial::m_port |
|
private |
◆ m_portIndex
quint8 IO::DataSources::Serial::m_portIndex |
|
private |
◆ m_portList
◆ m_settings
QSettings IO::DataSources::Serial::m_settings |
|
private |
◆ m_stopBits
QSerialPort::StopBits IO::DataSources::Serial::m_stopBits |
|
private |
◆ m_stopBitsIndex
quint8 IO::DataSources::Serial::m_stopBitsIndex |
|
private |
◆ autoReconnect
bool IO::DataSources::Serial::autoReconnect |
|
readwrite |
◆ baudRate
qint32 IO::DataSources::Serial::baudRate |
|
readwrite |
◆ baudRateList
◆ dataBitsIndex
quint8 IO::DataSources::Serial::dataBitsIndex |
|
readwrite |
◆ dataBitsList
◆ flowControlIndex
quint8 IO::DataSources::Serial::flowControlIndex |
|
readwrite |
◆ flowControlList
StringList IO::DataSources::Serial::flowControlList |
|
read |
◆ parityIndex
quint8 IO::DataSources::Serial::parityIndex |
|
readwrite |
◆ parityList
◆ portIndex
quint8 IO::DataSources::Serial::portIndex |
|
readwrite |
◆ portList
◆ portName
QString IO::DataSources::Serial::portName |
|
read |
◆ stopBitsIndex
quint8 IO::DataSources::Serial::stopBitsIndex |
|
readwrite |
◆ stopBitsList
The documentation for this class was generated from the following files:
- /Users/alex/Documents/GitHub/Serial-Studio/src/IO/DataSources/Serial.h
- /Users/alex/Documents/GitHub/Serial-Studio/src/IO/DataSources/Serial.cpp