DtkBluetooth
BlueZ DBus interface binding for Qt
dbluetoothobexmanager.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DBLUETOOTHOBEXMANAGER_H
6#define DBLUETOOTHOBEXMANAGER_H
7
8#include "dbluetoothtypes.h"
9#include <DExpected>
10#include <DObject>
11
12DBLUETOOTH_BEGIN_NAMESPACE
13
14using DTK_CORE_NAMESPACE::DExpected;
15using DTK_CORE_NAMESPACE::DObject;
16
17class DObexSession;
18class DObexAgent;
19class DObexManagerPrivate;
20
21class DObexManager : public QObject, public DObject
22{
23 Q_OBJECT
24public:
25 explicit DObexManager(QObject *parent = nullptr);
26 ~DObexManager() override = default;
27
28 Q_PROPERTY(bool available READ available CONSTANT)
29
30 bool available() const;
31
32public Q_SLOTS:
33 DExpected<ObexSessionInfo> createSession(const QString &destination, const QVariantMap &args) const;
34 DExpected<void> removeSession(const QSharedPointer<DObexSession> session) const;
35 DExpected<void> registerAgent(const QSharedPointer<DObexAgent> &agent) const;
36 DExpected<void> unregisterAgent(const QSharedPointer<DObexAgent> &agent) const;
37
38 DExpected<QList<ObexSessionInfo>> sessions() const;
39 DExpected<QSharedPointer<DObexSession>> sessionFromInfo(const ObexSessionInfo &info);
40
41Q_SIGNALS:
42 void sessionAdded(const ObexSessionInfo &info);
43 void sessionRemoved(const ObexSessionInfo &info);
44
45private:
46 D_DECLARE_PRIVATE(DObexManager)
47};
48
49DBLUETOOTH_END_NAMESPACE
50#endif
对于自定义蓝牙obex代理的封装
Definition: dbluetoothobexagent.h:18
蓝牙obex管理类
Definition: dbluetoothobexmanager.h:22
蓝牙obex会话类
Definition: dbluetoothobexsession.h:24
一些自定义类型和枚举
传输会话的信息
Definition: dbluetoothtypes.h:23