| 1 | /* |
|---|---|
| 2 | * BluezQt - Asynchronous Bluez wrapper library |
| 3 | * |
| 4 | * SPDX-FileCopyrightText: 2021 Ivan Podkurkov <podkiva2@gmail.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #include "gattserviceremote.h" |
| 10 | #include "gattserviceremote_p.h" |
| 11 | #include "device.h" |
| 12 | #include "device_p.h" |
| 13 | #include "pendingcall.h" |
| 14 | #include "utils.h" |
| 15 | |
| 16 | namespace BluezQt |
| 17 | { |
| 18 | |
| 19 | GattServiceRemote::GattServiceRemote(const QString &path, const QVariantMap &properties, DevicePtr adapter) |
| 20 | : QObject() |
| 21 | , d(new GattServiceRemotePrivate(path, properties, adapter)) |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | GattServiceRemote::~GattServiceRemote() |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | GattServiceRemotePtr GattServiceRemote::toSharedPtr() const |
| 30 | { |
| 31 | return d->q.toStrongRef(); |
| 32 | } |
| 33 | |
| 34 | QString GattServiceRemote::ubi() const |
| 35 | { |
| 36 | return d->m_bluezGattService->path(); |
| 37 | } |
| 38 | |
| 39 | QString GattServiceRemote::uuid() const |
| 40 | { |
| 41 | return d->m_uuid; |
| 42 | } |
| 43 | |
| 44 | bool GattServiceRemote::isPrimary() const |
| 45 | { |
| 46 | return d->m_primary; |
| 47 | } |
| 48 | |
| 49 | DevicePtr GattServiceRemote::device() const |
| 50 | { |
| 51 | return d->m_device; |
| 52 | } |
| 53 | |
| 54 | QList<QDBusObjectPath> GattServiceRemote::includes() const |
| 55 | { |
| 56 | return d->m_includes; |
| 57 | } |
| 58 | |
| 59 | quint16 GattServiceRemote::handle() const |
| 60 | { |
| 61 | return d->m_handle; |
| 62 | } |
| 63 | |
| 64 | PendingCall* GattServiceRemote::setHandle(quint16 handle) |
| 65 | { |
| 66 | return new PendingCall(d->setDBusProperty(QStringLiteral("Handle"), value: QVariant::fromValue(value: handle)), PendingCall::ReturnVoid, this); |
| 67 | } |
| 68 | |
| 69 | QList<GattCharacteristicRemotePtr> GattServiceRemote::characteristics() const |
| 70 | { |
| 71 | return d->m_characteristics; |
| 72 | } |
| 73 | |
| 74 | } // namespace BluezQt |
| 75 | |
| 76 | #include "moc_gattserviceremote.cpp" |
| 77 |
