Keypop Storage Card C++ API - 1.2.0
Component of the Keypop C++ API
StorageCard.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2026 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 ******************************************************************************/
10
11#pragma once
12
13#include <cstdint>
14#include <memory>
15#include <vector>
16
17#include "keypop/reader/selection/spi/SmartCard.hpp"
19
20namespace keypop {
21namespace storagecard {
22namespace card {
23
24using keypop::reader::selection::spi::SmartCard;
25
32class StorageCard : public SmartCard {
33public:
37 virtual ~StorageCard() = default;
38
45 virtual ProductType getProductType() const = 0;
46
53 virtual std::vector<uint8_t> getUID() const = 0;
54
74 virtual std::shared_ptr<std::vector<uint8_t>> getSystemBlock() const = 0;
75
88 virtual std::vector<uint8_t> getBlock(int blockAddress) const = 0;
89
109 virtual std::vector<uint8_t>
110 getBlocks(int fromBlockAddress, int toBlockAddress) const = 0;
111};
112
113} /* namespace card */
114} /* namespace storagecard */
115} /* namespace keypop */
Represents the different types of storage cards supported by the library.
Definition: ProductType.hpp:22
Represents a storage card with various methods to retrieve information and data from it.
Definition: StorageCard.hpp:32
virtual std::vector< uint8_t > getUID() const =0
Retrieves the unique identifier (UID) of the storage card.
virtual std::shared_ptr< std::vector< uint8_t > > getSystemBlock() const =0
Retrieves the system block from the storage card when available.
virtual ProductType getProductType() const =0
Returns the product type of the storage card.
virtual std::vector< uint8_t > getBlocks(int fromBlockAddress, int toBlockAddress) const =0
Retrieves the data blocks within the specified range from the memory image of the storage card.
virtual std::vector< uint8_t > getBlock(int blockAddress) const =0
Retrieves the data block at the specified block address.