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
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2019-02-03 00:44:22 +00:00
|
|
|
#include <QBluetoothSocket>
|
2020-11-30 19:11:47 +00:00
|
|
|
#include <QSslCertificate>
|
2015-03-01 20:17:46 +00:00
|
|
|
|
|
|
|
#include "../devicelink.h"
|
|
|
|
#include "../devicelinereader.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;
|
|
|
|
|
2016-11-11 14:55:16 +00:00
|
|
|
class KDECONNECTCORE_EXPORT BluetoothDeviceLink
|
2015-03-01 20:17:46 +00:00
|
|
|
: public DeviceLink
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-03-08 18:18:01 +00: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;
|
2018-03-04 19:48:51 +00: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:
|
2016-11-11 14:55:16 +00:00
|
|
|
DeviceLineReader* mSocketReader;
|
2019-03-08 18:18:01 +00:00
|
|
|
ConnectionMultiplexer* mConnection;
|
|
|
|
QSharedPointer<MultiplexChannel> mChannel;
|
2016-11-11 14:55:16 +00:00
|
|
|
BluetoothPairingHandler* mPairingHandler;
|
2015-03-01 20:17:46 +00:00
|
|
|
|
|
|
|
void sendMessage(const QString mMessage);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|