qbluetoothserver.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // qbluetoothserver.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 QBluetoothServer : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qbluetoothserver.h>
  26. %End
  27. %ConvertToSubClassCode
  28. static struct class_graph {
  29. const char *name;
  30. sipTypeDef **type;
  31. int yes, no;
  32. } graph[] = {
  33. {sipName_QBluetoothDeviceDiscoveryAgent, &sipType_QBluetoothDeviceDiscoveryAgent, -1, 1},
  34. {sipName_QBluetoothLocalDevice, &sipType_QBluetoothLocalDevice, -1, 2},
  35. {sipName_QBluetoothServer, &sipType_QBluetoothServer, -1, 3},
  36. {sipName_QBluetoothServiceDiscoveryAgent, &sipType_QBluetoothServiceDiscoveryAgent, -1, 4},
  37. {sipName_QBluetoothSocket, &sipType_QBluetoothSocket, -1, 5},
  38. {sipName_QLowEnergyController, &sipType_QLowEnergyController, -1, 6},
  39. {sipName_QLowEnergyService, &sipType_QLowEnergyService, -1, -1},
  40. };
  41. int i = 0;
  42. sipType = NULL;
  43. do
  44. {
  45. struct class_graph *cg = &graph[i];
  46. if (cg->name != NULL && sipCpp->inherits(cg->name))
  47. {
  48. sipType = *cg->type;
  49. i = cg->yes;
  50. }
  51. else
  52. i = cg->no;
  53. }
  54. while (i >= 0);
  55. %End
  56. public:
  57. enum Error
  58. {
  59. NoError,
  60. UnknownError,
  61. PoweredOffError,
  62. InputOutputError,
  63. ServiceAlreadyRegisteredError,
  64. UnsupportedProtocolError,
  65. %If (Qt_6_4_0 -)
  66. MissingPermissionsError,
  67. %End
  68. };
  69. QBluetoothServer(QBluetoothServiceInfo::Protocol serverType, QObject *parent /TransferThis/ = 0);
  70. virtual ~QBluetoothServer();
  71. void close() /ReleaseGIL/;
  72. bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0) /ReleaseGIL/;
  73. QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString()) /ReleaseGIL/;
  74. bool isListening() const;
  75. void setMaxPendingConnections(int numConnections);
  76. int maxPendingConnections() const;
  77. bool hasPendingConnections() const;
  78. QBluetoothSocket *nextPendingConnection() /Factory/;
  79. QBluetoothAddress serverAddress() const;
  80. quint16 serverPort() const;
  81. void setSecurityFlags(QBluetooth::SecurityFlags security);
  82. QBluetooth::SecurityFlags securityFlags() const;
  83. QBluetoothServiceInfo::Protocol serverType() const;
  84. QBluetoothServer::Error error() const;
  85. signals:
  86. void newConnection();
  87. void errorOccurred(QBluetoothServer::Error error);
  88. };
  89. %End