#ifndef VBLUETOOTHDEVICEINFO_H #define VBLUETOOTHDEVICEINFO_H // Qt #include #include #include // Project // forward declarations class tst_views; namespace View { /*! * \brief The VBluetoothDeviceInfo class * Exposes the name, address, and connection status of a specific bluetooth device * \details Allows convient access to the name, address, and connection status of a bluetooth device. Allows such data to be * extracted from the QBluetoothDeviceInfo class so that it can be accessed and displayed easily in qml for each BLE device. * */ class VBluetoothDeviceInfo: public QObject { Q_OBJECT // friends friend class::tst_views; Q_PROPERTY(QString name READ getName NOTIFY deviceChanged) Q_PROPERTY(QString address READ getAddress NOTIFY deviceChanged) Q_PROPERTY(bool connected READ isConnected NOTIFY deviceChanged) public: explicit VBluetoothDeviceInfo(const QBluetoothDeviceInfo &device); VBluetoothDeviceInfo(const QString &address, const QString &name); QString getName() const; QString getAddress() const; bool isConnected() const; void setConnected(const bool &conn); bool isValid() const; signals: void deviceChanged(); private: bool operator==(const VBluetoothDeviceInfo &d1) { if (getAddress() != d1.getAddress()) return false; return true; } QString _address; QString _name; bool _connected; }; } #endif // VBLUETOOTHDEVICEINFO_H