2015-03-01 20:17:46 +00:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2016 Saikrishna Arcot <saiarcot895@gmail.com>
|
2015-03-01 20:17:46 +00:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2015-03-01 20:17:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BLUETOOTHDEVICELINK_H
|
|
|
|
#define BLUETOOTHDEVICELINK_H
|
|
|
|
|
2019-02-03 00:44:22 +00:00
|
|
|
#include <QBluetoothSocket>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QObject>
|
2020-11-30 19:11:47 +00:00
|
|
|
#include <QSslCertificate>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QString>
|
2015-03-01 20:17:46 +00:00
|
|
|
|
|
|
|
#include "../devicelinereader.h"
|
2022-09-10 22:23:52 +01:00
|
|
|
#include "../devicelink.h"
|
2016-11-11 14:55:16 +00:00
|
|
|
#include "bluetoothpairinghandler.h"
|
2015-03-01 20:17:46 +00:00
|
|
|
|
2019-03-08 18:18:01 +00:00
|
|
|
class ConnectionMultiplexer;
|
|
|
|
class MultiplexChannel;
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
class KDECONNECTCORE_EXPORT BluetoothDeviceLink : public DeviceLink
|
2015-03-01 20:17:46 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-09-10 22:23:52 +01:00
|
|
|
BluetoothDeviceLink(const QString &deviceId, LinkProvider *parent, ConnectionMultiplexer *connection, QSharedPointer<MultiplexChannel> socket);
|
2015-03-01 20:17:46 +00:00
|
|
|
|
2016-11-11 14:55:16 +00:00
|
|
|
virtual QString name() override;
|
2022-09-10 22:23:52 +01:00
|
|
|
bool sendPacket(NetworkPacket &np) override;
|
2016-11-11 14:55:16 +00:00
|
|
|
|
|
|
|
virtual void userRequestsPair() override;
|
|
|
|
virtual void userRequestsUnpair() override;
|
|
|
|
|
|
|
|
virtual bool linkShouldBeKeptAlive() override;
|
2020-11-30 19:11:47 +00:00
|
|
|
QSslCertificate certificate() const override;
|
2015-03-01 20:17:46 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void dataReceived();
|
|
|
|
|
|
|
|
private:
|
2022-09-10 22:23:52 +01:00
|
|
|
DeviceLineReader *mSocketReader;
|
|
|
|
ConnectionMultiplexer *mConnection;
|
2019-03-08 18:18:01 +00:00
|
|
|
QSharedPointer<MultiplexChannel> mChannel;
|
2022-09-10 22:23:52 +01:00
|
|
|
BluetoothPairingHandler *mPairingHandler;
|
2015-03-01 20:17:46 +00:00
|
|
|
|
|
|
|
void sendMessage(const QString mMessage);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|