Changeset View
Changeset View
Standalone View
Standalone View
core/backends/bluetooth/bluetoothpairinghandler.h
Show All 21 Lines | |||||
22 | #define KDECONNECT_BLUETOOTHPAIRINGHANDLER_H | 22 | #define KDECONNECT_BLUETOOTHPAIRINGHANDLER_H | ||
23 | 23 | | |||
24 | #include "device.h" | 24 | #include "device.h" | ||
25 | #include "../devicelink.h" | 25 | #include "../devicelink.h" | ||
26 | #include "../pairinghandler.h" | 26 | #include "../pairinghandler.h" | ||
27 | 27 | | |||
28 | #include <QTimer> | 28 | #include <QTimer> | ||
29 | 29 | | |||
30 | // This class is used pairing related stuff. It has direct access to links and can directly send packages | 30 | // This class is used pairing related stuff. It has direct access to links and can directly send packets | ||
31 | class BluetoothPairingHandler | 31 | class BluetoothPairingHandler | ||
32 | : public PairingHandler | 32 | : public PairingHandler | ||
33 | { | 33 | { | ||
34 | public: | 34 | public: | ||
35 | 35 | | |||
36 | enum InternalPairStatus { | 36 | enum InternalPairStatus { | ||
37 | NotPaired, | 37 | NotPaired, | ||
38 | Requested, | 38 | Requested, | ||
39 | RequestedByPeer, | 39 | RequestedByPeer, | ||
40 | Paired, | 40 | Paired, | ||
41 | }; | 41 | }; | ||
42 | 42 | | |||
43 | BluetoothPairingHandler(DeviceLink* deviceLink); | 43 | BluetoothPairingHandler(DeviceLink* deviceLink); | ||
44 | virtual ~BluetoothPairingHandler() { } | 44 | virtual ~BluetoothPairingHandler() { } | ||
45 | 45 | | |||
46 | virtual void packageReceived(const NetworkPackage& np) Q_DECL_OVERRIDE; | 46 | virtual void packetReceived(const NetworkPacket& np) Q_DECL_OVERRIDE; | ||
47 | virtual bool requestPairing() Q_DECL_OVERRIDE; | 47 | virtual bool requestPairing() Q_DECL_OVERRIDE; | ||
48 | virtual bool acceptPairing() Q_DECL_OVERRIDE; | 48 | virtual bool acceptPairing() Q_DECL_OVERRIDE; | ||
49 | virtual void rejectPairing() Q_DECL_OVERRIDE; | 49 | virtual void rejectPairing() Q_DECL_OVERRIDE; | ||
50 | virtual void unpair() Q_DECL_OVERRIDE; | 50 | virtual void unpair() Q_DECL_OVERRIDE; | ||
51 | 51 | | |||
52 | bool isPairRequested() const { return m_status == Requested; } | 52 | bool isPairRequested() const { return m_status == Requested; } | ||
53 | bool isPaired() const { return m_status == Paired; } | 53 | bool isPaired() const { return m_status == Paired; } | ||
54 | 54 | | |||
Show All 13 Lines |