Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qbluetoothlocaldevice.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QBLUETOOTHLOCALDEVICE_H
5#define QBLUETOOTHLOCALDEVICE_H
6
7#include <QtBluetooth/qtbluetoothglobal.h>
8
9#include <QtCore/QObject>
10#include <QtCore/QList>
11#include <QtCore/QString>
12
13#include <QtBluetooth/QBluetoothHostInfo>
14
16
18
19class Q_BLUETOOTH_EXPORT QBluetoothLocalDevice : public QObject
20{
22
23public:
24 enum Pairing {
27 AuthorizedPaired
28 };
29 Q_ENUM(Pairing)
30
31 enum HostMode {
35 HostDiscoverableLimitedInquiry
36 };
37 Q_ENUM(HostMode)
38
46
47 explicit QBluetoothLocalDevice(QObject *parent = nullptr);
48 explicit QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent = nullptr);
49 virtual ~QBluetoothLocalDevice();
50
51 bool isValid() const;
52
53 void requestPairing(const QBluetoothAddress &address, Pairing pairing);
54 Pairing pairingStatus(const QBluetoothAddress &address) const;
55
56 void setHostMode(QBluetoothLocalDevice::HostMode mode);
57 HostMode hostMode() const;
58 QList<QBluetoothAddress> connectedDevices() const;
59
60 void powerOn();
61
62 QString name() const;
64
65 static QList<QBluetoothHostInfo> allDevices();
66
72
74
75private:
76 Q_DECLARE_PRIVATE(QBluetoothLocalDevice)
78};
79
81
83 Q_BLUETOOTH_EXPORT)
85 Q_BLUETOOTH_EXPORT)
87 Q_BLUETOOTH_EXPORT)
88
89#endif // QBLUETOOTHLOCALDEVICE_H
\inmodule QtBluetooth
\inmodule QtBluetooth
Pairing
This enum describes the pairing state between the two Bluetooth devices.
void errorOccurred(QBluetoothLocalDevice::Error error)
Signal emitted if there's an exceptional error while pairing.
HostMode
This enum describes the most of the local Bluetooth device.
void deviceConnected(const QBluetoothAddress &address)
Error
This enum describes errors that maybe returned.
void deviceDisconnected(const QBluetoothAddress &address)
void pairingFinished(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing)
Pairing or unpairing has completed with address.
void hostModeStateChanged(QBluetoothLocalDevice::HostMode state)
The state of the host has transitioned to a different HostMode.
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
else opt state
[0]
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT)
Definition qmetatype.h:1376
GLenum mode
GLuint name
GLuint GLuint64EXT address
#define Q_ENUM(x)
#define Q_OBJECT
#define Q_SIGNALS