23#include <QBluetoothDeviceInfo>
26#if __has_include (<QSerialPortInfo>)
27#include <QSerialPortInfo>
30using namespace Qt::Literals::StringLiterals;
43 QML_VALUE_TYPE(connectionInfo)
45 friend QDataStream& operator<<(QDataStream& stream, const Traffic::
ConnectionInfo &connectionInfo);
46 friend QDataStream& operator>>(QDataStream& stream, Traffic::
ConnectionInfo& connectionInfo);
80#if __has_include (<QSerialPortInfo>)
183 [[nodiscard]]
bool canConnect()
const {
return m_canConnect; }
190 [[nodiscard]]
bool canonical()
const {
return m_canonical; }
197 [[nodiscard]] QString
description()
const {
return m_description; }
204 [[nodiscard]] QString
name()
const {
return m_name; }
211 [[nodiscard]] QString
icon()
const {
return m_icon; }
251 [[nodiscard]] quint16
port()
const {
return m_port; }
284 bool m_canConnect {
false };
285 bool m_canonical {
false };
286 QString m_description;
287 QString m_icon{u
"/icons/material/ic_delete.svg"_s};
288 QString m_name { QObject::tr(
"Invalid Device",
"Traffic::ConnectionInfo") };
294 QBluetoothDeviceInfo m_bluetoothDeviceInfo;
304QDataStream& operator<<(QDataStream& stream,
const Traffic::ConnectionInfo &connectionInfo);
311QDataStream& operator>>(QDataStream& stream, Traffic::ConnectionInfo& connectionInfo);
Connection to a traffic data receiver.
bool operator==(const Traffic::ConnectionInfo &other) const =default
Equality of ConnectionInfos.
Traffic::ConnectionInfo::Type type() const
Getter function for the property with the same name.
Traffic::ConnectionInfo::Type type
Type.
quint16 port() const
Port.
bool canonical() const
Getter function for the property with the same name.
QString name() const
Getter function for the property with the same name.
bool canonical
Canonicity.
ConnectionInfo()=default
Default constructor.
QString description() const
Getter function for the property with the same name.
bool sameConnectionAs(const Traffic::ConnectionInfo &other) const
Equality of connection.
QString icon() const
Getter function for the property with the same name.
QBluetoothDeviceInfo bluetoothDeviceInfo() const
Bluetooth Device Info.
bool canConnect
Connectability.
ConnectionInfo(quint16 port, bool canonical=false)
Constructor for UDP Connections.
bool operator<(const Traffic::ConnectionInfo &other) const
Comparison.
ConnectionInfo(const QString &host, quint16 port, bool canonical=false)
Constructor for TCP Connections.
QString description
Description.