Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qapduutils_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QAPDUUTILS_P_H
5#define QAPDUUTILS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/QByteArray>
19
21
22class QResponseApdu
23{
24public:
25 static constexpr uint16_t Empty = 0x0000;
26 static constexpr uint16_t Success = 0x9000;
27
28 explicit QResponseApdu(const QByteArray &response = {});
29
30 const QByteArray &data() const { return m_data; }
31 uint16_t status() const { return m_status; }
32 bool isOk() const { return m_status == Success; }
33
34private:
35 QByteArray m_data;
36 uint16_t m_status;
37};
38
39namespace QCommandApdu {
40
41// INS byte values for command APDUs
42constexpr uint8_t Select = 0xA4;
43constexpr uint8_t ReadBinary = 0xB0;
44constexpr uint8_t GetData = 0xCA;
45constexpr uint8_t UpdateBinary = 0xD6;
46
47QByteArray build(uint8_t cla, uint8_t ins, uint8_t p1, uint8_t p2, QByteArrayView data,
48 uint16_t ne = 0);
49};
50
51QT_END_NAMESPACE
52
53#endif // QAPDUUTILS_P_H
Action provideResponse(const QByteArray &response) override
Action writeMessages(const QList< QNdefMessage > &messages) override
Action readMessages() override
QNdefMessage getMessage(Action &nextAction) override
Action detectNdefSupport() override
QByteArray getCommand(Action &nextAction) override
constexpr uint8_t Select
constexpr uint8_t GetData
QByteArray build(uint8_t cla, uint8_t ins, uint8_t p1, uint8_t p2, QByteArrayView data, uint16_t ne=0)
constexpr uint8_t ReadBinary
constexpr uint8_t UpdateBinary