qlowenergyservice.sip 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // qlowenergyservice.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtBluetooth Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. %If (Qt_6_2_0 -)
  22. class QLowEnergyService : public QObject /NoDefaultCtors/
  23. {
  24. %TypeHeaderCode
  25. #include <qlowenergyservice.h>
  26. %End
  27. public:
  28. enum DiscoveryMode
  29. {
  30. FullDiscovery,
  31. SkipValueDiscovery,
  32. };
  33. enum ServiceType /BaseType=Flag/
  34. {
  35. PrimaryService,
  36. IncludedService,
  37. };
  38. typedef QFlags<QLowEnergyService::ServiceType> ServiceTypes;
  39. enum ServiceError
  40. {
  41. NoError,
  42. OperationError,
  43. CharacteristicWriteError,
  44. DescriptorWriteError,
  45. CharacteristicReadError,
  46. DescriptorReadError,
  47. UnknownError,
  48. };
  49. enum ServiceState
  50. {
  51. InvalidService,
  52. DiscoveryRequired,
  53. ServiceDiscovered,
  54. LocalService,
  55. RemoteService,
  56. RemoteServiceDiscovering,
  57. RemoteServiceDiscovered,
  58. DiscoveringService,
  59. };
  60. enum WriteMode
  61. {
  62. WriteWithResponse,
  63. WriteWithoutResponse,
  64. WriteSigned,
  65. };
  66. virtual ~QLowEnergyService();
  67. QList<QBluetoothUuid> includedServices() const;
  68. QLowEnergyService::ServiceTypes type() const;
  69. QLowEnergyService::ServiceState state() const;
  70. QLowEnergyCharacteristic characteristic(const QBluetoothUuid &uuid) const;
  71. QList<QLowEnergyCharacteristic> characteristics() const;
  72. QBluetoothUuid serviceUuid() const;
  73. QString serviceName() const;
  74. void discoverDetails(QLowEnergyService::DiscoveryMode mode = QLowEnergyService::FullDiscovery);
  75. QLowEnergyService::ServiceError error() const;
  76. bool contains(const QLowEnergyCharacteristic &characteristic) const;
  77. bool contains(const QLowEnergyDescriptor &descriptor) const;
  78. void writeCharacteristic(const QLowEnergyCharacteristic &characteristic, const QByteArray &newValue, QLowEnergyService::WriteMode mode = QLowEnergyService::WriteWithResponse);
  79. void writeDescriptor(const QLowEnergyDescriptor &descriptor, const QByteArray &newValue);
  80. signals:
  81. void stateChanged(QLowEnergyService::ServiceState newState);
  82. void characteristicChanged(const QLowEnergyCharacteristic &info, const QByteArray &value);
  83. void characteristicWritten(const QLowEnergyCharacteristic &info, const QByteArray &value);
  84. void descriptorWritten(const QLowEnergyDescriptor &info, const QByteArray &value);
  85. void errorOccurred(QLowEnergyService::ServiceError error);
  86. public:
  87. void readCharacteristic(const QLowEnergyCharacteristic &characteristic);
  88. void readDescriptor(const QLowEnergyDescriptor &descriptor);
  89. signals:
  90. void characteristicRead(const QLowEnergyCharacteristic &info, const QByteArray &value);
  91. void descriptorRead(const QLowEnergyDescriptor &info, const QByteArray &value);
  92. };
  93. %End