Skip to content
bluetoothmanagementwidget.h 1.34 KiB
Newer Older
#ifndef BLUETOOTHMANAGEMENTWIDGET_H
#define BLUETOOTHMANAGEMENTWIDGET_H

#include "serialmanagementwidget.h"
GigAnon's avatar
GigAnon committed

GigAnon's avatar
GigAnon committed
class QTableWidget;
class QLabel;
class BluetoothManagementWidget: public SerialManagementWidget
        BluetoothManagementWidget(BluetoothProxy *bluetoothProxy = nullptr, QWidget *parent = nullptr);
GigAnon's avatar
GigAnon committed
        QString getSelectedAddress() const;

GigAnon's avatar
GigAnon committed

        void checkBluetoothAvailability();
        void checkConnectionStatus();

        void deviceDiscovered(const QString& name, const QString& address);
        void on_connectButton_clicked();

        void changeUUID(const QString& uuid);

GigAnon's avatar
GigAnon committed
        // Find a device in the list by its address.
        // Returns -1 if none is found
        int findDeviceByAddress(const QString& address);

        // Qt::ItemDataRole index for device address
        // (allow for the stored data to be different from the display)
        const int ADDRESS_DATA_INDEX = (Qt::UserRole+10);
GigAnon's avatar
GigAnon committed
        QPushButton* m_checkBluetoothButton;
        QPushButton* m_connectButton;

        QLabel* m_bluetoothAvLabel;
        QLabel* m_connectionLabel;

GigAnon's avatar
GigAnon committed
        QTableWidget* m_detectedDevices;

        BluetoothProxy* m_bluetoothProxy;
};

#endif // BLUETOOTHMANAGEMENTWIDGET_H