File indexing completed on 2024-04-28 15:17:51

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #include "gattcharacteristicadaptor.h"
0010 #include "gattcharacteristic.h"
0011 #include "gattservice.h"
0012 
0013 namespace BluezQt
0014 {
0015 GattCharacteristicAdaptor::GattCharacteristicAdaptor(GattCharacteristic *parent)
0016     : QDBusAbstractAdaptor(parent)
0017     , m_gattCharacteristic(parent)
0018 {
0019 }
0020 
0021 QString GattCharacteristicAdaptor::uuid() const
0022 {
0023     return m_gattCharacteristic->uuid();
0024 }
0025 
0026 QDBusObjectPath GattCharacteristicAdaptor::service() const
0027 {
0028     return m_gattCharacteristic->service()->objectPath();
0029 }
0030 
0031 QStringList GattCharacteristicAdaptor::flags() const
0032 {
0033     // TODO: implement flags
0034     return {QStringLiteral("read"), QStringLiteral("write")};
0035 }
0036 
0037 QByteArray GattCharacteristicAdaptor::ReadValue(const QVariantMap & /*options*/)
0038 {
0039     return m_gattCharacteristic->readValue();
0040 }
0041 
0042 void GattCharacteristicAdaptor::WriteValue(const QByteArray &value, const QVariantMap & /*options*/)
0043 {
0044     m_gattCharacteristic->writeValue(value);
0045 }
0046 
0047 void GattCharacteristicAdaptor::StartNotify()
0048 {
0049     // TODO: implement
0050 }
0051 
0052 void GattCharacteristicAdaptor::StopNotify()
0053 {
0054     // TODO: implement
0055 }
0056 
0057 } // namespace BluezQt
0058 
0059 #include "moc_gattcharacteristicadaptor.cpp"