Skip to content

Commit 21a952d

Browse files
feat: updated to 2.0.1
1 parent 72a0afd commit 21a952d

File tree

9 files changed

+47
-2794
lines changed

9 files changed

+47
-2794
lines changed

.cppcheck.suppress

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
cstyleCast
2-
missingIncludeSystem
32
missingInclude
43
*:./include/keypop/reader/cpp/Any.hpp

.github/doxygen/Doxyfile

Lines changed: 0 additions & 2736 deletions
This file was deleted.
Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,14 @@
1-
name: Build and test code
1+
name: Build and Test code
22

33
on:
44
push:
55
branches:
66
- main
77
pull_request:
88

9-
jobs:
10-
build:
11-
12-
strategy:
13-
matrix:
14-
env:
15-
- toolchain: "toolchain/gcc-linux.cmake"
16-
runner: ubuntu-latest
17-
generator: ""
18-
- toolchain: "toolchain/clang-macos.cmake"
19-
runner: macos-latest
20-
generator: ""
21-
- toolchain: "\"toolchain/clang-windows.cmake\""
22-
runner: windows-latest
23-
generator: "-G \"Visual Studio 17 2022\""
24-
25-
runs-on: ${{ matrix.env.runner }}
26-
27-
steps:
28-
- name: Check out repository
29-
uses: actions/checkout@v4
309

31-
- name: Install Linux reqs
32-
if: ${{ matrix.env.runner == 'ubuntu-latest' }}
33-
run: |
34-
sudo apt-get update
35-
sudo apt-get install -y clang cmake cppcheck clang-format clang-tidy gcc pre-commit
36-
37-
- name: Install macOS reqs
38-
if: ${{ matrix.env.runner == 'macos-latest' }}
39-
run: |
40-
brew install llvm cppcheck clang-format gcc pre-commit
41-
42-
- name: Build
43-
run: |
44-
cmake ${{ matrix.env.generator }} -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ matrix.env.toolchain }}
45-
cmake --build build -j8
46-
47-
- name: Run Linux/macOS tests
48-
if: ${{ matrix.env.runner == 'ubuntu-latest' || matrix.env.runner == 'macos-latest' }}
49-
run: |
50-
./build/bin/keypopreader_ut
10+
jobs:
11+
call-reusable-workflow:
12+
uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-cpp-build-and-test.yml@main # NOSONAR - Same organization, trusted source
13+
with:
14+
test_executable_name: './build/bin/keypopreader_ut'

.github/workflows/publish-doc-release.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ name: Publish API documentation (release)
22
on:
33
release:
44
types: [published]
5-
workflow_dispatch:
6-
inputs:
7-
version:
8-
description: 'Version tag (ex: 1.0.0)'
9-
required: true
105

116
permissions:
127
checks: write
138

149
jobs:
1510
publish-doc-release:
16-
uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-publish-doxygen.yml@main
11+
uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-publish-doxygen.yml@main # NOSONAR - Same organization, trusted source
1712
with:
1813
version: ${{ github.event.inputs.version || github.ref_name }}
19-
secrets: inherit
14+
secrets: inherit # NOSONAR - Same organization, trusted source

.github/workflows/publish-doc-snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ permissions:
1010

1111
jobs:
1212
publish-doc-snapshot:
13-
uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-publish-doxygen.yml@main
14-
secrets: inherit
13+
uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-publish-doxygen.yml@main # NOSONAR - Same organization, trusted source
14+
secrets: inherit # NOSONAR - Same organization, trusted source

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
1212

1313
PROJECT(KeypopReaderCppApi
14-
VERSION 2.0.0
14+
VERSION 2.0.1
1515
LANGUAGES C CXX)
1616

1717
SET(PACKAGE_NAME "keypop-reader-cpp-api")

include/keypop/reader/CardReaderEvent.hpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pragma once
1212

1313
#include <memory>
14+
#include <ostream>
1415
#include <string>
1516

1617
#include "keypop/reader/selection/ScheduledCardSelectionsResponse.hpp"
@@ -100,5 +101,35 @@ class CardReaderEvent {
100101
getScheduledCardSelectionsResponse() const = 0;
101102
};
102103

104+
/**
105+
* Operator << for CardReaderEvent::Type enum to enable readable logging.
106+
*
107+
* @param os The output stream.
108+
* @param type The event type.
109+
* @return The output stream.
110+
*/
111+
inline std::ostream&
112+
operator<<(std::ostream& os, const CardReaderEvent::Type type)
113+
{
114+
switch (type) {
115+
case CardReaderEvent::Type::CARD_INSERTED:
116+
os << "CARD_INSERTED";
117+
break;
118+
case CardReaderEvent::Type::CARD_MATCHED:
119+
os << "CARD_MATCHED";
120+
break;
121+
case CardReaderEvent::Type::CARD_REMOVED:
122+
os << "CARD_REMOVED";
123+
break;
124+
case CardReaderEvent::Type::UNAVAILABLE:
125+
os << "UNAVAILABLE";
126+
break;
127+
default:
128+
os << "UNKNOWN_TYPE(" << static_cast<int>(type) << ")";
129+
break;
130+
}
131+
return os;
132+
}
133+
103134
} /* namespace reader */
104135
} /* namespace keypop */

include/keypop/reader/selection/CardSelector.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ class CardSelector : public CardSelectorBase {
5050
*
5151
* <p>The protocol is identified by its <b>logical name</b>.
5252
*
53-
* <p><b>Prerequisites</b>: the reader must be of type keypop::reader::ConfigurableCardReader
54-
* and the targeted card protocol(s) must be activated via the
55-
* keypop::reader::ConfigurableCardReader#activateProtocol(const
53+
* <p><b>Prerequisites</b>: the reader must be of type
54+
* keypop::reader::ConfigurableCardReader and the targeted card protocol(s)
55+
* must be activated via the keypop::reader
56+
* ::ConfigurableCardReader#activateProtocol(const
5657
* std::string&, const std::string&) method and associated with the logical
5758
* name used as a filter.
5859
*

include/keypop/reader/selection/spi/IsoSmartCard.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class IsoSmartCard : public SmartCard {
4242
* @return Null if no selection application has been performed.
4343
* @since 1.0.0
4444
*/
45-
virtual const std::vector<uint8_t>&
46-
getSelectApplicationResponse() const = 0;
45+
virtual std::vector<std::uint8_t> getSelectApplicationResponse() const = 0;
4746
};
4847

4948
} /* namespace spi */

0 commit comments

Comments
 (0)