This commit is contained in:
rattatwinko
2025-05-25 20:42:58 +02:00
commit 8e9b2568b2
4902 changed files with 1152638 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Automatically generated configuration for PyQt5.QtBluetooth.
sip-version = "6.8.6"
sip-abi-version = "12.15"
module-tags = ["Qt_5_15_14", "WS_X11"]
module-disabled-features = []

View File

@@ -0,0 +1,71 @@
// QtBluetoothmod.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%Module(name=PyQt5.QtBluetooth, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip
%Copying
Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
This file is part of PyQt5.
This file may be used under the terms of the GNU General Public License
version 3.0 as published by the Free Software Foundation and appearing in
the file LICENSE included in the packaging of this file. Please review the
following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you do not wish to use this file under the terms of the GPL version 3.0
then you may purchase a commercial license. For more information contact
info@riverbankcomputing.com.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%End
%Include qbluetooth.sip
%Include qbluetoothaddress.sip
%Include qbluetoothdevicediscoveryagent.sip
%Include qbluetoothdeviceinfo.sip
%Include qbluetoothhostinfo.sip
%Include qbluetoothlocaldevice.sip
%Include qbluetoothserver.sip
%Include qbluetoothservicediscoveryagent.sip
%Include qbluetoothserviceinfo.sip
%Include qbluetoothsocket.sip
%Include qbluetoothtransfermanager.sip
%Include qbluetoothtransferreply.sip
%Include qbluetoothtransferrequest.sip
%Include qbluetoothuuid.sip
%Include qlowenergyadvertisingdata.sip
%Include qlowenergyadvertisingparameters.sip
%Include qlowenergycharacteristic.sip
%Include qlowenergycharacteristicdata.sip
%Include qlowenergyconnectionparameters.sip
%Include qlowenergycontroller.sip
%Include qlowenergydescriptor.sip
%Include qlowenergydescriptordata.sip
%Include qlowenergyservice.sip
%Include qlowenergyservicedata.sip
%Include qpybluetooth_quint128.sip
%Include qpybluetooth_qlist.sip

View File

@@ -0,0 +1,63 @@
// qbluetooth.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
namespace QBluetooth
{
%TypeHeaderCode
#include <qbluetooth.h>
%End
enum Security
{
NoSecurity,
Authorization,
Authentication,
Encryption,
Secure,
};
typedef QFlags<QBluetooth::Security> SecurityFlags;
QFlags<QBluetooth::Security> operator|(QBluetooth::Security f1, QFlags<QBluetooth::Security> f2);
%If (Qt_5_7_0 -)
enum AttAccessConstraint
{
AttAuthorizationRequired,
AttAuthenticationRequired,
AttEncryptionRequired,
};
%End
%If (Qt_5_7_0 -)
typedef QFlags<QBluetooth::AttAccessConstraint> AttAccessConstraints;
%End
%If (Qt_5_7_0 -)
QFlags<QBluetooth::AttAccessConstraint> operator|(QBluetooth::AttAccessConstraint f1, QFlags<QBluetooth::AttAccessConstraint> f2);
%End
};
%End
%If (Qt_5_4_0 -)
typedef quint16 QLowEnergyHandle;
%End

View File

@@ -0,0 +1,46 @@
// qbluetoothaddress.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothAddress
{
%TypeHeaderCode
#include <qbluetoothaddress.h>
%End
public:
QBluetoothAddress();
explicit QBluetoothAddress(quint64 address);
explicit QBluetoothAddress(const QString &address);
QBluetoothAddress(const QBluetoothAddress &other);
~QBluetoothAddress();
bool isNull() const;
void clear();
bool operator<(const QBluetoothAddress &other) const;
bool operator==(const QBluetoothAddress &other) const;
bool operator!=(const QBluetoothAddress &other) const;
quint64 toUInt64() const;
QString toString() const;
};
%End

View File

@@ -0,0 +1,114 @@
// qbluetoothdevicediscoveryagent.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothDeviceDiscoveryAgent : public QObject
{
%TypeHeaderCode
#include <qbluetoothdevicediscoveryagent.h>
%End
public:
enum Error
{
NoError,
InputOutputError,
PoweredOffError,
%If (Qt_5_3_0 -)
InvalidBluetoothAdapterError,
%End
%If (Qt_5_5_0 -)
UnsupportedPlatformError,
%End
%If (Qt_5_8_0 -)
UnsupportedDiscoveryMethod,
%End
UnknownError,
};
enum InquiryType
{
GeneralUnlimitedInquiry,
LimitedInquiry,
};
%If (Qt_5_6_1 -)
explicit QBluetoothDeviceDiscoveryAgent(QObject *parent /TransferThis/ = 0);
%End
%If (- Qt_5_6_1)
QBluetoothDeviceDiscoveryAgent(QObject *parent /TransferThis/ = 0);
%End
QBluetoothDeviceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothDeviceDiscoveryAgent();
QBluetoothDeviceDiscoveryAgent::InquiryType inquiryType() const;
void setInquiryType(QBluetoothDeviceDiscoveryAgent::InquiryType type);
bool isActive() const;
QBluetoothDeviceDiscoveryAgent::Error error() const;
QString errorString() const;
QList<QBluetoothDeviceInfo> discoveredDevices() const;
public slots:
void start();
%If (Qt_5_8_0 -)
void start(QBluetoothDeviceDiscoveryAgent::DiscoveryMethods method);
%End
void stop();
signals:
void deviceDiscovered(const QBluetoothDeviceInfo &info);
void finished();
void error(QBluetoothDeviceDiscoveryAgent::Error error);
void canceled();
%If (Qt_5_12_0 -)
void deviceUpdated(const QBluetoothDeviceInfo &info, QBluetoothDeviceInfo::Fields updatedFields);
%End
public:
%If (Qt_5_8_0 -)
enum DiscoveryMethod
{
NoMethod,
ClassicMethod,
LowEnergyMethod,
};
%End
%If (Qt_5_8_0 -)
typedef QFlags<QBluetoothDeviceDiscoveryAgent::DiscoveryMethod> DiscoveryMethods;
%End
%If (Qt_5_8_0 -)
void setLowEnergyDiscoveryTimeout(int msTimeout);
%End
%If (Qt_5_8_0 -)
int lowEnergyDiscoveryTimeout() const;
%End
%If (Qt_5_8_0 -)
static QBluetoothDeviceDiscoveryAgent::DiscoveryMethods supportedDiscoveryMethods();
%End
};
%End
%If (Qt_5_8_0 -)
QFlags<QBluetoothDeviceDiscoveryAgent::DiscoveryMethod> operator|(QBluetoothDeviceDiscoveryAgent::DiscoveryMethod f1, QFlags<QBluetoothDeviceDiscoveryAgent::DiscoveryMethod> f2);
%End

View File

@@ -0,0 +1,272 @@
// qbluetoothdeviceinfo.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothDeviceInfo
{
%TypeHeaderCode
#include <qbluetoothdeviceinfo.h>
%End
public:
enum MajorDeviceClass
{
MiscellaneousDevice,
ComputerDevice,
PhoneDevice,
LANAccessDevice,
%If (Qt_5_13_0 -)
NetworkDevice,
%End
AudioVideoDevice,
PeripheralDevice,
ImagingDevice,
WearableDevice,
ToyDevice,
HealthDevice,
UncategorizedDevice,
};
enum MinorMiscellaneousClass
{
UncategorizedMiscellaneous,
};
enum MinorComputerClass
{
UncategorizedComputer,
DesktopComputer,
ServerComputer,
LaptopComputer,
HandheldClamShellComputer,
HandheldComputer,
WearableComputer,
};
enum MinorPhoneClass
{
UncategorizedPhone,
CellularPhone,
CordlessPhone,
SmartPhone,
WiredModemOrVoiceGatewayPhone,
CommonIsdnAccessPhone,
};
enum MinorNetworkClass
{
NetworkFullService,
NetworkLoadFactorOne,
NetworkLoadFactorTwo,
NetworkLoadFactorThree,
NetworkLoadFactorFour,
NetworkLoadFactorFive,
NetworkLoadFactorSix,
NetworkNoService,
};
enum MinorAudioVideoClass
{
UncategorizedAudioVideoDevice,
WearableHeadsetDevice,
HandsFreeDevice,
Microphone,
Loudspeaker,
Headphones,
PortableAudioDevice,
CarAudio,
SetTopBox,
HiFiAudioDevice,
Vcr,
VideoCamera,
Camcorder,
VideoMonitor,
VideoDisplayAndLoudspeaker,
VideoConferencing,
GamingDevice,
};
enum MinorPeripheralClass
{
UncategorizedPeripheral,
KeyboardPeripheral,
PointingDevicePeripheral,
KeyboardWithPointingDevicePeripheral,
JoystickPeripheral,
GamepadPeripheral,
RemoteControlPeripheral,
SensingDevicePeripheral,
DigitizerTabletPeripheral,
CardReaderPeripheral,
};
enum MinorImagingClass
{
UncategorizedImagingDevice,
ImageDisplay,
ImageCamera,
ImageScanner,
ImagePrinter,
};
enum MinorWearableClass
{
UncategorizedWearableDevice,
WearableWristWatch,
WearablePager,
WearableJacket,
WearableHelmet,
WearableGlasses,
};
enum MinorToyClass
{
UncategorizedToy,
ToyRobot,
ToyVehicle,
ToyDoll,
ToyController,
ToyGame,
};
enum MinorHealthClass
{
UncategorizedHealthDevice,
HealthBloodPressureMonitor,
HealthThermometer,
HealthWeightScale,
HealthGlucoseMeter,
HealthPulseOximeter,
HealthDataDisplay,
HealthStepCounter,
};
enum ServiceClass
{
NoService,
PositioningService,
NetworkingService,
RenderingService,
CapturingService,
ObjectTransferService,
AudioService,
TelephonyService,
InformationService,
AllServices,
};
typedef QFlags<QBluetoothDeviceInfo::ServiceClass> ServiceClasses;
enum DataCompleteness
{
DataComplete,
DataIncomplete,
DataUnavailable,
};
QBluetoothDeviceInfo();
QBluetoothDeviceInfo(const QBluetoothAddress &address, const QString &name, quint32 classOfDevice);
%If (Qt_5_5_0 -)
QBluetoothDeviceInfo(const QBluetoothUuid &uuid, const QString &name, quint32 classOfDevice);
%End
QBluetoothDeviceInfo(const QBluetoothDeviceInfo &other);
~QBluetoothDeviceInfo();
bool isValid() const;
bool isCached() const;
void setCached(bool cached);
bool operator==(const QBluetoothDeviceInfo &other) const;
bool operator!=(const QBluetoothDeviceInfo &other) const;
QBluetoothAddress address() const;
QString name() const;
QBluetoothDeviceInfo::ServiceClasses serviceClasses() const;
QBluetoothDeviceInfo::MajorDeviceClass majorDeviceClass() const;
quint8 minorDeviceClass() const;
qint16 rssi() const;
void setRssi(qint16 signal);
void setServiceUuids(const QList<QBluetoothUuid> &uuids, QBluetoothDeviceInfo::DataCompleteness completeness);
%If (Qt_5_13_0 -)
void setServiceUuids(const QVector<QBluetoothUuid> &uuids);
%End
QList<QBluetoothUuid> serviceUuids(QBluetoothDeviceInfo::DataCompleteness *completeness /Out/ = 0) const;
QBluetoothDeviceInfo::DataCompleteness serviceUuidsCompleteness() const;
%If (Qt_5_4_0 -)
enum CoreConfiguration
{
UnknownCoreConfiguration,
LowEnergyCoreConfiguration,
BaseRateCoreConfiguration,
BaseRateAndLowEnergyCoreConfiguration,
};
%End
%If (Qt_5_4_0 -)
typedef QFlags<QBluetoothDeviceInfo::CoreConfiguration> CoreConfigurations;
%End
%If (Qt_5_4_0 -)
void setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs);
%End
%If (Qt_5_4_0 -)
QBluetoothDeviceInfo::CoreConfigurations coreConfigurations() const;
%End
%If (Qt_5_5_0 -)
void setDeviceUuid(const QBluetoothUuid &uuid);
%End
%If (Qt_5_5_0 -)
QBluetoothUuid deviceUuid() const;
%End
%If (Qt_5_12_0 -)
enum class Field
{
None /PyName=None_/,
RSSI,
ManufacturerData,
All,
};
%End
%If (Qt_5_12_0 -)
typedef QFlags<QBluetoothDeviceInfo::Field> Fields;
%End
%If (Qt_5_12_0 -)
QVector<quint16> manufacturerIds() const;
%End
%If (Qt_5_12_0 -)
QByteArray manufacturerData(quint16 manufacturerId) const;
%End
%If (Qt_5_12_0 -)
bool setManufacturerData(quint16 manufacturerId, const QByteArray &data);
%End
%If (Qt_5_12_0 -)
QHash<quint16, QByteArray> manufacturerData() const;
%End
};
%End
%If (Qt_5_5_0 -)
QFlags<QBluetoothDeviceInfo::CoreConfiguration> operator|(QBluetoothDeviceInfo::CoreConfiguration f1, QFlags<QBluetoothDeviceInfo::CoreConfiguration> f2);
%End
%If (Qt_5_5_0 -)
QFlags<QBluetoothDeviceInfo::ServiceClass> operator|(QBluetoothDeviceInfo::ServiceClass f1, QFlags<QBluetoothDeviceInfo::ServiceClass> f2);
%End

View File

@@ -0,0 +1,47 @@
// qbluetoothhostinfo.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothHostInfo
{
%TypeHeaderCode
#include <qbluetoothhostinfo.h>
%End
public:
QBluetoothHostInfo();
QBluetoothHostInfo(const QBluetoothHostInfo &other);
~QBluetoothHostInfo();
QBluetoothAddress address() const;
void setAddress(const QBluetoothAddress &address);
QString name() const;
void setName(const QString &name);
%If (Qt_5_5_0 -)
bool operator==(const QBluetoothHostInfo &other) const;
%End
%If (Qt_5_5_0 -)
bool operator!=(const QBluetoothHostInfo &other) const;
%End
};
%End

View File

@@ -0,0 +1,92 @@
// qbluetoothlocaldevice.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothLocalDevice : public QObject
{
%TypeHeaderCode
#include <qbluetoothlocaldevice.h>
%End
public:
enum Pairing
{
Unpaired,
Paired,
AuthorizedPaired,
};
enum HostMode
{
HostPoweredOff,
HostConnectable,
HostDiscoverable,
HostDiscoverableLimitedInquiry,
};
enum Error
{
NoError,
PairingError,
UnknownError,
};
%If (Qt_5_6_1 -)
explicit QBluetoothLocalDevice(QObject *parent /TransferThis/ = 0);
%End
%If (- Qt_5_6_1)
QBluetoothLocalDevice(QObject *parent /TransferThis/ = 0);
%End
QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothLocalDevice();
bool isValid() const;
void requestPairing(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing);
QBluetoothLocalDevice::Pairing pairingStatus(const QBluetoothAddress &address) const;
void setHostMode(QBluetoothLocalDevice::HostMode mode);
QBluetoothLocalDevice::HostMode hostMode() const;
void powerOn();
QString name() const;
QBluetoothAddress address() const;
static QList<QBluetoothHostInfo> allDevices();
%If (Qt_5_3_0 -)
QList<QBluetoothAddress> connectedDevices() const;
%End
public slots:
void pairingConfirmation(bool confirmation);
signals:
void hostModeStateChanged(QBluetoothLocalDevice::HostMode state);
void pairingFinished(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing);
void pairingDisplayPinCode(const QBluetoothAddress &address, QString pin);
void pairingDisplayConfirmation(const QBluetoothAddress &address, QString pin);
void error(QBluetoothLocalDevice::Error error);
%If (Qt_5_3_0 -)
void deviceConnected(const QBluetoothAddress &address);
%End
%If (Qt_5_3_0 -)
void deviceDisconnected(const QBluetoothAddress &address);
%End
};
%End

View File

@@ -0,0 +1,108 @@
// qbluetoothserver.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothServer : public QObject
{
%TypeHeaderCode
#include <qbluetoothserver.h>
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QBluetoothDeviceDiscoveryAgent, &sipType_QBluetoothDeviceDiscoveryAgent, -1, 1},
{sipName_QBluetoothServiceDiscoveryAgent, &sipType_QBluetoothServiceDiscoveryAgent, -1, 2},
#if QT_VERSION >= 0x050400
{sipName_QLowEnergyService, &sipType_QLowEnergyService, -1, 3},
#else
{0, 0, -1, 3},
#endif
{sipName_QBluetoothTransferReply, &sipType_QBluetoothTransferReply, -1, 4},
{sipName_QBluetoothTransferManager, &sipType_QBluetoothTransferManager, -1, 5},
{sipName_QBluetoothServer, &sipType_QBluetoothServer, -1, 6},
#if QT_VERSION >= 0x050400
{sipName_QLowEnergyController, &sipType_QLowEnergyController, -1, 7},
#else
{0, 0, -1, 7},
#endif
{sipName_QBluetoothSocket, &sipType_QBluetoothSocket, -1, 8},
{sipName_QBluetoothLocalDevice, &sipType_QBluetoothLocalDevice, -1, -1},
};
int i = 0;
sipType = NULL;
do
{
struct class_graph *cg = &graph[i];
if (cg->name != NULL && sipCpp->inherits(cg->name))
{
sipType = *cg->type;
i = cg->yes;
}
else
i = cg->no;
}
while (i >= 0);
%End
public:
enum Error
{
NoError,
UnknownError,
PoweredOffError,
InputOutputError,
ServiceAlreadyRegisteredError,
UnsupportedProtocolError,
};
QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothServer();
void close() /ReleaseGIL/;
bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0) /ReleaseGIL/;
QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString()) /ReleaseGIL/;
bool isListening() const;
void setMaxPendingConnections(int numConnections);
int maxPendingConnections() const;
bool hasPendingConnections() const;
QBluetoothSocket *nextPendingConnection() /Factory/;
QBluetoothAddress serverAddress() const;
quint16 serverPort() const;
void setSecurityFlags(QBluetooth::SecurityFlags security);
QBluetooth::SecurityFlags securityFlags() const;
QBluetoothServiceInfo::Protocol serverType() const;
QBluetoothServer::Error error() const;
signals:
void newConnection();
void error(QBluetoothServer::Error);
};
%End

View File

@@ -0,0 +1,79 @@
// qbluetoothservicediscoveryagent.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothServiceDiscoveryAgent : public QObject
{
%TypeHeaderCode
#include <qbluetoothservicediscoveryagent.h>
%End
public:
enum Error
{
NoError,
InputOutputError,
PoweredOffError,
%If (Qt_5_3_0 -)
InvalidBluetoothAdapterError,
%End
UnknownError,
};
enum DiscoveryMode
{
MinimalDiscovery,
FullDiscovery,
};
%If (Qt_5_6_1 -)
explicit QBluetoothServiceDiscoveryAgent(QObject *parent /TransferThis/ = 0);
%End
%If (- Qt_5_6_1)
QBluetoothServiceDiscoveryAgent(QObject *parent /TransferThis/ = 0);
%End
QBluetoothServiceDiscoveryAgent(const QBluetoothAddress &deviceAdapter, QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothServiceDiscoveryAgent();
bool isActive() const;
QBluetoothServiceDiscoveryAgent::Error error() const;
QString errorString() const;
QList<QBluetoothServiceInfo> discoveredServices() const;
void setUuidFilter(const QList<QBluetoothUuid> &uuids);
void setUuidFilter(const QBluetoothUuid &uuid);
QList<QBluetoothUuid> uuidFilter() const;
bool setRemoteAddress(const QBluetoothAddress &address);
QBluetoothAddress remoteAddress() const;
public slots:
void start(QBluetoothServiceDiscoveryAgent::DiscoveryMode mode = QBluetoothServiceDiscoveryAgent::MinimalDiscovery);
void stop();
void clear();
signals:
void serviceDiscovered(const QBluetoothServiceInfo &info);
void finished();
void canceled();
void error(QBluetoothServiceDiscoveryAgent::Error error);
};
%End

View File

@@ -0,0 +1,95 @@
// qbluetoothserviceinfo.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothServiceInfo
{
%TypeHeaderCode
#include <qbluetoothserviceinfo.h>
%End
public:
enum AttributeId
{
ServiceRecordHandle,
ServiceClassIds,
ServiceRecordState,
ServiceId,
ProtocolDescriptorList,
BrowseGroupList,
LanguageBaseAttributeIdList,
ServiceInfoTimeToLive,
ServiceAvailability,
BluetoothProfileDescriptorList,
DocumentationUrl,
ClientExecutableUrl,
IconUrl,
AdditionalProtocolDescriptorList,
PrimaryLanguageBase,
ServiceName,
ServiceDescription,
ServiceProvider,
};
enum Protocol
{
UnknownProtocol,
L2capProtocol,
RfcommProtocol,
};
QBluetoothServiceInfo();
QBluetoothServiceInfo(const QBluetoothServiceInfo &other);
~QBluetoothServiceInfo();
bool isValid() const;
bool isComplete() const;
void setDevice(const QBluetoothDeviceInfo &info);
QBluetoothDeviceInfo device() const;
QVariant attribute(quint16 attributeId) const;
QList<quint16> attributes() const;
bool contains(quint16 attributeId) const;
void removeAttribute(quint16 attributeId);
QBluetoothServiceInfo::Protocol socketProtocol() const;
int protocolServiceMultiplexer() const;
int serverChannel() const;
QBluetoothServiceInfo::Sequence protocolDescriptor(QBluetoothUuid::ProtocolUuid protocol) const;
bool isRegistered() const;
bool registerService(const QBluetoothAddress &localAdapter = QBluetoothAddress());
bool unregisterService();
void setAttribute(quint16 attributeId, const QBluetoothUuid &value);
void setAttribute(quint16 attributeId, const QBluetoothServiceInfo::Sequence &value);
void setAttribute(quint16 attributeId, const QVariant &value);
void setServiceName(const QString &name);
QString serviceName() const;
void setServiceDescription(const QString &description);
QString serviceDescription() const;
void setServiceProvider(const QString &provider);
QString serviceProvider() const;
void setServiceAvailability(quint8 availability);
quint8 serviceAvailability() const;
void setServiceUuid(const QBluetoothUuid &uuid);
QBluetoothUuid serviceUuid() const;
QList<QBluetoothUuid> serviceClassUuids() const;
};
%End

View File

@@ -0,0 +1,149 @@
// qbluetoothsocket.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothSocket : public QIODevice
{
%TypeHeaderCode
#include <qbluetoothsocket.h>
%End
public:
enum SocketState
{
UnconnectedState,
ServiceLookupState,
ConnectingState,
ConnectedState,
BoundState,
ClosingState,
ListeningState,
};
enum SocketError
{
NoSocketError,
UnknownSocketError,
HostNotFoundError,
ServiceNotFoundError,
NetworkError,
UnsupportedProtocolError,
%If (Qt_5_3_0 -)
OperationError,
%End
%If (Qt_5_10_0 -)
RemoteHostClosedError,
%End
};
QBluetoothSocket(QBluetoothServiceInfo::Protocol socketType, QObject *parent /TransferThis/ = 0);
%If (Qt_5_6_1 -)
explicit QBluetoothSocket(QObject *parent /TransferThis/ = 0);
%End
%If (- Qt_5_6_1)
QBluetoothSocket(QObject *parent /TransferThis/ = 0);
%End
virtual ~QBluetoothSocket();
void abort();
virtual void close() /ReleaseGIL/;
virtual bool isSequential() const;
virtual qint64 bytesAvailable() const;
virtual qint64 bytesToWrite() const;
virtual bool canReadLine() const;
void connectToService(const QBluetoothServiceInfo &service, QIODevice::OpenMode mode = QIODevice::ReadWrite) /ReleaseGIL/;
void connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, QIODevice::OpenMode mode = QIODevice::ReadWrite) /ReleaseGIL/;
void connectToService(const QBluetoothAddress &address, quint16 port, QIODevice::OpenMode mode = QIODevice::ReadWrite) /ReleaseGIL/;
void disconnectFromService() /ReleaseGIL/;
QString localName() const;
QBluetoothAddress localAddress() const;
quint16 localPort() const;
QString peerName() const;
QBluetoothAddress peerAddress() const;
quint16 peerPort() const;
bool setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType, QBluetoothSocket::SocketState state = QBluetoothSocket::ConnectedState, QIODevice::OpenMode mode = QIODevice::ReadWrite);
int socketDescriptor() const;
QBluetoothServiceInfo::Protocol socketType() const;
QBluetoothSocket::SocketState state() const;
QBluetoothSocket::SocketError error() const;
QString errorString() const;
signals:
void connected();
void disconnected();
void error(QBluetoothSocket::SocketError error);
void stateChanged(QBluetoothSocket::SocketState state);
protected:
virtual SIP_PYOBJECT readData(qint64 maxlen) /TypeHint="Py_v3:bytes;str",ReleaseGIL/ [qint64 (char *data, qint64 maxSize)];
%MethodCode
// Return the data read or None if there was an error.
if (a0 < 0)
{
PyErr_SetString(PyExc_ValueError, "maximum length of data to be read cannot be negative");
sipIsErr = 1;
}
else
{
char *s = new char[a0];
qint64 len;
Py_BEGIN_ALLOW_THREADS
#if defined(SIP_PROTECTED_IS_PUBLIC)
len = sipSelfWasArg ? sipCpp->QBluetoothSocket::readData(s, a0) : sipCpp->readData(s, a0);
#else
len = sipCpp->sipProtectVirt_readData(sipSelfWasArg, s, a0);
#endif
Py_END_ALLOW_THREADS
if (len < 0)
{
Py_INCREF(Py_None);
sipRes = Py_None;
}
else
{
sipRes = SIPBytes_FromStringAndSize(s, len);
if (!sipRes)
sipIsErr = 1;
}
delete[] s;
}
%End
virtual qint64 writeData(const char *data /Array/, qint64 maxSize /ArraySize/) /ReleaseGIL/;
void setSocketState(QBluetoothSocket::SocketState state);
void setSocketError(QBluetoothSocket::SocketError error);
void doDeviceDiscovery(const QBluetoothServiceInfo &service, QIODevice::OpenMode openMode);
public:
%If (Qt_5_6_0 -)
void setPreferredSecurityFlags(QBluetooth::SecurityFlags flags);
%End
%If (Qt_5_6_0 -)
QBluetooth::SecurityFlags preferredSecurityFlags() const;
%End
};
%End

View File

@@ -0,0 +1,40 @@
// qbluetoothtransfermanager.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothTransferManager : public QObject
{
%TypeHeaderCode
#include <qbluetoothtransfermanager.h>
%End
public:
explicit QBluetoothTransferManager(QObject *parent /TransferThis/ = 0);
virtual ~QBluetoothTransferManager();
QBluetoothTransferReply *put(const QBluetoothTransferRequest &request, QIODevice *data) /Transfer/;
signals:
void finished(QBluetoothTransferReply *reply);
};
%End

View File

@@ -0,0 +1,74 @@
// qbluetoothtransferreply.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothTransferReply : public QObject
{
%TypeHeaderCode
#include <qbluetoothtransferreply.h>
%End
public:
enum TransferError
{
NoError,
UnknownError,
FileNotFoundError,
HostNotFoundError,
UserCanceledTransferError,
%If (Qt_5_3_0 -)
IODeviceNotReadableError,
%End
%If (Qt_5_3_0 -)
ResourceBusyError,
%End
%If (Qt_5_4_0 -)
SessionError,
%End
};
virtual ~QBluetoothTransferReply();
virtual bool isFinished() const = 0;
virtual bool isRunning() const = 0;
QBluetoothTransferManager *manager() const;
virtual QBluetoothTransferReply::TransferError error() const = 0;
virtual QString errorString() const = 0;
QBluetoothTransferRequest request() const;
public slots:
void abort();
signals:
void finished(QBluetoothTransferReply *);
void transferProgress(qint64 bytesTransferred, qint64 bytesTotal);
%If (Qt_5_4_0 -)
void error(QBluetoothTransferReply::TransferError lastError);
%End
protected:
explicit QBluetoothTransferReply(QObject *parent /TransferThis/ = 0);
void setManager(QBluetoothTransferManager *manager);
void setRequest(const QBluetoothTransferRequest &request);
};
%End

View File

@@ -0,0 +1,51 @@
// qbluetoothtransferrequest.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothTransferRequest
{
%TypeHeaderCode
#include <qbluetoothtransferrequest.h>
%End
public:
enum Attribute
{
DescriptionAttribute,
TimeAttribute,
TypeAttribute,
LengthAttribute,
NameAttribute,
};
explicit QBluetoothTransferRequest(const QBluetoothAddress &address = QBluetoothAddress());
QBluetoothTransferRequest(const QBluetoothTransferRequest &other);
~QBluetoothTransferRequest();
QVariant attribute(QBluetoothTransferRequest::Attribute code, const QVariant &defaultValue = QVariant()) const;
void setAttribute(QBluetoothTransferRequest::Attribute code, const QVariant &value);
QBluetoothAddress address() const;
bool operator!=(const QBluetoothTransferRequest &other) const;
bool operator==(const QBluetoothTransferRequest &other) const;
};
%End

View File

@@ -0,0 +1,553 @@
// qbluetoothuuid.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_2_0 -)
class QBluetoothUuid : public QUuid
{
%TypeHeaderCode
#include <qbluetoothuuid.h>
%End
public:
enum ProtocolUuid
{
Sdp,
Udp,
Rfcomm,
Tcp,
TcsBin,
TcsAt,
Att,
Obex,
Ip,
Ftp,
Http,
Wsp,
Bnep,
Upnp,
Hidp,
HardcopyControlChannel,
HardcopyDataChannel,
HardcopyNotification,
Avctp,
Avdtp,
Cmtp,
UdiCPlain,
McapControlChannel,
McapDataChannel,
L2cap,
};
enum ServiceClassUuid
{
ServiceDiscoveryServer,
BrowseGroupDescriptor,
PublicBrowseGroup,
SerialPort,
LANAccessUsingPPP,
DialupNetworking,
IrMCSync,
ObexObjectPush,
OBEXFileTransfer,
IrMCSyncCommand,
Headset,
AudioSource,
AudioSink,
AV_RemoteControlTarget,
AdvancedAudioDistribution,
AV_RemoteControl,
AV_RemoteControlController,
HeadsetAG,
PANU,
NAP,
GN,
DirectPrinting,
ReferencePrinting,
ImagingResponder,
ImagingAutomaticArchive,
ImagingReferenceObjects,
Handsfree,
HandsfreeAudioGateway,
DirectPrintingReferenceObjectsService,
ReflectedUI,
BasicPrinting,
PrintingStatus,
HumanInterfaceDeviceService,
HardcopyCableReplacement,
HCRPrint,
HCRScan,
SIMAccess,
PhonebookAccessPCE,
PhonebookAccessPSE,
PhonebookAccess,
HeadsetHS,
MessageAccessServer,
MessageNotificationServer,
MessageAccessProfile,
PnPInformation,
GenericNetworking,
GenericFileTransfer,
GenericAudio,
GenericTelephony,
VideoSource,
VideoSink,
VideoDistribution,
HDP,
HDPSource,
HDPSink,
%If (Qt_5_3_0 -)
BasicImage,
%End
%If (Qt_5_3_0 -)
GNSS,
%End
%If (Qt_5_3_0 -)
GNSSServer,
%End
%If (Qt_5_3_0 -)
Display3D,
%End
%If (Qt_5_3_0 -)
Glasses3D,
%End
%If (Qt_5_3_0 -)
Synchronization3D,
%End
%If (Qt_5_3_0 -)
MPSProfile,
%End
%If (Qt_5_3_0 -)
MPSService,
%End
%If (Qt_5_4_0 -)
GenericAccess,
%End
%If (Qt_5_4_0 -)
GenericAttribute,
%End
%If (Qt_5_4_0 -)
ImmediateAlert,
%End
%If (Qt_5_4_0 -)
LinkLoss,
%End
%If (Qt_5_4_0 -)
TxPower,
%End
%If (Qt_5_4_0 -)
CurrentTimeService,
%End
%If (Qt_5_4_0 -)
ReferenceTimeUpdateService,
%End
%If (Qt_5_4_0 -)
NextDSTChangeService,
%End
%If (Qt_5_4_0 -)
Glucose,
%End
%If (Qt_5_4_0 -)
HealthThermometer,
%End
%If (Qt_5_4_0 -)
DeviceInformation,
%End
%If (Qt_5_4_0 -)
HeartRate,
%End
%If (Qt_5_4_0 -)
PhoneAlertStatusService,
%End
%If (Qt_5_4_0 -)
BatteryService,
%End
%If (Qt_5_4_0 -)
BloodPressure,
%End
%If (Qt_5_4_0 -)
AlertNotificationService,
%End
%If (Qt_5_4_0 -)
HumanInterfaceDevice,
%End
%If (Qt_5_4_0 -)
ScanParameters,
%End
%If (Qt_5_4_0 -)
RunningSpeedAndCadence,
%End
%If (Qt_5_4_0 -)
CyclingSpeedAndCadence,
%End
%If (Qt_5_4_0 -)
CyclingPower,
%End
%If (Qt_5_4_0 -)
LocationAndNavigation,
%End
%If (Qt_5_5_0 -)
EnvironmentalSensing,
%End
%If (Qt_5_5_0 -)
BodyComposition,
%End
%If (Qt_5_5_0 -)
UserData,
%End
%If (Qt_5_5_0 -)
WeightScale,
%End
%If (Qt_5_5_0 -)
BondManagement,
%End
%If (Qt_5_5_0 -)
ContinuousGlucoseMonitoring,
%End
};
%If (Qt_5_4_0 -)
enum CharacteristicType
{
DeviceName,
Appearance,
PeripheralPrivacyFlag,
ReconnectionAddress,
PeripheralPreferredConnectionParameters,
ServiceChanged,
AlertLevel,
TxPowerLevel,
DateTime,
DayOfWeek,
DayDateTime,
ExactTime256,
DSTOffset,
TimeZone,
LocalTimeInformation,
TimeWithDST,
TimeAccuracy,
TimeSource,
ReferenceTimeInformation,
TimeUpdateControlPoint,
TimeUpdateState,
GlucoseMeasurement,
BatteryLevel,
TemperatureMeasurement,
TemperatureType,
IntermediateTemperature,
MeasurementInterval,
BootKeyboardInputReport,
SystemID,
ModelNumberString,
SerialNumberString,
FirmwareRevisionString,
HardwareRevisionString,
SoftwareRevisionString,
ManufacturerNameString,
IEEE1107320601RegulatoryCertificationDataList,
CurrentTime,
ScanRefresh,
BootKeyboardOutputReport,
BootMouseInputReport,
GlucoseMeasurementContext,
BloodPressureMeasurement,
IntermediateCuffPressure,
HeartRateMeasurement,
BodySensorLocation,
HeartRateControlPoint,
AlertStatus,
RingerControlPoint,
RingerSetting,
AlertCategoryIDBitMask,
AlertCategoryID,
AlertNotificationControlPoint,
UnreadAlertStatus,
NewAlert,
SupportedNewAlertCategory,
SupportedUnreadAlertCategory,
BloodPressureFeature,
HIDInformation,
ReportMap,
HIDControlPoint,
Report,
ProtocolMode,
ScanIntervalWindow,
PnPID,
GlucoseFeature,
RecordAccessControlPoint,
RSCMeasurement,
RSCFeature,
SCControlPoint,
CSCMeasurement,
CSCFeature,
SensorLocation,
CyclingPowerMeasurement,
CyclingPowerVector,
CyclingPowerFeature,
CyclingPowerControlPoint,
LocationAndSpeed,
Navigation,
PositionQuality,
LNFeature,
LNControlPoint,
%If (Qt_5_5_0 -)
MagneticDeclination,
%End
%If (Qt_5_5_0 -)
Elevation,
%End
%If (Qt_5_5_0 -)
Pressure,
%End
%If (Qt_5_5_0 -)
Temperature,
%End
%If (Qt_5_5_0 -)
Humidity,
%End
%If (Qt_5_5_0 -)
TrueWindSpeed,
%End
%If (Qt_5_5_0 -)
TrueWindDirection,
%End
%If (Qt_5_5_0 -)
ApparentWindSpeed,
%End
%If (Qt_5_5_0 -)
ApparentWindDirection,
%End
%If (Qt_5_5_0 -)
GustFactor,
%End
%If (Qt_5_5_0 -)
PollenConcentration,
%End
%If (Qt_5_5_0 -)
UVIndex,
%End
%If (Qt_5_5_0 -)
Irradiance,
%End
%If (Qt_5_5_0 -)
Rainfall,
%End
%If (Qt_5_5_0 -)
WindChill,
%End
%If (Qt_5_5_0 -)
HeatIndex,
%End
%If (Qt_5_5_0 -)
DewPoint,
%End
%If (Qt_5_5_0 -)
DescriptorValueChanged,
%End
%If (Qt_5_5_0 -)
AerobicHeartRateLowerLimit,
%End
%If (Qt_5_5_0 -)
AerobicThreshold,
%End
%If (Qt_5_5_0 -)
Age,
%End
%If (Qt_5_5_0 -)
AnaerobicHeartRateLowerLimit,
%End
%If (Qt_5_5_0 -)
AnaerobicHeartRateUpperLimit,
%End
%If (Qt_5_5_0 -)
AnaerobicThreshold,
%End
%If (Qt_5_5_0 -)
AerobicHeartRateUpperLimit,
%End
%If (Qt_5_5_0 -)
DateOfBirth,
%End
%If (Qt_5_5_0 -)
DateOfThresholdAssessment,
%End
%If (Qt_5_5_0 -)
EmailAddress,
%End
%If (Qt_5_5_0 -)
FatBurnHeartRateLowerLimit,
%End
%If (Qt_5_5_0 -)
FatBurnHeartRateUpperLimit,
%End
%If (Qt_5_5_0 -)
FirstName,
%End
%If (Qt_5_5_0 -)
FiveZoneHeartRateLimits,
%End
%If (Qt_5_5_0 -)
Gender,
%End
%If (Qt_5_5_0 -)
HeartRateMax,
%End
%If (Qt_5_5_0 -)
Height,
%End
%If (Qt_5_5_0 -)
HipCircumference,
%End
%If (Qt_5_5_0 -)
LastName,
%End
%If (Qt_5_5_0 -)
MaximumRecommendedHeartRate,
%End
%If (Qt_5_5_0 -)
RestingHeartRate,
%End
%If (Qt_5_5_0 -)
SportTypeForAerobicAnaerobicThresholds,
%End
%If (Qt_5_5_0 -)
ThreeZoneHeartRateLimits,
%End
%If (Qt_5_5_0 -)
TwoZoneHeartRateLimits,
%End
%If (Qt_5_5_0 -)
VO2Max,
%End
%If (Qt_5_5_0 -)
WaistCircumference,
%End
%If (Qt_5_5_0 -)
Weight,
%End
%If (Qt_5_5_0 -)
DatabaseChangeIncrement,
%End
%If (Qt_5_5_0 -)
UserIndex,
%End
%If (Qt_5_5_0 -)
BodyCompositionFeature,
%End
%If (Qt_5_5_0 -)
BodyCompositionMeasurement,
%End
%If (Qt_5_5_0 -)
WeightMeasurement,
%End
%If (Qt_5_5_0 -)
WeightScaleFeature,
%End
%If (Qt_5_5_0 -)
UserControlPoint,
%End
%If (Qt_5_5_0 -)
MagneticFluxDensity2D,
%End
%If (Qt_5_5_0 -)
MagneticFluxDensity3D,
%End
%If (Qt_5_5_0 -)
Language,
%End
%If (Qt_5_5_0 -)
BarometricPressureTrend,
%End
};
%End
%If (Qt_5_4_0 -)
enum DescriptorType
{
UnknownDescriptorType,
CharacteristicExtendedProperties,
CharacteristicUserDescription,
ClientCharacteristicConfiguration,
ServerCharacteristicConfiguration,
CharacteristicPresentationFormat,
CharacteristicAggregateFormat,
ValidRange,
ExternalReportReference,
ReportReference,
%If (Qt_5_5_0 -)
EnvironmentalSensingConfiguration,
%End
%If (Qt_5_5_0 -)
EnvironmentalSensingMeasurement,
%End
%If (Qt_5_5_0 -)
EnvironmentalSensingTriggerSetting,
%End
};
%End
QBluetoothUuid();
QBluetoothUuid(QBluetoothUuid::ProtocolUuid uuid /Constrained/);
QBluetoothUuid(QBluetoothUuid::ServiceClassUuid uuid /Constrained/);
%If (Qt_5_4_0 -)
QBluetoothUuid(QBluetoothUuid::CharacteristicType uuid /Constrained/);
%End
%If (Qt_5_4_0 -)
QBluetoothUuid(QBluetoothUuid::DescriptorType uuid /Constrained/);
%End
explicit QBluetoothUuid(quint32 uuid);
explicit QBluetoothUuid(quint128 uuid);
explicit QBluetoothUuid(const QString &uuid);
QBluetoothUuid(const QBluetoothUuid &uuid);
QBluetoothUuid(const QUuid &uuid);
~QBluetoothUuid();
bool operator==(const QBluetoothUuid &other) const;
%If (Qt_5_7_0 -)
bool operator!=(const QBluetoothUuid &other) const;
%End
int minimumSize() const;
quint16 toUInt16(bool *ok = 0) const;
quint32 toUInt32(bool *ok = 0) const;
quint128 toUInt128() const;
%If (Qt_5_4_0 -)
static QString serviceClassToString(QBluetoothUuid::ServiceClassUuid uuid);
%End
%If (Qt_5_4_0 -)
static QString protocolToString(QBluetoothUuid::ProtocolUuid uuid);
%End
%If (Qt_5_4_0 -)
static QString characteristicToString(QBluetoothUuid::CharacteristicType uuid);
%End
%If (Qt_5_4_0 -)
static QString descriptorToString(QBluetoothUuid::DescriptorType uuid);
%End
};
%End
%If (Qt_5_12_0 -)
QDataStream &operator<<(QDataStream &s, const QBluetoothUuid &uuid /Constrained/) /ReleaseGIL/;
%End
%If (Qt_5_12_0 -)
QDataStream &operator>>(QDataStream &s, QBluetoothUuid &uuid /Constrained/) /ReleaseGIL/;
%End

View File

@@ -0,0 +1,66 @@
// qlowenergyadvertisingdata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_7_0 -)
class QLowEnergyAdvertisingData
{
%TypeHeaderCode
#include <qlowenergyadvertisingdata.h>
%End
public:
QLowEnergyAdvertisingData();
QLowEnergyAdvertisingData(const QLowEnergyAdvertisingData &other);
~QLowEnergyAdvertisingData();
void setLocalName(const QString &name);
QString localName() const;
static quint16 invalidManufacturerId();
void setManufacturerData(quint16 id, const QByteArray &data);
quint16 manufacturerId() const;
QByteArray manufacturerData() const;
void setIncludePowerLevel(bool doInclude);
bool includePowerLevel() const;
enum Discoverability
{
DiscoverabilityNone,
DiscoverabilityLimited,
DiscoverabilityGeneral,
};
void setDiscoverability(QLowEnergyAdvertisingData::Discoverability mode);
QLowEnergyAdvertisingData::Discoverability discoverability() const;
void setServices(const QList<QBluetoothUuid> &services);
QList<QBluetoothUuid> services() const;
void setRawData(const QByteArray &data);
QByteArray rawData() const;
void swap(QLowEnergyAdvertisingData &other);
};
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyAdvertisingData &data1, const QLowEnergyAdvertisingData &data2);
%End
%If (Qt_5_7_0 -)
bool operator!=(const QLowEnergyAdvertisingData &data1, const QLowEnergyAdvertisingData &data2);
%End

View File

@@ -0,0 +1,84 @@
// qlowenergyadvertisingparameters.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_7_0 -)
class QLowEnergyAdvertisingParameters
{
%TypeHeaderCode
#include <qlowenergyadvertisingparameters.h>
%End
public:
QLowEnergyAdvertisingParameters();
QLowEnergyAdvertisingParameters(const QLowEnergyAdvertisingParameters &other);
~QLowEnergyAdvertisingParameters();
enum Mode
{
AdvInd,
AdvScanInd,
AdvNonConnInd,
};
void setMode(QLowEnergyAdvertisingParameters::Mode mode);
QLowEnergyAdvertisingParameters::Mode mode() const;
struct AddressInfo
{
%TypeHeaderCode
#include <qlowenergyadvertisingparameters.h>
%End
AddressInfo(const QBluetoothAddress &addr, QLowEnergyController::RemoteAddressType t);
AddressInfo();
QBluetoothAddress address;
QLowEnergyController::RemoteAddressType type;
};
enum FilterPolicy
{
IgnoreWhiteList,
UseWhiteListForScanning,
UseWhiteListForConnecting,
UseWhiteListForScanningAndConnecting,
};
void setWhiteList(const QList<QLowEnergyAdvertisingParameters::AddressInfo> &whiteList, QLowEnergyAdvertisingParameters::FilterPolicy policy);
QList<QLowEnergyAdvertisingParameters::AddressInfo> whiteList() const;
QLowEnergyAdvertisingParameters::FilterPolicy filterPolicy() const;
void setInterval(quint16 minimum, quint16 maximum);
int minimumInterval() const;
int maximumInterval() const;
void swap(QLowEnergyAdvertisingParameters &other);
};
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyAdvertisingParameters &p1, const QLowEnergyAdvertisingParameters &p2);
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyAdvertisingParameters::AddressInfo &ai1, const QLowEnergyAdvertisingParameters::AddressInfo &ai2);
%End
%If (Qt_5_7_0 -)
bool operator!=(const QLowEnergyAdvertisingParameters &p1, const QLowEnergyAdvertisingParameters &p2);
%End

View File

@@ -0,0 +1,64 @@
// qlowenergycharacteristic.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_4_0 -)
class QLowEnergyCharacteristic
{
%TypeHeaderCode
#include <qlowenergycharacteristic.h>
%End
public:
enum PropertyType
{
Unknown,
Broadcasting,
Read,
WriteNoResponse,
Write,
Notify,
Indicate,
WriteSigned,
ExtendedProperty,
};
typedef QFlags<QLowEnergyCharacteristic::PropertyType> PropertyTypes;
QLowEnergyCharacteristic();
QLowEnergyCharacteristic(const QLowEnergyCharacteristic &other);
~QLowEnergyCharacteristic();
bool operator==(const QLowEnergyCharacteristic &other) const;
bool operator!=(const QLowEnergyCharacteristic &other) const;
QString name() const;
QBluetoothUuid uuid() const;
QByteArray value() const;
QLowEnergyCharacteristic::PropertyTypes properties() const;
QLowEnergyHandle handle() const;
QLowEnergyDescriptor descriptor(const QBluetoothUuid &uuid) const;
QList<QLowEnergyDescriptor> descriptors() const;
bool isValid() const;
};
%End
%If (Qt_5_4_0 -)
QFlags<QLowEnergyCharacteristic::PropertyType> operator|(QLowEnergyCharacteristic::PropertyType f1, QFlags<QLowEnergyCharacteristic::PropertyType> f2);
%End

View File

@@ -0,0 +1,61 @@
// qlowenergycharacteristicdata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_7_0 -)
class QLowEnergyCharacteristicData
{
%TypeHeaderCode
#include <qlowenergycharacteristicdata.h>
%End
public:
QLowEnergyCharacteristicData();
QLowEnergyCharacteristicData(const QLowEnergyCharacteristicData &other);
~QLowEnergyCharacteristicData();
QBluetoothUuid uuid() const;
void setUuid(const QBluetoothUuid &uuid);
QByteArray value() const;
void setValue(const QByteArray &value);
QLowEnergyCharacteristic::PropertyTypes properties() const;
void setProperties(QLowEnergyCharacteristic::PropertyTypes properties);
QList<QLowEnergyDescriptorData> descriptors() const;
void setDescriptors(const QList<QLowEnergyDescriptorData> &descriptors);
void addDescriptor(const QLowEnergyDescriptorData &descriptor);
void setReadConstraints(QBluetooth::AttAccessConstraints constraints);
QBluetooth::AttAccessConstraints readConstraints() const;
void setWriteConstraints(QBluetooth::AttAccessConstraints constraints);
QBluetooth::AttAccessConstraints writeConstraints() const;
void setValueLength(int minimum, int maximum);
int minimumValueLength() const;
int maximumValueLength() const;
bool isValid() const;
void swap(QLowEnergyCharacteristicData &other);
};
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyCharacteristicData &cd1, const QLowEnergyCharacteristicData &cd2);
%End
%If (Qt_5_7_0 -)
bool operator!=(const QLowEnergyCharacteristicData &cd1, const QLowEnergyCharacteristicData &cd2);
%End

View File

@@ -0,0 +1,51 @@
// qlowenergyconnectionparameters.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_7_0 -)
class QLowEnergyConnectionParameters
{
%TypeHeaderCode
#include <qlowenergyconnectionparameters.h>
%End
public:
QLowEnergyConnectionParameters();
QLowEnergyConnectionParameters(const QLowEnergyConnectionParameters &other);
~QLowEnergyConnectionParameters();
void setIntervalRange(double minimum, double maximum);
double minimumInterval() const;
double maximumInterval() const;
void setLatency(int latency);
int latency() const;
void setSupervisionTimeout(int timeout);
int supervisionTimeout() const;
void swap(QLowEnergyConnectionParameters &other);
};
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2);
%End
%If (Qt_5_7_0 -)
bool operator!=(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2);
%End

View File

@@ -0,0 +1,153 @@
// qlowenergycontroller.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_4_0 -)
class QLowEnergyController : public QObject
{
%TypeHeaderCode
#include <qlowenergycontroller.h>
%End
public:
enum Error
{
NoError,
UnknownError,
UnknownRemoteDeviceError,
NetworkError,
InvalidBluetoothAdapterError,
%If (Qt_5_5_0 -)
ConnectionError,
%End
%If (Qt_5_7_0 -)
AdvertisingError,
%End
%If (Qt_5_10_0 -)
RemoteHostClosedError,
%End
%If (Qt_5_14_0 -)
AuthorizationError,
%End
};
enum ControllerState
{
UnconnectedState,
ConnectingState,
ConnectedState,
DiscoveringState,
DiscoveredState,
ClosingState,
%If (Qt_5_7_0 -)
AdvertisingState,
%End
};
enum RemoteAddressType
{
PublicAddress,
RandomAddress,
};
%If (Qt_5_5_0 -)
QLowEnergyController(const QBluetoothDeviceInfo &remoteDevice, QObject *parent /TransferThis/ = 0);
%End
QLowEnergyController(const QBluetoothAddress &remoteDevice, QObject *parent /TransferThis/ = 0);
QLowEnergyController(const QBluetoothAddress &remoteDevice, const QBluetoothAddress &localDevice, QObject *parent /TransferThis/ = 0);
virtual ~QLowEnergyController();
QBluetoothAddress localAddress() const;
QBluetoothAddress remoteAddress() const;
QLowEnergyController::ControllerState state() const;
QLowEnergyController::RemoteAddressType remoteAddressType() const;
void setRemoteAddressType(QLowEnergyController::RemoteAddressType type);
void connectToDevice();
void disconnectFromDevice();
void discoverServices();
QList<QBluetoothUuid> services() const;
QLowEnergyService *createServiceObject(const QBluetoothUuid &service, QObject *parent /TransferThis/ = 0) /Factory/;
QLowEnergyController::Error error() const;
QString errorString() const;
%If (Qt_5_5_0 -)
QString remoteName() const;
%End
signals:
void connected();
void disconnected();
void stateChanged(QLowEnergyController::ControllerState state);
void error(QLowEnergyController::Error newError);
void serviceDiscovered(const QBluetoothUuid &newService);
void discoveryFinished();
public:
%If (Qt_5_7_0 -)
enum Role
{
CentralRole,
PeripheralRole,
};
%End
%If (Qt_5_7_0 -)
static QLowEnergyController *createCentral(const QBluetoothDeviceInfo &remoteDevice, QObject *parent /TransferThis/ = 0) /Factory/;
%End
%If (Qt_5_14_0 -)
static QLowEnergyController *createCentral(const QBluetoothAddress &remoteDevice, const QBluetoothAddress &localDevice, QObject *parent /TransferThis/ = 0) /Factory/;
%End
%If (Qt_5_7_0 -)
static QLowEnergyController *createPeripheral(QObject *parent /TransferThis/ = 0) /Factory/;
%End
%If (Qt_5_7_0 -)
void startAdvertising(const QLowEnergyAdvertisingParameters &parameters, const QLowEnergyAdvertisingData &advertisingData, const QLowEnergyAdvertisingData &scanResponseData = QLowEnergyAdvertisingData());
%End
%If (Qt_5_7_0 -)
void stopAdvertising();
%End
%If (Qt_5_7_0 -)
QLowEnergyService *addService(const QLowEnergyServiceData &service, QObject *parent /TransferThis/ = 0) /Factory/;
%End
%If (Qt_5_7_0 -)
void requestConnectionUpdate(const QLowEnergyConnectionParameters &parameters);
%End
%If (Qt_5_7_0 -)
QLowEnergyController::Role role() const;
%End
signals:
%If (Qt_5_7_0 -)
void connectionUpdated(const QLowEnergyConnectionParameters &parameters);
%End
public:
%If (Qt_5_8_0 -)
QBluetoothUuid remoteDeviceUuid() const;
%End
private:
%If (Qt_5_7_0 -)
explicit QLowEnergyController(QObject *parent = 0);
%End
};
%End

View File

@@ -0,0 +1,45 @@
// qlowenergydescriptor.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_4_0 -)
class QLowEnergyDescriptor
{
%TypeHeaderCode
#include <qlowenergydescriptor.h>
%End
public:
QLowEnergyDescriptor();
QLowEnergyDescriptor(const QLowEnergyDescriptor &other);
~QLowEnergyDescriptor();
bool operator==(const QLowEnergyDescriptor &other) const;
bool operator!=(const QLowEnergyDescriptor &other) const;
bool isValid() const;
QByteArray value() const;
QBluetoothUuid uuid() const;
QLowEnergyHandle handle() const;
QString name() const;
QBluetoothUuid::DescriptorType type() const;
};
%End

View File

@@ -0,0 +1,56 @@
// qlowenergydescriptordata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_7_0 -)
class QLowEnergyDescriptorData
{
%TypeHeaderCode
#include <qlowenergydescriptordata.h>
%End
public:
QLowEnergyDescriptorData();
QLowEnergyDescriptorData(const QBluetoothUuid &uuid, const QByteArray &value);
QLowEnergyDescriptorData(const QLowEnergyDescriptorData &other);
~QLowEnergyDescriptorData();
QByteArray value() const;
void setValue(const QByteArray &value);
QBluetoothUuid uuid() const;
void setUuid(const QBluetoothUuid &uuid);
bool isValid() const;
void setReadPermissions(bool readable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints());
bool isReadable() const;
QBluetooth::AttAccessConstraints readConstraints() const;
void setWritePermissions(bool writable, QBluetooth::AttAccessConstraints constraints = QBluetooth::AttAccessConstraints());
bool isWritable() const;
QBluetooth::AttAccessConstraints writeConstraints() const;
void swap(QLowEnergyDescriptorData &other);
};
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyDescriptorData &d1, const QLowEnergyDescriptorData &d12);
%End
%If (Qt_5_7_0 -)
bool operator!=(const QLowEnergyDescriptorData &d1, const QLowEnergyDescriptorData &d2);
%End

View File

@@ -0,0 +1,119 @@
// qlowenergyservice.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_4_0 -)
class QLowEnergyService : public QObject /NoDefaultCtors/
{
%TypeHeaderCode
#include <qlowenergyservice.h>
%End
public:
enum ServiceType
{
PrimaryService,
IncludedService,
};
typedef QFlags<QLowEnergyService::ServiceType> ServiceTypes;
enum ServiceError
{
NoError,
OperationError,
CharacteristicWriteError,
DescriptorWriteError,
%If (Qt_5_5_0 -)
CharacteristicReadError,
%End
%If (Qt_5_5_0 -)
DescriptorReadError,
%End
%If (Qt_5_5_0 -)
UnknownError,
%End
};
enum ServiceState
{
InvalidService,
DiscoveryRequired,
DiscoveringServices,
ServiceDiscovered,
%If (Qt_5_7_0 -)
LocalService,
%End
};
enum WriteMode
{
WriteWithResponse,
WriteWithoutResponse,
%If (Qt_5_7_0 -)
WriteSigned,
%End
};
virtual ~QLowEnergyService();
QList<QBluetoothUuid> includedServices() const;
QLowEnergyService::ServiceTypes type() const;
QLowEnergyService::ServiceState state() const;
QLowEnergyCharacteristic characteristic(const QBluetoothUuid &uuid) const;
QList<QLowEnergyCharacteristic> characteristics() const;
QBluetoothUuid serviceUuid() const;
QString serviceName() const;
void discoverDetails();
QLowEnergyService::ServiceError error() const;
bool contains(const QLowEnergyCharacteristic &characteristic) const;
bool contains(const QLowEnergyDescriptor &descriptor) const;
void writeCharacteristic(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue, QLowEnergyService::WriteMode mode = QLowEnergyService::WriteWithResponse);
void writeDescriptor(const QLowEnergyDescriptor &descriptor, const QByteArray &newValue);
signals:
void stateChanged(QLowEnergyService::ServiceState newState);
void characteristicChanged(const QLowEnergyCharacteristic &info, const QByteArray &value);
void characteristicWritten(const QLowEnergyCharacteristic &info, const QByteArray &value);
void descriptorWritten(const QLowEnergyDescriptor &info, const QByteArray &value);
void error(QLowEnergyService::ServiceError error);
public:
%If (Qt_5_5_0 -)
void readCharacteristic(const QLowEnergyCharacteristic &characteristic);
%End
%If (Qt_5_5_0 -)
void readDescriptor(const QLowEnergyDescriptor &descriptor);
%End
signals:
%If (Qt_5_5_0 -)
void characteristicRead(const QLowEnergyCharacteristic &info, const QByteArray &value);
%End
%If (Qt_5_5_0 -)
void descriptorRead(const QLowEnergyDescriptor &info, const QByteArray &value);
%End
};
%End
%If (Qt_5_5_0 -)
QFlags<QLowEnergyService::ServiceType> operator|(QLowEnergyService::ServiceType f1, QFlags<QLowEnergyService::ServiceType> f2);
%End

View File

@@ -0,0 +1,62 @@
// qlowenergyservicedata.sip generated by MetaSIP
//
// This file is part of the QtBluetooth Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_5_7_0 -)
class QLowEnergyServiceData
{
%TypeHeaderCode
#include <qlowenergyservicedata.h>
%End
public:
QLowEnergyServiceData();
QLowEnergyServiceData(const QLowEnergyServiceData &other);
~QLowEnergyServiceData();
enum ServiceType
{
ServiceTypePrimary,
ServiceTypeSecondary,
};
QLowEnergyServiceData::ServiceType type() const;
void setType(QLowEnergyServiceData::ServiceType type);
QBluetoothUuid uuid() const;
void setUuid(const QBluetoothUuid &uuid);
QList<QLowEnergyService *> includedServices() const;
void setIncludedServices(const QList<QLowEnergyService *> &services);
void addIncludedService(QLowEnergyService *service);
QList<QLowEnergyCharacteristicData> characteristics() const;
void setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics);
void addCharacteristic(const QLowEnergyCharacteristicData &characteristic);
bool isValid() const;
void swap(QLowEnergyServiceData &other);
};
%End
%If (Qt_5_7_0 -)
bool operator==(const QLowEnergyServiceData &sd1, const QLowEnergyServiceData &sd2);
%End
%If (Qt_5_7_0 -)
bool operator!=(const QLowEnergyServiceData &sd1, const QLowEnergyServiceData &sd2);
%End

View File

@@ -0,0 +1,240 @@
// This is the SIP interface definition for the QList based mapped types
// specific to the QtBluetooth module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%MappedType QList<quint16>
/TypeHintIn="Iterable[int]", TypeHintOut="List[int]",
TypeHintValue="[]"/
{
%TypeHeaderCode
#include <qlist.h>
%End
%ConvertFromTypeCode
PyObject *l = PyList_New(sipCpp->size());
if (!l)
return 0;
for (int i = 0; i < sipCpp->size(); ++i)
{
// Convert to a Python long to make sure it doesn't get interpreted as
// a signed value.
PyObject *pobj = PyLong_FromUnsignedLongLong(sipCpp->value(i));
if (!pobj)
{
Py_DECREF(l);
return 0;
}
PyList_SetItem(l, i, pobj);
}
return l;
%End
%ConvertToTypeCode
PyObject *iter = PyObject_GetIter(sipPy);
if (!sipIsErr)
{
PyErr_Clear();
Py_XDECREF(iter);
return (iter
#if PY_MAJOR_VERSION < 3
&& !PyString_Check(sipPy)
#endif
&& !PyUnicode_Check(sipPy));
}
if (!iter)
{
*sipIsErr = 1;
return 0;
}
QList<quint16> *qv = new QList<quint16>;
for (Py_ssize_t i = 0; ; ++i)
{
PyErr_Clear();
PyObject *itm = PyIter_Next(iter);
if (!itm)
{
if (PyErr_Occurred())
{
delete qv;
Py_DECREF(iter);
*sipIsErr = 1;
return 0;
}
break;
}
PyErr_Clear();
unsigned long val = PyLong_AsUnsignedLongMask(itm);
if (PyErr_Occurred())
{
PyErr_Format(PyExc_TypeError,
"index %zd has type '%s' but 'int' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete qv;
Py_DECREF(iter);
*sipIsErr = 1;
return 0;
}
qv->append(val);
Py_DECREF(itm);
}
Py_DECREF(iter);
*sipCppPtr = qv;
return sipGetState(sipTransferObj);
%End
};
// QBluetoothServiceInfo::Sequence is actually a sub-class of QList<QVariant>.
// Note that QBluetoothServiceInfo::Alternative is identical and they are both
// syntactic sugar. By ignoring methods using the latter then everything works
// as expected.
%MappedType QBluetoothServiceInfo::Sequence
/TypeHintIn="Iterable[QVariant]", TypeHintOut="List[QVariant]",
TypeHintValue="[]"/
{
%TypeHeaderCode
#include <qbluetoothserviceinfo.h>
%End
%ConvertFromTypeCode
PyObject *l = PyList_New(sipCpp->size());
if (!l)
return 0;
for (int i = 0; i < sipCpp->size(); ++i)
{
QVariant *t = new QVariant(sipCpp->at(i));
PyObject *tobj = sipConvertFromNewType(t, sipType_QVariant,
sipTransferObj);
if (!tobj)
{
delete t;
Py_DECREF(l);
return 0;
}
PyList_SetItem(l, i, tobj);
}
return l;
%End
%ConvertToTypeCode
PyObject *iter = PyObject_GetIter(sipPy);
if (!sipIsErr)
{
PyErr_Clear();
Py_XDECREF(iter);
return (iter
#if PY_MAJOR_VERSION < 3
&& !PyString_Check(sipPy)
#endif
&& !PyUnicode_Check(sipPy));
}
if (!iter)
{
*sipIsErr = 1;
return 0;
}
QBluetoothServiceInfo::Sequence *ql = new QBluetoothServiceInfo::Sequence;
for (Py_ssize_t i = 0; ; ++i)
{
PyErr_Clear();
PyObject *itm = PyIter_Next(iter);
if (!itm)
{
if (PyErr_Occurred())
{
delete ql;
Py_DECREF(iter);
*sipIsErr = 1;
return 0;
}
break;
}
int state;
QVariant *t = reinterpret_cast<QVariant *>(
sipForceConvertToType(itm, sipType_QVariant, sipTransferObj,
SIP_NOT_NONE, &state, sipIsErr));
if (*sipIsErr)
{
PyErr_Format(PyExc_TypeError,
"index %zd has type '%s' but '_TYPE_' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete ql;
Py_DECREF(iter);
return 0;
}
ql->append(*t);
sipReleaseType(t, sipType_QVariant, state);
Py_DECREF(itm);
}
Py_DECREF(iter);
*sipCppPtr = ql;
return sipGetState(sipTransferObj);
%End
};

View File

@@ -0,0 +1,115 @@
// This is the SIP interface definition for the quint128 mapped type.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt5.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%MappedType quint128 /TypeHint="Tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int]"/
{
%TypeHeaderCode
#include <qbluetoothuuid.h>
%End
%ConvertFromTypeCode
PyObject *t = PyTuple_New(16);
if (!t)
return 0;
for (Py_ssize_t i = 0; i < 16; ++i)
{
// Convert to a Python long to make sure it doesn't get interpreted as
// a signed value.
PyObject *pobj = PyLong_FromUnsignedLong(sipCpp->data[i]);
if (!pobj)
{
Py_DECREF(t);
return 0;
}
PyTuple_SetItem(t, i, pobj);
}
return t;
%End
%ConvertToTypeCode
if (!sipIsErr)
return (PySequence_Check(sipPy)
#if PY_MAJOR_VERSION < 3
&& !PyString_Check(sipPy)
#endif
&& !PyUnicode_Check(sipPy));
Py_ssize_t len = PySequence_Size(sipPy);
if (len != 16)
{
// A negative length should only be an internal error so let the
// original exception stand.
if (len >= 0)
PyErr_Format(PyExc_TypeError,
"sequence has %zd elements but 16 elements are expected",
len);
*sipIsErr = 1;
return 0;
}
quint128 *qv = new quint128;
for (Py_ssize_t i = 0; i < 16; ++i)
{
PyObject *itm = PySequence_GetItem(sipPy, i);
if (!itm)
{
delete qv;
*sipIsErr = 1;
return 0;
}
PyErr_Clear();
unsigned long val = PyLong_AsUnsignedLongMask(itm);
if (PyErr_Occurred())
{
PyErr_Format(PyExc_TypeError,
"element %zd has type '%s' but 'int' is expected", i,
sipPyTypeName(Py_TYPE(itm)));
Py_DECREF(itm);
delete qv;
*sipIsErr = 1;
return 0;
}
qv->data[i] = val;
Py_DECREF(itm);
}
*sipCppPtr = qv;
return sipGetState(sipTransferObj);
%End
};