1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the QtNfc module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:LGPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU Lesser General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
21 | ** packaging of this file. Please review the following information to |
22 | ** ensure the GNU Lesser General Public License version 3 requirements |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
24 | ** |
25 | ** GNU General Public License Usage |
26 | ** Alternatively, this file may be used under the terms of the GNU |
27 | ** General Public License version 2.0 or (at your option) the GNU General |
28 | ** Public license version 3 or any later version approved by the KDE Free |
29 | ** Qt Foundation. The licenses are as published by the Free Software |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
31 | ** included in the packaging of this file. Please review the following |
32 | ** information to ensure the GNU General Public License requirements will |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
35 | ** |
36 | ** $QT_END_LICENSE$ |
37 | ** |
38 | ****************************************************************************/ |
39 | |
40 | #include "qnearfieldtagtype3_p.h" |
41 | |
42 | QT_BEGIN_NAMESPACE |
43 | |
44 | /*! |
45 | \class QNearFieldTagType3 |
46 | \brief The QNearFieldTagType3 class provides an interface for communicating with an NFC Tag |
47 | Type 3 tag. |
48 | |
49 | \ingroup connectivity-nfc |
50 | \inmodule QtNfc |
51 | \internal |
52 | */ |
53 | |
54 | /*! |
55 | \fn Type QNearFieldTagType3::type() const |
56 | \reimp |
57 | */ |
58 | |
59 | /*! |
60 | Constructs a new tag type 3 near field target with \a parent. |
61 | */ |
62 | QNearFieldTagType3::QNearFieldTagType3(QObject *parent) : |
63 | QNearFieldTarget(parent) |
64 | { |
65 | } |
66 | |
67 | /*! |
68 | Returns the system code of the target. |
69 | */ |
70 | quint16 QNearFieldTagType3::systemCode() |
71 | { |
72 | return 0; |
73 | } |
74 | |
75 | /*! |
76 | Returns a list of available services. |
77 | */ |
78 | QList<quint16> QNearFieldTagType3::services() |
79 | { |
80 | return QList<quint16>(); |
81 | } |
82 | |
83 | /*! |
84 | Returns the memory size of the service specified by \a serviceCode. |
85 | */ |
86 | int QNearFieldTagType3::serviceMemorySize(quint16 serviceCode) |
87 | { |
88 | Q_UNUSED(serviceCode); |
89 | |
90 | return 0; |
91 | } |
92 | |
93 | /*! |
94 | Requests the data contents of the service specified by \a serviceCode. Returns a request id |
95 | which can be used to track the completion status of the request. |
96 | |
97 | Once the request completes successfully the service data can be retrieved from the |
98 | requestResponse() function. The response of this request will be a QByteArray. |
99 | |
100 | \sa requestCompleted(), waitForRequestCompleted() |
101 | */ |
102 | QNearFieldTarget::RequestId QNearFieldTagType3::serviceData(quint16 serviceCode) |
103 | { |
104 | Q_UNUSED(serviceCode); |
105 | |
106 | return RequestId(); |
107 | } |
108 | |
109 | /*! |
110 | Writes \a data to the service specified by \a serviceCode. Returns a request id which can |
111 | be used to track the completion status of the request. |
112 | |
113 | Once the request completes the response can be retrieved from the requestResponse() function. |
114 | The response of this request will be a boolean value, true for success; otherwise false. |
115 | |
116 | \sa requestCompleted(), waitForRequestCompleted() |
117 | */ |
118 | QNearFieldTarget::RequestId QNearFieldTagType3::writeServiceData(quint16 serviceCode, |
119 | const QByteArray &data) |
120 | { |
121 | Q_UNUSED(serviceCode); |
122 | Q_UNUSED(data); |
123 | |
124 | return RequestId(); |
125 | } |
126 | |
127 | /*! |
128 | Sends the \e check request to the target. Requests the service data blocks specified by |
129 | \a serviceBlockList. Returns a request id which can be used to track the completion status of |
130 | the request. |
131 | |
132 | The \a serviceBlockList parameter is a map with the key being the service code and the value |
133 | being a list of block indexes to retrieve. |
134 | |
135 | Once the request completes the response can be retrieved from the requestResponse() function. |
136 | The response of this request will be a QMap<quint16, QByteArray>, with the key being the |
137 | service code and the value being the concatenated blocks retrieved for that service. |
138 | |
139 | This is a low level function, to retrieve the entire data contents of a service use |
140 | serviceData(). |
141 | |
142 | \sa requestCompleted(), waitForRequestCompleted() |
143 | */ |
144 | QNearFieldTarget::RequestId QNearFieldTagType3::check(const QMap<quint16, QList<quint16> > &serviceBlockList) |
145 | { |
146 | Q_UNUSED(serviceBlockList); |
147 | |
148 | return RequestId(); |
149 | } |
150 | |
151 | /*! |
152 | Sends the \e update request to the target. Writes \a data to the services and block indexes |
153 | sepecified by \a serviceBlockList. Returns a request id which can be used to track the |
154 | completion status of the request. |
155 | |
156 | The \a serviceBlockList parameter is a map with the key being the service code and the value |
157 | being a list of block indexes to write to. |
158 | |
159 | Once the request completes the response can be retried from the requestResponse() function. The |
160 | response of this request will be a boolean value, true for success; otherwise false. |
161 | |
162 | This is a low level function, to write the entire data contents of a service use |
163 | writeServiceData(). |
164 | |
165 | \sa requestCompleted(), waitForRequestCompleted() |
166 | */ |
167 | QNearFieldTarget::RequestId QNearFieldTagType3::update(const QMap<quint16, QList<quint16> > &serviceBlockList, |
168 | const QByteArray &data) |
169 | { |
170 | Q_UNUSED(serviceBlockList); |
171 | Q_UNUSED(data); |
172 | |
173 | return RequestId(); |
174 | } |
175 | |
176 | /*! |
177 | \reimp |
178 | */ |
179 | bool QNearFieldTagType3::handleResponse(const QNearFieldTarget::RequestId &id, |
180 | const QByteArray &response) |
181 | { |
182 | return QNearFieldTarget::handleResponse(id, response); |
183 | } |
184 | |
185 | QT_END_NAMESPACE |
186 | |