2020-10-08 20:01:21 +02:00
|
|
|
#ifndef DEVICEINFO_H
|
|
|
|
#define DEVICEINFO_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QObject>
|
|
|
|
#include <qbluetoothdeviceinfo.h>
|
|
|
|
#include <qbluetoothaddress.h>
|
|
|
|
#include <qbluetoothuuid.h>
|
|
|
|
|
2020-10-09 12:06:33 +02:00
|
|
|
/*!
|
|
|
|
* \brief The QBluetoothLeUartDevice class is a helper class for use with QBluetoothLeUart.
|
|
|
|
* It is used to get device details and connect to devices
|
|
|
|
*/
|
2020-10-08 20:01:21 +02:00
|
|
|
class QBluetoothLeUartDevice: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString name READ getName NOTIFY deviceChanged)
|
|
|
|
Q_PROPERTY(QString address READ getAddress NOTIFY deviceChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
QBluetoothLeUartDevice(QBluetoothDeviceInfo device, QObject *parent = nullptr);
|
|
|
|
|
|
|
|
friend class QBluetoothLeUart;
|
|
|
|
|
2020-10-09 12:06:33 +02:00
|
|
|
/*!
|
|
|
|
* \brief Function to get the name of the device
|
|
|
|
* \return The name of the device
|
|
|
|
*/
|
2020-10-09 00:03:51 +02:00
|
|
|
Q_INVOKABLE QString getName();
|
2020-10-09 12:06:33 +02:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Function to get the address of the device
|
|
|
|
* \return address of the device
|
|
|
|
*/
|
2020-10-09 00:03:51 +02:00
|
|
|
Q_INVOKABLE QString getAddress();
|
2020-10-08 20:01:21 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
QBluetoothDeviceInfo getDevice();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void setDevice(QBluetoothDeviceInfo device);
|
|
|
|
QBluetoothDeviceInfo bluetoothDeviceInfo;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void deviceChanged();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DEVICEINFO_H
|