Skip to content

Commit 7e11d91

Browse files
feat: updated to 3.2.3
1 parent 74e6af3 commit 7e11d91

15 files changed

Lines changed: 130 additions & 90 deletions

CPPLINT.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#* *
1111
#* SPDX-License-Identifier: EPL-2.0 *
1212
#******************************************************************************/
13+
1314
set noparent
1415
filter=-whitespace/indent,-build/c++11,-runtime/references,-whitespace/braces,-whitespace/blank_line,-runtime/string
1516
linelength=80

include/keyple/core/service/CardSelectionManagerAdapter.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "keyple/core/service/ObservableLocalReaderAdapter.hpp"
2626
#include "keyple/core/service/ScheduledCardSelectionsResponseAdapter.hpp"
2727
#include "keyple/core/util/KeypleAssert.hpp"
28-
#include "keyple/core/util/cpp/KeypleStd.hpp"
2928
#include "keyple/core/util/cpp/Logger.hpp"
3029
#include "keyple/core/util/cpp/LoggerFactory.hpp"
3130
#include "keyple/core/util/cpp/exception/IllegalArgumentException.hpp"

include/keyple/core/service/LocalReaderAdapter.hpp

Lines changed: 80 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "keyple/core/service/CardResponseAdapter.hpp"
2525
#include "keyple/core/service/InternalIsoCardSelector.hpp"
2626
#include "keyple/core/service/KeypleServiceExport.hpp"
27+
#include "keyple/core/util/cpp/KeypleStd.hpp"
2728
#include "keypop/card/spi/ApduRequestSpi.hpp"
2829
#include "keypop/card/spi/CardSelectionRequestSpi.hpp"
2930
#include "keypop/reader/selection/CardSelector.hpp"
@@ -170,6 +171,85 @@ class KEYPLESERVICE_API LocalReaderAdapter : public AbstractReaderAdapter {
170171
*/
171172
void releaseChannel() final;
172173

174+
/**
175+
* (private)<br>
176+
* Local implementation of ApduRequestSpi.
177+
*/
178+
class ApduRequest : public ApduRequestSpi {
179+
public:
180+
friend class LocalReaderAdapter;
181+
182+
/**
183+
*
184+
*/
185+
virtual ~ApduRequest() = default;
186+
187+
/**
188+
*
189+
*/
190+
std::vector<uint8_t> getApdu() const override;
191+
192+
/**
193+
*
194+
*/
195+
const std::vector<int>& getSuccessfulStatusWords() const override;
196+
197+
/**
198+
*
199+
*/
200+
const std::string& getInfo() const override;
201+
202+
/**
203+
*
204+
*/
205+
friend std::ostream&
206+
operator<<(std::ostream& os, const ApduRequest& ar);
207+
208+
/**
209+
*
210+
*/
211+
friend std::ostream&
212+
operator<<(std::ostream& os, const std::shared_ptr<ApduRequest> ar);
213+
214+
/**
215+
*
216+
*/
217+
friend std::ostream& operator<<(
218+
std::ostream& os,
219+
const std::vector<std::shared_ptr<ApduRequest>>& ars);
220+
221+
private:
222+
/**
223+
*
224+
*/
225+
static const int DEFAULT_SUCCESSFUL_CODE;
226+
227+
/**
228+
*
229+
*/
230+
std::vector<uint8_t> mApdu;
231+
232+
/**
233+
*
234+
*/
235+
const std::vector<int> mSuccessfulStatusWords;
236+
237+
/**
238+
*
239+
*/
240+
std::string mInfo;
241+
242+
/**
243+
*
244+
*/
245+
explicit ApduRequest(const std::vector<uint8_t>& apdu);
246+
247+
/**
248+
*
249+
*/
250+
ApduRequest& setInfo(const std::string& info);
251+
};
252+
173253
protected:
174254
/**
175255
* @return null or the name of the physical protocol used for the last card
@@ -267,66 +347,6 @@ class KEYPLESERVICE_API LocalReaderAdapter : public AbstractReaderAdapter {
267347
const bool mHasMatched;
268348
};
269349

270-
/**
271-
* (private)<br>
272-
* Local implementation of ApduRequestSpi.
273-
*/
274-
class ApduRequest : public ApduRequestSpi {
275-
public:
276-
friend class LocalReaderAdapter;
277-
278-
/**
279-
*
280-
*/
281-
virtual ~ApduRequest() = default;
282-
283-
/**
284-
*
285-
*/
286-
std::vector<uint8_t> getApdu() const override;
287-
288-
/**
289-
*
290-
*/
291-
const std::vector<int>& getSuccessfulStatusWords() const override;
292-
293-
/**
294-
*
295-
*/
296-
const std::string& getInfo() const override;
297-
298-
private:
299-
/**
300-
*
301-
*/
302-
static const int DEFAULT_SUCCESSFUL_CODE;
303-
304-
/**
305-
*
306-
*/
307-
std::vector<uint8_t> mApdu;
308-
309-
/**
310-
*
311-
*/
312-
const std::vector<int> mSuccessfulStatusWords;
313-
314-
/**
315-
*
316-
*/
317-
std::string mInfo;
318-
319-
/**
320-
*
321-
*/
322-
explicit ApduRequest(const std::vector<uint8_t>& apdu);
323-
324-
/**
325-
*
326-
*/
327-
ApduRequest& setInfo(const std::string& info);
328-
};
329-
330350
/**
331351
* Determines the current protocol used by the card.
332352
*

include/keyple/core/service/PoolPlugin.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
#include <vector>
1919

2020
#include "keyple/core/service/KeypleServiceExport.hpp"
21+
#include "keyple/core/service/Plugin.hpp"
22+
#include "keypop/reader/CardReader.hpp"
2123
#include "keypop/reader/selection/spi/SmartCard.hpp"
2224

2325
namespace keyple {
2426
namespace core {
2527
namespace service {
2628

29+
using keypop::reader::CardReader;
2730
using keypop::reader::selection::spi::SmartCard;
2831

2932
/**

include/keyple/core/service/ReaderApiFactoryAdapter.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**************************************************************************************************
22
* Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ *
33
* *
4-
* This program and the accomping materials are made available under the *
4+
* This program and the accomping materials are made available under the *
55
* terms of the MIT License which is available at https://opensource.org/licenses/MIT. *
66
* *
7-
* SPDX-License-Identifier: MIT *
7+
* SPDX-License-Identifier: MIT *
88
**************************************************************************************************/
99

1010
#pragma once

include/keyple/core/service/SmartCardServiceAdapter.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "keyple/core/service/ObservableLocalPluginAdapter.hpp"
3939
#include "keyple/core/service/ReaderApiFactoryAdapter.hpp"
4040
#include "keyple/core/util/KeypleAssert.hpp"
41-
#include "keyple/core/util/cpp/KeypleStd.hpp"
4241
#include "keyple/core/util/cpp/StringUtils.hpp"
4342
#include "keyple/core/util/cpp/exception/IllegalArgumentException.hpp"
4443
#include "keyple/core/util/cpp/exception/IllegalStateException.hpp"

src/CMakeLists.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# *****************************************************************************
2-
# Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3-
# *
4-
# This program and the accompanying materials are made available under the *
5-
# terms of the MIT License which is available at *
6-
# https://opensource.org/licenses/MIT. *
7-
# *
8-
# SPDX-License-Identifier: MIT *
9-
# *****************************************************************************/
1+
#******************************************************************************
2+
#* Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3+
#* *
4+
#* See the NOTICE file(s) distributed with this work for additional *
5+
#* information regarding copyright ownership. *
6+
#* *
7+
#* This program and the accompanying materials are made available under the *
8+
#* terms of the Eclipse Public License 2.0 which is available at *
9+
#* http://www.eclipse.org/legal/epl-2.0 *
10+
#* *
11+
#* SPDX-License-Identifier: EPL-2.0 *
12+
#******************************************************************************/
1013

1114
# Add projects
1215
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/main)

src/main/CardInsertionPassiveMonitoringJobAdapter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "keyple/core/plugin/TaskCanceledException.hpp"
2020
#include "keyple/core/plugin/spi/reader/observable/state/insertion/CardInsertionWaiterBlockingSpi.hpp"
2121
#include "keyple/core/plugin/spi/reader/observable/state/insertion/WaitForCardInsertionBlockingSpi.hpp"
22-
#include "keyple/core/util/cpp/KeypleStd.hpp"
2322
#include "keyple/core/util/cpp/exception/RuntimeException.hpp"
2423

2524
namespace keyple {

src/main/CardSelectionManagerAdapter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ CardSelectionManagerAdapter::processCardSelectionResponses(
232232
std::shared_ptr<SmartCard> smartCard = nullptr;
233233
try {
234234
smartCard = std::dynamic_pointer_cast<SmartCard>(
235-
mCardSelections[index]->parse(
236-
std::dynamic_pointer_cast<CardSelectionRequestSpi>(
237-
cardSelectionResponse)));
235+
mCardSelections[index]->parse(cardSelectionResponse));
238236

239237
} catch (const ParseException& e) {
240238
throw InvalidCardResponseException(

src/main/LocalReaderAdapter.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,25 @@ operator<<(
837837
return os;
838838
}
839839

840+
std::ostream&
841+
operator<<(
842+
std::ostream& os,
843+
const std::vector<std::shared_ptr<LocalReaderAdapter::ApduRequest>>& ars)
844+
{
845+
os << "APDU_REQUESTS: {";
846+
847+
for (auto it = ars.begin(); it != ars.end(); it++) {
848+
if (it != ars.begin()) {
849+
os << ", ";
850+
}
851+
os << *it;
852+
}
853+
854+
os << "}";
855+
856+
return os;
857+
}
858+
840859
} /* namespace service */
841860
} /* namespace core */
842861
} /* namespace keyple */

0 commit comments

Comments
 (0)