/** * SPDX-FileCopyrightText: 2016 Saikrishna Arcot * * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ #ifndef BLUETOOTHLINKPROVIDER_H #define BLUETOOTHLINKPROVIDER_H #include #include #include #include #include #include #include #include #include #include #include "../linkprovider.h" class BluetoothDeviceLink; class ConnectionMultiplexer; class MultiplexChannel; class KDECONNECTCORE_EXPORT BluetoothLinkProvider : public LinkProvider { Q_OBJECT public: BluetoothLinkProvider(); virtual ~BluetoothLinkProvider(); QString name() override { return QStringLiteral("BluetoothLinkProvider"); } public Q_SLOTS: virtual void onNetworkChange() override; virtual void onStart() override; virtual void onStop() override; virtual void onLinkDestroyed(const QString &deviceId, DeviceLink *oldPtr) override; void connectError(); private Q_SLOTS: void socketDisconnected(const QBluetoothAddress &peerAddress, MultiplexChannel *socket); void serverNewConnection(); void serverDataReceived(const QBluetoothAddress &peerAddress, QSharedPointer socket); void clientConnected(QPointer socket); void clientIdentityReceived(const QBluetoothAddress &peerAddress, QSharedPointer socket); void serviceDiscovered(const QBluetoothServiceInfo &info); private: void addLink(BluetoothDeviceLink *deviceLink, const QString &deviceId); QList getPairedDevices(); QBluetoothUuid mServiceUuid; QPointer mBluetoothServer; QBluetoothServiceInfo mKdeconnectService; QBluetoothServiceDiscoveryAgent *mServiceDiscoveryAgent; QTimer *connectTimer; QMap mLinks; QMap mSockets; }; #endif