1// qlowenergycontroller.sip generated by MetaSIP
2//
3// This file is part of the QtBluetooth Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23%If (Qt_5_4_0 -)
24
25class QLowEnergyController : QObject
26{
27%TypeHeaderCode
28#include <qlowenergycontroller.h>
29%End
30
31public:
32    enum Error
33    {
34        NoError,
35        UnknownError,
36        UnknownRemoteDeviceError,
37        NetworkError,
38        InvalidBluetoothAdapterError,
39%If (Qt_5_5_0 -)
40        ConnectionError,
41%End
42%If (Qt_5_7_0 -)
43        AdvertisingError,
44%End
45%If (Qt_5_10_0 -)
46        RemoteHostClosedError,
47%End
48%If (Qt_5_14_0 -)
49        AuthorizationError,
50%End
51    };
52
53    enum ControllerState
54    {
55        UnconnectedState,
56        ConnectingState,
57        ConnectedState,
58        DiscoveringState,
59        DiscoveredState,
60        ClosingState,
61%If (Qt_5_7_0 -)
62        AdvertisingState,
63%End
64    };
65
66    enum RemoteAddressType
67    {
68        PublicAddress,
69        RandomAddress,
70    };
71
72%If (Qt_5_5_0 -)
73    QLowEnergyController(const QBluetoothDeviceInfo &remoteDevice, QObject *parent /TransferThis/ = 0);
74%End
75    QLowEnergyController(const QBluetoothAddress &remoteDevice, QObject *parent /TransferThis/ = 0);
76    QLowEnergyController(const QBluetoothAddress &remoteDevice, const QBluetoothAddress &localDevice, QObject *parent /TransferThis/ = 0);
77    virtual ~QLowEnergyController();
78    QBluetoothAddress localAddress() const;
79    QBluetoothAddress remoteAddress() const;
80    QLowEnergyController::ControllerState state() const;
81    QLowEnergyController::RemoteAddressType remoteAddressType() const;
82    void setRemoteAddressType(QLowEnergyController::RemoteAddressType type);
83    void connectToDevice();
84    void disconnectFromDevice();
85    void discoverServices();
86    QList<QBluetoothUuid> services() const;
87    QLowEnergyService *createServiceObject(const QBluetoothUuid &service, QObject *parent /TransferThis/ = 0) /Factory/;
88    QLowEnergyController::Error error() const;
89    QString errorString() const;
90%If (Qt_5_5_0 -)
91    QString remoteName() const;
92%End
93
94signals:
95    void connected();
96    void disconnected();
97    void stateChanged(QLowEnergyController::ControllerState state);
98    void error(QLowEnergyController::Error newError);
99    void serviceDiscovered(const QBluetoothUuid &newService);
100    void discoveryFinished();
101
102public:
103%If (Qt_5_7_0 -)
104
105    enum Role
106    {
107        CentralRole,
108        PeripheralRole,
109    };
110
111%End
112%If (Qt_5_7_0 -)
113    static QLowEnergyController *createCentral(const QBluetoothDeviceInfo &remoteDevice, QObject *parent /TransferThis/ = 0) /Factory/;
114%End
115%If (Qt_5_14_0 -)
116    static QLowEnergyController *createCentral(const QBluetoothAddress &remoteDevice, const QBluetoothAddress &localDevice, QObject *parent /TransferThis/ = 0) /Factory/;
117%End
118%If (Qt_5_7_0 -)
119    static QLowEnergyController *createPeripheral(QObject *parent /TransferThis/ = 0) /Factory/;
120%End
121%If (Qt_5_7_0 -)
122    void startAdvertising(const QLowEnergyAdvertisingParameters &parameters, const QLowEnergyAdvertisingData &advertisingData, const QLowEnergyAdvertisingData &scanResponseData = QLowEnergyAdvertisingData());
123%End
124%If (Qt_5_7_0 -)
125    void stopAdvertising();
126%End
127%If (Qt_5_7_0 -)
128    QLowEnergyService *addService(const QLowEnergyServiceData &service, QObject *parent /TransferThis/ = 0) /Factory/;
129%End
130%If (Qt_5_7_0 -)
131    void requestConnectionUpdate(const QLowEnergyConnectionParameters &parameters);
132%End
133%If (Qt_5_7_0 -)
134    QLowEnergyController::Role role() const;
135%End
136
137signals:
138%If (Qt_5_7_0 -)
139    void connectionUpdated(const QLowEnergyConnectionParameters &parameters);
140%End
141
142public:
143%If (Qt_5_8_0 -)
144    QBluetoothUuid remoteDeviceUuid() const;
145%End
146
147private:
148%If (Qt_5_7_0 -)
149    explicit QLowEnergyController(QObject *parent = 0);
150%End
151};
152
153%End
154