kdeconnect-kde/core/backends/bluetooth/bluetoothdevicelink.h

53 lines
1.3 KiB
C
Raw Normal View History

/**
* SPDX-FileCopyrightText: 2016 Saikrishna Arcot <saiarcot895@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#ifndef BLUETOOTHDEVICELINK_H
#define BLUETOOTHDEVICELINK_H
#include <QObject>
#include <QString>
2019-02-03 00:44:22 +00:00
#include <QBluetoothSocket>
#include <QSslCertificate>
#include "../devicelink.h"
#include "../devicelinereader.h"
2016-11-11 14:55:16 +00:00
#include "bluetoothpairinghandler.h"
class ConnectionMultiplexer;
class MultiplexChannel;
2016-11-11 14:55:16 +00:00
class KDECONNECTCORE_EXPORT BluetoothDeviceLink
: public DeviceLink
{
Q_OBJECT
public:
BluetoothDeviceLink(const QString& deviceId, LinkProvider* parent, ConnectionMultiplexer* connection, QSharedPointer<MultiplexChannel> socket);
2016-11-11 14:55:16 +00:00
virtual QString name() override;
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;
QSslCertificate certificate() const override;
private Q_SLOTS:
void dataReceived();
private:
2016-11-11 14:55:16 +00:00
DeviceLineReader* mSocketReader;
ConnectionMultiplexer* mConnection;
QSharedPointer<MultiplexChannel> mChannel;
2016-11-11 14:55:16 +00:00
BluetoothPairingHandler* mPairingHandler;
void sendMessage(const QString mMessage);
};
#endif