File indexing completed on 2024-07-14 03:50:59

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Ivan Podkurkov <podkiva2@gmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef GATTCHARACTERISTICREMOTETEST_H
0008 #define GATTCHARACTERISTICREMOTETEST_H
0009 
0010 #include <QList>
0011 #include <QObject>
0012 
0013 #include "bluezgattcharacteristic1_tst.h"
0014 #include "dbusproperties_tst.h"
0015 
0016 #include "gattserviceremote.h"
0017 #include "gattcharacteristicremote.h"
0018 #include "manager.h"
0019 
0020 class GattCharacteristicRemoteTest : public QObject
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit GattCharacteristicRemoteTest();
0026 
0027 private Q_SLOTS:
0028     void initTestCase();
0029     void cleanupTestCase();
0030 
0031     void getPropertiesTest();
0032     void setHandleTest();
0033 
0034     void readValueTest();
0035     void writeValueTest();
0036     void startNotifyTest();
0037     void stopNotifyTest();
0038 
0039     void characteristicRemovedTest();
0040 
0041 private:
0042     struct GattCharacteristicRemoteUnit {
0043         BluezQt::GattCharacteristicRemotePtr characteristic;
0044         org::bluez::GattCharacteristic1 *dbusCharacteristic;
0045         org::freedesktop::DBus::Properties *dbusProperties;
0046     };
0047 
0048     BluezQt::Manager *m_manager;
0049     QList<GattCharacteristicRemoteUnit> m_units;
0050 };
0051 
0052 #endif // GATTCHARACTERISTICREMOTETEST_H