LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
mifarenfctagcardservice.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_MIFARENFCTAGCARDSERVICE_HPP
8#define LOGICALACCESS_MIFARENFCTAGCARDSERVICE_HPP
9
15
16namespace logicalaccess
17{
18#define MIFARE_NFC_CARDSERVICE "MifareNFCTag"
19
23class LLA_CARDS_MIFARE_API MifareNFCTagCardService : public NFCTagCardService
24{
25 public:
30 explicit MifareNFCTagCardService(std::shared_ptr<Chip> chip)
31 : NFCTagCardService(chip)
32 {
33 }
34
36 {
37 }
38
39 std::string getCSType() override
40 {
42 }
43
44
45 std::shared_ptr<NdefMessage> readNDEF() override;
46 void writeNDEF(std::shared_ptr<NdefMessage> records) override;
47 void eraseNDEF() override;
48
49
50 std::vector<std::shared_ptr<NfcData> > readNFC();
51 std::vector<std::shared_ptr<NfcData> > readNFC(std::shared_ptr<AccessInfo> ai, unsigned int sector = 0);
52 void writeNFC(std::shared_ptr<NfcData> records, int sector, std::shared_ptr<AccessInfo> ai, MifareAccessInfo::SectorAccessBits madSab = MifareAccessInfo::SectorAccessBits());
53 void writeNFC(std::shared_ptr<NfcData> records,int sector, std::shared_ptr<MifareKey> keyA, std::shared_ptr<MifareKey> keyB, bool useMad = false);
54 void eraseNfc(std::shared_ptr<MifareKey> sectorKeyB = std::make_shared<MifareKey>("ff ff ff ff ff ff"), std::shared_ptr<MifareKey> madKeyB = std::make_shared<MifareKey>("ff ff ff ff ff ff"));
55 void eraseNfc(int sector, std::shared_ptr<MifareKey> sectorKeyB = std::make_shared<MifareKey>("ff ff ff ff ff ff"), std::shared_ptr<MifareKey> madKeyB = std::make_shared<MifareKey>("ff ff ff ff ff ff"));
56 void fillMemoryList(ByteVector data);
57 ByteVector getCardData();
58 int checkForReservedArea(unsigned int i);
59
60
61 protected:
62 void writeInfo(int baseAddr, std::shared_ptr<MifareKey> keyB, ByteVector tmpBuff, bool useMad, std::shared_ptr<StorageCardService> storage);
63 void writeInfo(int baseAddr, std::shared_ptr<MifareAccessInfo> aiToWrite, ByteVector tmpBuffer, std::shared_ptr<StorageCardService> storage);
64 std::shared_ptr<MifareChip> getMifareChip() const
65 {
66 return std::dynamic_pointer_cast<MifareChip>(getChip());
67 }
68 std::vector<MemoryData> _memoryList;
69};
70}
71
72#endif /* LOGICALACCESS_MIFARENFCTAGCARDSERVICE_HPP */
The Mifare Classic NFC Tag storage card service base class.
Definition: mifarenfctagcardservice.hpp:24
std::shared_ptr< MifareChip > getMifareChip() const
Definition: mifarenfctagcardservice.hpp:64
std::string getCSType() override
Definition: mifarenfctagcardservice.hpp:39
std::vector< MemoryData > _memoryList
Definition: mifarenfctagcardservice.hpp:68
MifareNFCTagCardService(std::shared_ptr< Chip > chip)
Constructor.
Definition: mifarenfctagcardservice.hpp:30
virtual ~MifareNFCTagCardService()
Definition: mifarenfctagcardservice.hpp:35
Definition: nfctagcardservice.hpp:26
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Memory control tlv.
Mifare chip.
#define MIFARE_NFC_CARDSERVICE
Definition: mifarenfctagcardservice.hpp:18
Definition: asn1.hpp:9
NDEF Message.
NFC Tag card service.
Storage Card service.
Sector access bits structure.
Definition: mifareaccessinfo.hpp:177