-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserviceinfo.h
43 lines (33 loc) · 1.04 KB
/
serviceinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef SERVICEINFO_H
#define SERVICEINFO_H
#include <QObject>
#include <QQmlEngine>
QT_BEGIN_NAMESPACE
class QLowEnergyService;
QT_END_NAMESPACE
class ServiceInfo: public QObject
{
Q_OBJECT
Q_PROPERTY(QString serviceName READ getName NOTIFY serviceChanged)
Q_PROPERTY(QString serviceUuid READ getUuid NOTIFY serviceChanged)
Q_PROPERTY(QString serviceType READ getType NOTIFY serviceChanged)
Q_PROPERTY(bool isRxTx READ isRxTx CONSTANT)
QML_ANONYMOUS
public:
ServiceInfo() = default;
ServiceInfo(QLowEnergyService *service);
QLowEnergyService *service() const;
QString getUuid() const;
QString getName() const;
QString getType() const;
bool isRxTx() const { return m_is_rx_tx; }
Q_SIGNALS:
void serviceChanged();
private:
QLowEnergyService *m_service = nullptr;
bool m_is_rx_tx = false;
};
#endif // SERVICEINFO_H