7#ifndef LOGICALACCESS_MIFARECOMMANDS_HPP
8#define LOGICALACCESS_MIFARECOMMANDS_HPP
16#define CMD_MIFARE "Mifare"
36 virtual ByteVector readSector(
int sector,
int start_block,
37 std::shared_ptr<MifareKey> keyA,
38 std::shared_ptr<MifareKey> keyB,
40 bool readtrailer =
false) final;
43 writeSector(
int sector,
int start_block, const
ByteVector &buf,
46 unsigned char userbyte = 0x00,
51 virtual
ByteVector readSectors(
int start_sector,
int stop_sector,
int start_block,
56 virtual
void writeSectors(
57 int start_sector,
int stop_sector,
int start_block, const
ByteVector &buf,
59 const
MifareAccessInfo::SectorAccessBits &sab,
unsigned char userbyte = 0x00,
70 unsigned int getSectorFromMAD(
long aid,
std::shared_ptr<
MifareKey> madKeyA);
79 void setSectorToMAD(
long aid,
unsigned int sector,
std::shared_ptr<
MifareKey> madKeyA,
88 static
unsigned char calculateMADCrc(const
unsigned char *madbuf,
size_t madbuflen);
96 static
unsigned int findReferencedSector(
long aid,
unsigned char *madbuf,
109 std::shared_ptr<
MifareKey> newkeyB,
unsigned int sector,
111 unsigned char userbyte = 0x00);
114 std::shared_ptr<
MifareKey> newkeyB,
unsigned int sector,
116 unsigned char userbyte = 0x00);
119 int sector,
int block,
bool write);
130 int block,
bool write);
138 virtual
ByteVector readBinary(
unsigned char blockno,
size_t len) = 0;
147 virtual
void updateBinary(
unsigned char blockno, const
ByteVector &buf) = 0;
175 virtual
void authenticate(
unsigned char blockno,
unsigned char keyno,
184 virtual
void authenticate(
unsigned char blockno,
196 virtual
void increment(uint8_t blockno, uint32_t value) = 0;
206 virtual
void decrement(uint8_t blockno, uint32_t value) = 0;
213 bool writeValueBlock(uint8_t blockno, int32_t value, uint8_t backup_blockno);
220 bool readValueBlock(uint8_t blockno, int32_t &value, uint8_t &backup_block);
227 static
unsigned char getNbBlocks(
int sector);
234 static
unsigned char getSectorStartBlock(
int sector);
LLA_CARDS_MIFARE_API void getMifareChip(std::shared_ptr< logicalaccess::Chip > *chip)
Definition: libraryentry.cpp:30
A Access informations. Describe key used of authentication and access rights for a specific or a grou...
Definition: accessinfo.hpp:22
The base commands class for all card commands.
Definition: commands.hpp:21
A Key storage base class. The key storage specify where the key is stored in memory....
Definition: keystorage.hpp:31
A location informations.
Definition: location.hpp:19
A Mifare access informations.
Definition: mifareaccessinfo.hpp:26
The Mifare base chip class.
Definition: mifarechip.hpp:25
The Mifare commands class.
Definition: mifarecommands.hpp:24
MifareCommands()
Definition: mifarecommands.hpp:26
MifareCommands(std::string ct)
Definition: mifarecommands.hpp:31
A Mifare Key class.
Definition: mifarekey.hpp:24
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
#define CMD_MIFARE
Definition: mifarecommands.hpp:16
MifareKeyType
Mifare Key Type.
Definition: mifareaccessinfo.hpp:18
Definition: urirecord.hpp:30
Sector access bits structure.
Definition: mifareaccessinfo.hpp:177