#ifndef VBLUETOOTH_H #define VBLUETOOTH_H // Qt #include #include // Project #include "VBluetoothDeviceInfo.h" #include "guicontroller.h" using namespace Gui; // forward diclations class tst_views; namespace View { class VBluetooth : public QObject { Q_OBJECT public: explicit VBluetooth(QObject *parent = nullptr); protected: Q_PROPERTY(QVariant devices READ getDevices NOTIFY devicesChanged) Q_PROPERTY(QVariant status READ getStatus NOTIFY statusChanged) public slots: void onScanForDevices(); QVariant getDevices(); void onSelectedDevice(const QString &addr); signals: void devicesChanged(); void selectedDevice(const QString &addr); void scanFinished(); void statusChanged(); private: QList bleDevices; QString status; QString getStatus() { return status; } private slots: void onScanForDevicesError(QBluetoothDeviceDiscoveryAgent::Error error); void onScanForDevicesFinished(); void onDeviceDiscovered(const QBluetoothDeviceInfo &device); }; } #endif // VBLUETOOTH_H