LedDisplay/OmobiDisplayApp/omobidisplaybackend.h

34 lines
793 B
C
Raw Normal View History

2020-10-08 20:06:57 +02:00
#ifndef OMOBIDISPLAYBACKEND_H
#define OMOBIDISPLAYBACKEND_H
#include <QObject>
2020-10-08 22:03:30 +02:00
#include <qbluetoothleuart.h>
2020-10-08 20:06:57 +02:00
class OmobiDisplayBackend : public QObject
{
Q_OBJECT
2020-10-09 00:03:50 +02:00
Q_PROPERTY(QBluetoothLeUart* bleController READ getBleController NOTIFY bleControllerChanged)
2020-10-08 20:06:57 +02:00
public:
explicit OmobiDisplayBackend(QObject *parent = nullptr);
2020-10-09 00:03:50 +02:00
Q_INVOKABLE void startScanning();
2020-10-08 20:06:57 +02:00
private:
QBluetoothLeUart *ble;
2020-10-09 00:03:50 +02:00
public slots:
QBluetoothLeUart* getBleController();
2020-10-08 20:06:57 +02:00
private slots:
void handleBluetoothStateChange(QBluetoothLeUart::BluetoothLeUartState state);
2020-10-08 22:03:30 +02:00
void handleFoundNewDevice(QBluetoothLeUartDevice* device);
2020-10-08 20:06:57 +02:00
void DataHandler(const QString &s);
2020-10-09 00:03:50 +02:00
void handleBluetoothDeviceConected();
2020-10-08 20:06:57 +02:00
signals:
2020-10-09 00:03:50 +02:00
void bleControllerChanged();
2020-10-08 20:06:57 +02:00
};
#endif // OMOBIDISPLAYBACKEND_H