LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
mifarechip.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_MIFARECHIP_HPP
8#define LOGICALACCESS_MIFARECHIP_HPP
9
12#include <logicalaccess/plugins/cards/mifare/lla_cards_mifare_api.hpp>
13#include <string>
14#include <vector>
15#include <iostream>
16
17namespace logicalaccess
18{
19#define CHIP_MIFARE "Mifare"
20
24class LLA_CARDS_MIFARE_API MifareChip : public Chip
25{
26 public:
30 MifareChip();
31
35 explicit MifareChip(std::string cardtype);
36
40 virtual ~MifareChip();
41
46 std::string getGenericCardType() const override
47 {
48 return CHIP_MIFARE;
49 }
50
55 std::shared_ptr<LocationNode> getRootLocationNode() override;
56
60 unsigned int getNbSectors() const;
61
67 static void addSectorNode(std::shared_ptr<LocationNode> rootNode, int sector);
68
75 static void addBlockNode(std::shared_ptr<LocationNode> rootNode, int sector,
76 unsigned char block);
77
83 std::shared_ptr<CardService> getService(CardServiceType serviceType) override;
84
89 std::shared_ptr<AccessInfo> createAccessInfo() const override;
90
95 std::shared_ptr<Location> createLocation() const override;
96
101 std::shared_ptr<MifareCommands> getMifareCommands() const
102 {
103 return std::dynamic_pointer_cast<MifareCommands>(getCommands());
104 }
105
106 protected:
112 MifareChip(std::string cardtype, unsigned int nbSectors);
113
117 unsigned int d_nbSectors;
118};
119}
120
121#endif /* LOGICALACCESS_MIFARECHIP_HPP */
Chip descriptor.
The base chip class for all chip. Each chip have is own object and providers according to himself and...
Definition: chip.hpp:37
The Mifare base chip class.
Definition: mifarechip.hpp:25
std::string getGenericCardType() const override
Get the generic card type.
Definition: mifarechip.hpp:46
std::shared_ptr< MifareCommands > getMifareCommands() const
Get the Mifare commands.
Definition: mifarechip.hpp:101
unsigned int d_nbSectors
The number of sectors in the Mifare card.
Definition: mifarechip.hpp:117
#define CHIP_MIFARE
Definition: mifarechip.hpp:19
Mifare commands.
Definition: asn1.hpp:9
CardServiceType
The card services.
Definition: cardservice.hpp:35