Dokit
Internal development documentation
Loading...
Searching...
No Matches
PokitDiscoveryAgentPrivate Class Reference

The PokitDiscoveryAgentPrivate class provides private implementation for PokitDiscoveryAgent. More...

Inheritance diagram for PokitDiscoveryAgentPrivate:
[legend]
Collaboration diagram for PokitDiscoveryAgentPrivate:
[legend]

Public Slots

void canceled () const
 Handle scan canceled signals, by simply logging the event for diagnostic purposes.
 
void deviceDiscovered (const QBluetoothDeviceInfo &info)
 Handle deviceDiscovered signals.
 
void deviceUpdated (const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields)
 Handle deviceUpdated signals.
 
void error (const QBluetoothDeviceDiscoveryAgent::Error error) const
 Handle scan errors, by simply logging error for diagnostic purposes.
 
void finished () const
 Handle scan finished signals, by simply logging the event for diagnostic purposes.
 

Public Member Functions

 PokitDiscoveryAgentPrivate (PokitDiscoveryAgent *const q)
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThreadthread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

Static Public Member Functions

static Q_LOGGING_CATEGORY (lc, "pokit.ble.discovery", QtInfoMsg)
 Logging category.
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 

Protected Attributes

PokitDiscoveryAgentq_ptr
 Internal q-pointer.
 

Friends

class TestPokitDiscoveryAgent
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The PokitDiscoveryAgentPrivate class provides private implementation for PokitDiscoveryAgent.

Definition at line 22 of file pokitdiscoveryagent_p.h.

Constructor & Destructor Documentation

◆ PokitDiscoveryAgentPrivate()

PokitDiscoveryAgentPrivate::PokitDiscoveryAgentPrivate ( PokitDiscoveryAgent *const q)
explicit

Constructs a new PokitDiscoveryAgentPrivate object with public implementation q.

Definition at line 129 of file pokitdiscoveryagent.cpp.

130 : q_ptr(q)
131{
134
137
138 #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) // Signal added in Qt 5.12.
141 #endif
142
143 connect(q,
144 #if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0))
145 QOverload<PokitDiscoveryAgent::Error>::of(&PokitDiscoveryAgent::error),
146 #else
147 &QBluetoothDeviceDiscoveryAgent::errorOccurred,
148 #endif
150
153}
void canceled() const
Handle scan canceled signals, by simply logging the event for diagnostic purposes.
PokitDiscoveryAgent * q_ptr
Internal q-pointer.
void finished() const
Handle scan finished signals, by simply logging the event for diagnostic purposes.
void error(const QBluetoothDeviceDiscoveryAgent::Error error) const
Handle scan errors, by simply logging error for diagnostic purposes.
void deviceDiscovered(const QBluetoothDeviceInfo &info)
Handle deviceDiscovered signals.
void deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields)
Handle deviceUpdated signals.
void deviceDiscovered(const QBluetoothDeviceInfo &info)
void deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields)
QBluetoothDeviceDiscoveryAgent::Error error() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)

References QBluetoothDeviceDiscoveryAgent::canceled(), canceled(), QObject::connect(), deviceDiscovered(), QBluetoothDeviceDiscoveryAgent::deviceDiscovered(), deviceUpdated(), QBluetoothDeviceDiscoveryAgent::deviceUpdated(), QBluetoothDeviceDiscoveryAgent::error(), error(), QBluetoothDeviceDiscoveryAgent::finished(), and finished().

Here is the call graph for this function:

Member Function Documentation

◆ canceled

void PokitDiscoveryAgentPrivate::canceled ( ) const
slot

Handle scan canceled signals, by simply logging the event for diagnostic purposes.

Definition at line 158 of file pokitdiscoveryagent.cpp.

159{
160 qCDebug(lc).noquote() << tr("Pokit device scan cancelled.");
161}
QString tr(const char *sourceText, const char *disambiguation, int n)

References QObject::tr().

Referenced by PokitDiscoveryAgentPrivate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deviceDiscovered

void PokitDiscoveryAgentPrivate::deviceDiscovered ( const QBluetoothDeviceInfo & info)
slot

Handle deviceDiscovered signals.

Here we simply check if info describes a Pokit device, and if so, emit pokitDeviceDiscovered().

Definition at line 168 of file pokitdiscoveryagent.cpp.

169{
171 if (!isPokitProduct(info)) return;
172 qCDebug(lc).noquote() << tr(R"(Discovered Pokit device "%1" at %2.)")
173 .arg(info.name(), info.address().toString());
174 Q_EMIT q->pokitDeviceDiscovered(info);
175}
The PokitDiscoveryAgent class discovers nearby Pokit devices.
QTPOKIT_EXPORT bool isPokitProduct(const QBluetoothDeviceInfo &info)
Returns true if info describes a Pokit device.
QString toString() const const
QBluetoothAddress address() const const
QString name() const const
Q_EMITQ_EMIT
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const

References QBluetoothDeviceInfo::address(), QString::arg(), isPokitProduct(), QBluetoothDeviceInfo::name(), QObject::Q_EMIT(), QBluetoothAddress::toString(), and QObject::tr().

Referenced by PokitDiscoveryAgentPrivate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deviceUpdated

void PokitDiscoveryAgentPrivate::deviceUpdated ( const QBluetoothDeviceInfo & info,
QBluetoothDeviceInfo::Fields updatedFields )
slot

Handle deviceUpdated signals.

Here we simply check if info describes a Pokit device, and if so, emit pokitDeviceUpdated().

Since
Qt 5.12.0

Definition at line 185 of file pokitdiscoveryagent.cpp.

187{
189 if (!isPokitProduct(info)) return;
190 qCDebug(lc).noquote() << tr(R"(Pokit device "%1" at %2 updated with RSSI %3.)")
191 .arg(info.name(), info.address().toString()).arg(info.rssi());
192 Q_EMIT q->pokitDeviceUpdated(info, updatedFields);
193}
qint16 rssi() const const

References QBluetoothDeviceInfo::address(), QString::arg(), isPokitProduct(), QBluetoothDeviceInfo::name(), QObject::Q_EMIT(), QBluetoothDeviceInfo::rssi(), QBluetoothAddress::toString(), and QObject::tr().

Referenced by PokitDiscoveryAgentPrivate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ error

void PokitDiscoveryAgentPrivate::error ( const QBluetoothDeviceDiscoveryAgent::Error error) const
slot

Handle scan errors, by simply logging error for diagnostic purposes.

Definition at line 199 of file pokitdiscoveryagent.cpp.

200{
201 qCWarning(lc).noquote() << tr("Pokit device scan error:") << error;
202}

References error(), and QObject::tr().

Referenced by error(), and PokitDiscoveryAgentPrivate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finished

void PokitDiscoveryAgentPrivate::finished ( ) const
slot

Handle scan finished signals, by simply logging the event for diagnostic purposes.

Definition at line 207 of file pokitdiscoveryagent.cpp.

208{
209 qCDebug(lc).noquote() << tr("Pokit device scan finished.");
210}

References QObject::tr().

Referenced by PokitDiscoveryAgentPrivate().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ TestPokitDiscoveryAgent

friend class TestPokitDiscoveryAgent
friend

Definition at line 46 of file pokitdiscoveryagent_p.h.

Member Data Documentation

◆ q_ptr

PokitDiscoveryAgent* PokitDiscoveryAgentPrivate::q_ptr
protected

Internal q-pointer.

Definition at line 41 of file pokitdiscoveryagent_p.h.


The documentation for this class was generated from the following files: