File indexing completed on 2024-04-28 03:52:07

0001 /*
0002  * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <mincequi@web.de>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef LESERVER_H
0008 #define LESERVER_H
0009 
0010 #include <QObject>
0011 #include <QTimer>
0012 
0013 #include "gattcharacteristic.h"
0014 #include "types.h"
0015 
0016 namespace BluezQt
0017 {
0018 class PendingCall;
0019 }
0020 
0021 class LeServer : public QObject
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit LeServer(BluezQt::Manager *manager, QObject *parent = nullptr);
0027 
0028 private:
0029     void onCallFinished(BluezQt::PendingCall *call);
0030 
0031     BluezQt::Manager *m_manager;
0032     BluezQt::GattCharacteristic *m_notifyingCharacteristic = nullptr;
0033 
0034     QTimer m_characteristicWriteTimer; // < Used to write to characteristic with 'notify' flag set.
0035 };
0036 
0037 #endif