LibLogicalAccess
2.5.0
An Open Source RFID Library
|
#include <json_dump_card_service.hpp>
Public Member Functions | |
virtual | ~JsonDumpCardService () |
JsonDumpCardService (const std::shared_ptr< Chip > &chip) | |
std::string | getCSType () override |
void | configure (const std::string &json_template) |
std::string | dump () |
![]() | |
virtual | ~CardService ()=default |
CardService (std::shared_ptr< Chip > chip, CardServiceType serviceType) | |
Constructor. | |
virtual std::string | getCSType ()=0 |
std::shared_ptr< Chip > | getChip () const |
virtual CardServiceType | getServiceType () const |
Get the card service type. | |
Public Attributes | |
std::map< std::string, std::shared_ptr< Format > > | formats_ |
std::map< std::string, std::shared_ptr< Key > > | keys_ |
std::map< std::string, std::shared_ptr< FormatInfos > > | format_infos_ |
Static Public Attributes | |
static constexpr const CardServiceType | service_type_ = CST_JSON_DUMP |
Private Member Functions | |
void | extract_formats (const nlohmann::json &json) |
virtual std::shared_ptr< Key > | create_key (const nlohmann::json &key_description)=0 |
void | extract_keys (const nlohmann::json &json) |
virtual void | configure_format_infos (const nlohmann::json &json)=0 |
Private Attributes | |
bool | configured_ |
Additional Inherited Members | |
![]() | |
std::shared_ptr< Chip > | d_chip |
Chip object. | |
CardServiceType | d_serviceType |
Card service type. | |
A high level service that read data from a card and return its content.
The content to fetch, from format to keys, is described by JSON. Similarly, the output is a JSON string representing the data that have been extracted from the card.
The input JSON format is RFID.onl format. Todo better documentation ?
|
virtual |
|
explicit |
void logicalaccess::JsonDumpCardService::configure | ( | const std::string & | json_template | ) |
Configure the service, providing the input JSON that will be used to create internal object required to properly dump the content of the card.
It is required to call configure() before calling dump().
|
privatepure virtual |
Populate the format_infos_ map. The subclass is expected to parse the provided JSON and create corresponding FormatInfo with proper Format, Location and AccessInfo.
Implemented in logicalaccess::DESFireJsonDumpCardService.
|
privatepure virtual |
Create a properly typed key object that can be used against the given card.
Implemented in logicalaccess::DESFireJsonDumpCardService.
std::string logicalaccess::JsonDumpCardService::dump | ( | ) |
Dump the content of the content of the card, according the configuration provided at the configure() call.
|
private |
|
private |
|
inlineoverridevirtual |
Implements logicalaccess::CardService.
|
private |
std::map<std::string, std::shared_ptr<FormatInfos> > logicalaccess::JsonDumpCardService::format_infos_ |
std::map<std::string, std::shared_ptr<Format> > logicalaccess::JsonDumpCardService::formats_ |
std::map<std::string, std::shared_ptr<Key> > logicalaccess::JsonDumpCardService::keys_ |
|
staticconstexpr |