qnearfieldtarget.sip 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // qnearfieldtarget.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNfc 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 QNearFieldTarget : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qnearfieldtarget.h>
  26. %End
  27. public:
  28. enum Type
  29. {
  30. ProprietaryTag,
  31. NfcTagType1,
  32. NfcTagType2,
  33. NfcTagType3,
  34. NfcTagType4,
  35. NfcTagType4A,
  36. NfcTagType4B,
  37. MifareTag,
  38. };
  39. enum AccessMethod /BaseType=Flag/
  40. {
  41. UnknownAccess,
  42. NdefAccess,
  43. TagTypeSpecificAccess,
  44. AnyAccess,
  45. };
  46. typedef QFlags<QNearFieldTarget::AccessMethod> AccessMethods;
  47. enum Error
  48. {
  49. NoError,
  50. UnknownError,
  51. UnsupportedError,
  52. TargetOutOfRangeError,
  53. NoResponseError,
  54. ChecksumMismatchError,
  55. InvalidParametersError,
  56. NdefReadError,
  57. NdefWriteError,
  58. CommandError,
  59. ConnectionError,
  60. TimeoutError,
  61. %If (Qt_6_8_0 -)
  62. UnsupportedTargetError,
  63. %End
  64. };
  65. class RequestId
  66. {
  67. %TypeHeaderCode
  68. #include <qnearfieldtarget.h>
  69. %End
  70. public:
  71. RequestId();
  72. RequestId(const QNearFieldTarget::RequestId &other);
  73. ~RequestId();
  74. bool isValid() const;
  75. int refCount() const;
  76. bool operator<(const QNearFieldTarget::RequestId &other) const;
  77. bool operator==(const QNearFieldTarget::RequestId &other) const;
  78. bool operator!=(const QNearFieldTarget::RequestId &other) const;
  79. };
  80. explicit QNearFieldTarget(QObject *parent /TransferThis/ = 0);
  81. virtual ~QNearFieldTarget();
  82. QByteArray uid() const;
  83. QNearFieldTarget::Type type() const;
  84. QNearFieldTarget::AccessMethods accessMethods() const;
  85. bool hasNdefMessage();
  86. QNearFieldTarget::RequestId readNdefMessages();
  87. QNearFieldTarget::RequestId writeNdefMessages(const QList<QNdefMessage> &messages);
  88. QNearFieldTarget::RequestId sendCommand(const QByteArray &command);
  89. bool waitForRequestCompleted(const QNearFieldTarget::RequestId &id, int msecs = 5000) /ReleaseGIL/;
  90. QVariant requestResponse(const QNearFieldTarget::RequestId &id) const;
  91. signals:
  92. void disconnected();
  93. void ndefMessageRead(const QNdefMessage &message);
  94. void requestCompleted(const QNearFieldTarget::RequestId &id);
  95. void error(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id);
  96. public:
  97. bool disconnect();
  98. int maxCommandLength() const;
  99. };
  100. %End