Keypop Storage Card C++ API - 1.2.0
Component of the Keypop C++ API
Keypop Storage Card C++ API

Overview

This repository contains C++ source files aligned with the Terminal Storage Card specifications proposed by the Calypso Networks Association. This C++ interface is a port of the Keypop Storage Card Java API, which remains the primary reference implementation. The C++ version aims to closely follow and maintain compatibility with the Java version, ensuring consistent functionality and adherence to the established specifications.

The focus of this project is on providing interface definitions essential for selecting and operating transactions with storage cards (e.g. NXP Mifare Ultralight, NXP Mifare Classic, ST Microelectronics ST25/SRT512). These interfaces serve as a foundational layer that can be extended and customized to suit specific application needs, while ensuring consistency across implementations, which is essential for enabling certification processes.

While the codebase primarily consists of header files, some .cpp files are included for internal consistency testing and validation.

Key Characteristics

  • Interface-Driven Design: The main source files define structures and interfaces. Concrete implementations can be provided by developers as per their specific requirements.
  • Modular Interfaces: Designed to support modular extensions, allowing developers to implement custom functionality while adhering to the standardized interface structure defined by this project.
  • Compliance: Aligned with the specifications of the Calypso Networks Association, ensuring that implementations conform to recognized standards, which is crucial for the terminal storage card layer certification.

Dependencies

This API relies on the Keypop Reader C++ API for card reader and card selection related interfaces.

Usage

To use the interface definitions in your project, include the relevant headers in your source files and provide concrete implementations of the defined interfaces as needed.

Building with Conan

This repository is packaged as a Conan recipe (conanfile.py), providing the Keypop::StorageCard CMake target as keypop-storagecard-cpp-api. It requires keypop-reader-cpp-api/[~2.1.1] (declared with transitive_headers=True, since this API's public headers include Keypop Reader headers directly), resolved via Conan instead of FetchContent; downstream keypop/keyple recipes should consume this package the same way, with self.requires("keypop-storagecard-cpp-api/[~1.2.0]").

The unit test suite is opt-in via the with_tests option (default False), so consumers of the package don't pay for compiling GoogleTest.

Local development

Use conan build to configure/compile in-tree, in a regular build/ folder you can inspect, rerun and debug against (and which generates a CMakeUserPresets.json for IDE integration). The build type defaults to Release; pass -s build_type=Debug for a debug build, which lands in its own build/Debug subfolder alongside build/Release:

# Release build, with the unit test suite, under ./build/Release
conan build . -o with_tests=True --build=missing
# Debug build, under ./build/Debug
conan build . -o with_tests=True -s build_type=Debug --build=missing
# Re-run the tests directly afterwards
./build/Release/bin/keypopstoragecard_ut
./build/Debug/bin/keypopstoragecard_ut

Packaging to the local cache

Use conan create to export the recipe and package to your local Conan cache, for consumption by other recipes/repos (no remote upload involved):

# Build and export the package to the local cache
conan create . --build=missing
# Same, but also build and run the unit test suite as part of the recipe build
conan create . -o with_tests=True --build=missing
# Package a Debug build instead (build_type defaults to Release)
conan create . -o with_tests=True -s build_type=Debug --build=missing

Conan profile

Builds use your default Conan profile. If you don't have one yet, create it with:

conan profile detect

Documentation & Contribution Guide

The full documentation, including the UML diagrams and design guide, is available on the Keypop website.

Contributing

Refer to the contributing guide file for guidelines on how to contribute. Please adhere to the Code of Conduct when participating in this project.

License

This project is licensed under the [MIT License](LICENSE). For more details, please refer to the [LICENSE](LICENSE) file.