LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
cardservice.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_CARDSERVICE_HPP
8#define LOGICALACCESS_CARDSERVICE_HPP
9
10#include <memory>
11#include <string>
12#include <logicalaccess/lla_core_api.hpp>
13
14namespace logicalaccess
15{
16#define EXCEPTION_MSG_AUTHENTICATE \
17 "Authenticate failed."
18#define EXCEPTION_MSG_LOADKEY \
19 "Load key failed."
20#define EXCEPTION_MSG_NOKEY \
21 "No key found."
22#define EXCEPTION_MSG_READ \
23 "Read operation failed."
24#define EXCEPTION_MSG_WRITE \
25 "Write operation failed."
26#define EXCEPTION_MSG_CHANGEKEY \
27 "Change key failed."
29class Chip;
30
35{
36 CST_UNDEFINED = 0x0000,
38 CST_NFC_TAG = 0x0002,
39 CST_STORAGE = 0x0003,
40 CST_UID_CHANGER = 0x0004,
41 CST_IDENTITY = 0x0005,
42 CST_JSON_DUMP = 0x0006,
44};
45
49class LLA_CORE_API CardService : public std::enable_shared_from_this<CardService>
50{
51 public:
52 virtual ~CardService() = default;
53
59 CardService(std::shared_ptr<Chip> chip, CardServiceType serviceType);
60
61 virtual std::string getCSType() = 0;
62
63 /*
64 * \brief Get the associated chip object.
65 * \return The chip.
66 */
67 std::shared_ptr<Chip> getChip() const
68 {
69 return d_chip;
70 }
71
76 virtual CardServiceType getServiceType() const;
77
78 protected:
82 std::shared_ptr<Chip> d_chip;
83
88};
89}
90
91#endif
The base card service class for all services.
Definition: cardservice.hpp:50
virtual std::string getCSType()=0
CardServiceType d_serviceType
Card service type.
Definition: cardservice.hpp:87
std::shared_ptr< Chip > d_chip
Chip object.
Definition: cardservice.hpp:82
virtual ~CardService()=default
std::shared_ptr< Chip > getChip() const
Definition: cardservice.hpp:67
Definition: asn1.hpp:9
CardServiceType
The card services.
Definition: cardservice.hpp:35
@ CST_CHALLENGE_RESPONSE
Definition: cardservice.hpp:43
@ CST_STORAGE
Definition: cardservice.hpp:39
@ CST_NFC_TAG
Definition: cardservice.hpp:38
@ CST_IDENTITY
Definition: cardservice.hpp:41
@ CST_ACCESS_CONTROL
Definition: cardservice.hpp:37
@ CST_UNDEFINED
Definition: cardservice.hpp:36
@ CST_UID_CHANGER
Definition: cardservice.hpp:40
@ CST_JSON_DUMP
Definition: cardservice.hpp:42